Commit 5bd6bf03 by 梁建民

多次点击

parent b5f11c9c
Showing with 15 additions and 3 deletions
!function () {
window.UploadSingle = {
isClick: false,
init: function () {
this.created(this).mounted(this).handleBind(this);
},
......@@ -38,9 +39,20 @@
//上传商品
layui.form.on('submit(add)', function (data) {
IcController.getData(apis.goodsAdd, 'POST', data.field, function (res) {
console.log(res)
});
$(data.elem).addClass("layui-btn-disabled");
if (!opt.isClick) {
opt.isClick = true;
IcController.getData(apis.goodsAdd, 'POST', data.field, function (res) {
if (res.errcode == 0) {
layer.msg('上传商品成功', {time: 2000}, function () {
window.location.href = '/goodmanage';
});
} else {
layer.msg(res.errmsg);
opt.isClick = false;
}
});
}
});
return this;
},
......
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