Browse Source

修改用户订阅消息逻辑

xiaoxin 2 years ago
parent
commit
22b836aa4e
1 changed files with 24 additions and 13 deletions
  1. 24 13
      pages/payStatus/payStatus.vue

+ 24 - 13
pages/payStatus/payStatus.vue

@@ -35,19 +35,18 @@ export default {
 		handleClickBtn() {
 			if (this.status === '1') {
 				// 返回主页
-				this.getMessage()
+				this.getMessage(1)
 			} else if (this.status === '2') {
 				// 重新支付
 				uni.navigateBack(1)
 			}
 		},
+		// 查看详情按钮回调
 		handleGoDetail() {
-			uni.navigateTo({
-				url: `/pages/orderDetail/orderDetail?id=${this.id}`
-			})
+			this.getMessage(2)
 		},
-		// 订阅消息
-		getMessage() {
+		// 订阅消息  1 代表主页  2代表详情页
+		getMessage(type) {
 			uni.showLoading({
 				title: '加载中',
 				mask: true
@@ -67,9 +66,15 @@ export default {
 								} else {
 									// console.log('拒绝2')
 								}
-								uni.switchTab({
-									url: '/pages/home3/home3'
-								})
+								if (type == 1) {
+									uni.switchTab({
+										url: '/pages/home3/home3'
+									})
+								} else if (type == 2) {
+									uni.navigateTo({
+										url: `/pages/orderDetail/orderDetail?id=${this.id}`
+									})
+								}
 							},
 							fail(err) {
 								console.log(err)
@@ -85,15 +90,21 @@ export default {
 								if (res.confirm) {
 									uni.openSetting({
 										success: (res) => {
-											// this.handleClick()
+											this.handleClickBtn()
 										}
 									})
 								} else {
 									// console.log('失败')
 									setTimeout(() => {
-										uni.switchTab({
-											url: '/pages/home3/home3'
-										})
+										if (type == 1) {
+											uni.switchTab({
+												url: '/pages/home3/home3'
+											})
+										} else if (type == 2) {
+											uni.navigateTo({
+												url: `/pages/orderDetail/orderDetail?id=${this.id}`
+											})
+										}
 									}, 1500)
 								}
 							}