This commit is contained in:
那些花儿
2025-05-06 19:47:19 +08:00
19 changed files with 314 additions and 138 deletions
+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%;
+18 -4
View File
@@ -26,7 +26,7 @@
<div class="stat-icon"><i class="bi bi-people"></i></div>
<div class="stat-content">
<div class="stat-value">成员:{{ team.groupUsers?.length }}</div>
<!-- <div class="stat-label">成员</div>-->
<!-- <div class="stat-label">成员</div>-->
</div>
</div>
<div class="stat-divider"></div>
@@ -59,7 +59,8 @@
<div class="section-badge">{{ team.groupUsers.length }}</div>
</div>
<div class="member-grid">
<div class="member-grid-item" v-for="member in team.groupUsers" :key="member.id" @click="openUserDetail(member)">
<div class="member-grid-item" v-for="member in team.groupUsers" :key="member.id"
@click="openUserDetail(member)">
<div class="member-name">
{{ member.userName }}
<t-tag theme="danger" size="small" v-if="member.isLeader">队长</t-tag>
@@ -151,6 +152,16 @@
<text class="picker-title">成员信息</text>
<t-icon name="close" @click="showUserDetailPicker = false"/>
</view>
<view class="member-list">
<t-cell-group bordered>
<t-cell title="姓名" hover>{{ userInfo.userName }}</t-cell>
<t-cell title="性别" hover>{{userInfo.sex}}</t-cell>
<t-cell title="联系方式" hover>{{userInfo.phone}}</t-cell>
<t-cell title="职务" hover>{{userInfo.position}}</t-cell>
<t-cell title="所属单位" hover>{{userInfo.unitName}}</t-cell>
</t-cell-group>
</view>
</view>
</t-popup>
</template>
@@ -185,10 +196,12 @@ let team = ref(null);
const leaderConfirmVisible = ref(false)
// 用户详情弹框
const showUserDetailPicker=ref(false)
const showUserDetailPicker = ref(false)
const userInfo = ref({})
// 打开用户详情
const openUserDetail = (val) => {
showUserDetailPicker.value = true
userInfo.value = val
console.log(val)
}
@@ -251,7 +264,7 @@ const getListAct = async () => {
};
// 点击查看成绩排名
const queryRank=()=>{
const queryRank = () => {
uni.navigateTo({url: '/pages/activity/rank/index?id=' + pageForm.actId})
}
@@ -272,6 +285,7 @@ onLoad(() => {
.content-area {
padding: 0 16px 24px;
}
/*用户弹框*/
.member-picker {
background-color: #fff;
+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>