MrShi
7 小时以前 553ba669bcb6e064f2b6a915366c8888cae2b68f
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
<template>
    <view class="all-orders-page">
        <view class="tabs-wrap">
            <u-tabs
                :list="tabList"
                :current="currentTab"
                scrollable
                lineColor="#004096"
                lineWidth="42rpx"
                lineHeight="4rpx"
                :itemStyle="itemStyle"
                :activeStyle="activeStyle"
                :inactiveStyle="inactiveStyle"
                @change="handleTabChange"
            ></u-tabs>
        </view>
 
        <view class="list-wrap">
            <view v-for="item in filteredOrders" :key="item.id" class="order-card">
                <view class="card-head">
                    <view class="head-left">
                        <view class="mode-tag" :class="item.mode === 'city' ? 'city-tag' : 'local-tag'">{{ item.mode === 'city' ? '同城寄送' : '就地寄存' }}</view>
                        <text class="head-user">{{ item.user }}</text>
                    </view>
                    <text class="status-text" :class="item.statusClass">{{ item.status }}</text>
                </view>
 
                <view class="goods-list">
                    <view v-for="goods in item.goods" :key="goods.name" class="goods-row">
                        <view class="goods-left">
                            <text class="goods-name">{{ goods.name }}</text>
                            <text class="goods-size">{{ goods.size }}</text>
                        </view>
                        <view class="goods-right">
                            <text class="goods-price">{{ goods.price }}</text>
                            <text class="goods-count">x1</text>
                        </view>
                    </view>
                </view>
 
                <view class="amount-row">
                    <view class="amount-row-left">
                        <text class="amount-label">实付款:</text>
                        <text class="amount-value">{{ item.amount }}</text>
                    </view>
                    <view class="btn-group" v-if="item.buttons && item.buttons.length">
                        <view v-for="btn in item.buttons" :key="btn.text" class="action-btn" :class="btn.primary ? 'primary-btn' : 'plain-btn'">{{ btn.text }}</view>
                    </view>
                </view>
 
                <view class="action-row">
                    订单备注:{{ item.remark }}
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                currentTab: 5,
                itemStyle: {
                    height: '90rpx',
                    padding: '0 22rpx'
                },
                activeStyle: {
                    color: '#222222',
                    fontSize: '32rpx',
                    fontWeight: '500'
                },
                inactiveStyle: {
                    color: '#666666',
                    fontSize: '30rpx',
                    fontWeight: '400'
                },
                tabList: [
                    { name: '全部', value: 'all' },
                    { name: '待核验', value: 'verify' },
                    { name: '待配送', value: 'delivery' },
                    { name: '待收货', value: 'receive' },
                    { name: '已完成', value: 'done' },
                    { name: '退款', value: 'refund' }
                ],
                orders: [
                    {
                        id: 1,
                        mode: 'local',
                        user: '李明明 181****1898',
                        status: '退款中',
                        statusClass: 'red-text',
                        statusKey: 'refund',
                        amount: '¥80.00',
                        remark: '13:30来寄存',
                        goods: [
                            { name: '大件行李箱', size: '24-28寸', price: '¥35' },
                            { name: '中件行李箱', size: '24-28寸', price: '¥35' }
                        ],
                        buttons: [
                            { text: '联系客服' },
                            { text: '确认到店', primary: true }
                        ]
                    },
                    {
                        id: 2,
                        mode: 'local',
                        user: '李明明 181****1898',
                        status: '待退款',
                        statusClass: 'red-text',
                        statusKey: 'refund',
                        amount: '¥80.00',
                        remark: '13:30来寄存',
                        goods: [
                            { name: '大件行李箱', size: '24-28寸', price: '¥35' },
                            { name: '中件行李箱', size: '24-28寸', price: '¥35' }
                        ],
                        buttons: [
                            { text: '联系客服' },
                            { text: '确认退款', primary: true }
                        ]
                    },
                    {
                        id: 3,
                        mode: 'city',
                        user: '谢莉莉 181****1333',
                        status: '已退款',
                        statusClass: 'gray-text',
                        statusKey: 'refund',
                        amount: '¥90.00',
                        remark: '12点来拿',
                        goods: [
                            { name: '大件行李箱', size: '24-28寸', price: '¥35' },
                            { name: '中件行李箱', size: '24-28寸', price: '¥35' }
                        ],
                        buttons: []
                    }
                ]
            }
        },
        computed: {
            filteredOrders() {
                const current = this.tabList[this.currentTab]
                if (!current || current.value === 'all') {
                    return this.orders
                }
                return this.orders.filter(item => item.statusKey === current.value)
            }
        },
        methods: {
            handleTabChange(item) {
                this.currentTab = item.index
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .all-orders-page {
        min-height: 100vh;
        background: #f5f7fb;
    }
 
    .tabs-wrap {
        background: #ffffff;
        border-bottom: 1rpx solid #f0f1f4;
        position: sticky;
        top: 0;
        left: 0;
        z-index: 999;
        width: 100%;
    }
 
    .list-wrap {
        padding: 20rpx 38rpx;
        box-sizing: border-box;
    }
 
    .order-card {
        margin-bottom: 20rpx;
        background: #ffffff;
        border-radius: 20rpx;
        padding: 20rpx 18rpx 16rpx;
        box-sizing: border-box;
    }
 
    .card-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
 
    .head-left {
        display: flex;
        align-items: center;
        min-width: 0;
    }
 
    .mode-tag {
        width: 104rpx;
        height: 40rpx;
        border-radius: 8rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22rpx;
        font-weight: 400;
        color: #ffffff;
        margin-right: 20rpx;
        flex-shrink: 0;
    }
 
    .local-tag {
        background: linear-gradient(90deg, #19adf8 0%, #38c5ff 100%);
    }
 
    .city-tag {
        background: linear-gradient(90deg, #ff8b28 0%, #ffb24f 100%);
    }
 
    .head-user {
        font-weight: 400;
        font-size: 28rpx;
        color: #333333;
    }
 
    .status-text {
        font-size: 26rpx;
        font-weight: 500;
        flex-shrink: 0;
    }
 
    .red-text {
        color: #ff3b30;
    }
 
    .gray-text {
        color: #999999;
    }
 
    .goods-list {
        margin-top: 30rpx;
    }
 
    .goods-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        // padding: 10rpx 0;
        margin-bottom: 26rpx;
    }
 
    .goods-left {
        flex: 1;
    }
 
    .goods-name {
        display: block;
        font-weight: 600;
        font-size: 28rpx;
        color: #333333;
    }
 
    .goods-size {
        display: block;
        margin-top: 12rpx;
        font-weight: 400;
        font-size: 24rpx;
        color: #8C939F;
    }
 
    .goods-right {
        width: 92rpx;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
 
    .goods-price {
        font-weight: 400;
        font-size: 30rpx;
        color: #333333;
    }
 
    .goods-count {
        margin-top: 12rpx;
        font-weight: 400;
        font-size: 24rpx;
        color: #8C939F;
    }
 
    .amount-row {
        padding-top: 8rpx;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
    }
 
    .amount-label {
        font-weight: 400;
        font-size: 26rpx;
        color: #333333;
    }
 
    .amount-value {
        font-weight: 600;
        font-size: 32rpx;
        color: #222222;
        &:before {
            content: "¥";
            font-weight: 600;
            font-size: 26rpx;
            color: #222222;
        }
    }
 
    .action-row {
        margin-top: 24rpx;
        width: 100%;
        height: 76rpx;
        padding: 0 20rpx;
        box-sizing: border-box;
        background: #F8F9FB;
        border-radius: 8rpx;
        line-height: 76rpx;
        font-weight: 400;
        font-size: 26rpx;
        color: #666666;
    }
 
    .remark-box {
        flex: 1;
        height: 54rpx;
        padding: 0 18rpx;
        border-radius: 10rpx;
        background: #f6f8fb;
        display: flex;
        align-items: center;
        font-size: 20rpx;
        color: #9aa0aa;
        box-sizing: border-box;
    }
 
    .btn-group {
        display: flex;
        align-items: center;
        gap: 12rpx;
    }
 
    .action-btn {
        width: 160rpx;
        height: 64rpx;
        border-radius: 34rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28rpx;
        box-sizing: border-box;
    }
 
    .plain-btn {
        border: 1rpx solid #004096;
        color: #004096;
        background: #ffffff;
    }
 
    .primary-btn {
        background: #004096;
        color: #ffffff;
    }
</style>