|
@@ -92,7 +92,7 @@
|
|
|
placeholder="请输入支付密码" />
|
|
|
</view>
|
|
|
<view class="fot-btn">
|
|
|
- <u-button @click="toPay" type="error" >确认支付</u-button>
|
|
|
+ <u-button :loading="payBtn" @click="toPay" type="error" >确认支付</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
@@ -122,6 +122,7 @@
|
|
|
showSetPswModal: false, // 设置支付密码弹窗
|
|
|
showInputPsw: false, // 打开输入密码弹窗
|
|
|
showLeavePsw: false, // 打开确定放弃弹窗
|
|
|
+ payBtn: false
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
@@ -209,34 +210,40 @@
|
|
|
},
|
|
|
// 支付 保存订单
|
|
|
toSaveOrder () {
|
|
|
- let orderGoodsList = []
|
|
|
- this.goodsList.map((item,index)=>{
|
|
|
- orderGoodsList[index] = {
|
|
|
- goodsNo: item.goodsNo,
|
|
|
- buyQty: item.buyQty
|
|
|
+ // 已生成订单
|
|
|
+ if(this.orderId) {
|
|
|
+ // 校验用户是否设置过支付密码
|
|
|
+ this.toCheckPwd()
|
|
|
+ } else {
|
|
|
+ this.btnLoading = true
|
|
|
+ let orderGoodsList = []
|
|
|
+ this.goodsList.map((item,index)=>{
|
|
|
+ orderGoodsList[index] = {
|
|
|
+ goodsNo: item.goodsNo,
|
|
|
+ buyQty: item.buyQty
|
|
|
+ }
|
|
|
+ })
|
|
|
+ let params = {
|
|
|
+ receiveAddress: this.userInfo.receiveAddress,
|
|
|
+ receiverName: this.userInfo.receiverName,
|
|
|
+ receiverPhone: this.userInfo.receiverPhone,
|
|
|
+ orderGoodsList: orderGoodsList,
|
|
|
}
|
|
|
- })
|
|
|
- this.btnLoading = true
|
|
|
- let params = {
|
|
|
- receiveAddress: this.userInfo.receiveAddress,
|
|
|
- receiverName: this.userInfo.receiverName,
|
|
|
- receiverPhone: this.userInfo.receiverPhone,
|
|
|
- orderGoodsList: orderGoodsList,
|
|
|
- }
|
|
|
- saveOrder(params).then(res=>{
|
|
|
- console.log(res,'rrrrrrr')
|
|
|
- if(res.status==200) {
|
|
|
- this.orderId = res.data.id
|
|
|
- // 校验用户是否设置过支付密码
|
|
|
- this.toCheckPwd()
|
|
|
- } else {
|
|
|
+ saveOrder(params).then(res=>{
|
|
|
+ console.log(res,'rrrrrrr')
|
|
|
this.btnLoading = false
|
|
|
- uni.showToast({
|
|
|
- title: res.message,
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ if(res.status==200) {
|
|
|
+ this.orderId = res.data.id
|
|
|
+ // 校验用户是否设置过支付密码
|
|
|
+ this.toCheckPwd()
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// 支付
|
|
|
toPay() {
|
|
@@ -244,8 +251,9 @@
|
|
|
payPwd: this.password,
|
|
|
id: this.orderId
|
|
|
}
|
|
|
+ this.payBtn = true
|
|
|
signPay(params).then(res=>{
|
|
|
- this.btnLoading = false
|
|
|
+ this.payBtn = false
|
|
|
if(res.status == 200) {
|
|
|
// 跳转到支付完成界面
|
|
|
uni.navigateTo({
|