Lufaneng 11 months ago
parent f43fc7b4ca
commit 3d4a802ba5

@ -1,24 +1,12 @@
<template>
<view class="container">
<!-- 顶部筛选标签 -->
<view class="filter-tabs">
<view class="tab-item" :class="{ active: activeTab === 'all' }" @click="switchTab('all')">
全部
</view>
<view class="tab-item" :class="{ active: activeTab === 'recharge' }" @click="switchTab('recharge')">
充值
</view>
<view class="tab-item" :class="{ active: activeTab === 'monthly' }" @click="switchTab('monthly')">
包月
</view>
<view class="tab-item" :class="{ active: activeTab === 'season' }" @click="switchTab('season')">
包季
</view>
<view class="tab-item" :class="{ active: activeTab === 'yearly' }" @click="switchTab('yearly')">
包年
</view>
</view>
<view class="container">
<uv-sticky bgColor="#fff" offsetTop="0">
<div class="tabBox">
<div class="tabItem" :class="{selected:active==='全部'}" @click="() => active = '全部'">全部</div>
<div class="tabItem" :class="{selected:active==='已支付'}" @click="() => active = '已支付'">已支付</div>
<div class="tabItem" :class="{selected:active==='待支付'}" @click="() => active = '待支付'">待支付</div>
</div>
</uv-sticky>
<!-- 订单列表 -->
<view class="order-list">
<view class="order-item" v-for="order in filteredOrders" :key="order.id">
@ -139,7 +127,8 @@
useUserStore
} from "@/store";
import HeaderCustom from '/components/HeaderCustom/HeaderCustom.vue'
import RPC from "@/utils/request";
import RPC from "@/utils/request";
const active = ref('全部')
const authStore = useAuthStore()
const userStore = useUserStore()
@ -319,41 +308,27 @@
min-height: 100vh;
padding-bottom: 50px;
background-color: #f8f8f8;
}
.tabBox {
height: 50px;
background-color: #fff;
display: flex;
.tabItem {
height: 100%;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
&.selected {
color: #5479ED;
border-bottom: 1px solid #5479ED;
}
}
}
.filter-tabs {
display: flex;
background: white;
padding: 0 16px;
border-bottom: 1px solid #e5e5e5;
.tab-item {
flex: 1;
text-align: center;
padding: 16px 0;
color: #666;
font-size: 14px;
position: relative;
&.active {
color: #4285f4;
font-weight: 500;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 20px;
height: 2px;
background: #4285f4;
border-radius: 1px;
}
}
}
}
.order-list {
padding: 16px;

@ -68,7 +68,7 @@
</view>
<!-- 空状态 -->
<view v-if="list.length === 0" class="empty-state">
<view v-if="list.length === 0 && loadingStatus !== 'loading'" class="empty-state">
<uv-icon name="file-text" size="60" color="#ccc"></uv-icon>
<text class="empty-text">暂无生成记录</text>
</view>
@ -200,7 +200,7 @@ const deleteRecord = (record) => {
//
const loadRecords = async () => {
loadingStatus.value === "loading";
loadingStatus.value = "loading";
RPC.post("/planned_list", { page: page.value, page_size: 20 })
.then((res) => {
list.value = [...list.value, ...res.list];
@ -220,7 +220,7 @@ const loadRecords = async () => {
onPullDownRefresh(() => {
list.value = [];
page.value = 1;
loadingStatus.value === "loading";
loadingStatus.value = "loading";
RPC.post("/planned_list", { page: page.value, page_size: 20 })
.then((res) => {
list.value = [...list.value, ...res.list];

Loading…
Cancel
Save