Commit ce4177b5 by 施宇

Merge branch 'sy_ic_1016'

parents 746cc195 2bbad10c
...@@ -27,5 +27,3 @@ ...@@ -27,5 +27,3 @@
item_url = 'itemicsales', item_url = 'itemicsales',
dist = '__PUBLIC__'; dist = '__PUBLIC__';
</script> </script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css">
\ No newline at end of file
...@@ -20,6 +20,9 @@ class IndexController extends BaseController ...@@ -20,6 +20,9 @@ class IndexController extends BaseController
*/ */
public function index() public function index()
{ {
$datas['roll_banners'] = $this->apiBaseCache('pc_home_roll_banner', '', ''); // 合作平台
$this->assign('roll_banners', $datas['roll_banners']);
$this->display('Home/index'); $this->display('Home/index');
} }
......
...@@ -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>
...@@ -57,7 +58,21 @@ ...@@ -57,7 +58,21 @@
<div class="search_command clr"> <div class="search_command clr">
</div> </div>
</div> </div>
<!-- 轮播部分 -->
<if condition="!empty($roll_banners['data'])">
<div class="sy-carousel">
<div class="swiper-wrapper">
<volist name="roll_banners['data']" id="vo">
<a class="swiper-slide" href="{$vo['url']}"
style="background:url({$vo['images']}) center center no-repeat;"
target="{$vo['window_open'] > 0 ? '_blank' : '_self'}"
title="{$vo['title']}"></a>
</volist>
</div>
<!-- Add Pagination -->
<div class="sy-pagination"></div>
</div>
</if>
<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 +96,7 @@ ...@@ -81,6 +96,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,34 @@ ...@@ -123,6 +123,34 @@
.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 {
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;
} }
...@@ -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,35 @@ ...@@ -152,6 +156,35 @@
} }
} }
.sy-carousel {
width:690px;
height:200px;
margin:30px auto 0;
overflow: hidden;
position: relative;
border-radius:4px;
.swiper-slide {
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 +208,7 @@ ...@@ -175,6 +208,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 +241,30 @@ ...@@ -207,25 +241,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 +355,7 @@ ...@@ -316,7 +355,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);
} }
} }
......
...@@ -194,7 +194,11 @@ ...@@ -194,7 +194,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 () {
......
$(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