Skip to content

Commit

Permalink
提交订单按钮不允许重复点击
Browse files Browse the repository at this point in the history
  • Loading branch information
gooking committed Dec 9, 2021
1 parent 172387a commit b9bc26e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
version: '12.7.2',
note: '优化', // 这个为版本描述,无需修改
version: '12.8.0',
note: '提交订单按钮不允许重复点击', // 这个为版本描述,无需修改
subDomain: 'tz', // liu123 此处改成你自己的专属域名。什么是专属域名?请看教程 https://www.it120.cc/help/qr6l4m.html
merchantId: 951, // 商户ID,可在后台工厂设置-->商户信息查看
sdkAppID: 1400450467, // 腾讯实时音视频应用编号,请看教程 https://www.it120.cc/help/nxoqsl.html
Expand Down
2 changes: 1 addition & 1 deletion miniprogram_npm/apifm-wxapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports =
/* eslint-disable */
// 小程序开发api接口工具包,https://github.com/gooking/wxapi
var API_BASE_URL = 'https://api.it120.cc';
// var API_BASE_URL = 'http://127.0.0.1:8081';
// var API_BASE_URL = 'http://192.168.1.103:8081';
var subDomain = '-';
var merchantId = '0';

Expand Down
27 changes: 27 additions & 0 deletions pages/to-pay-order/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,19 @@ Page({
this.data.remark = e.detail.value
},
async goCreateOrder() {
this.setData({
btnLoading: true
})
// 检测实名认证状态
if (wx.getStorageSync('needIdCheck') == 1) {
const res = await WXAPI.userDetail(wx.getStorageSync('token'))
if (res.code == 0 && !res.data.base.isIdcardCheck) {
wx.navigateTo({
url: '/pages/idCheck/index',
})
this.setData({
btnLoading: false
})
return
}
}
Expand Down Expand Up @@ -271,6 +277,9 @@ Page({
title: '请设置收货地址',
icon: 'none'
})
this.setData({
btnLoading: false
})
return;
}
if (postData.peisongType == 'kd') {
Expand All @@ -291,6 +300,9 @@ Page({
title: '请选择自提门店',
icon: 'none'
})
this.setData({
btnLoading: false
})
return;
}
const extJsonStr = {}
Expand All @@ -300,13 +312,19 @@ Page({
title: '请填写联系人',
icon: 'none'
})
this.setData({
btnLoading: false
})
return;
}
if (!this.data.mobile) {
wx.showToast({
title: '请填写联系电话',
icon: 'none'
})
this.setData({
btnLoading: false
})
return;
}
extJsonStr['联系人'] = this.data.name
Expand Down Expand Up @@ -354,6 +372,9 @@ Page({
content: res.msg,
showCancel: false
})
this.setData({
btnLoading: false
})
return;
}
totalRes.data.score += res.data.score
Expand Down Expand Up @@ -444,6 +465,9 @@ Page({
content: res.msg,
showCancel: false
})
this.setData({
btnLoading: false
})
return;
}
totalRes = res
Expand Down Expand Up @@ -530,6 +554,9 @@ Page({
this.processAfterCreateOrder(totalRes)
},
async processAfterCreateOrder(res) {
this.setData({
btnLoading: false
})
let orderId = ''
if (res.data.orderIds && res.data.orderIds.length > 0) {
orderId = res.data.orderIds.join()
Expand Down
1 change: 1 addition & 0 deletions pages/to-pay-order/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
price="{{ allGoodsAndYunPrice*100 }}"
suffix-label="{{ totalScoreToPay ? '+' + totalScoreToPay + ' 积分' : '' }}"
button-text="提交订单"
loading="{{ btnLoading }}"
bind:submit="goCreateOrder"
/>
</block>
Expand Down
4 changes: 2 additions & 2 deletions project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"minifyWXML": true
"useCompilerPlugins": false
},
"compileType": "miniprogram",
"libVersion": "2.20.0",
Expand Down

0 comments on commit b9bc26e

Please sign in to comment.