feat:认证相关开发

This commit is contained in:
huxuejian 2026-01-26 14:52:33 +08:00
parent d2eeaf8c11
commit 25966f97f4
7 changed files with 123 additions and 34 deletions

View File

@ -4,7 +4,7 @@
{{ name }}<text v-if="required" class="form-cell--required"></text> {{ name }}<text v-if="required" class="form-cell--required"></text>
</view> </view>
<view class="mt-10"> <view class="mt-10">
<textarea :disabled="disableChange" :value="value" class="form-textarea" <textarea :auto-height="autoHeight" :disabled="disableChange" :value="value" class="form-textarea"
:class="border ? 'form-textarea--border' : ''" :placeholder="placeholder" placeholder-class="form__placeholder" :class="border ? 'form-textarea--border' : ''" :placeholder="placeholder" placeholder-class="form__placeholder"
:maxlength="wordLimit" @input="change($event)" /> :maxlength="wordLimit" @input="change($event)" />
<view v-if="wordLimit > 0" class="form-textarea__count"> <view v-if="wordLimit > 0" class="form-textarea__count">
@ -43,6 +43,10 @@ const props = defineProps({
wordLimit: { wordLimit: {
type: [Number, String], type: [Number, String],
default: 100 default: 100
},
autoHeight: {
type: Boolean,
default: false
} }
}) })

View File

