Commit 0abdbdf5 by 施宇

111

parent 3979a58f
......@@ -14,70 +14,13 @@
<div class="right_content good_detail_content">
<div class="content">
<div class="nav_title">
商品管理 > 商品列表 > 商品详情 STM32F103ZET6
<span class="fr">2019-05-22 15:35</span>
</div>
<div class="bj_item">
<div class="top">
<span class="name bold">深圳邦马特科技有限公司深圳邦马特科技有限公司</span>
</div>
<div class="center clr">
<div class="center_left boxsiz clr fl">
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
公司认证
</div>
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
贸易商
</div>
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
贸易商
</div>
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
贸易商
</div>
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
贸易商
</div>
</div>
<div class="center_right ellipsis boxsiz fl">
报价:<span class="bold">21次</span>
</div>
</div>
<div class="gt_div fl btn btn_yellow">
<span class="icon iconfont iconjuxing7 va-m"></span>
在线沟通
</div>
</div>
<div class="goods_detail clr">
<img src="__PUBLIC__/images/test.jpg" alt="" class="fr">
<div class=" goods_desc boxsiz">
<div class="title">
<div class="fr title_right">
<span class="mark lineBlock"></span><span class="text">展示中</span>
</div>
<div class="title_left">
<h3 class="bold fl boxsiz">STM32F103ZET6</h3>
<div class="price fl bold boxsiz">¥67.9800</div>
</div>
</div>
<div class="desc">
<div class="brand fl boxsiz ellipsis">
品牌:<span>Texas InstrumentsTexas InstrumentsTexas</span>
</div>
<div class="fz fl boxsiz ellipsis">
封装:<span>LQFP-144</span>
</div>
<div class="num fl boxsiz ellipsis"> 库存:<span class="bold">100,000 PCS</span></div>
<div class="hq fl boxsiz ellipsis"> 货期:<span>现货</span></div>
<div class="time fl boxsiz ellipsis"> 更新时间:<span>2019-05-27 17:27</span></div>
</div>
</div>
</div>
......@@ -87,6 +30,113 @@
</div>
<include file="public/foot" />
<script src="__PUBLIC__/js/goodmanage/gooddetail.js"></script>
<script type="text/html" id="navTpl">
询报价
>
我的询价
>
询价详情
{{d.goods_name}}
<span class="fr">{{layui.util.toDateString(d.add_time * 1000)}}</span>
</script>
<script type="text/html" id="companyTpl">
<div class="top">
<span class="name bold">{{d.company_name||'--'}}</span>
</div>
<div class="center clr">
<div class="center_left boxsiz clr fl">
{{# if(d.auth_type!==""){ }}
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
{{# if(d.auth_type==0){ }}
未认证
{{# } }}
{{# if(d.auth_type==1){ }}
个人认证
{{# } }}
{{# if(d.auth_type==2){ }}
企业认证
{{# } }}
</div>
{{# } }}
{{# if(d.company_type!==""){ }}
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
{{# if(d.company_type==1){ }}
贸易商
{{# } }}
{{# if(d.company_type==2){ }}
代理商
{{# } }}
{{# if(d.company_type==3){ }}
原厂
{{# } }}
{{# if(d.company_type==4){ }}
制造商
{{# } }}
{{# if(d.company_type==5){ }}
个人用户
{{# } }}
</div>
{{# } }}
</div>
<!-- <div class="center_right ellipsis boxsiz fl">
报价:<span class="bold">21</span>
</div> -->
</div>
<div class="gt_div fl btn btn_yellow" imid="{{d.im_username}}">
<span class="icon iconfont iconjuxing7 va-m"></span>
在线沟通
</div>
</script>
<script type="text/html" id="detailTpl">
{{# if(d['goods_images']){ }}
<img src="{{d.goods_images}}" alt="" class="fr">
{{# } else { }}
<img src="__PUBLIC__/images/defaultgood.png" alt="" class="fr">
{{# } }}
<div class=" goods_desc boxsiz">
<div class="title">
<div class="fr title_right">
{{# if(d['audit_status'] == 1){ }}
{{# if(d['status'] == 1){ }}
<span class="mark lineBlock zs"></span><span class="text">展示中</span>
{{# } else { }}
<span class="mark lineBlock xj"></span><span class="text">已下架</span>
{{# } }}
{{# } else { }}
<span class="mark lineBlock jy"></span><span class="text">禁用中</span>
{{# } }}
</div>
<div class="title_left">
<h3 class="bold fl boxsiz goods_name">{{d.goods_name}}</h3>
<div class="price fl bold boxsiz">
{{# if(d.currency == 1){ }}
{{# } else { }}
$
{{# } }}
{{d.price}}</div>
</div>
</div>
<div class="desc">
<div class="brand fl boxsiz ellipsis">
品牌:<span>{{d.brand_name}}</span>
</div>
<div class="fz fl boxsiz ellipsis">
封装:<span>{{d.encap}}</span>
</div>
<div class="num fl boxsiz ellipsis"> 库存:<span class="bold">{{d.stock}} PCS</span></div>
<div class="hq fl boxsiz ellipsis"> 货期:<span>{{d.delivery_time}}</span></div>
<div class="time fl boxsiz ellipsis"> 更新时间:<span>{{layui.util.toDateString(d.add_time * 1000)}}</span>
</div>
<div class="btn fl btn_blue bj_btn">
编辑商品
</div>
</div>
</div>
</script>
</body>
</html>
\ No newline at end of file
......@@ -63,7 +63,7 @@
<script type="text/html" id="sphtml">
<div class="my_xj_list clr ">
{{# layui.each(d, function(index, item){ }}
<div class="my_xj_item fl boxsiz">
<div class="my_xj_item fl boxsiz sp_item" goodid="{{item.goods_id}}" style="cursor:pointer">
<div class="item_top clr">
<div class="fl num ellipsis">{{item.goods_name}}</div>
</div>
......
......@@ -3,11 +3,13 @@
}
.good_detail_content .nav_title {
padding: 20px 0;
min-height: 19px;
}
.good_detail_content .goods_detail {
background-color: #fff;
padding: 20px 30px;
margin-top: 10px;
min-height: 220px;
}
.good_detail_content .goods_detail img {
height: 220px;
......@@ -34,6 +36,15 @@
vertical-align: sub;
margin-right: 9px;
}
.good_detail_content .goods_detail .goods_desc .title .title_right .mark.zs {
background-color: #52CCA8;
}
.good_detail_content .goods_detail .goods_desc .title .title_right .mark.xj {
background-color: #D8DFE6;
}
.good_detail_content .goods_detail .goods_desc .title .title_right .mark.jy {
background-color: #EA1717;
}
.good_detail_content .goods_detail .goods_desc .title .title_right .text {
font-size: 16px;
color: #515559;
......@@ -64,6 +75,11 @@
margin-top: 22px;
padding-right: 10px;
}
.good_detail_content .goods_detail .goods_desc .desc div.bj_btn {
width: 120px;
color: #fff;
display: none;
}
.good_detail_content .goods_detail .goods_desc .desc div span {
color: #515559;
}
......@@ -77,6 +93,7 @@
background-color: #fff;
padding: 20px 360px 20px 30px;
position: relative;
min-height: 80px;
}
.good_detail_content .bj_item .top .name {
font-size: 16px;
......@@ -116,6 +133,7 @@
right: 20px;
width: 110px;
top: 20px;
display: none;
}
.good_detail_content .bj_item .gt_div span {
font-size: 20px;
......
......@@ -3,12 +3,14 @@
.nav_title {
padding: 20px 0;
min-height: 19px;
}
.goods_detail {
background-color: #fff;
padding: 20px 30px;
margin-top: 10px;
min-height: 220px;
img {
height: 220px;
......@@ -36,6 +38,19 @@
border-radius: 50% 50%;
vertical-align: sub;
margin-right: 9px;
&.zs {
background-color: #52CCA8;
}
&.xj {
background-color: #D8DFE6;
}
&.jy {
background-color: #EA1717;
}
}
.text {
......@@ -77,7 +92,11 @@
width: 50%;
margin-top: 22px;
padding-right: 10px;
&.bj_btn{
width:120px;
color:#fff;
display: none
}
span {
color: #515559;
}
......@@ -102,6 +121,7 @@
background-color: #fff;
padding: 20px 360px 20px 30px;
position: relative;
min-height: 80px;
.top {
.name {
......@@ -110,6 +130,7 @@
}
}
.center {
position: relative;
margin-top: 15px;
......@@ -150,6 +171,7 @@
right: 20px;
width: 110px;
top: 20px;
display: none;
span {
font-size: 20px;
......
......@@ -193,7 +193,7 @@ $(function () {
userHtml: function (num, user, message) {
//左边用户的dom拼接
if (num == 0) {
return '<img src="' + dist + '/images/test.jpg" alt="" class="user_logo">' +
return '<img src="' + dist + '/images/default.jpg" alt="" class="user_logo">' +
'<div class="user_right">' +
'<div class="clr">' +
'<h3 class="boxsiz ellipsis">' + user + '</h3>' +
......@@ -201,7 +201,7 @@ $(function () {
'<div class="message ellipsis">' + message + '</div>' +
'</div>'
} else {
return '<img src="' + dist + '/images/test.jpg" alt="" class="user_logo">' +
return '<img src="' + dist + '/images/default.jpg" alt="" class="user_logo">' +
'<div class="user_right">' +
'<div class="clr">' +
'<span class="num fr">' + num + '</span>' +
......@@ -216,7 +216,7 @@ $(function () {
var htmlp = '<p>' + html + '</p>';
if (isTemplate) {
var htmlp = '<div class="template lineBlock boxsiz">' +
'<img src="http://resic.liexin.com/images/test.jpg" alt="">' +
'<img src="http://resic.liexin.com/images/defaultgood.png" alt="">' +
'<div class="template_right">' +
'<div class="template_right_top clr">' +
'<h3 class="bold fl">' + html.type + '</h3>' +
......@@ -239,7 +239,7 @@ $(function () {
if (leftOrRight == 1) { //右边
if (html) {
return '<div class="notice_item right clr">' +
'<img src="' + dist + '/images/test.jpg" alt="" class="fr user_logo">' +
'<img src="' + dist + '/images/default.jpg" alt="" class="fr user_logo">' +
'<div class="notice_content">' +
htmlp +
'<div>' + this.curentTime() + '</div>' +
......@@ -252,7 +252,7 @@ $(function () {
} else { //左边
if (html) {
return '<div class = "notice_item left clr" > ' +
'<img src="' + dist + '/images/test.jpg" alt="" class="fl user_logo">' +
'<img src="' + dist + '/images/default.jpg" alt="" class="fl user_logo">' +
'<div class="notice_content">' +
htmlp +
'<div>' + this.curentTime() + '</div>' +
......@@ -374,6 +374,7 @@ $(function () {
}, //收到表情消息;
onCmdMessage: function (message) {
console.log(message)
self.receiveData(1, message, true);
self.addChatMember(message.from)
}, //收到命令消息;
......@@ -475,6 +476,7 @@ $(function () {
}
});
this.conn.send(msg.body);
console.log(msg.body)
},
sendPrivateImg: function () {
......@@ -575,6 +577,8 @@ $(function () {
queue: id,
count: "50",
success: function (data) {
console.log(data)
self.rendHistoryMessage(id, data)
},
fail: function (e) {
......@@ -609,8 +613,9 @@ $(function () {
} else if (data[i].url) { //图片
chatCon += this.messageHtml(rightOrLeft, '<img src ="' + data[i].url + '" class="edit_img"/>');
} else if (data.action) { //模板
} else if (data[i].action == 'template') { //模板
chatCon += this.messageHtml(rightOrLeft, data[i].ext,true);
}
}
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
$(function () {
var gooddetailObj = {
type: Util.getCookie('type') || '',
id: Util.getCookie('id') || '',
type: Util.getRequest('type') || "",
token: Util.getCookie('token') || '',
id: Util.getRequest('id') || "",
init: function () {
this.getDetail();
this.bindFun();
},
getDetail: function () {
//获取商品详情
var url = "";
if(this.type == 1){
var url = "",
self = this;
if (this.type == 1) {
url = apis.goodsInfo;
}else if(this.type==2){
} else if (this.type == 2) {
url = apis.goodsSearch;
}else{
} else {
return;
}
IcController.getData(url, 'GET', params, function (res) {
IcController.getData(url, 'GET', {
"token": self.token,
"goods_id/eq": self.id
}, function (res) {
var getTpl = listHtml.innerHTML;
var getNav = navTpl.innerHTML,
getCompany = companyTpl.innerHTML,
getDetail = detailTpl.innerHTML;
if (res.errcode === 0) {
// layui.laytpl(getTpl).render(res.goods_list, function (html) {
// $("#listData").empty().html(html);
// layui.laypage.render({
// elem: 'pagination',
// theme: '#1080d0',
// count: res.total,
// limit: 10,
// curr: curr,
// layout: ['prev', 'page', 'next', 'refresh'],
// jump: function (obj, first) {
// if (!first) {
// //分页回调调用
// var json = {
// p: obj.curr
// }
// var param = $.extend({}, params, json);
// GoodManageController.render(opt, param, obj.curr);
// }
// }
// });
// });
layui.laytpl(getNav).render(res.goods_list[self.id], function (html) {
$(".good_detail_content .nav_title").empty().html(html);
});
layui.laytpl(getCompany).render(res.goods_list[self.id], function (html) {
$(".good_detail_content .bj_item").empty().html(html);
if(self.type==2){
$('.gt_div').show();
}
});
layui.laytpl(getDetail).render(res.goods_list[self.id], function (html) {
$(".good_detail_content .goods_detail").empty().html(html);
if(self.type==1){
$('.bj_btn').show();
}
});
} else {
layui.laytpl(getTpl).render([], function (html) {
$("#listData").empty().html(html);
layui.laytpl(getNav).render([], function (html) {
$(".good_detail_content .nav_title").empty().html(html);
});
layui.laytpl(getCompany).render([], function (html) {
$(".good_detail_content .bj_item").empty().html(html);
});
layui.laytpl(getDetail).render([], function (html) {
$(".good_detail_content .goods_detail").empty().html(html);
});
}
});
},
bindFun: function () {
var self = this;
$('.good_detail_content').on('click', '.gt_div', function () {
var userId = $(this).attr('imid'),
parent = $('.goods_detail'),
type = parent.find('.goods_name').text(),
price = parent.find('.price').text(),
brand = parent.find('.brand').find('span').text(),
fz = parent.find('.fz').find('span').text(),
num = parent.find('.num').find('span').text(),
hq = parent.find('.hq').find('span').text(),
time = parent.find('.time').find('span').text(),
obj = {
userId: userId,
type: type,
price: price,
brand: brand,
fz: fz,
num: num,
hq: hq,
time:time
};
Util.setCookie('template', JSON.stringify(obj), 1, cookieHostname)
window.location.href = '/chat'
});
$('.good_detail_content ').on('click', '.bj_btn', function () {
window.location.href = '/uploadsingle?id='+self.id
})
}
};
gooddetailObj.init()
......
......@@ -50,7 +50,6 @@ $(function () {
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);
});
......
......@@ -26,7 +26,6 @@ $(function () {
layui.laytpl(getDetail).render([], function (html) {
$(".inquiry_detail_content .goods_detail").empty().html(html);
});
}
})
},
......
......@@ -91,6 +91,10 @@ $(function () {
var userid = $(this).attr('userid');
window.location.href = "/quotedetail?id=" + userid
});
$('.goods_data_list').on('click','.sp_item',function(){
var goodid = $(this).attr('goodid');
window.location.href = "/gooddetail?type=2&id=" + goodid
});
}
};
search.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