diff --git a/src/pages.json b/src/pages.json index d85a3d3..005faea 100644 --- a/src/pages.json +++ b/src/pages.json @@ -45,6 +45,12 @@ "style": { "navigationBarTitleText": "结算" } + }, + { + "path": "pages/order/order", + "style": { + "navigationBarTitleText": "订单" + } } ], "globalStyle": { @@ -110,7 +116,13 @@ "name": "个人页面", "path": "pages/my/my", "query": "" - } + }, + { + "name": "订单页", + "path": "pages/order/order", + "query": "" + } + ] } } diff --git a/src/pages/order/order.vue b/src/pages/order/order.vue new file mode 100644 index 0000000..69dcf7d --- /dev/null +++ b/src/pages/order/order.vue @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/src/pages/pay/pay.vue b/src/pages/pay/pay.vue index fbbe6e1..13e7823 100644 --- a/src/pages/pay/pay.vue +++ b/src/pages/pay/pay.vue @@ -80,7 +80,7 @@ export default { // 去付款 async payHandle(){ if (!this.address.userName) { - return uni.showToast({ title: "请选择收货地址", icon: "none" }); + return uni.showToast({ title: "请选择收货地址", icon: "none" }); } else { // console.log("走支付逻辑"); // 创建订单 @@ -103,11 +103,25 @@ export default { const {message: {pay}} = await this.$u.api.orderPayParams({order_number}) console.log(pay); // 调用支付接口 - const res1 = await wx.requestPayment(pay) - console.log(res1) + // const res1 = await wx.requestPayment(pay) + // console.log(res1) // 更新支付状态 - const res2 = await this.$u.api.checkOrder(order_number) - console.log(res2); + // const {message} = await this.$u.api.checkOrder(order_number) + // 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); } }, },