Commit b7909fb416d06b4cbb3eb5bc094e7cfc4a677452

Authored by pengye
1 parent 7f24cd89

商家入驻信息多次提交问题处理

... ... @@ -76,7 +76,7 @@ Page({
})
})
},
submitInfo() {
submitInfo: util.throttle(function () {
let sellername = this.data.sellername.trim();
let phone = this.data.phone.trim();
let rname = this.data.rname.trim();
... ... @@ -131,9 +131,15 @@ Page({
if (res.ret != 200) {
return util.toast(res.msg, 'none')
}
if(this.data.phone!='18601216909') this.sendIntentionFun()
if(this.data.phone!='18601216909') {
this.sendIntentionFun()
}else{
wx.redirectTo({
url: '/pages/customer/collectSeller',
})
}
})
},
},3000),
// 发送意向店铺通知短信
sendIntentionFun(){
App.SaiYouYun.SendIntention({
... ...
... ... @@ -255,6 +255,20 @@ function deletelUpload(filename,token,cb) {
}
})
};
// 节流函数
function throttle(fn, gapTime) {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
let _lastTime = null
return function () {
let _nowTime = + new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
}
}
}
module.exports = {
formatTime: formatTime,
unixtoTime: unixtoTime,
... ... @@ -266,6 +280,7 @@ module.exports = {
imageZoomHeightUtil,
uploadFile,
deletelUpload,
throttle,
cgi: function (act) {
return uri.HOST__LINE + act //正式
//return uri.HOST__TEST+act //测试
... ...