支付成功跳转订单页
This commit is contained in:
		
							parent
							
								
									1ec179d2ae
								
							
						
					
					
						commit
						0597bdbcb0
					
				@ -45,6 +45,12 @@
 | 
				
			|||||||
			"style": {
 | 
								"style": {
 | 
				
			||||||
				"navigationBarTitleText": "结算"
 | 
									"navigationBarTitleText": "结算"
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
								"path": "pages/order/order",
 | 
				
			||||||
 | 
								"style": {
 | 
				
			||||||
 | 
									"navigationBarTitleText": "订单"
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	],
 | 
						],
 | 
				
			||||||
	"globalStyle": {
 | 
						"globalStyle": {
 | 
				
			||||||
@ -110,7 +116,13 @@
 | 
				
			|||||||
				"name": "个人页面",
 | 
									"name": "个人页面",
 | 
				
			||||||
				"path": "pages/my/my",
 | 
									"path": "pages/my/my",
 | 
				
			||||||
				"query": ""
 | 
									"query": ""
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
									"name": "订单页",
 | 
				
			||||||
 | 
									"path": "pages/order/order",
 | 
				
			||||||
 | 
									"query": ""
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
		]
 | 
							]
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										15
									
								
								src/pages/order/order.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/pages/order/order.vue
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					  <view>
 | 
				
			||||||
 | 
					    订定单页面
 | 
				
			||||||
 | 
					  </view>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@ -103,11 +103,25 @@ export default {
 | 
				
			|||||||
        const {message: {pay}} = await this.$u.api.orderPayParams({order_number})
 | 
					        const {message: {pay}} = await this.$u.api.orderPayParams({order_number})
 | 
				
			||||||
        console.log(pay);
 | 
					        console.log(pay);
 | 
				
			||||||
        // 调用支付接口
 | 
					        // 调用支付接口
 | 
				
			||||||
        const res1 = await wx.requestPayment(pay)
 | 
					        // const res1 = await wx.requestPayment(pay)
 | 
				
			||||||
        console.log(res1)
 | 
					        // console.log(res1)
 | 
				
			||||||
        // 更新支付状态
 | 
					        // 更新支付状态
 | 
				
			||||||
        const res2 = await this.$u.api.checkOrder(order_number)
 | 
					        // const {message} = await this.$u.api.checkOrder(order_number)
 | 
				
			||||||
        console.log(res2);
 | 
					        // console.log(message);
 | 
				
			||||||
 | 
					        // 支付成功
 | 
				
			||||||
 | 
					        await uni.showToast({
 | 
				
			||||||
 | 
					          title: "支付成功",
 | 
				
			||||||
 | 
					          icon: "none"
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        setTimeout(() => {
 | 
				
			||||||
 | 
					          // 保留未支付的商品
 | 
				
			||||||
 | 
					          const cartList = this.cartList.filter(item=>!item.goods_select)
 | 
				
			||||||
 | 
					          uni.setStorageSync("cartList", cartList)
 | 
				
			||||||
 | 
					          // 替换到订单页
 | 
				
			||||||
 | 
					          uni.redirectTo({
 | 
				
			||||||
 | 
					            url: "/pages/order/order"
 | 
				
			||||||
 | 
					          })
 | 
				
			||||||
 | 
					        }, 1500);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user