<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>
|