yanjie 4 éve
szülő
commit
9988c085eb
2 módosított fájl, 126 hozzáadás és 314 törlés
  1. 1 1
      pages/common_tools/my_consulting/my_consulting.vue
  2. 125 313
      pages/order/payment.vue

+ 1 - 1
pages/common_tools/my_consulting/my_consulting.vue

xqd
@@ -39,7 +39,7 @@
 							<text style="color: #333333;">编号:{{item.order_sn}}</text>
 							<text v-if="item.order_status==4&&item.is_evaluate!=1" @click.stop="evaluate(item,index)" style="width: 130rpx; text-align: right;"
 							 class="text-blue">评价</text>
-							<text v-else-if="item.order_status==1" class="text-blue">取消</text>
+							<!-- <text v-else-if="item.order_status==1" class="text-blue">取消</text> -->
 							<text v-else-if="item.order_status==4&&item.is_evaluate==1" class="text-blue" @click.stop="gotoeva">查看评价</text>
 						</view>
 						<view class="textstyle margin-top-xs">

+ 125 - 313
pages/order/payment.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -228,7 +228,8 @@
 				pageservice: 1,
 				serviceList: [],
 				paytype: 2,
-				serviceid: ""
+				serviceid: "",
+				order_id: ""
 			}
 		},
 		methods: {
@@ -383,10 +384,12 @@
 					uni.requestSubscribeMessage({
 						tmplIds: ['M9b6PPKtD7PEqLsSnQ453iTIHtIZZpixOBjUjax8YXU'],
 						success: (res) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						},
 						fail: (err) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						}
@@ -397,10 +400,12 @@
 							'ZrL4Ag28cW2F1I1gWcnIk-fxNmZNhb-vNsx32j1ulG0'
 						],
 						success: (res) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						},
 						fail: (err) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						}
@@ -411,10 +416,12 @@
 							'phcsQ7ZbsJapfmx3NMCha0MrHCqFrgN7BWVneE5OffI'
 						],
 						success: (res) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						},
 						fail: (err) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						}
@@ -425,10 +432,12 @@
 							'phcsQ7ZbsJapfmx3NMChaxepR9tJFiqbO25P9tujErI'
 						],
 						success: (res) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						},
 						fail: (err) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						}
@@ -437,15 +446,18 @@
 					uni.requestSubscribeMessage({
 						tmplIds: ['obCFv2gAnl_RaW-OlnZkjCfi6teT3LUaHxxInUkwLbw'],
 						success: (res) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						},
 						fail: (err) => {
+							this.payment()
 							this.popupShow = true
 							this.show = true
 						}
 					})
 				} else {
+					this.payment()
 					this.popupShow = true
 					this.show = true
 				}
