index.vue 11 KB

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