Quellcode durchsuchen

Signed-off-by: liuboyan <632697560@qq.com>
支付

liuboyan vor 4 Jahren
Ursprung
Commit
bc880bc29b
1 geänderte Dateien mit 24 neuen und 8 gelöschten Zeilen
  1. 24 8
      pagesMain/entrustForm.vue

+ 24 - 8
pagesMain/entrustForm.vue

@@ -75,15 +75,31 @@
 					...this.entrustForm,
 					entrustDurationTime: JSON.stringify(this.entrustForm.entrustDurationTime)
 				}, 'POST').then(res => {
-					this.$refs.uTips.show({
-						title: '支付成功',
-						type: 'success',
+					uni.requestPayment({
+						provider: 'wxpay',
+						timeStamp: res.data.timeStamp,
+						nonceStr: res.data.nonceStr,
+						package: res.data.packageValue,
+						signType: res.data.signType,
+						paySign: res.data.paySign,
+						success: (payRes) => {
+							this.$refs.uTips.show({
+								title: '支付成功',
+								type: 'success',
+							})
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '/pagesMain/paySuccess'
+								});
+							}, 1000)
+						},
+						fail: (error) => {
+							this.$refs.uTips.show({
+								title: '支付失败',
+								type: 'warning',
+							})
+						}
 					})
-					setTimeout(() => {
-						uni.reLaunch({
-							url: '/pagesMain/paySuccess'
-						});
-					}, 1000)
 				}).catch(error => {
 					this.$refs.uTips.show({
 						title: '支付失败',