2026-01-20 19:36:49 +08:00
|
|
|
<template>
|
|
|
|
|
<view v-if="member" class="flex flex-col h-full items-center justify-center">
|
|
|
|
|
<view class="business-card">
|
|
|
|
|
<view class="flex">
|
|
|
|
|
<image class="mr-10 avatar" :src="member.avatar || '/static/default-avatar.png'"></image>
|
|
|
|
|
<view class="w-0 flex-grow leading-normal">
|
|
|
|
|
<view class="flex items-center">
|
|
|
|
|
<view class="mr-5 text-lg font-semibold text-dark">{{ member.anotherName }}</view>
|
|
|
|
|
<view class="text-base text-warning">@企业微信</view>
|
|
|
|
|
</view>
|
2026-01-21 10:35:08 +08:00
|
|
|
<view class="truncate text-base text-dark">{{ memberJob[member.userid] }}</view>
|
2026-01-20 19:36:49 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mt-12 border-primary qrcode p-15 mx-auto rounded" @click="previewImage()">
|
|
|
|
|
<image v-if="qrcode" class="h-full w-full" :src="qrcode"></image>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup>
|
2026-01-21 10:35:08 +08:00
|
|
|
import { ref, watch } from 'vue';
|
2026-01-20 19:36:49 +08:00
|
|
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
2026-01-21 10:35:08 +08:00
|
|
|
import useJob from '@/hooks/useJob';
|
2026-01-20 19:36:49 +08:00
|
|
|
import api from '@/utils/api';
|
|
|
|
|
import { toast } from '@/utils/widget';
|
|
|
|
|
|
|
|
|
|
const corpId = ref('');
|
|
|
|
|
const userid = ref('');
|
|
|
|
|
const qrcode = ref('')
|
|
|
|
|
const member = ref(null);
|
2026-01-21 10:35:08 +08:00
|
|
|
const { memberJob, memberList } = useJob();
|
2026-01-20 19:36:49 +08:00
|
|
|
|
|
|
|
|
function previewImage() {
|
|
|
|
|
if (!qrcode.value) return;
|
|
|
|
|
uni.previewImage({
|
|
|
|
|
urls: [qrcode.value]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function getMember() {
|
|
|
|
|
const res = await api('getCorpMemberHomepageInfo', { userid: userid.value, corpId: corpId.value });
|
|
|
|
|
if (res && res.success) {
|
|
|
|
|
member.value = res.data;
|
|
|
|
|
if (!qrcode.value) {
|
|
|
|
|
getQrcode();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
toast(res.message || '获取医生信息失败')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function getQrcode() {
|
|
|
|
|
const res = await api('addContactWay', { corpUserId: userid.value, corpId: corpId.value });
|
|
|
|
|
if (res && res.data) {
|
|
|
|
|
qrcode.value = res.data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
corpId.value = options.corpId;
|
|
|
|
|
userid.value = options.userid;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onShow(() => {
|
|
|
|
|
if (corpId.value && userid.value) {
|
|
|
|
|
getMember()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
2026-01-21 10:35:08 +08:00
|
|
|
watch(member, n => {
|
|
|
|
|
memberList.value = [n].filter(Boolean)
|
|
|
|
|
}, { immedate: true })
|
|
|
|
|
|
2026-01-20 19:36:49 +08:00
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
.business-card {
|
|
|
|
|
width: 600rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
|
width: 80rpx;
|
|
|
|
|
height: 96rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.qrcode {
|
|
|
|
|
width: 560rpx;
|
|
|
|
|
height: 560rpx;
|
|
|
|
|
}
|
|
|
|
|
</style>
|