Commit 7d6be5b7 by 施宇

11111

parent 9920d8c0
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<script type="text/html" id="listHtml"> <script type="text/html" id="listHtml">
<div class="data_list"> <div class="data_list">
{{# layui.each(d, function(index, item){ }} {{# layui.each(d, function(index, item){ }}
<div class="data_item"> <div class="data_item" goodid="{{item.goods_id}}">
<div class="data_detail"> <div class="data_detail">
<div class="type fl ellipsis boxsiz"> <div class="type fl ellipsis boxsiz">
<span class="bold">{{item.goods_name}}</span> <span class="bold">{{item.goods_name}}</span>
...@@ -132,14 +132,41 @@ ...@@ -132,14 +132,41 @@
<span>{{item.stock}}</span> <span>{{item.stock}}</span>
</div> </div>
<div class="price fl ellipsis boxsiz bold">{{item.price}}</div> <div class="price fl ellipsis boxsiz bold">{{item.price}}</div>
{{# if(item['audit_status'] == 1){ }}
{{# if(item['status'] == 1){ }}
<div class="data_status fl boxsiz zs"> <div class="data_status fl boxsiz zs">
<span class="mark lineBlock"></span> <span class="mark lineBlock"></span><span class="text">展示中</span>
<span class="text">展示中</span>
</div> </div>
{{# } else { }}
<div class="data_status fl boxsiz xj">
<span class="mark lineBlock"></span><span class="text">已下架</span>
</div>
{{# } }}
{{# } else { }}
<div class="data_status fl boxsiz jy">
<span class="mark lineBlock"></span><span class="text">禁用中</span>
</div>
{{# } }}
<div class="time fr ellipsis boxsiz">{{ layui.util.toDateString(item.update_time * 1000)}}</div> <div class="time fr ellipsis boxsiz">{{ layui.util.toDateString(item.update_time * 1000)}}</div>
</div> </div>
<a class="xj fr">下架</a> {{# if(item['status'] == 1){ }}
{{# if(item['audit_status'] == 1){ }}
<a class="xj xj_status fr">下架</a>
{{# } else { }}
<a class="xj xj_status fr disabled">下架</a>
{{# } }}
{{# } else { }}
{{# if(item['audit_status'] == 1){ }}
<a class="fb xj_status fr">发布</a>
{{# } else { }}
<a class="fb xj_status fr disabled">发布</a>
{{# } }}
{{# } }}
{{# if(item['audit_status'] == 1){ }}
<a class="edit fr">编辑</a> <a class="edit fr">编辑</a>
{{# } else { }}
<a class="edit fr disabled">编辑</a>
{{# } }}
</div> </div>
{{# }); }} {{# }); }}
{{# if(d.length === 0){ }} {{# if(d.length === 0){ }}
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<span>服务时间<i>9:00-22:00</i></span> <span>服务时间<i>9:00-22:00</i></span>
<span>联系电话:<i>400-888-1688</i></span> <span>联系电话:<i>400-888-1688</i></span>
</p> </p>
<h5>copyright &#169 2019 www.ICsales.com</h5> <h5>copyright &#169; 2019 www.ICsales.com</h5>
</div> </div>
<div class="fl qrcode"> <div class="fl qrcode">
......
...@@ -196,6 +196,9 @@ ...@@ -196,6 +196,9 @@
.good_manage_content .good_data .data_list .data_item .data_status.xj .mark { .good_manage_content .good_data .data_list .data_item .data_status.xj .mark {
background-color: #D8DFE6; background-color: #D8DFE6;
} }
.good_manage_content .good_data .data_list .data_item .data_status.jy .mark {
background-color: #EA1717;
}
.good_manage_content .good_data .data_list .data_item .data_status .text { .good_manage_content .good_data .data_list .data_item .data_status .text {
color: #686E73; color: #686E73;
} }
...@@ -224,12 +227,17 @@ ...@@ -224,12 +227,17 @@
color: #686E73; color: #686E73;
cursor: pointer; cursor: pointer;
} }
.good_manage_content .good_data .data_list .data_item .xj { .good_manage_content .good_data .data_list .data_item .edit.disabled {
cursor: not-allowed;
}
.good_manage_content .good_data .data_list .data_item .xj_status {
color: #686E73; color: #686E73;
cursor: pointer; cursor: pointer;
margin-left: 20px; margin-left: 20px;
} }
.good_manage_content .good_data .data_list .data_item .xj.fb { .good_manage_content .good_data .data_list .data_item .xj_status.disabled {
cursor: not-allowed;
}
.good_manage_content .good_data .data_list .data_item .xj_status.fb {
color: #0D84D1; color: #0D84D1;
} }
/*# sourceMappingURL=goodmanage.css.map */
\ No newline at end of file
...@@ -252,6 +252,11 @@ ...@@ -252,6 +252,11 @@
background-color: #D8DFE6; background-color: #D8DFE6;
} }
} }
&.jy{
.mark {
background-color: #EA1717;
}
}
.text { .text {
color: #686E73; color: #686E73;
...@@ -291,13 +296,18 @@ ...@@ -291,13 +296,18 @@
.edit { .edit {
color: #686E73; color: #686E73;
cursor: pointer; cursor: pointer;
&.disabled{
cursor: not-allowed;
}
} }
.xj { .xj_status{
color: #686E73; color: #686E73;
cursor: pointer; cursor: pointer;
margin-left: 20px; margin-left: 20px;
&.disabled{
cursor: not-allowed;
}
&.fb { &.fb {
color: #0D84D1; color: #0D84D1;
} }
......
...@@ -461,9 +461,7 @@ $(function () { ...@@ -461,9 +461,7 @@ $(function () {
msg: 'template', msg: 'template',
to: userId, to: userId,
action: "template", action: "template",
ext: $.extend({}, templateObj, { ext: templateObj,
time: self.curentTime()
}),
success: function () { success: function () {
self.addChatMember(userId) self.addChatMember(userId)
$('#' + userId).find('.notice_item_content').append(self.messageHtml(1, $('#' + userId).find('.notice_item_content').append(self.messageHtml(1,
......
...@@ -89,6 +89,10 @@ ...@@ -89,6 +89,10 @@
* 商品修改 * 商品修改
*/ */
goodsSave: goods_url + '/goods/save', goodsSave: goods_url + '/goods/save',
/***
* 商品上下架
*/
goodsStatus: goods_url + "/goods/status",
/**** /****
* 询价搜索 不需要token * 询价搜索 不需要token
*/ */
...@@ -108,7 +112,7 @@ ...@@ -108,7 +112,7 @@
/*** /***
* 询价上下架 * 询价上下架
*/ */
inquirstatusysave: offer_url + "/inquiry/status/save", inquirystatussave: offer_url + "/inquiry/status/save",
/*** /***
* 询价统计 * 询价统计
*/ */
......
!function () { ! function () {
window.GoodManageController = { window.GoodManageController = {
token: Util.getCookie('token') || '', token: Util.getCookie('token') || '',
init: function () { init: function () {
this.created(this).mounted(this).render(this, {offset: 10, p: 1, token: this.token}, 1).handleBind(this); this.created(this).mounted(this).render(this, {
offset: 10,
p: 1,
token: this.token
}, 1).handleBind(this);
}, },
created: function (opt) { created: function (opt) {
//日期控件初始化 //日期控件初始化
layui.laydate.render({ layui.laydate.render({
elem: '#start_time', elem: '#start_time',
theme: '#0D84D1' theme: '#0D84D1'
}); });
layui.laydate.render({ layui.laydate.render({
elem: '#end_time', elem: '#end_time',
theme: '#0D84D1' theme: '#0D84D1'
}); });
return this; return this;
}, },
mounted: function (opt) { mounted: function (opt) {
//商品数量获取 //商品数量获取
IcController.getData(apis.goodsCount, 'GET', {token: opt.token}, function (res) { IcController.getData(apis.goodsCount, 'GET', {
token: opt.token
}, function (res) {
if (res.errcode === 0) { if (res.errcode === 0) {
var getTpl = countHtml.innerHTML; var getTpl = countHtml.innerHTML;
layui.laytpl(getTpl).render(res.count, function (html) { layui.laytpl(getTpl).render(res.count, function (html) {
$(".good_total").empty().html(html); $(".good_total").empty().html(html);
}); });
} }
}); });
return this; return this;
}, },
render: function (opt, params, curr) { render: function (opt, params, curr) {
//商品列表初始化 //商品列表初始化
IcController.getData(apis.goodsInfo, 'GET', params, function (res) { IcController.getData(apis.goodsInfo, 'GET', params, function (res) {
var getTpl = listHtml.innerHTML; var getTpl = listHtml.innerHTML;
if (res.errcode === 0) { if (res.errcode === 0) {
layui.laytpl(getTpl).render(res.goods_list, function (html) { layui.laytpl(getTpl).render(res.goods_list, function (html) {
$("#listData").empty().html(html); $("#listData").empty().html(html);
layui.laypage.render({ layui.laypage.render({
elem: 'pagination', elem: 'pagination',
theme: '#1080d0', theme: '#1080d0',
count: res.total, count: res.total,
limit: 10, limit: 10,
curr: curr, curr: curr,
layout: ['prev', 'page', 'next', 'refresh'],
jump: function (obj, first) { jump: function (obj, first) {
if (!first) { if (!first) {
//分页回调调用 //分页回调调用
var json = { var json = {
p: obj.curr p: obj.curr
} }
var param = $.extend({}, params, json); var param = $.extend({}, params, json);
GoodManageController.render(opt, param, obj.curr); GoodManageController.render(opt, param, obj.curr);
} }
} }
}); });
}); });
} else if (res.errcode === 110001 || res.errcode === 103001) { } else if (res.errcode === 110001 || res.errcode === 103001) {
layui.laytpl(getTpl).render([], function (html) { layui.laytpl(getTpl).render([], function (html) {
$("#listData").empty().html(html); $("#listData").empty().html(html);
}); });
} }
}); });
return this; return this;
},
sxj: function (id, type) {
//上下架 1上架 2下架
var self = this;
IcController.getData(apis.goodsStatus, 'GET', {
"token": Util.getCookie('token') || "",
"goods_id": id,
"status": type
}, function (res) {
if (res.errcode === 0) {
layer.msg('操作成功', {
time: 600
}, function () {
self.mounted(self);
$('.layui-icon-refresh').click();
});
} else {
layer.msg('操作失败')
}
})
}, },
handleBind: function (opt) { handleBind: function (opt) {
//搜索 //搜索
layui.form.on('submit(search)', function (data) { layui.form.on('submit(search)', function (data) {
var param = { var param = {
token: opt.token, token: opt.token,
offset: 10, offset: 10,
p: 1 p: 1
}; };
var params = $.extend({}, data.field, param); var params = $.extend({}, data.field, param);
opt.render(this, params, 1) opt.render(this, params, 1)
});
//上架
$('#listData').on('click', '.fb', function (e) {
e.stopPropagation();
var goodId = $(this).parent('.data_item').attr('goodid');
if ($(this).hasClass('disabled')) {
return
} else {
opt.sxj(goodId, 1)
}
});
//下架
$('#listData').on('click', '.xj', function (e) {
e.stopPropagation();
var goodId = $(this).parent('.data_item').attr('goodid');
if ($(this).hasClass('disabled')) {
return
} else {
opt.sxj(goodId, 2)
}
}); });
return this; return this;
}, },
}, $(function () { }, $(function () {
......
...@@ -99,7 +99,7 @@ $(function () { ...@@ -99,7 +99,7 @@ $(function () {
sxj: function (id, type) { sxj: function (id, type) {
//上下架 1上架 2下架 //上下架 1上架 2下架
var self = this; var self = this;
IcController.getData(apis.inquirstatusysave, 'GET', { IcController.getData(apis.inquirystatussave, 'GET', {
"token": Util.getCookie('token') || "", "token": Util.getCookie('token') || "",
"inquiry_items_id": id, "inquiry_items_id": id,
"status": type "status": type
......
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