commit
This commit is contained in:
@@ -59,13 +59,14 @@
|
||||
:value="member.userId"
|
||||
:label="member.userName+'-'+member.sex"
|
||||
:content="member.unitName"
|
||||
:disabled="!isSelfLeader"
|
||||
icon-size="20px"
|
||||
/>
|
||||
</view>
|
||||
</t-checkbox-group>
|
||||
</view>
|
||||
<view class="picker-footer">
|
||||
<t-button block theme="primary" @click="submitRegistration" >
|
||||
<view class="picker-footer"v-if="isSelfLeader">
|
||||
<t-button block theme="primary" @click="submitRegistration">
|
||||
确认报名 ({{ selectedMemberIds.length }}人)
|
||||
</t-button>
|
||||
</view>
|
||||
@@ -129,7 +130,6 @@ const selectedMemberIds = ref([]);
|
||||
const showMemberPicker = ref(false);
|
||||
|
||||
|
||||
|
||||
// 获取活动列表
|
||||
async function listActs() {
|
||||
try {
|
||||
@@ -165,17 +165,21 @@ async function listItems() {
|
||||
}
|
||||
}
|
||||
|
||||
// 自己是否是队长
|
||||
const isSelfLeader = ref(false)
|
||||
|
||||
// 获取团队成员
|
||||
async function listTeamUser() {
|
||||
try {
|
||||
const {code, data, msg} = await request.get('/client/item/list-team-user/' + selectActId.value)
|
||||
if (code === 0) {
|
||||
teamMembers.value = data;
|
||||
isSelfLeader.value = data.find(t => t.userId===getApp().globalData.user.id)?.isLeader
|
||||
} else {
|
||||
Toast.error(msg)
|
||||
}
|
||||
} catch (e) {
|
||||
Toast.error(msg)
|
||||
Toast.error(e)
|
||||
console.error(e)
|
||||
}
|
||||
}
|
||||
@@ -184,7 +188,6 @@ async function listTeamUser() {
|
||||
const registrationStatus = ref(new Map());
|
||||
// 获取报名状态 - 使用静态数据
|
||||
const fetchRegistrationStatus = () => {
|
||||
|
||||
const resultMap = selectedMemberList.value.reduce((acc, item) => {
|
||||
const key = item.itemId;
|
||||
if (!acc.has(key)) {
|
||||
@@ -194,6 +197,7 @@ const fetchRegistrationStatus = () => {
|
||||
return acc;
|
||||
}, new Map());
|
||||
registrationStatus.value = resultMap;
|
||||
console.log(resultMap)
|
||||
};
|
||||
|
||||
// 选择项目
|
||||
|
||||
@@ -41,9 +41,10 @@
|
||||
</div>
|
||||
|
||||
<!-- 项目报名按钮 -->
|
||||
<div class="action-section" >
|
||||
<t-button block theme="danger" size="large" class="register-btn" @click="goToEventRegistration">
|
||||
{{ team.isSelfLeader ? '参与项目报名' : '查看项目报名' }}
|
||||
<div class="action-section">
|
||||
<t-button block theme="danger" size="large" class="register-btn" @click="goToEventRegistration" :disabled="!team.teamIsLeader">
|
||||
<div v-if="team.teamIsLeader"> {{ team.isSelfLeader ? '参与项目报名' : '查看项目报名' }}</div>
|
||||
<div v-else>暂无队长无法报名</div>
|
||||
</t-button>
|
||||
</div>
|
||||
|
||||
@@ -80,8 +81,19 @@
|
||||
<div class="role-desc">拥有团队所有管理权限</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="team.teamIsLeader&&!team.isSelfLeader">
|
||||
<div class="role-card">
|
||||
<div class="role-icon">
|
||||
<i class="bi bi-person"></i>
|
||||
</div>
|
||||
<div class="role-info">
|
||||
<div class="role-title">您是普通成员</div>
|
||||
<div class="role-desc">项目报名请联系队长</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<div v-if="!team.teamIsLeader&&!team.isSelfLeader">
|
||||
<div class="role-card">
|
||||
<div class="role-icon">
|
||||
<i class="bi bi-person"></i>
|
||||
@@ -104,10 +116,10 @@
|
||||
</div>
|
||||
</view>
|
||||
<view v-else style="background-color: #FFFFFF">
|
||||
<view >
|
||||
<view>
|
||||
<t-result>
|
||||
<template #image>
|
||||
<t-image src="https://tdesign.gtimg.com/mobile/demos/result1.png" class="external-class-image" />
|
||||
<t-image src="https://tdesign.gtimg.com/mobile/demos/result1.png" class="external-class-image"/>
|
||||
</template>
|
||||
<template #title>
|
||||
<div>暂无团队</div>
|
||||
@@ -207,8 +219,7 @@ const getTeamInfo = async () => {
|
||||
const {code, msg, data} = await useRequest().post('/client/group/info/' + pageForm.actId);
|
||||
if (code === 0) {
|
||||
team.value = data
|
||||
console.log(team.value.groupUsers.find(t=>t.userId===uni.getStorageSync('userId')))
|
||||
console.log()
|
||||
team.value.teamIsLeader = !!team.value.groupUsers.find(t => t.isLeader)
|
||||
} else {
|
||||
Toast({message: msg, theme: 'error'});
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ import {useRequest} from "@/utils/request";
|
||||
|
||||
// 用户资料数据
|
||||
const userInfo = ref({
|
||||
id: '10001',
|
||||
name: '张三',
|
||||
id: '--',
|
||||
name: '--',
|
||||
avatar: '/static/avatar.png',
|
||||
phone: '188****8888',
|
||||
company: '腾讯科技有限公司'
|
||||
phone: '--',
|
||||
company: '--'
|
||||
});
|
||||
|
||||
// 我的活动数据
|
||||
@@ -55,6 +55,13 @@ const handleEditProfile = () => {
|
||||
onMounted(() => {
|
||||
// 获取用户信息
|
||||
console.log('个人资料页面已加载');
|
||||
userInfo.value={
|
||||
id: getApp().globalData.user.id,
|
||||
name: getApp().globalData.user.userName,
|
||||
avatar: '/static/avatar.png',
|
||||
phone: getApp().globalData.user.phone,
|
||||
company: getApp().globalData.user.unitName
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -76,7 +83,7 @@ onMounted(() => {
|
||||
<t-icon name="edit" size="20"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="user-company">{{ userInfo.company }}</view>
|
||||
<view class="user-company">{{ userInfo.phone }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user