更新分组密码
This commit is contained in:
Vendored
+31
-3
@@ -52,9 +52,37 @@
|
||||
if (typeof goodsMsg !== 'undefined' && goodsMsg !== '') {
|
||||
let cateTpl = document.getElementById('cateTpl').innerHTML, cateHtml = '';
|
||||
let goodsTpl = document.getElementById('goodsTpl').innerHTML, goodsHtml;
|
||||
let changeCate = function (key) {
|
||||
let showGroupPassword = function (group) {
|
||||
layer.prompt({
|
||||
title : (typeof groupPasswordTitle !== 'undefined' ? groupPasswordTitle : '请输入分类访问密码') + ':' + group.gp_name,
|
||||
formType: 1
|
||||
}, function (value, index) {
|
||||
$.post(groupPasswordVerifyUrl, {
|
||||
_token : groupPasswordCsrfToken,
|
||||
group_id: group.id,
|
||||
password: value
|
||||
}, function (res) {
|
||||
if (res.code === 200) {
|
||||
layer.close(index);
|
||||
window.location.reload();
|
||||
} else {
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
let changeCate = function (key, silent) {
|
||||
let group = goodsMsg[key];
|
||||
if (group.is_group_locked) {
|
||||
$('.goods-list').empty();
|
||||
$('.cate-box').removeClass('cate-box-select').eq(key).addClass('cate-box-select');
|
||||
if (!silent) {
|
||||
showGroupPassword(group);
|
||||
}
|
||||
return;
|
||||
}
|
||||
goodsHtml = '';
|
||||
goodsMsg[key].goods.forEach(function (i) {
|
||||
group.goods.forEach(function (i) {
|
||||
if (i.wholesale_price_cnf != "" && i.wholesale_price_cnf != null) {
|
||||
i.wholesale_price_arr = i.wholesale_price_cnf.split("\r\n");
|
||||
i.wholesale_price_arr.forEach(function (ii, k) {
|
||||
@@ -79,7 +107,7 @@
|
||||
$('.cate').empty().append(cateHtml).on('click', '.cate-box', function () {
|
||||
changeCate($(this).data('key'));
|
||||
});
|
||||
changeCate(0);
|
||||
changeCate(0, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user