audit.vue
7.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<template>
<u-navbar :title="Event?.title" :autoBack="true" bgColor="#fff" placeholder safeAreaInsetTop :titleStyle="{ color: '#000' }" leftIconColor="#000"></u-navbar>
<view class="audit">
<!-- 中 -->
<template v-if="Event?.authState === '10'">
<view class="main1">
<view class="flexC">
<view class="flexA" style="margin-bottom: 52rpx">
<image src="/static/images/auditwarring.png" class="audit-icon" mode="aspectFill" />
<view class="audit-title">审核中</view>
</view>
</view>
<!-- <view class="subtitle flexC" style="margin-bottom: 244rpx">提现申请已提交。请耐心等待审核通过!</view> -->
<view class="subtitle flexC" style="margin-bottom: 244rpx">认证申请已提交。请耐心等待审核通过!</view>
<view class="fixBox">
<up-button color="#05B8D2" shape="circle" text="修改信息" :customStyle="{ marginBottom: '24rpx' }" throttleTime="1500" @click="reapplyAuthHandler"></up-button>
<up-button type="info" shape="circle" text="返回" throttleTime="1500" @click="proxy.$h.relaunchUrl(`/pages/index/index`)"></up-button>
</view>
</view>
</template>
<!-- 失败 -->
<template v-if="Event?.authState === '30'">
<view class="main1">
<view class="flexC">
<view class="flexA" style="margin-bottom: 52rpx">
<image src="/static/images/auditerror.png" class="audit-icon" mode="aspectFill" />
<view class="audit-title">审核失败</view>
</view>
</view>
<view class="subtitle flexC" style="color: #ff3b2f; margin-bottom: 55%">驳回原因:{{ Event?.examineStateFailReason || '请联系管理员' }}</view>
<view class="fixBox">
<up-button color="#05B8D2" shape="circle" text="重新申请" :customStyle="{ marginBottom: '24rpx' }" throttleTime="1500" @click="reapplyAuthHandler"></up-button>
<up-button type="info" shape="circle" text="返回" throttleTime="1500" @click="proxy.$h.relaunchUrl(`/pages/index/index`)"></up-button>
</view>
</view>
</template>
<!-- 成功 -->
<template v-if="Event?.authState === '20'">
<view class="main">
<view class="bgimg" style="margin-bottom: 70rpx">
<image src="/static/images/auditbg.png" class="autbgimg" mode="aspectFill" />
<image :src="![null, '', undefined].includes(UserInfo?.avatar) ? proxy.$h.downFile(UserInfo?.avatar) : '/static/images/mAvatar.png'" class="avatar" mode="aspectFill" />
<view class="infomain Zindex">
<view class="infomain-title">您已完成认证</view>
<view style="margin-bottom: 10rpx">
{{ UserInfo?.nickname }}
<!-- <text>{{ UserInfo?.doctorUserType ? `- ${UserInfo?.doctorUserType}` : '' }}</text> -->
</view>
<view class="flexX intrbox" style="margin-bottom: 42rpx">
<view>
{{ UserInfo?.hospitalName }}
<text v-for="_ in UserInfo?.department">{{ _.name || '空的' }} </text>
</view>
</view>
<view class="flexJA">
<view @click="proxy.$h.jumpUrl(`/pages2/auth/step?type=detail`)">查看详情</view>
<view @click="showIsEditAuthState = true">修改信息</view>
</view>
</view>
</view>
<view class="state flexA">
<image src="/static/images/auditsuccess.png" style="width: 48rpx; height: 48rpx; margin-right: 18rpx" mode="aspectFill" />
<view>审核通过</view>
</view>
</view>
</template>
</view>
<!-- proxy.$h.jumpUrl(`/pages2/auth/step?type=edit`) -->
<u-modal :show="showIsEditAuthState" :title="`提示`">
<view class="flexCCol grayAuthText">
<view>修改认证信息将重新提交审核,</view>
<view>是否修改?</view>
</view>
<template #confirmButton>
<view class="flexJ">
<up-button type="info" plain shape="circle" text="暂不修改" throttleTime="1000" :customStyle="{ width: '248rpx', height: '92rpx', color: '#000', border: '2rpx solid #e5e5e5' }" @click="showIsEditAuthState = false"></up-button>
<up-button color="#05B8D2" shape="circle" text="修改信息" throttleTime="1000" :customStyle="{ width: '248rpx', height: '92rpx' }" @click="proxy.$h.jumpUrl(`/pages2/auth/step?type=edit&reapply=success`, () => (showIsEditAuthState = false))"></up-button>
</view>
</template>
</u-modal>
<!-- auditwarring.png auditerror.png auditsuccess.png auditbg.png -->
</template>
<script setup lang="ts">
import { ref, getCurrentInstance, ComponentPublicInstance } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { getMy, getDepartment } from '../../api'
import type { UserInfoType, IndexListType } from '../../types'
const { proxy } = getCurrentInstance() as { proxy: ComponentPublicInstance }
interface EventType {
title: string
authState: string
examineStateFailReason?: string
}
const Event = ref<EventType>()
const UserInfo = ref<UserInfoType>()
const showIsEditAuthState = ref<boolean>(false)
onLoad((e: EventType) => {
Event.value = e
})
const getUserInfoHandler = async () => {
const { result }: { result: UserInfoType } = await getMy()
const { result: departmentList }: { result: { records: IndexListType[] } } = await getDepartment({ keyword: '' })
result.doctorUserType = result.doctorUserType
?.split(',')
.map(_ => proxy.$h.optData('doctorUserType')[_])
.join(' ')
![null, undefined, ''].includes(result.department) && (result.department = departmentList.records.flatMap(item => item.list).filter(item => result.department.includes(item.id)))
UserInfo.value = result
}
onShow(() => Event.value?.authState === '20' && getUserInfoHandler())
const reapplyAuthHandler = () => {
proxy.$h.jumpUrl(`/pages2/auth/step?reapply=success&type=edit`)
}
</script>
<style lang="scss" scoped>
.audit {
.main {
box-sizing: border-box;
padding: 120rpx 20rpx;
.state {
margin: 0 auto;
box-sizing: border-box;
padding: 30rpx 40rpx;
width: 652rpx;
border-radius: 94rpx;
background: #fff;
box-shadow: 0 12rpx 40rpx 0 #0f4ce04d;
color: #323233;
font-size: 32rpx;
font-weight: 700;
}
.bgimg {
width: 100%;
height: 424rpx;
position: relative;
.infomain {
box-sizing: border-box;
padding: 108rpx 80rpx 40rpx;
color: #ffffff;
font-size: 28rpx;
font-weight: 700;
&-title {
font-size: 40rpx;
margin-bottom: 12rpx;
}
}
.autbgimg {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
}
.avatar {
position: absolute;
top: -10%;
left: 50%;
transform: translate(-50%);
width: 144rpx;
height: 144rpx;
border-radius: 50%;
}
}
}
.main1 {
box-sizing: border-box;
padding: 66rpx 84rpx 0;
}
.subtitle {
color: #666666;
font-size: 28rpx;
}
&-icon {
width: 66rpx;
height: 66rpx;
margin-right: 32rpx;
}
&-title {
color: #323233;
font-size: 48rpx;
font-weight: 700;
}
}
.intrbox {
height: 60rpx;
overflow: auto;
}
.grayAuthText {
color: #666666;
font-size: 28rpx;
}
.fixBox{
position: fixed;
bottom: 20%;
left: 84rpx;
right: 84rpx;
}
</style>