This commit is contained in:
那些花儿
2025-04-24 19:05:25 +08:00
parent bdaea43795
commit 4ad01ea72d
10 changed files with 1090 additions and 75 deletions
+21 -40
View File
@@ -1,12 +1,10 @@
<template>
<view class="page-container">
<!-- 顶部搜索区域 -->
<view class="header">
<view class="search-block">
<t-search
v-model="pageForm.searchKeyword"
placeholder="搜索活动"
shape="round"
class="search"
>
<template #action>
<t-button variant="text" @click="filterVisible = true">筛选</t-button>
@@ -57,7 +55,7 @@
@click="navigateToDetail(item.id)"
>
<view class="card-head">
<image :src="item.image" mode="aspectFill" class="card-img"/>
<image :src="item.cover" mode="aspectFill" class="card-img"/>
<text class="card-tag" :class="getStatusClass(item.status)">
{{ getStatusText(item.status) }}
</text>
@@ -68,33 +66,27 @@
<view class="card-info">
<view class="info-item">
<t-icon name="alarm" size="12px"/>
<text>{{ item.date }}</text>
报名时间
{{moment(item.signStartTime).format('YYYY-MM-DD HH:mm:ss')}}
{{moment(item.signEndTime).format('YYYY-MM-DD HH:mm:ss')}}
</view>
<view class="info-item">
<t-icon name="location" size="12px"/>
<text>{{ item.location }}</text>
</view>
<view class="info-item">
<t-icon name="user" size="12px"/>
<text>{{ item.participants }}人已报名</text>
活动时间
{{moment(item.startTime).format('YYYY-MM-DD HH:mm:ss')}}
{{moment(item.endTime).format('YYYY-MM-DD HH:mm:ss')}}
</view>
</view>
<view class="card-footer">
<view class="price">
<text class="price-symbol">¥</text>
<text class="price-value">{{ item.price }}</text>
</view>
<t-button
size="small"
shape="round"
:theme="item.status === 2 ? 'default' : 'primary'"
:disabled="item.status === 2"
>
{{ item.status === 1 ? '立即报名' : item.status === 3 ? '预约提醒' : '已结束' }}
</t-button>
</view>
<!-- <view class="card-footer">-->
<!-- <t-button-->
<!-- size="small"-->
<!-- shape="round"-->
<!-- :theme="item.status === 2 ? 'default' : 'primary'"-->
<!-- :disabled="item.status === 2"-->
<!-- >-->
<!-- {{ item.status === 1 ? '立即报名' : item.status === 3 ? '预约提醒' : '已结束' }}-->
<!-- </t-button>-->
<!-- </view>-->
</view>
</view>
@@ -117,6 +109,7 @@
import {ref, reactive, onMounted} from 'vue';
import {Toast} from 'tdesign-mobile-vue';
import {useRequest} from "@/util/request";
import moment from "moment";
// 筛选选项
const statusOptions = [
@@ -141,12 +134,6 @@ const hasMore = ref(true);
const refreshIng = ref(false);
const filterVisible = ref(false);
// 搜索表单
const searchForm = reactive({
keyword: '',
status: ''
});
// 获取状态样式类
const getStatusClass = (status) => {
return {
@@ -187,6 +174,7 @@ const getListData = async (isRefresh = false) => {
} else {
dataList.value = [...dataList.value, ...data.list];
}
pageForm.totalCount = data.totalCount;
hasMore.value = dataList.value.length < data.totalCount;
pageForm.pageNumber++;
console.log(hasMore.value)
@@ -237,19 +225,12 @@ onMounted(() => {
</script>
<style scoped>
.header {
.search-block {
background-color: #fff;
padding: 10px 16px;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
position: sticky;
top: 0;
z-index: 10;
}
.search {
--td-search-bg-color: #f0f0f0;
}
.filter {
background-color: #fff;
border-radius: 0 0 16px 16px;