@@ -472,66 +484,22 @@
 					order_pack_id: this.serviceid
 				})
 				if (res.status == 0) {
-					this.popupShow = false
-					this.show = false
-					uni.showToast({
-						title: "支付成功!",
-						duration: 1500
-					})
-					setTimeout(() => {
-						uni.redirectTo({
-							url: "order?type=" + this.infodata.product_type
-						})
-					}, 1500)
-				} else {
-					if (res.message == '密码错误') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "重试",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else if (res.message == '未设置支付密码') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "设置",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-									uni.navigateTo({
-										url: "../index/paypassword"
-									})
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "确定",
-							showCancel: false,
-							success: (rr) => {
-								if (rr.confirm) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
+					this.order_id = res.data.order_id
+					console.log(res)
+				}else{
+					uni.showModal({
+						title: "提示",
+						content: res.message,
+						confirmText: "确定",
+						showCancel: false,
+						success: (rr) => {
+							if (rr.confirm) {
+								this.popupShow = false
+								this.show = false
+								this.password = ""
 							}
-						})
-					}
+						}
+					})
 				}
 			},
 			paypacks: async function() {
@@ -555,66 +523,21 @@
 				})
 				console.log(res)
 				if (res.status == 0) {
-					this.popupShow = false
-					this.show = false
-					uni.showToast({
-						title: "支付成功!",
-						duration: 1500
-					})
-					setTimeout(() => {
-						uni.redirectTo({
-							url: "order?type=" + this.infodata.product_type
-						})
-					}, 1500)
-				} else {
-					if (res.message == '密码错误') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "重试",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else if (res.message == '未设置支付密码') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "设置",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-									uni.navigateTo({
-										url: "../index/paypassword"
-									})
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "确定",
-							showCancel: false,
-							success: (rr) => {
-								if (rr.confirm) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
+					this.order_id = res.data.order_id
+				}else{
+					uni.showModal({
+						title: "提示",
+						content: res.message,
+						confirmText: "确定",
+						showCancel: false,
+						success: (rr) => {
+							if (rr.confirm) {
+								this.popupShow = false
+								this.show = false
+								this.password = ""
 							}
-						})
-					}
+						}
+					})
 				}
 			},
 			payphone: async function() {
@@ -631,66 +554,22 @@
 					order_pack_id: this.serviceid
 				})
 				if (res.status == 0) {
-					this.popupShow = false
-					this.show = false
-					uni.showToast({
-						title: "支付成功!",
-						duration: 1500
-					})
-					setTimeout(() => {
-						uni.redirectTo({
-							url: "order?type=" + this.infodata.product_type
-						})
-					}, 1500)
-				} else {
-					if (res.message == '密码错误') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "重试",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else if (res.message == '未设置支付密码') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "设置",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-									uni.navigateTo({
-										url: "../index/paypassword"
-									})
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "确定",
-							showCancel: false,
-							success: (rr) => {
-								if (rr.confirm) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
+					this.order_id = res.data.order_id
+					console.log(res)
+				}else{
+					uni.showModal({
+						title: "提示",
+						content: res.message,
+						confirmText: "确定",
+						showCancel: false,
+						success: (rr) => {
+							if (rr.confirm) {
+								this.popupShow = false
+								this.show = false
+								this.password = ""
 							}
-						})
-					}
+						}
+					})
 				}
 			},
 			paychat: async function() {
@@ -707,66 +586,21 @@
 					order_pack_id: this.serviceid
 				})
 				if (res.status == 0) {
-					this.popupShow = false
-					this.show = false
-					uni.showToast({
-						title: "支付成功!",
-						duration: 1500
-					})
-					setTimeout(() => {
-						uni.redirectTo({
-							url: "order?type=" + this.infodata.product_type
-						})
-					}, 1500)
-				} else {
-					if (res.message == '密码错误') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "重试",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else if (res.message == '未设置支付密码') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "设置",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-									uni.navigateTo({
-										url: "../index/paypassword"
-									})
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "确定",
-							showCancel: false,
-							success: (rr) => {
-								if (rr.confirm) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
+					this.order_id = res.data.order_id
+				}else{
+					uni.showModal({
+						title: "提示",
+						content: res.message,
+						confirmText: "确定",
+						showCancel: false,
+						success: (rr) => {
+							if (rr.confirm) {
+								this.popupShow = false
+								this.show = false
+								this.password = ""
 							}
-						})
-					}
+						}
+					})
 				}
 			},
 			payvaccines: async function() {
@@ -784,66 +618,21 @@
 					order_pack_id: this.serviceid
 				})
 				if (res.status == 0) {
-					this.popupShow = false
-					this.show = false
-					uni.showToast({
-						title: "支付成功!",
-						duration: 1500
-					})
-					setTimeout(() => {
-						uni.redirectTo({
-							url: "order?type=" + this.infodata.product_type
-						})
-					}, 1500)
-				} else {
-					if (res.message == '密码错误') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "重试",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else if (res.message == '未设置支付密码') {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "设置",
-							success: (res) => {
-								if (res.confirm) {
-									this.password = ""
-									uni.navigateTo({
-										url: "../index/paypassword"
-									})
-								} else if (res.cancel) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
-							},
-						})
-					} else {
-						uni.showModal({
-							title: "提示",
-							content: res.message,
-							confirmText: "确定",
-							showCancel: false,
-							success: (rr) => {
-								if (rr.confirm) {
-									this.popupShow = false
-									this.show = false
-									this.password = ""
-								}
+					this.order_id = res.data.order_id
+				}else{
+					uni.showModal({
+						title: "提示",
+						content: res.message,
+						confirmText: "确定",
+						showCancel: false,
+						success: (rr) => {
+							if (rr.confirm) {
+								this.popupShow = false
+								this.show = false
+								this.password = ""
 							}
-						})
-					}
+						}
+					})
 				}
 			},
 			paychildcare: async function() {
@@ -862,6 +651,45 @@
 					order_pack_id: this.serviceid
 				})
 				console.log(res)
+				if (res.status == 0) {
+					this.order_id = res.data.order_id
+				}else{
+					uni.showModal({
+						title: "提示",
+						content: res.message,
+						confirmText: "确定",
+						showCancel: false,
+						success: (rr) => {
+							if (rr.confirm) {
+								this.popupShow = false
+								this.show = false
+								this.password = ""
+							}
+						}
+					})
+				}
+			},
+			//点击确认支付
+			payment(e) {
+				if (this.infodata.product_type == 1) {
+					this.payphone()
+				} else if (this.infodata.product_type == 2) {
+					this.paychat()
+				} else if (this.infodata.product_type == 6) {
+					this.paypacks()
+				} else if (this.infodata.product_type == 3) {
+					this.payyuyue()
+				} else if (this.infodata.product_type == 4) {
+					this.payvaccines()
+				} else if (this.infodata.product_type == 5) {
+					this.paychildcare()
+				}
+			},
+			orderPay: async function() {
+				let res = await this.$request.post("/api/v1/order/orderPay", {
+					order_id: this.order_id,
+					pay_password: this.password
+				})
 				if (res.status == 0) {
 					this.popupShow = false
 					this.show = false
@@ -925,29 +753,13 @@
 					}
 				}
 			},
-			//点击确认支付
-			payment(e) {
-				if (this.infodata.product_type == 1) {
-					this.payphone()
-				} else if (this.infodata.product_type == 2) {
-					this.paychat()
-				} else if (this.infodata.product_type == 6) {
-					this.paypacks()
-				} else if (this.infodata.product_type == 3) {
-					this.payyuyue()
-				} else if (this.infodata.product_type == 4) {
-					this.payvaccines()
-				} else if (this.infodata.product_type == 5) {
-					this.paychildcare()
-				}
-			},
 			// 按键被点击(点击退格键不会触发此事件)
 			valChange(val) {
 				// 将每次按键的值拼接到value变量中,注意+=写法
 				this.password += val;
 				if (this.password.charAt(0) != '0') {
 					if (this.password.length == 6) {
-						this.payment()
+						this.orderPay()
 					}
 				} else {
 					this.password = ''