2026-01-27 17:09:31 +08:00
|
|
|
<template>
|
|
|
|
|
<full-page :customScroll="list.length === 0">
|
|
|
|
|
<view v-if="list.length === 0" class="w-full h-full flex flex-col justify-center items-center">
|
|
|
|
|
<empty-data text="暂无团队" />
|
|
|
|
|
</view>
|
|
|
|
|
<view v-for="(i, idx) in list" :key="idx" class="p-15 mb-10 flex items-center bg-white shadow-lg">
|
2026-01-29 09:41:51 +08:00
|
|
|
<view class="mr-10 w-0 flex-grow" @click="toDetail(i)">
|
2026-01-27 17:09:31 +08:00
|
|
|
<view class="flex items-center">
|
|
|
|
|
<view class="team-name text-lg font-semibold truncate mr-5">
|
2026-01-29 09:41:51 +08:00
|
|
|
{{ i.name }}
|
2026-01-27 17:09:31 +08:00
|
|
|
</view>
|
|
|
|
|
<view v-if="doctorInfo && i.creator === doctorInfo.userid"
|
|
|
|
|
class="px-10 leading-normal text-sm border-auto text-primary rounded-full">创建</view>
|
|
|
|
|
<view v-else class="px-10 leading-normal text-sm border-auto text-warning rounded-full">加入</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mt-10 flex">
|
2026-01-29 09:41:51 +08:00
|
|
|
<view class="min-w-120 text-base text-dark">
|
|
|
|
|
成员: {{ i.memberList && i.memberList.length ? i.memberList.length : 0 }}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="min-w-120 text-base text-dark">
|
|
|
|
|
患者: 200
|
|
|
|
|
</view>
|
2026-01-27 17:09:31 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
2026-01-29 15:35:57 +08:00
|
|
|
<view class="flex-shrink-0 flex flex-col items-center justify-center" @click.stop="invite(i)">
|
2026-01-27 17:09:31 +08:00
|
|
|
<image class="mb-5 qrcode" src="/static/work/qrcode.svg" />
|
2026-01-29 15:35:57 +08:00
|
|
|
<view class="w-full text-sm text-dark text-center">邀请成员</view>
|
2026-01-27 17:09:31 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<template #footer>
|
2026-01-29 09:41:51 +08:00
|
|
|
<button-footer confirmText="创建团队" :showCancel="false" @confirm="toCreate()" />
|
2026-01-27 17:09:31 +08:00
|
|
|
</template>
|
|
|
|
|
</full-page>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
|
|
|
|
import { computed, ref } from "vue";
|
|
|
|
|
import { storeToRefs } from "pinia";
|
|
|
|
|
import useGuard from "@/hooks/useGuard.js";
|
|
|
|
|
import useAccountStore from "@/store/account.js";
|
|
|
|
|
import api from "@/utils/api.js";
|
|
|
|
|
|
|
|
|
|
import buttonFooter from '@/components/button-footer.vue';
|
|
|
|
|
import emptyData from "@/components/empty-data.vue";
|
|
|
|
|
import fullPage from '@/components/full-page.vue';
|
|
|
|
|
|
|
|
|
|
const { useShow } = useGuard();
|
2026-01-29 09:41:51 +08:00
|
|
|
const { doctorInfo, account } = storeToRefs(useAccountStore());
|
2026-01-27 17:09:31 +08:00
|
|
|
const list = ref([]);
|
|
|
|
|
|
2026-01-29 15:35:57 +08:00
|
|
|
function invite(team) {
|
|
|
|
|
uni.navigateTo({ url: `/pages/work/team/invite/invite-teammate?teamId=${team.teamId || ''}` })
|
|
|
|
|
// uni.navigateTo({ url: `/pages/work/team/invite/invite-patient?teamId=${team.teamId || ''}` })
|
2026-01-27 17:09:31 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-29 09:41:51 +08:00
|
|
|
function toCreate() {
|
|
|
|
|
uni.navigateTo({ url: '/pages/work/team/edit/team-edit' })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toDetail(team) {
|
|
|
|
|
uni.navigateTo({ url: `/pages/work/team/detail/team-detail?teamId=${team.teamId || ''}` })
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-27 17:09:31 +08:00
|
|
|
async function getTeams() {
|
|
|
|
|
const res = await api('getJoinedTeams', { corpId: account.value?.corpId, mateId: doctorInfo.value?.userid });
|
|
|
|
|
const arr = res && Array.isArray(res.data) ? res.data.map(i => ({
|
|
|
|
|
id: i._id,
|
|
|
|
|
teamId: i.teamId,
|
|
|
|
|
name: i.name,
|
2026-01-29 09:41:51 +08:00
|
|
|
memberList: i.memberList,
|
|
|
|
|
creator: i.creator
|
2026-01-27 17:09:31 +08:00
|
|
|
})) : [];
|
|
|
|
|
list.value = arr;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-29 09:41:51 +08:00
|
|
|
|
2026-01-27 17:09:31 +08:00
|
|
|
useShow(() => {
|
|
|
|
|
getTeams();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
2026-01-29 09:41:51 +08:00
|
|
|
.min-w-120 {
|
|
|
|
|
min-width: 240rpx;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-27 17:09:31 +08:00
|
|
|
.team-name {
|
|
|
|
|
max-width: 60%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.qrcode {
|
|
|
|
|
width: 60rpx;
|
|
|
|
|
height: 60rpx;
|
|
|
|
|
}
|
|
|
|
|
</style>
|