index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view class="container">
  3. <!-- 自定义头部 -->
  4. <view class="custom-header">
  5. <view class="header-left" @click="navBack">
  6. <image class="back-icon" src="/static/icons/chevron_right_dark.svg" style="transform: rotate(180deg);"></image>
  7. </view>
  8. <text class="header-title">认证信息</text>
  9. <view class="header-right"></view>
  10. </view>
  11. <view class="header-placeholder"></view>
  12. <!-- 身份认证 -->
  13. <view class="card">
  14. <view class="section-header">
  15. <view class="orange-bar"></view>
  16. <text class="section-title">身份认证</text>
  17. <view class="tag-orange" v-if="authInfo.pendingAudit">认证中</view>
  18. <view class="tag-green" v-else-if="authInfo.authId">已认证</view>
  19. <view class="tag-gray" v-else>未认证</view>
  20. </view>
  21. <view class="info-row">
  22. <text class="label">真实姓名</text>
  23. <text class="value">{{ authInfo.realName || '未设置' }}</text>
  24. </view>
  25. <view class="info-row">
  26. <text class="label">证件号码</text>
  27. <text class="value">{{ maskIdCard(authInfo.idCard) || '未设置' }}</text>
  28. </view>
  29. <view class="id-card-row">
  30. <view class="id-card-box green-bg" v-if="authInfo.idCardFront">
  31. <image class="id-card-img" :src="authInfo.idCardFront" mode="aspectFill"></image>
  32. <view class="corner-tag">人像面</view>
  33. </view>
  34. <view class="id-card-box green-bg" v-else>
  35. <text class="id-text">ID Front</text>
  36. <view class="corner-tag">人像面</view>
  37. </view>
  38. <view class="id-card-box green-bg" v-if="authInfo.idCardBack">
  39. <image class="id-card-img" :src="authInfo.idCardBack" mode="aspectFill"></image>
  40. <view class="corner-tag">国徽面</view>
  41. </view>
  42. <view class="id-card-box green-bg" v-else>
  43. <text class="id-text">ID Back</text>
  44. <view class="corner-tag">国徽面</view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 服务类型 -->
  49. <view class="card">
  50. <view class="section-header">
  51. <view class="orange-bar"></view>
  52. <text class="section-title">服务类型</text>
  53. </view>
  54. <view class="tags-row">
  55. <view class="service-tag" v-for="(type, index) in authInfo.serviceTypes" :key="index">{{ type }}</view>
  56. <text v-if="authInfo.serviceTypes.length === 0" class="empty-text">暂无服务类型</text>
  57. </view>
  58. </view>
  59. <!-- 资质证书 -->
  60. <view class="card">
  61. <view class="section-header">
  62. <view class="orange-bar"></view>
  63. <text class="section-title">资质证书</text>
  64. </view>
  65. <text class="sub-title">{{ authInfo.authQual ? '已认证' : '未认证' }}</text>
  66. <view class="cert-row">
  67. <view class="cert-box yellow-bg" v-for="(img, index) in authInfo.qualImages" :key="index">
  68. <image class="cert-img" :src="img" mode="aspectFill"></image>
  69. </view>
  70. <text v-if="authInfo.qualImages.length === 0" class="empty-text">暂无资质证书</text>
  71. </view>
  72. </view>
  73. <!-- 修改按钮 -->
  74. <view class="bottom-btn-area">
  75. <button class="action-btn disabled" v-if="authInfo.pendingAudit" disabled>认证审核中...</button>
  76. <button class="action-btn" v-else @click="editAuth">修改认证信息</button>
  77. <text class="tips" v-if="authInfo.pendingAudit">认证信息正在审核中,请耐心等待</text>
  78. <text class="tips" v-else>修改认证信息需要重新审核,审核期间无法接单</text>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import { getAuthInfo } from '@/api/fulfiller'
  84. export default {
  85. data() {
  86. return {
  87. authInfo: {
  88. realName: '',
  89. idCard: '',
  90. idCardFront: '',
  91. idCardBack: '',
  92. serviceTypes: [],
  93. authId: false,
  94. authQual: false,
  95. pendingAudit: false,
  96. qualImages: []
  97. }
  98. }
  99. },
  100. onLoad() {
  101. this.loadAuthInfo()
  102. },
  103. methods: {
  104. navBack() {
  105. uni.navigateBack({
  106. delta: 1
  107. });
  108. },
  109. async loadAuthInfo() {
  110. try {
  111. const res = await getAuthInfo()
  112. if (res.code === 200 && res.data) {
  113. this.authInfo = {
  114. realName: res.data.realName || '',
  115. idCard: res.data.idCard || '',
  116. idCardFront: res.data.idCardFrontUrl || '',
  117. idCardBack: res.data.idCardBackUrl || '',
  118. serviceTypes: res.data.serviceTypeList || [],
  119. authId: res.data.authId || false,
  120. authQual: res.data.authQual || false,
  121. pendingAudit: res.data.pendingAudit || false,
  122. qualImages: res.data.qualImageUrls || []
  123. }
  124. }
  125. } catch (e) {
  126. console.error('加载认证信息失败', e)
  127. uni.showToast({ title: '加载失败', icon: 'none' })
  128. }
  129. },
  130. maskIdCard(idCard) {
  131. if (!idCard || idCard.length < 8) return idCard
  132. return idCard.substring(0, 4) + '**********' + idCard.substring(idCard.length - 4)
  133. },
  134. editAuth() {
  135. uni.showModal({
  136. title: '提示',
  137. content: '修改认证信息需要重新审核,审核期间无法接单,确定要继续吗?',
  138. success: (res) => {
  139. if (res.confirm) {
  140. uni.navigateTo({
  141. url: '/pages/mine/settings/auth/edit'
  142. })
  143. }
  144. }
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style>
  151. page {
  152. background-color: #F8F8F8;
  153. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  154. }
  155. .custom-header {
  156. position: fixed;
  157. top: 0;
  158. left: 0;
  159. width: 100%;
  160. height: 88rpx;
  161. padding-top: var(--status-bar-height);
  162. background-color: #fff;
  163. display: flex;
  164. align-items: center;
  165. justify-content: space-between;
  166. padding-left: 30rpx;
  167. padding-right: 30rpx;
  168. box-sizing: content-box;
  169. z-index: 100;
  170. }
  171. .header-placeholder {
  172. height: calc(88rpx + var(--status-bar-height));
  173. }
  174. .back-icon {
  175. width: 40rpx;
  176. height: 40rpx;
  177. }
  178. .header-title {
  179. font-size: 28rpx;
  180. font-weight: bold;
  181. color: #333;
  182. }
  183. .header-right {
  184. width: 40rpx;
  185. }
  186. .container {
  187. padding: 20rpx 30rpx;
  188. padding-bottom: 100rpx;
  189. }
  190. .card {
  191. background-color: #fff;
  192. border-radius: 20rpx;
  193. padding: 30rpx;
  194. margin-bottom: 30rpx;
  195. }
  196. .section-header {
  197. display: flex;
  198. align-items: center;
  199. margin-bottom: 30rpx;
  200. }
  201. .orange-bar {
  202. width: 8rpx;
  203. height: 32rpx;
  204. background-color: #FF5722;
  205. border-radius: 4rpx;
  206. margin-right: 16rpx;
  207. }
  208. .section-title {
  209. font-size: 32rpx;
  210. font-weight: bold;
  211. color: #333;
  212. flex: 1;
  213. }
  214. .tag-green {
  215. font-size: 24rpx;
  216. color: #4CAF50;
  217. background-color: #E8F5E9;
  218. padding: 4rpx 12rpx;
  219. border-radius: 8rpx;
  220. }
  221. .tag-orange {
  222. font-size: 24rpx;
  223. color: #FF9800;
  224. background-color: #FFF3E0;
  225. padding: 4rpx 12rpx;
  226. border-radius: 8rpx;
  227. }
  228. .tag-red {
  229. font-size: 24rpx;
  230. color: #F44336;
  231. background-color: #FFEBEE;
  232. padding: 4rpx 12rpx;
  233. border-radius: 8rpx;
  234. }
  235. .tag-gray {
  236. font-size: 24rpx;
  237. color: #999;
  238. background-color: #F5F5F5;
  239. padding: 4rpx 12rpx;
  240. border-radius: 8rpx;
  241. }
  242. .info-row {
  243. display: flex;
  244. justify-content: space-between;
  245. margin-bottom: 20rpx;
  246. }
  247. .label {
  248. font-size: 28rpx;
  249. color: #999;
  250. }
  251. .value {
  252. font-size: 28rpx;
  253. color: #333;
  254. font-weight: 500;
  255. }
  256. .id-card-row {
  257. display: flex;
  258. justify-content: space-between;
  259. margin-top: 20rpx;
  260. }
  261. .id-card-box {
  262. width: 48%;
  263. height: 180rpx;
  264. border-radius: 12rpx;
  265. display: flex;
  266. align-items: center;
  267. justify-content: center;
  268. position: relative;
  269. overflow: hidden;
  270. }
  271. .green-bg {
  272. background-color: #E8F5E9;
  273. }
  274. .id-text {
  275. font-size: 36rpx;
  276. color: #4CAF50;
  277. font-weight: bold;
  278. }
  279. .corner-tag {
  280. position: absolute;
  281. right: 0;
  282. bottom: 0;
  283. background-color: rgba(0,0,0,0.5);
  284. color: #fff;
  285. font-size: 20rpx;
  286. padding: 4rpx 10rpx;
  287. border-top-left-radius: 8rpx;
  288. }
  289. .tags-row {
  290. display: flex;
  291. flex-wrap: wrap;
  292. }
  293. .service-tag {
  294. background-color: #FFF3E0;
  295. color: #FF9800;
  296. font-size: 26rpx;
  297. padding: 10rpx 30rpx;
  298. border-radius: 30rpx;
  299. margin-right: 20rpx;
  300. margin-bottom: 20rpx;
  301. }
  302. .sub-title {
  303. font-size: 28rpx;
  304. color: #666;
  305. margin-top: 10rpx;
  306. margin-bottom: 20rpx;
  307. display: block;
  308. }
  309. .cert-row {
  310. display: flex;
  311. flex-wrap: wrap;
  312. margin-bottom: 20rpx;
  313. }
  314. .cert-box {
  315. width: 180rpx;
  316. height: 180rpx;
  317. border-radius: 12rpx;
  318. display: flex;
  319. align-items: center;
  320. justify-content: center;
  321. margin-right: 20rpx;
  322. margin-bottom: 20rpx;
  323. }
  324. .yellow-bg { background-color: #FFF8E1; }
  325. .blue-bg { background-color: #E3F2FD; }
  326. .green-light-bg { background-color: #F1F8E9; }
  327. .cert-text { font-size: 32rpx; font-weight: bold; }
  328. .cert-text.orange { color: #FFA000; }
  329. .cert-text.blue { color: #2196F3; }
  330. .cert-text.green { color: #8BC34A; }
  331. .id-card-img, .cert-img {
  332. width: 100%;
  333. height: 100%;
  334. border-radius: 12rpx;
  335. }
  336. .empty-text {
  337. font-size: 26rpx;
  338. color: #999;
  339. }
  340. .bottom-btn-area {
  341. margin-top: 40rpx;
  342. text-align: center;
  343. }
  344. .action-btn {
  345. background-color: #fff;
  346. color: #FF5722;
  347. border: 1px solid #FF5722;
  348. font-size: 32rpx;
  349. border-radius: 44rpx;
  350. height: 88rpx;
  351. line-height: 88rpx;
  352. }
  353. .action-btn.disabled {
  354. background-color: #F5F5F5;
  355. color: #999;
  356. border: 1px solid #E0E0E0;
  357. }
  358. .tips {
  359. display: block;
  360. font-size: 24rpx;
  361. color: #999;
  362. margin-top: 20rpx;
  363. }
  364. </style>