order-confirm.vue
6.79 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<template>
<view class="page-shell order-confirm-page">
<view class="page-blur"></view>
<view class="page-blur-secondary"></view>
<view class="page-blur-tertiary"></view>
<view class="page-content subpage-content">
<view class="subpage-nav">
<view class="subpage-back" @tap="goBack">‹</view>
<view class="subpage-title-wrap">
<text class="subpage-title">确认订单</text>
<text class="subpage-subtitle">支付后自动生成核销二维码,支持任意时间任意门店核销自提</text>
</view>
</view>
<view class="subpage-card pickup-card">
<view class="pickup-head">
<view>
<text class="pickup-kicker">PICKUP ACCESS</text>
<text class="pickup-main">任意时间 · 任意门店</text>
</view>
<text class="pickup-action">二维码核销</text>
</view>
<text class="pickup-detail">支付成功后自动生成核销二维码,到任意门店出示即可核销自提,无需提前选择门店。</text>
<view class="meta-grid pickup-meta">
<text class="meta-pill">门店自提</text>
<text class="meta-pill">任意门店可用</text>
<text class="meta-pill rose">任意时间可核销</text>
</view>
</view>
<view class="product-card glass-card">
<image class="product-image" :src="product.image" mode="aspectFill" />
<view class="product-copy">
<text class="product-name">{{ product.name }}</text>
<text class="product-spec">{{ product.specs[0] || '默认规格' }} · 1 件</text>
<text class="product-desc">{{ product.desc }}</text>
<text class="product-price">¥{{ product.price }}</text>
</view>
</view>
<view class="subpage-card">
<view class="section-head">
<text class="section-title">自提说明</text>
<text class="section-link">购买须知</text>
</view>
<view class="flow-list">
<view v-for="(item, index) in pickupSteps" :key="item.title" class="flow-item">
<view class="flow-index">{{ index + 1 }}</view>
<view class="flow-copy">
<text class="flow-title">{{ item.title }}</text>
<text class="flow-desc">{{ item.desc }}</text>
</view>
</view>
</view>
</view>
<view class="subpage-card">
<view class="info-list">
<view class="info-row">
<text class="info-label">商品金额</text>
<text class="info-value">¥{{ product.price }}</text>
</view>
<view class="info-row">
<text class="info-label">提货方式</text>
<text class="info-value">到店自提</text>
</view>
<view class="info-row">
<text class="info-label">核销范围</text>
<text class="info-value">任意门店通用</text>
</view>
<view class="info-row">
<text class="info-label">使用时间</text>
<text class="info-value">任意时间可核销</text>
</view>
<view class="info-row">
<text class="info-label">实付金额</text>
<text class="info-value accent">¥{{ product.price }}</text>
</view>
</view>
</view>
<view class="cta-row">
<view class="secondary-button" @tap="goBack">返回商品</view>
<view class="primary-button" @tap="submitOrder">提交并支付</view>
</view>
</view>
</view>
</template>
<script>
import { findProductById } from '@/packageMall/data/products'
import { saveLatestPickupOrder } from '@/packageMall/data/orderFlow'
export default {
data() {
return {
product: findProductById(1),
pickupSteps: [
{ title: '提交订单', desc: '完成支付后,本单会立即进入门店自提流程。' },
{ title: '生成核销码', desc: '小程序自动生成专属二维码,无需等待发货。' },
{ title: '任意门店核销', desc: '支持任意时间前往任意门店出示二维码并完成核销。' }
]
}
},
onLoad(options) {
this.product = findProductById(options.productId)
},
methods: {
goBack() {
uni.navigateBack({ fail: () => uni.redirectTo({ url: `/packageMall/product-detail/product-detail?id=${this.product.id}` }) })
},
submitOrder() {
saveLatestPickupOrder({
orderId: 5001,
productId: this.product.id,
createdAt: new Date().toISOString().slice(0, 16).replace('T', ' ')
})
uni.navigateTo({ url: `/packageMall/payment-success/payment-success?orderId=5001&productId=${this.product.id}` })
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/mixins.scss';
@import '@/styles/subpage.scss';
.pickup-card {
margin-bottom: 24rpx;
}
.pickup-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 20rpx;
}
.pickup-kicker,
.pickup-main,
.pickup-detail,
.pickup-action,
.flow-title,
.flow-desc {
display: block;
}
.pickup-kicker {
font-size: 20rpx;
letter-spacing: 4rpx;
color: rgba(143, 118, 86, 0.82);
}
.pickup-main {
margin-top: 16rpx;
font-size: 30rpx;
font-weight: 700;
}
.pickup-action {
@include chip-soft;
white-space: nowrap;
}
.pickup-detail {
margin-top: 14rpx;
font-size: 24rpx;
line-height: 1.8;
color: $text-secondary;
}
.pickup-meta {
margin-top: 16rpx;
}
.product-card {
display: flex;
padding: 28rpx;
margin-bottom: 24rpx;
}
.product-image {
width: 180rpx;
height: 180rpx;
border-radius: 28rpx;
flex-shrink: 0;
}
.product-copy {
flex: 1;
margin-left: 22rpx;
}
.product-name,
.product-spec,
.product-desc,
.product-price {
display: block;
}
.product-name {
font-size: 30rpx;
line-height: 1.5;
font-weight: 700;
}
.product-spec,
.product-desc {
margin-top: 12rpx;
font-size: 24rpx;
line-height: 1.7;
color: $text-secondary;
}
.product-price {
margin-top: 16rpx;
font-size: 36rpx;
font-weight: 700;
color: $brand-primary-deep;
}
.flow-list {
margin-top: 6rpx;
}
.flow-item {
display: flex;
align-items: flex-start;
padding: 18rpx 0;
border-bottom: 1rpx solid rgba(100, 140, 118, 0.08);
}
.flow-item:last-child {
border-bottom: 0;
padding-bottom: 0;
}
.flow-index {
width: 52rpx;
height: 52rpx;
margin-right: 18rpx;
border-radius: 18rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
font-size: 24rpx;
font-weight: 700;
color: $brand-primary-deep;
background: rgba(210, 191, 156, 0.14);
}
.flow-copy {
flex: 1;
}
.flow-title {
font-size: 28rpx;
font-weight: 600;
color: $text-primary;
}
.flow-desc {
margin-top: 10rpx;
font-size: 23rpx;
line-height: 1.8;
color: $text-secondary;
}
.accent {
color: $brand-primary-deep;
}
</style>