Commit 5bd6bf03 by 梁建民

多次点击

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