order-confirm.vue
4.1 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
<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 address-card" @tap="manageAddress">
<text class="address-kicker">DELIVERY ADDRESS</text>
<text class="address-main">{{ address.name }} {{ address.phone }}</text>
<text class="address-detail">{{ address.full }}</text>
</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">默认规格 · 1 件</text>
<text class="product-desc">{{ product.desc }}</text>
<text class="product-price">¥{{ product.price }}</text>
</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 accent">¥{{ product.price }}</text>
</view>
</view>
</view>
<view class="cta-row">
<view class="secondary-button" @tap="manageAddress">管理地址</view>
<view class="primary-button" @tap="submitOrder">提交订单</view>
</view>
</view>
</view>
</template>
<script>
import { findProductById } from '@/packageMall/data/products'
import { addresses } from '@/data/mock'
export default {
data() {
return {
product: findProductById(1),
address: addresses[0]
}
},
onLoad(options) {
this.product = findProductById(options.productId)
},
methods: {
goBack() {
uni.navigateBack({ fail: () => uni.redirectTo({ url: `/pages/product-detail/product-detail?id=${this.product.id}` }) })
},
manageAddress() {
uni.navigateTo({ url: '/pages/address-list/address-list' })
},
submitOrder() {
uni.navigateTo({ url: `/pages/payment-success/payment-success?orderId=5001&productId=${this.product.id}` })
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/mixins.scss';
@import '@/styles/subpage.scss';
.address-card {
margin-bottom: 24rpx;
}
.address-kicker,
.address-main,
.address-detail {
display: block;
}
.address-kicker {
font-size: 20rpx;
letter-spacing: 4rpx;
color: rgba(143, 118, 86, 0.82);
}
.address-main {
margin-top: 16rpx;
font-size: 30rpx;
font-weight: 700;
}
.address-detail {
margin-top: 12rpx;
font-size: 24rpx;
line-height: 1.8;
color: $text-secondary;
}
.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;
}
.accent {
color: $brand-primary-deep;
}
</style>