This commit is contained in:
@jyuhsin
2025-05-06 19:40:35 +08:00
parent c60ec90770
commit 6f5f6b8076
5 changed files with 55 additions and 8 deletions
@@ -55,6 +55,7 @@ public class ClientActivityController {
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and(Cnd.likeEX("t1.title", pageForm.getSearchKeyword()));
sql.setCondition(cnd);
Pagination pagination = clientActivityService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
+11
View File
@@ -127,6 +127,17 @@
"selectedColor": "#f45a5a"
}
},
{
"pagePath": "pages/activity/rank/index",
"text": "排行榜",
"iconfont": {
"text": "\ue64d",
"selectedText": "\ue64d",
"fontSize": "17px",
"color": "#333",
"selectedColor": "#f45a5a"
}
},
{
"pagePath": "pages/profile/index",
"text": "我的",
@@ -8,6 +8,9 @@
shape="round"
class="search-input"
@onSearch="handleSearch"
@onSubmit="handleSearch"
@submit="handleSearch"
@search="handleSearch"
/>
</view>
</view>
+38 -6
View File
@@ -1,5 +1,10 @@
<template>
<view class="page-container">
<t-dropdown-menu class="top-dropdown">
<t-dropdown-item :options="actOptions" :value="activityId"/>
</t-dropdown-menu>
<view class="rank-header">
<view class="title-container">
<view class="title">活动排行榜</view>
@@ -75,17 +80,27 @@
</template>
<script setup>
import { ref, onMounted } from 'vue';
import {ref, onMounted, computed} from 'vue';
import { Toast } from 'tdesign-mobile-vue';
import { useRequest } from "@/utils/request";
import {onLoad} from "@dcloudio/uni-app";
// 排行榜数据
const actList = ref([])
const rankList = ref([]);
const activityId = ref([]);
const activityId = ref(null);
const loading = ref(false);
const refresherTriggered = ref(false);
const actOptions = computed(() => {
return actList.value.map(item => {
return {
value: item.id,
label: item.title
}
})
})
// 获取排行榜数据
const getRankData = async () => {
loading.value = true;
@@ -110,6 +125,22 @@ const getRankData = async () => {
}
};
async function listMineAct() {
try {
const {data, code, msg} = await useRequest().get('/client/activity/list-mine-act')
if (code === 0) {
actList.value = data
if (actList.value.length && activityId.value == null) {
activityId.value = actList.value[0].id
}
} else {
Toast.error(msg)
}
} catch (e) {
Toast.error(e.message)
}
}
// 刷新
const handleRefresh = () => {
if (loading.value) {
@@ -122,12 +153,13 @@ const handleRefresh = () => {
};
onLoad((option) => {
if (option.id) {
activityId.value=option.id
activityId.value = Number(option.id)
}
});
// 页面加载时获取数据
onMounted(() => {
getRankData();
onMounted(async () => {
await listMineAct()
await getRankData()
});
</script>
@@ -441,7 +473,7 @@ onMounted(() => {
.refresh-btn {
position: fixed;
right: 30rpx;
bottom: 40rpx;
bottom: 140rpx;
width: 90rpx;
height: 90rpx;
border-radius: 50%;
+2 -2
View File
@@ -22,7 +22,7 @@
<view class="menu-item" @click="navigateTo('/pages/activity/team/index')">
<view class="menu-icon-wrapper yellow-bg">
<view class="menu-icon team-icon"></view>
<view class="badge">3</view>
<!-- <view class="badge">3</view>-->
</view>
<view class="menu-text">我的团队</view>
</view>
@@ -71,7 +71,7 @@
</t-swiper>
<t-empty
v-if="actList.length === 0"
description="暂无精彩瞬间"
description="暂无近期活动"
/>
</view>