支付成功跳转订单页

This commit is contained in:
jqtmviyu@gmail.com 2021-03-06 23:52:31 +08:00
parent 1ec179d2ae
commit 0597bdbcb0
3 changed files with 47 additions and 6 deletions

View File

@ -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
View File

@ -0,0 +1,15 @@
<template>
<view>
订定单页面
</view>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -80,7 +80,7 @@ export default {
// //
async payHandle(){ async payHandle(){
if (!this.address.userName) { if (!this.address.userName) {
return uni.showToast({ title: "请选择收货地址", icon: "none" }); return uni.showToast({ title: "请选择收货地址", icon: "none" });
} else { } else {
// console.log(""); // console.log("");
// //
@ -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);
} }
}, },
}, },