Commit 9a4a7999 by 杨树贤

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

parents 4ccf78b4 a433e0a1
......@@ -27,5 +27,3 @@
item_url = 'itemicsales',
dist = '__PUBLIC__';
</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 @@
<head>
<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/common/swiper.min.css">
</head>
<body>
......@@ -57,7 +58,19 @@
<div class="search_command clr">
</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_title xj_title">
<span class="lineBlock"></span>
......@@ -81,6 +94,7 @@
</div>
</div>
<include file="Common@public/foot" />
<script src="__PUBLIC__/js/global/swiper.jquery.min.js"></script>
<script src="__PUBLIC__/js/home/index.js"></script>
<script type="text/html" id="hotTpl">
{{# if(d.length != 0){ }}
......
......@@ -173,7 +173,6 @@
<include file="Common@public/indexfoot" />
</div>
<!-- pc下的页面 -->
<!-- 移动端下的页面 -->
<div class="mobile_wrapper">
<div class="mobile_top">
......@@ -315,117 +314,7 @@
</div>
</div>
<include file="Common@public/foot" />
<!-- 移动端下的页面 -->
<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>
<script src="__PUBLIC__/js/index/index.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -123,6 +123,36 @@
.home_content .search_section .search_command .command_name div:hover {
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 {
padding-left: 20px;
}
......
......@@ -52,9 +52,11 @@
margin-top: 45px;
text-align: center;
width: 477px;
div{
div {
cursor: pointer;
}
.hf {
margin: 0 80px;
}
......@@ -143,7 +145,9 @@
cursor: pointer;
transition: all 0.2s ease-in-out;
display: block;
div.active ,&:hover{
div.active,
&:hover {
color: #0D84D1;
}
}
......@@ -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 {
padding-left: 20px;
......@@ -175,6 +210,7 @@
.my_xj_list {
max-height: 415px;
overflow: hidden;
.my_xj_item {
.item_top {
.type {
......@@ -207,25 +243,30 @@
}
}
.index_tab{
height:74px;
line-height:74px;
padding:0 25px;
.index_tab {
height: 74px;
line-height: 74px;
padding: 0 25px;
font-size: 16px;
background-color: #fff;
color:#686E73;
margin:20px 20px 0;
div{
color: #686E73;
margin: 20px 20px 0;
div {
cursor: pointer;
}
.active{
color:#0D84D1;
.active {
color: #0D84D1;
font-weight: 600;
}
.xj{
margin-left:44px;
.xj {
margin-left: 44px;
}
}
.new_xj {
margin-top: 35px;
......@@ -316,7 +357,7 @@
cursor: pointer;
}
&:hover{
&:hover {
box-shadow: 0px 5px 10px 0px rgba(216, 223, 230, 0.5);
}
}
......
......@@ -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) {
return apis;
......
$(function () {
var homeObj = {
sySwiper: new Swiper('.sy-carousel', {
loop: true,
autoplay: 3000,
pagination: '.sy-pagination',
paginationClickable: true,
autoplayDisableOnInteraction: false
}),
init: function () {
var me = this;
this.bindFun();
this.getXbData(1);
this.getNewXj();
this.getHotGoods()
this.getHotGoods();
$('.sy-carousel').hover(function () {
me.sySwiper.stopAutoplay();
}, function () {
me.sySwiper.startAutoplay();
})
},
getHotGoods: function () {
var obj = Util.dataEncryption();
......@@ -94,14 +107,14 @@ $(function () {
},
bindFun: function () {
var self = this;
$('.price_info').on('click','.xj',function(){
$('.price_info').on('click', '.xj', function () {
console.log(111)
window.location.href = "/inquiry";
});
$('.price_info').on('click','.hf',function(){
$('.price_info').on('click', '.hf', function () {
window.location.href = "/quote";
});
$('.price_info').on('click','.sp',function(){
$('.price_info').on('click', '.sp', function () {
window.location.href = "/goodmanage";
});
$('.index_tab div').on('click', function () {
......
$(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