Commit 9a4a7999 by 杨树贤

Merge branch 'sy_ic_1016' of ssh://119.23.72.7:22611/shiyu/icsales into sy_ic_1016

parents 4ccf78b4 a433e0a1
...@@ -26,6 +26,4 @@ ...@@ -26,6 +26,4 @@
home_url = 'homeicsales', home_url = 'homeicsales',
item_url = 'itemicsales', item_url = 'itemicsales',
dist = '__PUBLIC__'; dist = '__PUBLIC__';
</script> </script>
\ No newline at end of file
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css">
\ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<head> <head>
<include file="Common@public/header" /> <include file="Common@public/header" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/home.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/home.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common/swiper.min.css">
</head> </head>
<body> <body>
...@@ -55,9 +56,21 @@ ...@@ -55,9 +56,21 @@
</div> </div>
</div> </div>
<div class="search_command clr"> <div class="search_command clr">
</div> </div>
</div> </div>
<!-- 轮播部分 -->
<div class="sy-carousel">
<div class="swiper-wrapper">
<a class="swiper-slide" href="www.baidu.com"></a>
<a class="swiper-slide" href="www.baidu.com"></a>
<a class="swiper-slide" href="www.baidu.com"></a>
<a class="swiper-slide" href="www.baidu.com"></a>
<a class="swiper-slide" href="www.baidu.com"></a>
</div>
<!-- Add Pagination -->
<div class="sy-pagination"></div>
</div>
<div class="my_xj"> <div class="my_xj">
<div class="my_xj_title xj_title"> <div class="my_xj_title xj_title">
<span class="lineBlock"></span> <span class="lineBlock"></span>
...@@ -81,6 +94,7 @@ ...@@ -81,6 +94,7 @@
</div> </div>
</div> </div>
<include file="Common@public/foot" /> <include file="Common@public/foot" />
<script src="__PUBLIC__/js/global/swiper.jquery.min.js"></script>
<script src="__PUBLIC__/js/home/index.js"></script> <script src="__PUBLIC__/js/home/index.js"></script>
<script type="text/html" id="hotTpl"> <script type="text/html" id="hotTpl">
{{# if(d.length != 0){ }} {{# if(d.length != 0){ }}
......
...@@ -173,7 +173,6 @@ ...@@ -173,7 +173,6 @@
<include file="Common@public/indexfoot" /> <include file="Common@public/indexfoot" />
</div> </div>
<!-- pc下的页面 -->
<!-- 移动端下的页面 --> <!-- 移动端下的页面 -->
<div class="mobile_wrapper"> <div class="mobile_wrapper">
<div class="mobile_top"> <div class="mobile_top">
...@@ -315,117 +314,7 @@ ...@@ -315,117 +314,7 @@
</div> </div>
</div> </div>
<include file="Common@public/foot" /> <include file="Common@public/foot" />
<!-- 移动端下的页面 --> <script src="__PUBLIC__/js/index/index.js"></script>
<script>
$(function () {
if (!$('.mobile_wrapper').is(':hidden')) {
//移动端
var type = Util.getRequest('type');
if (type == 1) {
//小程序
$('.mobile_wrapper .lb_nav span').eq(1).addClass('active');
$('.mobile_wrapper .xcx_img').show();
$('.mobile_wrapper .xcx_item').show()
} else if (type == 2) {
//app
$('.mobile_wrapper .lb_nav span').eq(2).addClass('active');
$('.mobile_wrapper .app_img').show();
$('.mobile_wrapper .app_item').show()
} else {
//web
$('.mobile_wrapper .lb_nav span').eq(0).addClass('active');
$('.mobile_wrapper .web_img').show()
}
scrollFun()
};
// pc逻辑
$('.index_wrapper .lb_nav span').click(function () {
var index = $(this).index();
$('.index_wrapper .lb_div_content').css('left', -(index * 1190) + 'px');
$(this).addClass('active').siblings().removeClass('active')
});
$('.input_btn').click(function () {
var val = $.trim($('.search-input').val());
if (!val.length) {
layer.msg('搜索内容不能为空')
} else
if (val.length < 3) {
layer.msg('请至少输入3个字符')
} else {
var token = Util.getCookie('token') || "";
if (token) {
window.location.href = home_url + '/search?key=' + val + '&type=1';
} else {
window.location.href = search_url + '/' + decodeURIComponent(val) + '_1';
}
}
});
// h5逻辑
$('.mobile_wrapper .lb_nav span').click(function () {
var index = $(this).index();
window.location.replace(window.location.origin + '?type=' + index)
});
$('.mobile_wrapper .lb_nav span').click(function () {
var index = $(this).index();
window.location.replace(window.location.origin + '?type=' + index)
});
$('.mobile_wrapper').on('click', '.app_item_div', function () {
var index = $(this).index();
if (index == 0) {
//ios下载
window.location.href = 'https://itunes.apple.com/us/app/id1481750196'
} else {
//安卓下载
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") { //微信环境
$('.share_mask').show();
} else {
window.location.href =
'https://img.icsales.com/down/ICSales_release_1_v1.0_2019_10_12_14_42_57.apk'
}
}
});
$('.mobile_wrapper').on('click', '.xcx_item', function () {
$('.xcx_mask').show();
});
$('.mobile_wrapper').on('click', '.xcx_mask', function () {
$(this).hide()
});
$('.mobile_wrapper').on('click', '.share_mask', function () {
$(this).hide()
});
$('.mobile_wrapper').on('click', '.mask_img_div', function (e) {
if (e && e.stopPropagation) {
e.stopPropagation();
} else {
window.event.cancelBubble = true;
}
});
Util.showOrHideQrcode('xcx_btn', 'xcx_qrcode');
Util.showOrHideQrcode('app_btn', 'app_qrcode');
Util.showOrHideQrcode('ios', 'ios_qrcode');
Util.showOrHideQrcode('android', 'android_qrcode');
function scrollFun() {
var scrollHeight = $('.mobile_wrapper .lb_nav').offset().top;
$(document).scroll(function () {
var scroH = $(document).scrollTop(); //滚动高度
if (scroH > scrollHeight) {
$('.mobile_wrapper .lb_nav').addClass('fixed_lb_nav').addClass('clr');
$('.mobile_wrapper .lb_nav span').addClass('fl')
}else{
$('.mobile_wrapper .lb_nav').removeClass('fixed_lb_nav').removeClass('clr');
$('.mobile_wrapper .lb_nav span').removeClass('fl')
}
});
}
})
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -123,6 +123,36 @@ ...@@ -123,6 +123,36 @@
.home_content .search_section .search_command .command_name div:hover { .home_content .search_section .search_command .command_name div:hover {
color: #0D84D1; color: #0D84D1;
} }
.home_content .sy-carousel {
width: 690px;
height: 200px;
margin: 30px auto 0;
overflow: hidden;
position: relative;
border-radius: 4px;
}
.home_content .sy-carousel .swiper-slide {
background: url('http://img.icsales.com/test/images/icsales/201909/12/fa7488c3e772f4f72032d95bf93cb00f.png') no-repeat;
background-size: cover;
cursor: pointer;
display: block;
}
.home_content .sy-carousel .sy-pagination {
position: absolute;
bottom: 14px;
z-index: 99;
text-align: center;
}
.home_content .sy-carousel .sy-pagination span {
width: 30px;
height: 4px;
border-radius: 0;
background: #fff;
opacity: 1;
}
.home_content .sy-carousel .sy-pagination span.swiper-pagination-bullet-active {
background: #0D84D1;
}
.home_content .xj_title { .home_content .xj_title {
padding-left: 20px; padding-left: 20px;
} }
......
...@@ -52,9 +52,11 @@ ...@@ -52,9 +52,11 @@
margin-top: 45px; margin-top: 45px;
text-align: center; text-align: center;
width: 477px; width: 477px;
div{
div {
cursor: pointer; cursor: pointer;
} }
.hf { .hf {
margin: 0 80px; margin: 0 80px;
} }
...@@ -120,7 +122,7 @@ ...@@ -120,7 +122,7 @@
.input_btn { .input_btn {
width: 118px; width: 118px;
border-radius: 0px 4px 4px 0px; border-radius: 0px 4px 4px 0px;
} }
} }
...@@ -143,7 +145,9 @@ ...@@ -143,7 +145,9 @@
cursor: pointer; cursor: pointer;
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
display: block; display: block;
div.active ,&:hover{
div.active,
&:hover {
color: #0D84D1; color: #0D84D1;
} }
} }
...@@ -152,6 +156,37 @@ ...@@ -152,6 +156,37 @@
} }
} }
.sy-carousel {
width:690px;
height:200px;
margin:30px auto 0;
overflow: hidden;
position: relative;
border-radius:4px;
.swiper-slide {
background: url('http://img.icsales.com/test/images/icsales/201909/12/fa7488c3e772f4f72032d95bf93cb00f.png') no-repeat;
background-size: cover;
cursor: pointer;
display: block;
}
.sy-pagination{
position: absolute;
bottom: 14px;
z-index:99;
text-align: center;
span{
width:30px;
height:4px;
border-radius: 0;
background: #fff;
opacity: 1;
&.swiper-pagination-bullet-active{
background:#0D84D1;
}
}
}
}
.xj_title { .xj_title {
padding-left: 20px; padding-left: 20px;
...@@ -175,6 +210,7 @@ ...@@ -175,6 +210,7 @@
.my_xj_list { .my_xj_list {
max-height: 415px; max-height: 415px;
overflow: hidden; overflow: hidden;
.my_xj_item { .my_xj_item {
.item_top { .item_top {
.type { .type {
...@@ -207,25 +243,30 @@ ...@@ -207,25 +243,30 @@
} }
} }
.index_tab{
height:74px; .index_tab {
line-height:74px; height: 74px;
padding:0 25px; line-height: 74px;
padding: 0 25px;
font-size: 16px; font-size: 16px;
background-color: #fff; background-color: #fff;
color:#686E73; color: #686E73;
margin:20px 20px 0; margin: 20px 20px 0;
div{
div {
cursor: pointer; cursor: pointer;
} }
.active{
color:#0D84D1; .active {
color: #0D84D1;
font-weight: 600; font-weight: 600;
} }
.xj{
margin-left:44px; .xj {
margin-left: 44px;
} }
} }
.new_xj { .new_xj {
margin-top: 35px; margin-top: 35px;
...@@ -316,7 +357,7 @@ ...@@ -316,7 +357,7 @@
cursor: pointer; cursor: pointer;
} }
&:hover{ &:hover {
box-shadow: 0px 5px 10px 0px rgba(216, 223, 230, 0.5); box-shadow: 0px 5px 10px 0px rgba(216, 223, 230, 0.5);
} }
} }
......
...@@ -189,7 +189,11 @@ ...@@ -189,7 +189,11 @@
/** /**
* 标记会员通知(已读) * 标记会员通知(已读)
*/ */
userMarkmsg: user_url + '/user/markmsg' userMarkmsg: user_url + '/user/markmsg',
/**
* 获取最新版本信息
*/
getVersion: user_url + '/get/version'
}; };
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
return apis; return apis;
......
$(function () { $(function () {
var homeObj = { var homeObj = {
sySwiper: new Swiper('.sy-carousel', {
loop: true,
autoplay: 3000,
pagination: '.sy-pagination',
paginationClickable: true,
autoplayDisableOnInteraction: false
}),
init: function () { init: function () {
var me = this;
this.bindFun(); this.bindFun();
this.getXbData(1); this.getXbData(1);
this.getNewXj(); this.getNewXj();
this.getHotGoods() this.getHotGoods();
$('.sy-carousel').hover(function () {
me.sySwiper.stopAutoplay();
}, function () {
me.sySwiper.startAutoplay();
})
}, },
getHotGoods: function () { getHotGoods: function () {
var obj = Util.dataEncryption(); var obj = Util.dataEncryption();
...@@ -94,14 +107,14 @@ $(function () { ...@@ -94,14 +107,14 @@ $(function () {
}, },
bindFun: function () { bindFun: function () {
var self = this; var self = this;
$('.price_info').on('click','.xj',function(){ $('.price_info').on('click', '.xj', function () {
console.log(111) console.log(111)
window.location.href = "/inquiry"; window.location.href = "/inquiry";
}); });
$('.price_info').on('click','.hf',function(){ $('.price_info').on('click', '.hf', function () {
window.location.href = "/quote"; window.location.href = "/quote";
}); });
$('.price_info').on('click','.sp',function(){ $('.price_info').on('click', '.sp', function () {
window.location.href = "/goodmanage"; window.location.href = "/goodmanage";
}); });
$('.index_tab div').on('click', function () { $('.index_tab div').on('click', function () {
...@@ -139,9 +152,9 @@ $(function () { ...@@ -139,9 +152,9 @@ $(function () {
window.location.href = "/quotedetail?id=" + userid + '&offerid=' + offerid window.location.href = "/quotedetail?id=" + userid + '&offerid=' + offerid
}); });
$('.search_command').on('click', '.hot_item', function () { $('.search_command').on('click', '.hot_item', function () {
var title = $(this).attr('title'); var title = $(this).attr('title');
// window.location.href = "/search?key=" + title + '&type=1&time=1'; // window.location.href = "/search?key=" + title + '&type=1&time=1';
window.location.href = "/search?key=" + title + '&type=1'; window.location.href = "/search?key=" + title + '&type=1';
}); });
......
$(function () {
var indexObj = {
versionUrl:"",
init: function () {
this.bindFun();
Util.showOrHideQrcode('xcx_btn', 'xcx_qrcode');
Util.showOrHideQrcode('app_btn', 'app_qrcode');
Util.showOrHideQrcode('ios', 'ios_qrcode');
Util.showOrHideQrcode('android', 'android_qrcode');
},
scrollFun: function () {
var scrollHeight = $('.mobile_wrapper .lb_nav').offset().top;
$(document).scroll(function () {
var scroH = $(document).scrollTop(); //滚动高度
if (scroH > scrollHeight) {
$('.mobile_wrapper .lb_nav').addClass('fixed_lb_nav').addClass('clr');
$('.mobile_wrapper .lb_nav span').addClass('fl')
} else {
$('.mobile_wrapper .lb_nav').removeClass('fixed_lb_nav').removeClass('clr');
$('.mobile_wrapper .lb_nav span').removeClass('fl')
}
});
},
getVersion: function () {
var me = this;
//获取安卓下载的版本链接
IcController.getData(apis.getVersion, 'GET', {
source:'3',
version_code:'0'
}, function (res) {
if(res.errcode==0){
me.versionUrl = res.data.url
}
},false)
},
bindFun: function () {
if (!$('.mobile_wrapper').is(':hidden')) {
//移动端
this.bindFunH5()
} else {
// pc逻辑
this.bindFunWeb()
}
},
bindFunH5: function () {
//移动端
var me = this;
me.getVersion();
var type = Util.getRequest('type');
if (type == 1) {
//小程序
$('.mobile_wrapper .lb_nav span').eq(1).addClass('active');
$('.mobile_wrapper .xcx_img').show();
$('.mobile_wrapper .xcx_item').show()
} else if (type == 2) {
//app
$('.mobile_wrapper .lb_nav span').eq(2).addClass('active');
$('.mobile_wrapper .app_img').show();
$('.mobile_wrapper .app_item').show()
} else {
//web
$('.mobile_wrapper .lb_nav span').eq(0).addClass('active');
$('.mobile_wrapper .web_img').show()
}
me.scrollFun();
$('.mobile_wrapper .lb_nav span').click(function () {
var index = $(this).index();
window.location.replace(window.location.origin + '?type=' + index)
});
$('.mobile_wrapper .lb_nav span').click(function () {
var index = $(this).index();
window.location.replace(window.location.origin + '?type=' + index)
});
$('.mobile_wrapper').on('click', '.app_item_div', function () {
var index = $(this).index();
if (index == 0) {
//ios下载
window.location.href = 'https://itunes.apple.com/us/app/id1481750196'
} else {
//安卓下载
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") { //微信环境
$('.share_mask').show();
} else {
if(me.versionUrl){
window.location.href = me.versionUrl
}
}
}
});
$('.mobile_wrapper').on('click', '.xcx_item', function () {
$('.xcx_mask').show();
});
$('.mobile_wrapper').on('click', '.xcx_mask', function () {
$(this).hide()
});
$('.mobile_wrapper').on('click', '.share_mask', function () {
$(this).hide()
});
$('.mobile_wrapper').on('click', '.mask_img_div', function (e) {
if (e && e.stopPropagation) {
e.stopPropagation();
} else {
window.event.cancelBubble = true;
}
});
},
bindFunWeb: function () {
// pc逻辑
$('.index_wrapper .lb_nav span').click(function () {
var index = $(this).index();
$('.index_wrapper .lb_div_content').css('left', -(index * 1190) + 'px');
$(this).addClass('active').siblings().removeClass('active')
});
$('.input_btn').click(function () {
var val = $.trim($('.search-input').val());
if (!val.length) {
layer.msg('搜索内容不能为空')
} else
if (val.length < 3) {
layer.msg('请至少输入3个字符')
} else {
var token = Util.getCookie('token') || "";
if (token) {
window.location.href = home_url + '/search?key=' + val + '&type=1';
} else {
window.location.href = search_url + '/' + decodeURIComponent(val) + '_1';
}
}
});
}
};
indexObj.init()
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment