Commit fe4df5c3 by 施宇

32132

parent 6b1a42df
......@@ -82,22 +82,7 @@
</div>
<div class="new_xj">
<div class="new_xj_title xj_title">
<span class="lineBlock"></span>
<b>最新询价动态</b>
<a class="icon iconfont iconjuxing2"></a>
</div>
<div class="new_xj_list">
<div class="new_xj_item clr">
<div class="type fl bold ellipsis boxsiz">STM32F103ZET6</div>
<div class="brand fl ellipsis boxsiz">品牌:<span>Texas Instrument</span></div>
<div class="num fl ellipsis boxsiz">数量:<span>PCS10,000</span></div>
<div class="company fl ellipsis boxsiz"><span class="mark">代理商</span><span
class="name">深圳市猎芯科技有限公司</span></div>
<div class="time fl ellipsis boxsiz">3分钟前</div>
<div class="now_price fr">立即报价</div>
</div>
</div>
</div>
</div>
......@@ -177,6 +162,28 @@
</div>
{{# } }}
</script>
<script type="text/html" id="newTpl">
{{# if(d.length !== 0){ }}
<div class="new_xj_title xj_title">
<span class="lineBlock"></span>
<b>最新询价动态</b>
<a class="icon iconfont iconjuxing2 newXjIcon"></a>
</div>
<div class="new_xj_list">
{{# layui.each(d, function(index, item){ }}
<div class="new_xj_item clr" userid="{{item.inquiry_items_id}}" offerid="{{item.offer_id}}">
<div class="type fl bold ellipsis boxsiz">{{item.goods_name}}</div>
<div class="brand fl ellipsis boxsiz">品牌:<span>{{item.brand_name}}</span></div>
<div class="num fl ellipsis boxsiz">数量:<span>PCS{{item.number}}</span></div>
<div class="company fl ellipsis boxsiz"><span class="mark">代理商</span><span
class="name">{{item.company_name||'--'}}</span></div>
<div class="time fl ellipsis boxsiz">{{layui.util.toDateString(item.update_time * 1000)}}</div>
<div class="now_price fr">立即报价</div>
</div>
{{# }); }}
</div>
{{# } }}
</script>
</body>
......
......@@ -27,7 +27,7 @@
</div>
<div class="filter_section clr">
<div class="input_div fl">
<span class="lineBlock">价型号:</span>
<span class="lineBlock">价型号:</span>
<div>
<input type="text" placeholder="请输入型号" class="boxsiz" id="goodName">
</div>
......
......@@ -206,14 +206,16 @@
{{# } }}
{{# if(d.length == 3){ }}
<div class="bj_btn btn btn_60 btn_fz_18 disabled">
继续报价,剩余<span>0</span>
剩余<span>0</span>
</div>
{{# } else { }}
<div class="bj_btn btn btn_60 btn_fz_18 btn_blue">
继续报价,剩余
{{# if(d.length === 0){ }}
我要报价,剩余
<span>3</span>
{{# } else { }}
继续报价,剩余
<span>{{3-d.length}}</span>
{{# } }}
......
......@@ -21,9 +21,9 @@
</div>
<div class="condition_content">
<span class="bold">资质:</span>
<span class="all_xj active filter_span">全部询价</span>
<span class="all_xj active filter_span">最新询价</span>
<span class="today_xj filter_span">今日询价</span>
<span class="num_xj filter_span"><i>0</i>回复询价</span>
<!-- <span class="num_xj filter_span"><i>0</i>回复询价</span> -->
</div>
<div class="goods_data_list">
<div class="my_xj_list clr ">
......
......@@ -8,8 +8,8 @@
<span class="icon iconfont iconjuxing1"></span>
<span class="num" id="count_num">0</span>
</a>
<div class="input_div fr">
<!-- <div class="input_div fr">
<input type="text" placeholder="请输入要搜索的内容">
<span class="icon iconfont iconjuxing"></span>
</div>
</div> -->
</div>
\ No newline at end of file
......@@ -245,7 +245,7 @@
color: #686E73;
}
.home_content .new_xj .new_xj_list .new_xj_item .time {
width: 15%;
width: 16%;
}
.home_content .new_xj .new_xj_list .new_xj_item .now_price {
width: 70px;
......@@ -256,4 +256,3 @@
.home_content .new_xj .new_xj_list .new_xj_item:hover {
box-shadow: 0px 5px 10px 0px rgba(216, 223, 230, 0.5);
}
/*# sourceMappingURL=home.css.map */
\ No newline at end of file
......@@ -303,7 +303,7 @@
}
.time {
width: 15%;
width: 16%;
}
......
......@@ -2,7 +2,8 @@ $(function () {
var homeObj = {
init: function () {
this.bindFun();
this.getXbData(1)
this.getXbData(1);
this.getNewXj();
},
getXbData: function (type) { //1报价 2询价
var url;
......@@ -18,20 +19,20 @@ $(function () {
},
function (res) {
var getTpl = xjTpl.innerHTML;
if(type==1){
if (type == 1) {
getTpl = bjTpl.innerHTML
}
if (res.errcode === 0) {
var arr = [];
if(type == 1){
if (type == 1) {
arr = res.data;
}else{
} else {
arr = res.inquiry_list
}
layui.laytpl(getTpl).render(arr, function (html) {
$(".goods_data_list").empty().html(html);
});
} else if (res.errcode == type==1?105013:105001) {
} else if (res.errcode == type == 1 ? 105013 : 105001) {
layui.laytpl(getTpl).render([], function (html) {
$(".goods_data_list").empty().html(html);
......@@ -40,6 +41,28 @@ $(function () {
}
})
},
getNewXj: function () {
IcController.getData(apis.inquirySearch, 'GET', {
"offset": 5,
"p": 1,
"add_time/order": "desc"
},
function (res) {
var getTpl = newTpl.innerHTML;
if (res.errcode === 0) {
console.log(res.inquiry_list)
layui.laytpl(getTpl).render(res.inquiry_list, function (html) {
$(".new_xj").empty().html(html);
});
} else {
layui.laytpl(getTpl).render([], function (html) {
$(".new_xj").empty().html(html);
});
}
})
},
bindFun: function () {
var self = this;
$('.index_tab div').on('click', function () {
......@@ -50,7 +73,14 @@ $(function () {
});
$('.input_btn').click(function () {
window.location.href = "/search"
})
});
$('.home_content').on('click', '.newXjIcon', function () {
window.location.href = "/roborder"
});
$('.new_xj').on('click', '.now_price', function () {
var userid = $(this).parent('.new_xj_item').attr('userid');
window.location.href = "/quotedetail?id=" + userid
});
}
};
homeObj.init()
......
......@@ -6,7 +6,6 @@ $(function () {
this.bindFun();
this.formFun();
},
num: $('.bj_btn ').find('span').text(),
isClick: false,
getUserData: function () {
IcController.getData(apis.inquirySearch, 'GET', {
......@@ -33,11 +32,17 @@ $(function () {
})
},
getMybjData: function () {
//获取回复的询价
IcController.getData(apis.offerinfo, 'GET', {
"offer_id/eq": Util.getRequest('offerid') || "",
//获取我的报价
var params = {
"token": Util.getCookie('token') || ""
}, function (res) {
};
if(Util.getRequest('offerid')){
params["offer_id/eq"] = Util.getRequest('offerid')
}else{
params["inquiry_items_id/eq"] = Util.getRequest('id') || ""
}
IcController.getData(apis.offerinfo, 'GET',params, function (res) {
var getXj = xjTpl.innerHTML;
if (res.errcode == 0) {
if (res.total == 0) {
......@@ -123,8 +128,10 @@ $(function () {
layui.form.on('submit(add)', function (data) {
$(data.elem).addClass("layui-btn-disabled");
var params = {},
url = "";
if (self.num == 3) {
url = "",
num = $('.bj_btn').find('span').text();
if (num == 3) {
url = apis.offeradd;
params = $.extend({}, data.field, {
token: Util.getCookie('token') || "",
......
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