paySuccessful.vue
4.71 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<template>
<view class="payCourteous">
<global-loading />
<view class="payTitBox flex-items flex-center" :style="{'padding-top': topHeight + 'px'}">
<view class="payTit fs30">支付成功</view>
</view>
<view class="resultCard">
<view class="imgBox">
<image src="https://zhgw-uat.028wlkj.com/cdwlMall/zsfwzxt/file/static/images/payIcon.png"></image>
</view>
<view class="successful">支付成功</view>
<view class="btnBox fs28 font-color-333">
<view class="orderBtn btn" @click="goToOrder">查看订单</view>
<view class="homeBtn btn" @click="goToHome">返回首页</view>
</view>
<view class="orderPolite" v-if="orderPolite.growth || orderPolite.couponList">
<view class="politeImgBox">
<image src="https://zhgw-uat.028wlkj.com/cdwlMall/zsfwzxt/file/static/images/politeIcon.png"></image>
</view>
<view class="rightInfo">
<view class="growthBox"
v-if="orderPolite.credit">
恭喜获得额外积分<text class="growth">{{ orderPolite.credit }}</text>
</view>
<view class="growthBox" v-if="orderPolite.growth">
恭喜获得额外会员成长值<text class="growth">{{ orderPolite.growth }}</text>
</view>
<view class="couponBox"
v-for="(item, index) of orderPolite.couponList"
:key="index"
>
恭喜获得<text class="coupon">{{item.discount}}</text>{{ item.couponType === 1 ? '满减优惠券' : '折扣券'}}
</view>
</view>
</view>
</view>
<!-- 推荐 -->
<HotTemplate />
<!-- 广告 -->
<ad-window ref="adWindow" :triggerCondition="2"></ad-window>
</view>
</template>
<script>
import HotTemplate from '@/components/hoteRecommed/index.vue'
import AdWindow from "../../components/adWindow";
const NET = require('../../utils/request')
const API = require('../../config/api')
export default {
name: "payCourteous",
components: {
AdWindow,
HotTemplate
},
data() {
return {
orderId: null,
orderPolite: {},
topHeight: 0
}
},
onShow() {
// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.topHeight = menuButtonInfo.top + 10
// #endif
},
onLoad(option) {
this.orderId = option.orderId
if (this.orderId) {
this.getOrderPoliteFn()
}
this.$nextTick(()=>{
this.$refs.adWindow.getAd()
})
},
methods: {
goToOrder() {
uni.navigateTo({
url: '../orderModule/index'
})
},
goToHome() {
uni.switchTab({
url: '../../pages/tabbar/index/index'
})
},
getOrderPoliteFn() {
// uni.showLoading({
// mask: true,
// title: '加载中...',
// })
NET.request(API.getOrderPolite,{
orderId: this.orderId
},'GET').then(res => {
uni.hideLoading()
this.orderPolite = res.data
}).catch(res => {
uni.hideLoading()
})
}
}
}
</script>
<style lang="scss" scoped>
.payCourteous {
.payTitBox {
height: 100rpx;
position: fixed;
left: 0;
top: 0;
width: 100%;
background: #FFFFFF;
z-index: 99;
}
.resultCard{
padding: 200rpx 0 50rpx 0;
.imgBox {
padding-top: 100rpx;
display: flex;
justify-content: center;
image {
width: 166rpx;
height: 121rpx;
}
}
.successful {
text-align: center;
margin-top: 30rpx;
}
.btnBox {
display: flex;
justify-content: center;
margin-top: 30rpx;
.btn {
width: 140rpx;
height: 58rpx;
line-height: 58rpx;
border: 2rpx solid #999999;
text-align: center;
font-size: 24rpx;
color: #999999;
}
.orderBtn {
margin-right: 30rpx;
}
.homeBtn {
background: #333333;
border: none;
color: #FFEBC4;
}
}
.orderPolite {
display: flex;
align-items: center;
width: 670rpx;
background: #FFF9F6;
border: 2rpx solid #FBE9E6;
margin: 50rpx auto 0 auto;
padding: 0 30rpx;
box-sizing: border-box;
.politeImgBox {
image {
width: 186rpx;
height: 186rpx;
}
}
.rightInfo {
flex: 1;
font-size: 28rpx;
color: #333333;
.growthBox {
margin-bottom: 30rpx;
.growth {
color: #C83732;
}
}
.couponBox {
margin-bottom: 30rpx;
.coupon {
color: #C83732;
}
&:last-child {
margin-bottom: 0 !important;
}
}
}
}
}
}
</style>