result.vue
3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<template>
<view class="success-page">
<view class="success-box flex flex-direction align-center" v-if="orderDetail.total_fee">
<image class="pay-img" :src="pay ? 'http://shopro.7wpp.com/imgs/pay_success.png' : 'http://shopro.7wpp.com/imgs/pay_fail.png'" mode=""></image>
<text class="notice">{{ pay ? '支付成功' : '支付失败' }}</text>
<text class="pay-money" v-if="pay && orderDetail.total_fee">¥{{ orderDetail.total_fee }}</text>
<view class="btn-box flex justify-between">
<block v-if="pay && orderDetail.activity_type === 'groupon' && orderDetail.ext_arr.buy_type === 'groupon'">
<button
class="cu-btn base-btn"
v-if="orderDetail.ext_arr.groupon_id > 0"
@tap="replace('/pages/activity/groupon/detail', { id: orderDetail.ext_arr.groupon_id })"
>
拼团详情
</button>
<button class="cu-btn base-btn" v-else @tap="replace('/pages/activity/groupon/my-groupon')">我的拼团</button>
</block>
<button class="cu-btn base-btn" v-else @tap="routerTo.push('/pages/index/index')">返回首页</button>
<button class="cu-btn base-btn" @tap="onOrder">查看订单</button>
<button class="again-pay cu-btn" v-if="!pay" @tap="onPay">重新支付</button>
</view>
</view>
<!-- 登录提示 -->
<shopro-login-modal></shopro-login-modal>
</view>
</template>
<script>
import ShoproPay from '@/common/shopro-pay';
import { mapMutations, mapActions, mapState } from 'vuex';
export default {
components: {},
data() {
return {
routerTo: this.$Router,
orderDetail: {},
pay: null
};
},
computed: {},
onLoad() {
this.pay = +this.$Route.query.pay;
if (this.pay) {
this.getCartList();
}
this.getOrderDetail();
},
methods: {
...mapActions(['getCartList']),
jump(path, parmas) {
this.$Router.push({
path: path,
query: parmas
});
},
replace(path, parmas) {
this.$Router.replace({
path: path,
query: parmas
});
},
// 查看订单
onOrder() {
this.$Router.replace({
path: '/pages/order/detail',
query: { id: this.orderDetail.id }
});
},
// 支付信息
getOrderDetail() {
let that = this;
that.$api('order.detail', {
order_sn: that.$Route.query.orderSn
}).then(res => {
if (res.code === 1) {
that.orderDetail = res.data;
}
});
},
// 重新支付
onPay() {
let that = this;
let pay = new ShoproPay(that.$Route.query.type, that.orderDetail);
}
}
};
</script>
<style lang="scss">
.success-box {
background: #fff;
width: 750rpx;
padding: 40rpx 0;
.pay-img {
width: 128rpx;
height: 76rpx;
}
.notice {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(51, 51, 51, 1);
line-height: 30rpx;
margin-top: 30rpx;
}
.pay-money {
font-size: 36rpx;
color: #e1212b;
font-weight: 600;
margin-top: 20rpx;
}
.btn-box {
margin-top: 30rpx;
width: 660rpx;
.base-btn {
width: 320rpx;
height: 70rpx;
background: rgba(255, 255, 255, 1);
border: 1rpx solid rgba(223, 223, 223, 0.5);
border-radius: 35rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
padding: 0;
}
.again-pay {
width: 320rpx;
height: 70rpx;
background: linear-gradient(90deg, rgba(233, 180, 97, 1), rgba(238, 204, 137, 1));
box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
border-radius: 35rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(255, 255, 255, 0.8);
padding: 0;
}
}
}
.hot-box {
background: #fff;
padding: 20rpx;
margin-top: 20rpx;
.hot-title {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
height: 80rpx;
}
}
</style>