@ -56,8 +56,6 @@ export default function useGuard() {
const requireLogin = route && route.meta && route.meta.login; const requireLogin = route && route.meta && route.meta.login;
if (requireLogin && !account.value) { if (requireLogin && !account.value) {
await login() await login()
console.log('login success')
console.log(account.value)
if (account.value) { if (account.value) {
resolve() resolve()
} else { } else {
@ -68,7 +66,6 @@ export default function useGuard() {
}) })
onShow(opts => { onShow(opts => {
console.log('onShow')
onShowOptions.value = { ...opts }; onShowOptions.value = { ...opts };
triggleShowEvents() triggleShowEvents()
}) })

View File

@ -1,37 +1,85 @@
<template> <template>
<uni-popup ref="popup" type="center" :mask-click="false"> <uni-popup ref="popup" type="center" :mask-click="false">
<view class="bg-white rounded overflow-hidden" style="width: 690rpx;"> <view class="bg-white rounded overflow-hidden" style="width: 690rpx;">
<view class="px-15 py-12 text-center text-lg font-semibold text-dark"> <template v-if="status === 'unverified'">
认证须知 <view class="px-15 py-12 text-center text-lg font-semibold text-dark">
</view> 认证须知
<view class="text-base text-dark px-15 leading-normal font-semibold mt-10"> </view>
1认证通过后您个人账号病历档案管理数含所有团队上限由10个升级至100个 <view class="text-base text-dark px-15 leading-normal font-semibold mt-10">
</view> 1认证通过后您个人账号病历档案管理数含所有团队上限由10个升级至100个
<view class="px-15 leading-normal mt-10 "> </view>
<text class="text-base text-dark">2认证前请仔细核对个人信息确保准确无误认证后部分信息不支持修改包括姓名岗位等如需修改以上信息请联系客服人工处理</text> <view class="px-15 leading-normal mt-10 ">
</view> <text class="text-base text-dark">2认证前请仔细核对个人信息确保准确无误认证后部分信息不支持修改包括姓名岗位等如需修改以上信息请联系客服人工处理</text>
<view class="mt-10 px-15 leading-normal font-semibold pb-50 text-lg text-primary" @click="toService()">点击添加客服 </view>
</view> <view class="mt-10 px-15 leading-normal font-semibold pb-50 text-lg text-primary" @click="toService()">点击添加客服
<view class="footer-buttons"> </view>
<button-footer hideden-shadow confirmText="去认证" @confirm="confirm()" @cancel="close()" /> </template>
<template v-else-if="status === 'verified'">
<view class="px-15 py-12 text-center text-lg font-semibold text-dark">
提示
</view>
<view class="text-base text-dark px-15 leading-normal font-semibold mt-10">
您的认证已通过
</view>
<view class="px-15 leading-normal mt-10 text-base text-dark">
若需要修改姓名岗位等信息请联系客服人工处理
</view>
<view class="mt-10 px-15 leading-normal font-semibold pb-50 text-lg text-primary" @click="toService()">
点击添加客服
</view>
</template>
<template v-else-if="status === 'failed'">
<view class="px-15 py-12 text-center text-lg font-semibold text-dark">
认证失败原因
</view>
<view class="px-15 leading-normal mt-10 text-base text-dark pb-50">
{{ reason }}
</view>
</template>
<view v-if="btns" class="footer-buttons">
<button-footer hideden-shadow :cancelText="btns.cancelText" :confirmText="btns.confirmText"
:showCancel="btns.showCancel" :showConfirm="btns.showConfirm" @confirm="confirm()" @cancel="close()" />
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
</template> </template>
<script setup> <script setup>
import { ref, watch } from 'vue'; import { computed, ref, watch } from 'vue';
import { storeToRefs } from "pinia";
import useAccountStore from "@/store/account.js";
import api from "@/utils/api.js";
import { toast } from '@/utils/widget';
import ButtonFooter from '@/components/button-footer.vue'; import ButtonFooter from '@/components/button-footer.vue';
const emits = defineEmits(['close', 'confirm']) const emits = defineEmits(['close', 'confirm'])
const props = defineProps({ const props = defineProps({
status: {
type: String,
default: ''
},
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false
} }
}) })
const popup = ref() const popup = ref();
const status = ref('');
const reason = ref('');
const { account, doctorInfo } = storeToRefs(useAccountStore());
const btns = computed(() => {
if (status.value === 'unverified') {
return { showCancel: true, showConfirm: true, confirmText: '去认证' }
}
if (status.value === 'verified') {
return { showConfirm: false, cancelText: '我知道了' }
}
if (status.value === 'failed') {
return { showCancel: true, showConfirm: true, confirmText: '重新认证' }
}
})
function close() { function close() {
emits('close') emits('close')
@ -48,9 +96,21 @@ function toService() {
close() close()
} }
async function getStatus() {
const res = await api('getMemberVerifyStatus', { corpId: account.value.corpId, weChatOpenId: account.value.openid, id: doctorInfo.value._id })
if (res && res.success) {
status.value = res.data.verifyStatus;
reason.value = res.data.reason || '';
popup.value && popup.value.open()
} else {
toast(res.message);
close()
}
}
watch(() => props.visible, n => { watch(() => props.visible, n => {
if (n) { if (n) {
popup.value && popup.value.open() getStatus()
} else { } else {
popup.value && popup.value.close() popup.value && popup.value.close()
} }

View File

@ -2,7 +2,8 @@
<full-page> <full-page>
<view class="p-15"> <view class="p-15">
<view class="bg-white px-10 mb-10 rounded"> <view class="bg-white px-10 mb-10 rounded">
<form-input :form="formData" required wordLimit="10" title="anotherName" name="姓名" @change="onChange($event)" /> <form-input :form="formData" :required="rule.anotherName.required" wordLimit="10" title="anotherName"
:name="rule.anotherName.name" @change="onChange($event)" />
<common-cell title="avatar" name="头像"> <common-cell title="avatar" name="头像">
<view class="flex-grow flex items-center justify-end" @click="chooseAvatar()"> <view class="flex-grow flex items-center justify-end" @click="chooseAvatar()">
<image v-if="formData.avatar" class="avatar mr-5 rounded-full" :src="formData.avatar" /> <image v-if="formData.avatar" class="avatar mr-5 rounded-full" :src="formData.avatar" />
@ -16,20 +17,20 @@
<view class="bg-white px-10 mb-10 rounded"> <view class="bg-white px-10 mb-10 rounded">
<!-- 填写认证资料的时候岗位必填 --> <!-- 填写认证资料的时候岗位必填 -->
<common-cell :required="type === 'cert'" title="avatar" name="岗位"> <common-cell :required="type === 'cert'" title="job" :name="rule.job.name">
<view class="flex-grow flex items-center justify-end" @click="selectJob()"> <view class="flex-grow flex items-center justify-end" @click="selectJob()">
<view v-if="jobStr" class="text-base text-base">{{ jobStr }}</view> <view v-if="jobStr" class="text-base text-base">{{ jobStr }}</view>
<!-- <view class="mr-5 rounded-full" style="width: 64rpx;height: 64rpx;background: red;"></view> --> <!-- <view class="mr-5 rounded-full" style="width: 64rpx;height: 64rpx;background: red;"></view> -->
<uni-icons color="#999" type="right" size="16" /> <uni-icons color="#999" type="right" size="16" />
</view> </view>
</common-cell> </common-cell>
<common-cell title="avatar" name="职称"> <common-cell title="title" :name="rule.title.name">
<view class="flex-grow flex items-center justify-end"> <view class="flex-grow flex items-center justify-end">
<!-- <view class="mr-5 rounded-full" style="width: 64rpx;height: 64rpx;background: red;"></view> --> <!-- <view class="mr-5 rounded-full" style="width: 64rpx;height: 64rpx;background: red;"></view> -->
<uni-icons color="#999" type="right" size="16" /> <uni-icons color="#999" type="right" size="16" />
</view> </view>
</common-cell> </common-cell>
<common-cell title="avatar" name="科室"> <common-cell title="dept" :name="rule.dept.name">
<view class="flex-grow flex items-center justify-end"> <view class="flex-grow flex items-center justify-end">
<!-- <view class="mr-5 rounded-full" style="width: 64rpx;height: 64rpx;background: red;"></view> --> <!-- <view class="mr-5 rounded-full" style="width: 64rpx;height: 64rpx;background: red;"></view> -->
<uni-icons color="#999" type="right" size="16" /> <uni-icons color="#999" type="right" size="16" />
@ -38,7 +39,7 @@
</view> </view>
<view class="bg-white rounded"> <view class="bg-white rounded">
<form-textarea :border="false" :form="formData" title="intro" name="个人介绍" :wordLimit="300" <form-textarea autoHeight :border="false" :form="formData" title="intro" name="个人介绍" :wordLimit="300"
@change="onChange($event)" /> @change="onChange($event)" />
</view> </view>
</view> </view>
@ -79,6 +80,22 @@ const jobStr = computed(() => {
const jobs = formData.value && Array.isArray(formData.value.job) ? formData.value.job.filter(i => i === 'assistant' || i === 'doctor') : []; const jobs = formData.value && Array.isArray(formData.value.job) ? formData.value.job.filter(i => i === 'assistant' || i === 'doctor') : [];
return jobs[0] && job[jobs[0]] ? job[jobs[0]] : ''; return jobs[0] && job[jobs[0]] ? job[jobs[0]] : '';
}) })
const rule = computed(() => {
if (doctorInfo.value && ['verified', 'verifying'].includes(doctorInfo.value.verifyStatus)) {
return {
anotherName: { name: '姓名 (不可修改)', required: false, disabled: true },
job: { name: '岗位 (不可修改)', disabled: true },
title: { name: '职称 (不可修改)', disabled: true },
dept: { name: '科室 (不可修改)', disabled: true },
}
}
return {
anotherName: { name: '姓名', required: true, disabled: false },
job: { name: '岗位', disabled: false },
title: { name: '职称', disabled: false },
dept: { name: '科室', disabled: false },
}
})
// //
const genderOptions = [ const genderOptions = [
@ -131,6 +148,7 @@ function onChange({ title, value }) {
} }
function selectJob() { function selectJob() {
if (rule.value.job.disabled) return;
uni.showActionSheet({ uni.showActionSheet({
itemList: ['医生', '医生助理', '无'], itemList: ['医生', '医生助理', '无'],
success: ({ tapIndex }) => { success: ({ tapIndex }) => {

View File

@ -1,7 +1,7 @@
<template> <template>
<full-page pageClass="bg-white"> <full-page pageClass="bg-white">
<view class="p-15"> <view class="p-15">
<view class="title-bar relative text-dark text-base font-semibold">请填写执业医院</view> <view class="title-bar relative text-dark text-base font-semibold" @click="log()">请填写执业医院</view>
<!-- <view class="mt-12 p-10 flex items-center justify-between border rounded"> <!-- <view class="mt-12 p-10 flex items-center justify-between border rounded">
<view class="w-0 flex-grow truncate text-base mr-10" :class="formData.hospitalName ? 'text-dark' : 'text-gray'"> <view class="w-0 flex-grow truncate text-base mr-10" :class="formData.hospitalName ? 'text-dark' : 'text-gray'">
{{ formData.hospitalName || '请填写执业医院' }} {{ formData.hospitalName || '请填写执业医院' }}
@ -117,6 +117,11 @@ async function save() {
// uni.showToast({ title: '', icon: 'none' }) // uni.showToast({ title: '', icon: 'none' })
} }
function log() {
console.log(doctorInfo.value)
console.log(formData.value)
}
</script> </script>
<style scoped> <style scoped>
.title-bar { .title-bar {

View File

@ -23,7 +23,7 @@
<text class="tag-text text-white">信息待完善</text> <text class="tag-text text-white">信息待完善</text>
</view> </view>
<view v-if="certStatus" class="px-10 py-3 text-sm rounded-full" :class="certStatus.classnames" <view v-if="certStatus" class="px-10 py-3 text-sm rounded-full" :class="certStatus.classnames"
@click.stop="toCert()"> @click.stop="handleCert()">
{{ certStatus.text }} {{ certStatus.text }}
</view> </view>
</view> </view>
@ -73,8 +73,10 @@ import useAccountStore from "@/store/account.js";
import certPopup from "./components/cert-popup.vue"; import certPopup from "./components/cert-popup.vue";
import EmptyData from "@/components/empty-data.vue"; import EmptyData from "@/components/empty-data.vue";
import fullPage from '@/components/full-page.vue'; import fullPage from '@/components/full-page.vue';
import { toast } from '@/utils/widget';
const certConfig = { const certConfig = {
failed: { text: '认证失败', classnames: 'bg-danger text-white' },
verified: { text: '已认证', classnames: 'bg-success text-white' }, verified: { text: '已认证', classnames: 'bg-success text-white' },
verifying: { text: '认证中', classnames: 'bg-warning text-white' }, verifying: { text: '认证中', classnames: 'bg-warning text-white' },
unverified: { text: '未认证', classnames: 'bg-gray text-dark' }, unverified: { text: '未认证', classnames: 'bg-gray text-dark' },
@ -82,7 +84,7 @@ const certConfig = {
const { useLoad, useShow } = useGuard(); const { useLoad, useShow } = useGuard();
const { getDoctorInfo } = useAccountStore(); const { getDoctorInfo } = useAccountStore();
const { doctorInfo } = storeToRefs(useAccountStore()); const { account, doctorInfo } = storeToRefs(useAccountStore());
const list = ref([1]); const list = ref([1]);
const visible = ref(false); const visible = ref(false);
@ -120,10 +122,12 @@ function editProfile() {
}); });
} }
function toCert() { function handleCert() {
// if (doctorInfo.value.verifyStatus === 'unverified') { if (doctorInfo.value.verifyStatus === 'verifying') {
visible.value = true toast('信息认证中,请耐心等待!')
// } } else {
visible.value = true
}
} }
useLoad(() => { useLoad(() => {
@ -131,7 +135,7 @@ useLoad(() => {
}); });
useShow(() => { useShow(() => {
getDoctorInfo() getDoctorInfo();
}) })
</script> </script>

View File

@ -14,7 +14,8 @@ const urlsConfig = {
updateCorpMember: 'updateCorpMember', updateCorpMember: 'updateCorpMember',
addCorpMemberFromWxapp: "addCorpMemberFromWxapp", addCorpMemberFromWxapp: "addCorpMemberFromWxapp",
updateCorpMemberFromWxapp: "updateCorpMemberFromWxapp", updateCorpMemberFromWxapp: "updateCorpMemberFromWxapp",
submitCertProfile: 'submitCertProfile' submitCertProfile: 'submitCertProfile',
getMemberVerifyStatus: "getMemberVerifyStatus"
}, },
knowledgeBase: { knowledgeBase: {