fix: order-list
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 47s

This commit is contained in:
sexygoat
2026-04-15 16:32:12 +08:00
parent dc3a37f60f
commit 9797de4202

View File

@@ -9,6 +9,7 @@
@tap="onFilterChange(index)" @tap="onFilterChange(index)"
> >
{{ item.label }} {{ item.label }}
<view v-if="filterIndex === index" class="tab-line"></view>
</view> </view>
</view> </view>
@@ -18,38 +19,56 @@
<view class="empty-desc">当前账号下暂无订单信息</view> <view class="empty-desc">当前账号下暂无订单信息</view>
</view> </view>
<view v-else class="card order-card" v-for="(item, index) in orderList" :key="index"> <scroll-view v-else scroll-y class="order-scroll" @scrolltolower="loadMore">
<view class="order-header flex-row-sb"> <view class="order-card" v-for="(item, index) in orderList" :key="index">
<view class="order-no">{{ item.order_no }}</view> <view class="card-header">
<view class="tag-apple" :class="getStatusClass(item.payment_status)">{{ item.payment_status_name }}</view> <view class="header-left">
</view> <view class="header-row">
<text class="field-tag">订单号</text>
<text class="order-no">{{ item.order_no }}</text>
</view>
<view class="header-row" v-if="item.order_id">
<text class="field-tag">订单ID</text>
<text class="order-id">{{ item.order_id }}</text>
</view>
</view>
<view class="status-badge" :class="getStatusClass(item.payment_status)">
{{ item.payment_status_name }}
</view>
</view>
<view class="order-info"> <view class="card-body">
<view class="info-row flex-row-sb"> <view class="info-grid">
<view class="info-label">下单时间</view> <view class="info-item">
<view class="info-value">{{ item.created_at }}</view> <view class="info-label">订单时间</view>
<view class="info-value">{{ item.created_at }}</view>
</view>
<view class="info-item">
<view class="info-label">订单金额</view>
<view class="info-value amount">¥{{ formatMoney(item.total_amount) }}</view>
</view>
</view>
<view class="divider"></view>
<view class="package-section">
<view class="section-label">套餐信息</view>
<view class="package-list">
<view class="package-item" v-for="(pkgName, pIndex) in item.package_names" :key="pIndex">
<text class="field-tag">套餐名称</text>
<text class="package-name">{{ pkgName }}</text>
</view>
</view>
</view>
</view> </view>
</view> </view>
<view class="divider"></view> <view class="load-more" v-if="orderList.length > 0">
<text v-if="loading">加载中...</text>
<view class="package-list"> <text v-else-if="noMore">没有更多了</text>
<view class="package-item" v-for="(pkgName, pIndex) in item.package_names" :key="pIndex"> <text v-else>上拉加载更多</text>
<view class="package-name">{{ pkgName }}</view>
</view>
</view> </view>
</scroll-view>
<view class="order-footer flex-row-sb">
<view class="total-label">合计</view>
<view class="total-amount">¥{{ formatMoney(item.total_amount) }}</view>
</view>
</view>
<view class="load-more" v-if="orderList.length > 0">
<text v-if="loading">加载中...</text>
<text v-else-if="noMore">没有更多了</text>
<text v-else @tap="loadMore">点击加载更多</text>
</view>
</view> </view>
</template> </template>
@@ -146,81 +165,192 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
.filter-tabs { height: 100vh;
display: flex;
flex-direction: column;
background: #f5f6f7;
}
.filter-tabs {
display: flex;
padding: 0 24rpx;
background: #fff;
position: sticky;
top: 0;
z-index: 10;
.tab-item {
position: relative;
flex: 1;
text-align: center;
font-size: 28rpx;
color: #999;
padding: 28rpx 0;
transition: all 0.2s;
&.active {
color: #333;
font-weight: 600;
font-size: 30rpx;
}
.tab-line {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 48rpx;
height: 6rpx;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 3rpx;
}
}
}
.order-scroll {
flex: 1;
padding: 24rpx;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 200rpx 40rpx;
.empty-icon { font-size: 120rpx; margin-bottom: 30rpx; opacity: 0.6; }
.empty-title { font-size: 32rpx; font-weight: 600; color: #333; margin-bottom: 16rpx; }
.empty-desc { font-size: 26rpx; color: #999; text-align: center; }
}
.order-card {
background: #fff;
border-radius: 20rpx;
margin-bottom: 24rpx;
overflow: hidden;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.04);
.card-header {
display: flex; display: flex;
padding: var(--space-md) var(--space-lg); justify-content: space-between;
background: var(--bg-card); align-items: flex-start;
border-bottom: 1rpx solid var(--border-light); padding: 28rpx 28rpx 24rpx;
.tab-item { border-bottom: 1rpx solid #f0f0f0;
flex: 1;
text-align: center; .header-left {
font-size: 28rpx; display: flex;
color: var(--text-secondary); flex-direction: column;
padding: var(--space-sm) 0; gap: 10rpx;
&.active { }
color: var(--primary);
font-weight: 600; .header-row {
border-bottom: 4rpx solid var(--primary); display: flex;
} align-items: center;
gap: 12rpx;
}
.field-tag {
font-size: 20rpx;
color: #999;
background: #f5f6f7;
padding: 2rpx 10rpx;
border-radius: 4rpx;
}
.order-no {
font-size: 26rpx;
font-weight: 600;
color: #333;
font-family: monospace;
}
.order-id {
font-size: 24rpx;
color: #666;
font-family: monospace;
} }
} }
.empty-state { .card-body {
display: flex; padding: 24rpx 28rpx;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 120rpx 40rpx;
min-height: 400rpx;
.empty-icon { font-size: 120rpx; margin-bottom: 30rpx; opacity: 0.6; }
.empty-title { font-size: 32rpx; font-weight: 600; color: var(--text-primary); margin-bottom: 16rpx; }
.empty-desc { font-size: 26rpx; color: var(--text-tertiary); text-align: center; }
}
.order-card { .info-grid {
margin-bottom: var(--space-md); display: grid;
.order-header { grid-template-columns: 1fr 1fr;
margin-bottom: var(--space-md); gap: 20rpx;
.order-no { font-size: 28rpx; font-weight: 600; color: var(--text-primary); }
}
.order-info { .info-item {
.info-row { .info-label {
padding: var(--space-xs) 0; font-size: 22rpx;
.info-label { font-size: 24rpx; color: var(--text-tertiary); } color: #999;
.info-value { font-size: 24rpx; color: var(--text-primary); } margin-bottom: 8rpx;
}
.info-value {
font-size: 26rpx;
color: #333;
&.amount {
color: #ff6b6b;
font-weight: 700;
font-size: 30rpx;
}
}
} }
} }
.divider { .divider {
height: 1rpx; height: 1rpx;
background: var(--gray-200); background: #f5f5f5;
margin: var(--space-md) 0; margin: 24rpx 0;
} }
.package-list { .package-section {
.package-item { .section-label {
padding: var(--space-sm) 0; font-size: 22rpx;
border-bottom: 1rpx solid var(--gray-100); color: #999;
&:last-child { border-bottom: none; } margin-bottom: 16rpx;
.package-name { font-size: 26rpx; color: var(--text-primary); } }
.package-list {
.package-item {
display: flex;
align-items: center;
gap: 12rpx;
padding: 8rpx 0;
.package-name {
font-size: 26rpx;
color: #333;
}
}
} }
} }
.order-footer {
margin-top: var(--space-md);
padding-top: var(--space-md);
border-top: 1rpx solid var(--gray-200);
.total-label { font-size: 26rpx; color: var(--text-secondary); }
.total-amount { font-size: 32rpx; font-weight: 700; color: var(--danger); }
}
}
.load-more {
text-align: center;
padding: var(--space-lg);
color: var(--text-tertiary);
font-size: 24rpx;
} }
} }
.status-badge {
padding: 8rpx 20rpx;
border-radius: 30rpx;
font-size: 22rpx;
font-weight: 500;
&.tag-warning {
background: #fff7e6;
color: #fa8c16;
}
&.tag-success {
background: #e6f7ff;
color: #1890ff;
}
&.tag-secondary {
background: #f5f5f5;
color: #999;
}
&.tag-info {
background: #f0f0f0;
color: #666;
}
}
.load-more {
text-align: center;
padding: 32rpx;
color: #999;
font-size: 24rpx;
}
</style> </style>