index.vue 8.9 KB

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