dingdong-mall/pages/order/pay-result.vue

76 lines
1.7 KiB
Vue

<template>
<view>
<!-- 顶部操作条 -->
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">支付结果</block>
</cu-custom>
<view class="padding-lg margin-xl text-center">
<view class="text-xxl" v-if="customTip">{{customTip}}</view>
<view class="text-xxl" v-else>{{payResult ? '支付成功' : '支付失败'}}</view>
<view class="margin-top">
<view class="cu-btn bg-main-color radius text-xl shadow-blur" @click="showMyOrder">查看我的订单</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
payResult: false,
customTip: null,
servOrderTabList: [{
type: 'ordersWait2Pay',
name: '待付款'
}, {
type: 'ordersWait2Serv',
name: '待服务'
}, {
type: 'ordersServing',
name: '服务中'
}, {
type: 'ordersAfterServ',
name: '售后中'
}, {
type: 'ordersFinish',
name: '已完成'
}],
servOrderType: 'servOrder'
}
},
onLoad(options) {
if (options.payResult) {
this.payResult = options.payResult === '0' ? true : false;
} else if (options.customTip) {
this.customTip = options.customTip;
}
},
methods: {
showMyOrder() {
let params = null;
if (this.payResult || this.customTip) {
params = {
orderType: this.servOrderType,
tabHeaderList: this.servOrderTabList,
tabCur: 1
}
} else {
params = {
orderType: this.servOrderType,
tabHeaderList: this.servOrderTabList,
tabCur: 0
}
}
uni.navigateTo({
url: '/pages/my/my-order?tabInfo=' + encodeURIComponent(JSON.stringify(params))
})
}
},
}
</script>
<style>
</style>