Commit 5aa54a93 by 施宇

3213

parent e0eaf2e3
...@@ -55,15 +55,9 @@ ...@@ -55,15 +55,9 @@
</div> </div>
</div> </div>
<div class="search_command clr"> <div class="search_command clr">
<span class="fl comman_title">热门搜索:</span>
<div class="fl command_name">
<volist name="hot_goods" id="vo">
<a class="fl" href="{$vo.url}" title="{$vo.title}" target="_blank">{$vo.title}</a>
</volist>
</div> </div>
</div>
</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>
...@@ -88,6 +82,16 @@ ...@@ -88,6 +82,16 @@
</div> </div>
<include file="public/foot" /> <include file="public/foot" />
<script src="__PUBLIC__/js/home/index.js"></script> <script src="__PUBLIC__/js/home/index.js"></script>
<script type="text/html" id="hotTpl">
{{# if(d.length != 0){ }}
<span class="fl comman_title">热门搜索:</span>
<div class="fl command_name">
{{# layui.each(d, function(index, item){ }}
<div class="fl hot_item" title="{{item.title}}">{{item.title}}</div>
{{# }); }}
</div>
{{# } }}
</script>
<script type="text/html" id="xjTpl"> <script type="text/html" id="xjTpl">
<!-- 询价模板 --> <!-- 询价模板 -->
<div class="my_xj_list clr"> <div class="my_xj_list clr">
......
...@@ -110,14 +110,14 @@ ...@@ -110,14 +110,14 @@
color: #8A9299; color: #8A9299;
width: 625px; width: 625px;
} }
.home_content .search_section .search_command .command_name a { .home_content .search_section .search_command .command_name div {
margin-left: 20px; margin-left: 20px;
cursor: pointer; cursor: pointer;
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
display: block; display: block;
} }
.home_content .search_section .search_command .command_name a.active, .home_content .search_section .search_command .command_name div div.active,
.home_content .search_section .search_command .command_name a:hover { .home_content .search_section .search_command .command_name div:hover {
color: #0D84D1; color: #0D84D1;
} }
.home_content .xj_title { .home_content .xj_title {
...@@ -257,4 +257,3 @@ ...@@ -257,4 +257,3 @@
.home_content .new_xj .new_xj_list .new_xj_item:hover { .home_content .new_xj .new_xj_list .new_xj_item: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);
} }
/*# sourceMappingURL=home.css.map */
\ No newline at end of file
...@@ -136,13 +136,12 @@ ...@@ -136,13 +136,12 @@
color: #8A9299; color: #8A9299;
width: 625px; width: 625px;
a { div {
margin-left: 20px; margin-left: 20px;
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{
&.active ,&:hover{
color: #0D84D1; color: #0D84D1;
} }
} }
......
...@@ -61,6 +61,10 @@ ...@@ -61,6 +61,10 @@
* 获取会员认证信息 * 获取会员认证信息
*/ */
authInfo: user_url + '/user/authinfo', authInfo: user_url + '/user/authinfo',
/****
* 获取热门搜索商品
*/
hotgoods: home_url + '/hotgoods',
/*** /***
* 上传文件的接口 * 上传文件的接口
*/ */
...@@ -89,7 +93,7 @@ ...@@ -89,7 +93,7 @@
* 商品修改 * 商品修改
*/ */
goodsSave: goods_url + '/goods/save', goodsSave: goods_url + '/goods/save',
/*** /***
* 商品上下架 * 商品上下架
*/ */
goodsStatus: goods_url + "/goods/status", goodsStatus: goods_url + "/goods/status",
...@@ -117,7 +121,7 @@ ...@@ -117,7 +121,7 @@
* 询价统计 * 询价统计
*/ */
inquirycount: offer_url + "/inquiry/count", inquirycount: offer_url + "/inquiry/count",
/*** /***
* 报价统计 * 报价统计
*/ */
......
...@@ -4,6 +4,35 @@ $(function () { ...@@ -4,6 +4,35 @@ $(function () {
this.bindFun(); this.bindFun();
this.getXbData(1); this.getXbData(1);
this.getNewXj(); this.getNewXj();
this.getHotGoods()
},
getHotGoods: function () {
var obj = Util.dataEncryption();
IcController.getData(apis.hotgoods, 'GET', {
timestamp: obj.timestampStr,
random: obj.randomStr,
signature: obj.singnatrueStr
},
function (res) {
var hotHtml = hotTpl.innerHTML;
if (res.err_code === 0) {
if (res.data.length) {
layui.laytpl(hotHtml).render(res.data, function (html) {
$(".search_command").empty().html(html);
});
} else {
layui.laytpl(hotHtml).render([], function (html) {
$(".search_command").empty().html(html);
});
}
} else {
layui.laytpl(hotHtml).render([], function (html) {
$(".search_command").empty().html(html);
});
}
})
}, },
getXbData: function (type) { //1报价 2询价 getXbData: function (type) { //1报价 2询价
var url; var url;
...@@ -78,7 +107,7 @@ $(function () { ...@@ -78,7 +107,7 @@ $(function () {
} else if (val.length < 3) { } else if (val.length < 3) {
layer.msg('请至少输入3个字符') layer.msg('请至少输入3个字符')
} else { } else {
window.location.href = "/search?key=" + val+'&type=1&time=1'; window.location.href = "/search?key=" + val + '&type=1&time=1';
} }
}); });
...@@ -97,7 +126,13 @@ $(function () { ...@@ -97,7 +126,13 @@ $(function () {
var userid = $(this).attr('userid'), var userid = $(this).attr('userid'),
offerid = $(this).attr('offerid') offerid = $(this).attr('offerid')
window.location.href = "/quotedetail?id=" + userid + '&offerid=' + offerid window.location.href = "/quotedetail?id=" + userid + '&offerid=' + offerid
}) });
$('.search_command').on('click', '.hot_item', function () {
var title = $(this).attr('title');
window.location.href = "/search?key=" + title + '&type=1&time=1';
});
} }
}; };
homeObj.init() homeObj.init()
......
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