lilei 4 months ago
parent
commit
436243c9de

+ 25 - 6
pagesB/procureOrder/creatOrder.vue

@@ -263,7 +263,7 @@
 						 })
 					})
 				})
-				
+				this.loading = true
 				// 校验并提示信息
 				purchaseCheck({
 					detailList:detailList,
@@ -286,6 +286,7 @@
 									}
 								}
 							})
+							this.loading = false
 							return
 						}
 						const successList = res.data.successList.map(item => {
@@ -322,6 +323,7 @@
 							_this.submitForm(successList,delSn)
 						}
 					}else{
+						this.loading = false
 						uni.showToast({
 							title: res.message,
 							icon: 'none'
@@ -364,13 +366,11 @@
 										this.payData = ret.data?ret.data.payRequestRest:null
 									}else{
 										// 余额支付
-										this.payComplete(null,true)
+										this.payError()
 									}
 								}else{
-									uni.showToast({
-										title: ret.message,
-										icon: 'none'
-									})
+									// 支付失败
+									this.payError(ret.message)
 								}
 								uni.$emit("refashPayBalance")
 							})
@@ -387,6 +387,25 @@
 					}
 				})
 			},
+			// 支付失败关闭弹框并跳到订单详情页面
+			payError(msg){
+				if(msg){
+					uni.showModal({
+						title: '提示',
+						content: msg,
+						showCancel: false,
+						confirmText: '确定',
+						success: (res) => {
+							if (res.confirm) {
+								this.payComplete(null,true)
+							}
+						}
+					})
+				}else{
+					// 充值余额支付成功
+					this.payComplete(null,true)
+				}
+			},
 			// 订单详情页
 			payComplete(data){
 				// 创建成功,跳转到订单详情页

+ 8 - 0
pagesB/procureOrder/orderDetail.vue

@@ -132,6 +132,14 @@
 					<text>下单人员</text>
 					<text>{{info.purchaserName || '--'}}</text>
 				</view>
+				<view class="infoList" v-if="info.payOnlineType=='RECHARGE_BALANCE'">
+					<text>支付方式</text>
+					<text>{{info.payOnlineTypeDictValue}}</text>
+				</view>
+				<view class="infoList" v-if="info.payOnlineType=='RECHARGE_BALANCE'">
+					<text>支付时间</text>
+					<text>{{info.createDate||'--'}}</text>
+				</view>
 			</view>
 			<!-- 线上支付 显示 -->
 			<view class="info" v-if="hasPay && info">

+ 30 - 11
pagesB/shopiing/productDetail.vue

@@ -618,6 +618,7 @@
 					mask: true
 				})
 				const _this = this
+				this.loading = false
 				purchaseCheck({
 					   useSubsidyFlag: this.hasKdk&&!this.disKdk? '1' : '0',
 					   payOnlineType: this.payType == 0 ? 'RECHARGE_BALANCE' : this.payType == 1 ? 'PAY_WECHAT_ONLINE' : '',
@@ -680,6 +681,7 @@
 									_this.submitForm(successList)
 								}
 							}else{
+								this.loading = false
 								uni.showToast({
 									title: res.message,
 									icon: 'none'
@@ -693,6 +695,7 @@
 					title: '提交中...',
 					mask: true
 				})
+				this.loading = true
 				purchaseSave({
 					detailList: detailList,
 					useSubsidyFlag: this.hasKdk&&!this.disKdk? '1' : '0',
@@ -721,22 +724,14 @@
 											this.showPay = true
 											this.payData = ret.data?ret.data.payRequestRest:null
 										}else{
-											uni.showToast({
-												title: '支付失败',
-												icon: 'none'
-											})
+											this.payError('支付失败')
 										}
 									}else{
 										// 余额支付
-										this.showPay = true
-										this.showPopu = false
-										this.submitOk = true
+										this.payError()
 									}
 								}else{
-									uni.showToast({
-										title: ret.message,
-										icon: 'none'
-									})
+									this.payError(ret.message)
 								}
 								uni.$emit("refashPayBalance")
 								uni.hideLoading()
@@ -767,6 +762,29 @@
 					this.cancelPay()
 				}
 			},
+			// 支付失败关闭弹框并跳到订单详情页面
+			payError(msg){
+				if(msg){
+					uni.showModal({
+						title: '提示',
+						content: msg,
+						showCancel: false,
+						confirmText: '确定',
+						success: (res) => {
+							if (res.confirm) {
+								this.showPay = true
+								this.showPopu = false
+								this.submitOk = true
+							}
+						}
+					})
+				}else{
+					// 充值余额支付成功
+					this.showPay = true
+					this.showPopu = false
+					this.submitOk = true
+				}
+			},
 			// 关闭确定订单弹窗后
 			closePopu(){
 				this.showPopu = false
@@ -908,6 +926,7 @@
 			},
 			// 订单详情页
 			toOrderDetial(){
+				this.loading = false
 				this.resetPage()
 				// 跳转到订单详情页面
 				uni.navigateTo({