feat: 页面调整
This commit is contained in:
parent
6144eecd89
commit
1fe97b4897
7
App.vue
7
App.vue
@ -1,10 +1,15 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import dbStore from '@/store/db';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function () {
|
onLaunch: function () {
|
||||||
console.log('App Launch: ')
|
console.log('App Launch: ')
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
console.log('App Show')
|
const db = dbStore();
|
||||||
|
if(db && typeof db.getJobs === 'function'){
|
||||||
|
db.getJobs();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
console.log('App Hide')
|
console.log('App Hide')
|
||||||
|
|||||||
16
hooks/useJob.js
Normal file
16
hooks/useJob.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { ref, computed } from 'vue';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import dbStore from '@/store/db';
|
||||||
|
|
||||||
|
export default function useJob() {
|
||||||
|
const { jobMap } = storeToRefs(dbStore());
|
||||||
|
const memberList = ref([]);
|
||||||
|
const memberJob = computed(() => memberList.value.reduce((acc, item) => {
|
||||||
|
const jobs = item && Array.isArray(item.job) ? item.job : [];
|
||||||
|
const jobStr = jobs.map(jobId => jobMap.value[jobId]).filter(Boolean).join('、 ');
|
||||||
|
acc[item.userid] = jobStr;
|
||||||
|
return acc;
|
||||||
|
}, {}))
|
||||||
|
|
||||||
|
return { memberJob, memberList }
|
||||||
|
}
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<view class="mr-5 w-0 flex-grow text-base text-white">
|
<view class="mr-5 w-0 flex-grow text-base text-white">
|
||||||
该档案还未授权本服务团队,点击右侧授权按钮。我们将更精准的为您服务。
|
该档案还未授权本服务团队,点击右侧授权按钮。我们将更精准的为您服务。
|
||||||
</view>
|
</view>
|
||||||
<view class="px-12 py-5 text-base rounded-sm text-dark bg-white">
|
<view class="px-12 py-5 text-base rounded-sm text-dark bg-white" @click="auth()">
|
||||||
授权
|
授权
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -69,7 +69,7 @@ import { computed, ref, watch } from 'vue';
|
|||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import useAccount from '@/store/account';
|
import useAccount from '@/store/account';
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
import { toast } from '@/utils/widget';
|
import { toast, confirm } from '@/utils/widget';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
corpId: {
|
corpId: {
|
||||||
@ -127,10 +127,23 @@ function toManagePage() {
|
|||||||
uni.navigateTo({ url: `/pages/archive/archive-manage?corpId=${props.corpId}&teamId=${props.team.teamId}` })
|
uni.navigateTo({ url: `/pages/archive/archive-manage?corpId=${props.corpId}&teamId=${props.team.teamId}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function auth() {
|
||||||
|
await confirm(`是否授权${props.team.name}提供服务`);
|
||||||
|
const res = await api('authCustomerToTeam', { corpId: props.corpId, teamId: props.team.teamId, id: current.value._id });
|
||||||
|
if (res && res.success) {
|
||||||
|
await toast('授权成功');
|
||||||
|
getCustomers()
|
||||||
|
} else {
|
||||||
|
toast(res?.message || '授权失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function getCustomers() {
|
async function getCustomers() {
|
||||||
const res = await api('getMiniAppCustomers', { miniAppId: account.value.openid, corpId: props.corpId });
|
const res = await api('getMiniAppCustomers', { miniAppId: account.value.openid, corpId: props.corpId });
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
customers.value = res && Array.isArray(res.data) ? res.data : [];
|
||||||
|
const customer = customers.value.find(i => current.value && i._id === current.value._id);
|
||||||
|
current.value = customer || customers.value[0] || null;
|
||||||
} else {
|
} else {
|
||||||
toast(res.message || '获取档案失败');
|
toast(res.message || '获取档案失败');
|
||||||
}
|
}
|
||||||
@ -144,14 +157,6 @@ watch(() => props.corpId, n => {
|
|||||||
}
|
}
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
|
|
||||||
watch(customers, n => {
|
|
||||||
if (n.length && !(current.value && n.some(i => i._id === current.value._id))) {
|
|
||||||
toggle(n[0]);
|
|
||||||
} else {
|
|
||||||
current.value = null;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.h-80 {
|
.h-80 {
|
||||||
|
|||||||
@ -52,11 +52,11 @@ async function getTeams() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await api('queryWxJoinedTeams', { openid: account.value.openid });
|
const res = await api('queryWxJoinedTeams', { openid: account.value.openid });
|
||||||
teams.value = res && Array.isArray(res.data) ? res.data : [];
|
teams.value = res && Array.isArray(res.data) ? res.data : [];
|
||||||
const valid = team.value && teams.value.some(item => item.teamId === team.value.teamId);
|
const validTeam = teams.value.find(item => team.value && item.teamId === team.value.teamId) || teams.value[0];
|
||||||
if (teams.value.length) {
|
if (validTeam) {
|
||||||
changeTeam(teams.value[0])
|
changeTeam(validTeam)
|
||||||
return
|
return
|
||||||
} else if (!valid) {
|
} else {
|
||||||
team.value = null;
|
team.value = null;
|
||||||
}
|
}
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
|||||||
@ -24,7 +24,8 @@
|
|||||||
<view v-if="showDropDown" class="team-dropdown py-12 bg-white shadow-lg">
|
<view v-if="showDropDown" class="team-dropdown py-12 bg-white shadow-lg">
|
||||||
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
<scroll-view scroll-y="true" style="max-height: 50vh;">
|
||||||
<view class="px-15">
|
<view class="px-15">
|
||||||
<view v-for="item in teams" :key="item.teamId" class="mb-10 p-10 flex items-center bg-gray rounded-sm">
|
<view v-for="item in teams" :key="item.teamId" class="mb-10 p-10 flex items-center bg-gray rounded-sm"
|
||||||
|
@click="select(item)">
|
||||||
<view class="flex-shrink-0 mr-5">
|
<view class="flex-shrink-0 mr-5">
|
||||||
<group-avatar :size="96" :avatarList="item.avatarList" />
|
<group-avatar :size="96" :avatarList="item.avatarList" />
|
||||||
</view>
|
</view>
|
||||||
@ -72,6 +73,11 @@ const props = defineProps({
|
|||||||
|
|
||||||
const currentTeam = computed(() => props.teams.find(i => props.team && i.teamId === props.team.teamId))
|
const currentTeam = computed(() => props.teams.find(i => props.team && i.teamId === props.team.teamId))
|
||||||
|
|
||||||
|
function select(team) {
|
||||||
|
emits('changeTeam', team)
|
||||||
|
showDropDown.value = false
|
||||||
|
}
|
||||||
|
|
||||||
watch(() => props.teams, (teams) => {
|
watch(() => props.teams, (teams) => {
|
||||||
if (teams.length && !(currentTeam.value && teams.some(i => i.teamId === currentTeam.value.teamId))) {
|
if (teams.length && !(currentTeam.value && teams.some(i => i.teamId === currentTeam.value.teamId))) {
|
||||||
emits('changeTeam', teams[0])
|
emits('changeTeam', teams[0])
|
||||||
@ -84,7 +90,6 @@ onMounted(() => {
|
|||||||
statusBarHeight.value = win.statusBarHeight + 'px';
|
statusBarHeight.value = win.statusBarHeight + 'px';
|
||||||
}
|
}
|
||||||
menuButtonInfo.value = uni.getMenuButtonBoundingClientRect();
|
menuButtonInfo.value = uni.getMenuButtonBoundingClientRect();
|
||||||
console.log(win, menuButtonInfo.value)
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -14,11 +14,11 @@
|
|||||||
@click="toHomePage(i)">
|
@click="toHomePage(i)">
|
||||||
<image class="flex-shrink-0 avatar mr-5" :src="i.avatar || '/static/default-avatar.png'" />
|
<image class="flex-shrink-0 avatar mr-5" :src="i.avatar || '/static/default-avatar.png'" />
|
||||||
<view class="flex-grow flex flex-col">
|
<view class="flex-grow flex flex-col">
|
||||||
<view class="text-lg font-semibold text-dark whitespace-nowrap">
|
<view class="leading-normal h-24 text-lg font-semibold text-dark whitespace-nowrap">
|
||||||
{{ i.anotherName }}
|
{{ i.anotherName }}
|
||||||
</view>
|
</view>
|
||||||
<view class="text-base text-gray truncate">
|
<view class="max-w-100 h-21 leading-normal text-base text-gray truncate">
|
||||||
医生
|
{{ memberJob[i.userid] }}
|
||||||
</view>
|
</view>
|
||||||
<view v-if="i.canAddFriend" class="w-80 text-base leading-none border text-center text-dark rounded-full"
|
<view v-if="i.canAddFriend" class="w-80 text-base leading-none border text-center text-dark rounded-full"
|
||||||
@click.stop="toQrcode(i)">
|
@click.stop="toQrcode(i)">
|
||||||
@ -31,8 +31,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed } from 'vue'
|
import { computed, watch } from 'vue'
|
||||||
|
import useJob from '@/hooks/useJob';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
team: {
|
team: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -40,6 +40,8 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { memberJob, memberList } = useJob();
|
||||||
|
|
||||||
const teamates = computed(() => {
|
const teamates = computed(() => {
|
||||||
const friendlyMembers = props.team && Array.isArray(props.team.friendlyMembers) ? props.team.friendlyMembers : [];
|
const friendlyMembers = props.team && Array.isArray(props.team.friendlyMembers) ? props.team.friendlyMembers : [];
|
||||||
const memberList = props.team && Array.isArray(props.team.memberList) ? props.team.memberList : [];
|
const memberList = props.team && Array.isArray(props.team.memberList) ? props.team.memberList : [];
|
||||||
@ -47,7 +49,7 @@ const teamates = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function toHomePage(item) {
|
function toHomePage(item) {
|
||||||
uni.navigateTo({ url: `/pages/team/homepage?userid=${item.userid}&corpId=${item.corpId}` })
|
uni.navigateTo({ url: `/pages/team/homepage?userid=${item.userid}&corpId=${item.corpId}&showQrcode=${item.canAddFriend ? 'YES' : ''}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
function toQrcode(item) {
|
function toQrcode(item) {
|
||||||
@ -58,6 +60,11 @@ function toTeamDetail() {
|
|||||||
uni.navigateTo({ url: `/pages/team/team-detail?teamId=${props.team.teamId}&corpId=${props.team.corpId}&corpName=${encodeURIComponent(props.team.corpName)}` })
|
uni.navigateTo({ url: `/pages/team/team-detail?teamId=${props.team.teamId}&corpId=${props.team.corpId}&corpName=${encodeURIComponent(props.team.corpName)}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(teamates, val => {
|
||||||
|
console.log(val)
|
||||||
|
memberList.value = val;
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.avatar {
|
.avatar {
|
||||||
@ -65,10 +72,22 @@ function toTeamDetail() {
|
|||||||
height: 128rpx;
|
height: 128rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h-24 {
|
||||||
|
height: 48rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h-21 {
|
||||||
|
height: 42rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.min-w-120 {
|
.min-w-120 {
|
||||||
min-width: 240rpx;
|
min-width: 240rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.max-w-100 {
|
||||||
|
max-width: 200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.w-80 {
|
.w-80 {
|
||||||
width: 160rpx;
|
width: 160rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if="team" class="pt-lg px-15 flex flex-col items-center text-center">
|
<view v-if="team" class="pt-lg px-15 flex flex-col items-center text-center">
|
||||||
<group-avatar :avatarList="team.avatars" />
|
<group-avatar :avatarList="team.avatars" />
|
||||||
<view class="mt-15 text-base font-semibold text-dark">{{
|
<view class="mt-15 text-base font-semibold text-dark">
|
||||||
team.teamName
|
{{ team.teamName }}
|
||||||
}}</view>
|
</view>
|
||||||
<view class="mt-12 text-sm text-gray">{{ team.corpName }}</view>
|
<view class="mt-12 text-sm text-gray">{{ team.corpName }}</view>
|
||||||
<view class="mt-15 text-lg text-dark font-semibold"
|
<view class="mt-15 text-lg text-dark font-semibold">为您提供团队个性化专属服务</view>
|
||||||
>为您提供团队个性化专属服务</view
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="pt-lg px-15 flex flex-col items-center text-center">
|
<view v-else class="pt-lg px-15 flex flex-col items-center text-center">
|
||||||
<image src="/static/logo-plain.png" class="logo"></image>
|
<image src="/static/logo-plain.png" class="logo"></image>
|
||||||
@ -15,13 +13,7 @@
|
|||||||
<view class="mt-12 text-base text-dark">生命全周期健康管理伙伴</view>
|
<view class="mt-12 text-base text-dark">生命全周期健康管理伙伴</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="login-btn-wrap">
|
<view class="login-btn-wrap">
|
||||||
<button
|
<button v-if="checked" class="login-btn" type="primary" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||||
v-if="checked"
|
|
||||||
class="login-btn"
|
|
||||||
type="primary"
|
|
||||||
open-type="getPhoneNumber"
|
|
||||||
@getphonenumber="getPhoneNumber"
|
|
||||||
>
|
|
||||||
手机号快捷登录
|
手机号快捷登录
|
||||||
</button>
|
</button>
|
||||||
<!-- <button v-if="checked" class="login-btn" type="primary" @click="getPhoneNumber()">
|
<!-- <button v-if="checked" class="login-btn" type="primary" @click="getPhoneNumber()">
|
||||||
@ -31,10 +23,7 @@
|
|||||||
手机号快捷登录
|
手机号快捷登录
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="flex items-center justify-center mt-12 px-15" @click="checked = !checked">
|
||||||
class="flex items-center justify-center mt-12 px-15"
|
|
||||||
@click="checked = !checked"
|
|
||||||
>
|
|
||||||
<checkbox :checked="checked" style="transform: scale(0.7)" />
|
<checkbox :checked="checked" style="transform: scale(0.7)" />
|
||||||
<view class="text-sm text-gray">我已阅读并同意</view>
|
<view class="text-sm text-gray">我已阅读并同意</view>
|
||||||
<view class="text-sm text-primary">《用户协议》、</view>
|
<view class="text-sm text-primary">《用户协议》、</view>
|
||||||
@ -51,7 +40,7 @@ import { toast } from "@/utils/widget";
|
|||||||
|
|
||||||
import groupAvatar from "@/components/group-avatar.vue";
|
import groupAvatar from "@/components/group-avatar.vue";
|
||||||
|
|
||||||
const team = ref(true);
|
const team = ref(null);
|
||||||
const checked = ref(false);
|
const checked = ref(false);
|
||||||
const redirectUrl = ref("");
|
const redirectUrl = ref("");
|
||||||
const { login } = useAccountStore();
|
const { login } = useAccountStore();
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
<view class="mr-5 text-lg font-semibold text-dark">{{ member.anotherName }}</view>
|
<view class="mr-5 text-lg font-semibold text-dark">{{ member.anotherName }}</view>
|
||||||
<view class="text-base text-warning">@企业微信</view>
|
<view class="text-base text-warning">@企业微信</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-base text-dark">咨询师</view>
|
<view class="truncate text-base text-dark">{{ memberJob[member.userid] }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-12 border-primary qrcode p-15 mx-auto rounded" @click="previewImage()">
|
<view class="mt-12 border-primary qrcode p-15 mx-auto rounded" @click="previewImage()">
|
||||||
@ -18,8 +18,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
|
import useJob from '@/hooks/useJob';
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
import { toast } from '@/utils/widget';
|
import { toast } from '@/utils/widget';
|
||||||
|
|
||||||
@ -27,16 +28,7 @@ const corpId = ref('');
|
|||||||
const userid = ref('');
|
const userid = ref('');
|
||||||
const qrcode = ref('')
|
const qrcode = ref('')
|
||||||
const member = ref(null);
|
const member = ref(null);
|
||||||
|
const { memberJob, memberList } = useJob();
|
||||||
const corpNames = computed(() => {
|
|
||||||
const corpNames = member.value && Array.isArray(member.value.corpNames) ? member.value.corpNames : [];
|
|
||||||
return corpNames.join('、');
|
|
||||||
})
|
|
||||||
const deptNames = computed(() => {
|
|
||||||
const deptNames = member.value && Array.isArray(member.value.deptNames) ? member.value.deptNames : [];
|
|
||||||
return deptNames.join('、');
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
function previewImage() {
|
function previewImage() {
|
||||||
if (!qrcode.value) return;
|
if (!qrcode.value) return;
|
||||||
@ -75,6 +67,10 @@ onShow(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(member, n => {
|
||||||
|
memberList.value = [n].filter(Boolean)
|
||||||
|
}, { immedate: true })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.business-card {
|
.business-card {
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if="member" class="flex p-15 bg-whtie shadow-lg">
|
<view v-if="member" class="flex p-15 bg-whtie shadow-lg">
|
||||||
<view class="flex-grow w-0 mr-10 leading-normal">
|
<view class="flex-grow w-0 mr-10 leading-normal">
|
||||||
<view>
|
<view class="flex items-center">
|
||||||
<text class="mr-5 text-xl text-dark font-semibold">{{ member.anotherName }}</text>
|
<view class="mr-5 flex-shrink-0 text-xl text-dark font-semibold">{{ member.anotherName }}</view>
|
||||||
<text class="text-base text-gray">医生</text>
|
<view class="w-0 flex-grow truncate text-base text-gray">{{ memberJob[member.userid] }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex">
|
<view class="flex">
|
||||||
<view class="flex-shrink-0 text-base text-gray">机构部门:</view>
|
<view class="flex-shrink-0 text-base text-gray">机构部门:</view>
|
||||||
@ -61,6 +61,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
|
import useJob from '@/hooks/useJob';
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
import { toast } from '@/utils/widget';
|
import { toast } from '@/utils/widget';
|
||||||
|
|
||||||
@ -70,6 +71,7 @@ const showQrcode = ref(false);
|
|||||||
const qrcode = ref('')
|
const qrcode = ref('')
|
||||||
const member = ref(null);
|
const member = ref(null);
|
||||||
const expand = ref(false);
|
const expand = ref(false);
|
||||||
|
const { memberJob, memberList } = useJob();
|
||||||
|
|
||||||
const corpNames = computed(() => {
|
const corpNames = computed(() => {
|
||||||
const corpNames = member.value && Array.isArray(member.value.corpNames) ? member.value.corpNames : [];
|
const corpNames = member.value && Array.isArray(member.value.corpNames) ? member.value.corpNames : [];
|
||||||
@ -98,7 +100,7 @@ async function getMember() {
|
|||||||
const res = await api('getCorpMemberHomepageInfo', { userid: userid.value, corpId: corpId.value });
|
const res = await api('getCorpMemberHomepageInfo', { userid: userid.value, corpId: corpId.value });
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
member.value = res.data;
|
member.value = res.data;
|
||||||
if ( showQrcode.value && !qrcode.value) {
|
if (showQrcode.value && !qrcode.value) {
|
||||||
getQrcode();
|
getQrcode();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -108,7 +110,7 @@ async function getMember() {
|
|||||||
|
|
||||||
async function getQrcode() {
|
async function getQrcode() {
|
||||||
const res = await api('addContactWay', { corpUserId: userid.value, corpId: corpId.value });
|
const res = await api('addContactWay', { corpUserId: userid.value, corpId: corpId.value });
|
||||||
if (res && res.data ) {
|
if (res && res.data) {
|
||||||
qrcode.value = res.data;
|
qrcode.value = res.data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,7 +118,7 @@ async function getQrcode() {
|
|||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
corpId.value = options.corpId;
|
corpId.value = options.corpId;
|
||||||
userid.value = options.userid;
|
userid.value = options.userid;
|
||||||
showQrcode.value = options.showQrcode;
|
showQrcode.value = options.showQrcode === 'YES';
|
||||||
});
|
});
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
@ -125,6 +127,12 @@ onShow(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(member, n => {
|
||||||
|
if (n) {
|
||||||
|
memberList.value = [n];
|
||||||
|
}
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
|
|||||||
@ -23,12 +23,12 @@
|
|||||||
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.png'"></image>
|
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.png'"></image>
|
||||||
<view class="w-0 flex-grow leading-normal">
|
<view class="w-0 flex-grow leading-normal">
|
||||||
<view class="flex items-center justify-between">
|
<view class="flex items-center justify-between">
|
||||||
<view class="flex-grow w-0">
|
<view class="flex-shrink-0 mr-5 view-lg text-dark font-semibold">{{ i.anotherName }}</view>
|
||||||
<text class="mr-5 text-lg text-dark font-semibold">{{ i.anotherName }}</text>
|
<view class="w-0 flex-grow truncate text-base text-dark">
|
||||||
<text class="text-base text-dark">医生</text>
|
{{ memberJob[i.userid] }}
|
||||||
</view>
|
</view>
|
||||||
<view v-if="friendlyMember[i.userid]"
|
<view v-if="friendlyMember[i.userid]"
|
||||||
class="px-10 leading-normal text-sm border-auto text-primary rounded-full"
|
class="flex-shrink-0 px-10 leading-normal text-sm border-auto text-primary rounded-full"
|
||||||
@click.stop="toFriend(i.userid)">
|
@click.stop="toFriend(i.userid)">
|
||||||
添加好友
|
添加好友
|
||||||
</view>
|
</view>
|
||||||
@ -48,12 +48,12 @@
|
|||||||
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.png'"></image>
|
<image class="flex-shrink-0 mr-10 avatar" :src="i.avatar || '/static/default-avatar.png'"></image>
|
||||||
<view class="w-0 flex-grow leading-normal">
|
<view class="w-0 flex-grow leading-normal">
|
||||||
<view class="flex items-center justify-between">
|
<view class="flex items-center justify-between">
|
||||||
<view class="flex-grow w-0">
|
<view class="flex-shrink-0 mr-5 view-lg text-dark font-semibold">{{ i.anotherName }}</view>
|
||||||
<text class="mr-5 text-lg text-dark font-semibold">{{ i.anotherName }}</text>
|
<view class="w-0 flex-grow truncate text-base text-dark">
|
||||||
<text class="text-base text-dark">医生</text>
|
{{ memberJob[i.userid] }}
|
||||||
</view>
|
</view>
|
||||||
<view v-if="friendlyMember[i.userid]"
|
<view v-if="friendlyMember[i.userid]"
|
||||||
class="px-10 leading-normal text-sm border-auto text-primary rounded-full"
|
class="flex-shrink-0 px-10 leading-normal text-sm border-auto text-primary rounded-full"
|
||||||
@click.stop="toFriend(i.userid)">
|
@click.stop="toFriend(i.userid)">
|
||||||
添加好友
|
添加好友
|
||||||
</view>
|
</view>
|
||||||
@ -68,8 +68,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
|
import useJob from '@/hooks/useJob';
|
||||||
import api from '@/utils/api';
|
import api from '@/utils/api';
|
||||||
|
|
||||||
import groupAvatar from '@/components/group-avatar.vue';
|
import groupAvatar from '@/components/group-avatar.vue';
|
||||||
@ -78,7 +79,7 @@ const corpId = ref('');
|
|||||||
const teamId = ref('');
|
const teamId = ref('');
|
||||||
const team = ref(null);
|
const team = ref(null);
|
||||||
const corpName = ref('');
|
const corpName = ref('');
|
||||||
|
const { memberJob, memberList: list } = useJob();
|
||||||
|
|
||||||
const memberList = computed(() => team.value && Array.isArray(team.value.memberList) ? team.value.memberList : [])
|
const memberList = computed(() => team.value && Array.isArray(team.value.memberList) ? team.value.memberList : [])
|
||||||
|
|
||||||
@ -109,7 +110,7 @@ function toFriend(userid) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toHomePage(userid) {
|
function toHomePage(userid) {
|
||||||
uni.navigateTo({ url: `/pages/team/homepage?corpId=${corpId.value}&userid=${userid}&showQrcode=${friendlyMember[userid] ? 'YES' : ''}` })
|
uni.navigateTo({ url: `/pages/team/homepage?corpId=${corpId.value}&userid=${userid}&showQrcode=${friendlyMember.value[userid] ? 'YES' : ''}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTeam() {
|
async function getTeam() {
|
||||||
@ -132,6 +133,10 @@ onShow(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(memberList, n => {
|
||||||
|
list.value = n
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
page {
|
page {
|
||||||
|
|||||||
@ -20,14 +20,12 @@ export default defineStore("accountStore", () => {
|
|||||||
provider: "weixin",
|
provider: "weixin",
|
||||||
scope: "snsapi_base",
|
scope: "snsapi_base",
|
||||||
});
|
});
|
||||||
console.log('logincode: ', code)
|
|
||||||
if (code) {
|
if (code) {
|
||||||
const res = await api('wxAppLogin', {
|
const res = await api('wxAppLogin', {
|
||||||
phoneCode,
|
phoneCode,
|
||||||
code,
|
code,
|
||||||
});
|
});
|
||||||
loading.value = false
|
loading.value = false
|
||||||
console.log(res)
|
|
||||||
if (res.success && res.data && res.data.mobile) {
|
if (res.success && res.data && res.data.mobile) {
|
||||||
account.value = res.data;
|
account.value = res.data;
|
||||||
return res.data
|
return res.data
|
||||||
|
|||||||
24
store/db.js
Normal file
24
store/db.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { ref } from "vue";
|
||||||
|
import { defineStore } from "pinia";
|
||||||
|
import api from '@/utils/api';
|
||||||
|
|
||||||
|
|
||||||
|
export default defineStore("dbStore", () => {
|
||||||
|
const jobMap = ref({})
|
||||||
|
|
||||||
|
async function getJobs() {
|
||||||
|
const res = await api('getCorpMemberJob', {}, false);
|
||||||
|
if (res && res.success) {
|
||||||
|
const arr = Array.isArray(res.data) ? res.data : [];
|
||||||
|
jobMap.value = arr.reduce((map, item) => {
|
||||||
|
if (item.name && item.value) {
|
||||||
|
map[item.value] = item.name
|
||||||
|
}
|
||||||
|
return map
|
||||||
|
}, {})
|
||||||
|
}
|
||||||
|
console.log(jobMap.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return { jobMap, getJobs }
|
||||||
|
})
|
||||||
@ -9,6 +9,7 @@ const urlsConfig = {
|
|||||||
wxAppLogin: 'wxAppLogin',
|
wxAppLogin: 'wxAppLogin',
|
||||||
getTeamHealthTemplate: 'getTeamHealthTemplate',
|
getTeamHealthTemplate: 'getTeamHealthTemplate',
|
||||||
getTeamHealthTemps: "getTeamHealthTemps",
|
getTeamHealthTemps: "getTeamHealthTemps",
|
||||||
|
getCorpMemberJob: "getCorpMemberJob"
|
||||||
},
|
},
|
||||||
|
|
||||||
knowledgeBase: {
|
knowledgeBase: {
|
||||||
@ -18,6 +19,7 @@ const urlsConfig = {
|
|||||||
member: {
|
member: {
|
||||||
addCustomer: 'add',
|
addCustomer: 'add',
|
||||||
addMedicalRecord: 'addMedicalRecord',
|
addMedicalRecord: 'addMedicalRecord',
|
||||||
|
authCustomerToTeam: 'authCustomerToTeam', // 授权客户到团队
|
||||||
bindMiniAppArchive: "bindMiniAppArchive",
|
bindMiniAppArchive: "bindMiniAppArchive",
|
||||||
getCustomerByCustomerId: 'getCustomerByCustomerId',
|
getCustomerByCustomerId: 'getCustomerByCustomerId',
|
||||||
getMiniAppCustomers: 'getMiniAppCustomers',
|
getMiniAppCustomers: 'getMiniAppCustomers',
|
||||||
@ -26,7 +28,7 @@ const urlsConfig = {
|
|||||||
getCustomerMedicalRecord: 'getCustomerMedicalRecord',
|
getCustomerMedicalRecord: 'getCustomerMedicalRecord',
|
||||||
getMedicalRecordById: 'getMedicalRecordById',
|
getMedicalRecordById: 'getMedicalRecordById',
|
||||||
unbindMiniAppArchive: 'unbindMiniAppArchive',
|
unbindMiniAppArchive: 'unbindMiniAppArchive',
|
||||||
updateMedicalRecord: 'updateMedicalRecord'
|
updateMedicalRecord: 'updateMedicalRecord',
|
||||||
},
|
},
|
||||||
wecom: {
|
wecom: {
|
||||||
addContactWay: 'addContactWay'
|
addContactWay: 'addContactWay'
|
||||||
@ -46,7 +48,7 @@ const urls = Object.keys(urlsConfig).reduce((acc, path) => {
|
|||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
export default async function api(urlId, data) {
|
export default async function api(urlId, data = {}, loading = true) {
|
||||||
const config = urls[urlId];
|
const config = urls[urlId];
|
||||||
if (!config) {
|
if (!config) {
|
||||||
throw new Error(`Unknown URL ID: ${urlId}`);
|
throw new Error(`Unknown URL ID: ${urlId}`);
|
||||||
@ -58,5 +60,5 @@ export default async function api(urlId, data) {
|
|||||||
...data,
|
...data,
|
||||||
type,
|
type,
|
||||||
}
|
}
|
||||||
})
|
}, loading)
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user