certificateDetail.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="container">
  3. <view class="photo-box">
  4. <cover-image class="photo" :src="creditCard.headUrl"></cover-image>
  5. </view>
  6. <view class="info-box">
  7. <view class="info-item-box">
  8. <view class="label">
  9. <span>证书编号:</span>
  10. </view>
  11. <view class="text">
  12. {{ info.zsbh }}
  13. </view>
  14. </view>
  15. <view class="info-item-box">
  16. <view class="label">
  17. <span>发证部门:</span>
  18. </view>
  19. <view class="text">
  20. {{ info.fzbm }}
  21. </view>
  22. </view>
  23. <view class="info-item-box">
  24. <view class="label">
  25. <span>发证日期:</span>
  26. </view>
  27. <view class="text">
  28. {{ info.fzrq }}
  29. </view>
  30. </view>
  31. <view class="info-item-box">
  32. <view class="label">
  33. <span style="letter-spacing: 2em;">姓</span>
  34. <span>名:</span>
  35. </view>
  36. <view class="text">
  37. {{ info.xm }}
  38. </view>
  39. </view>
  40. <view class="info-item-box">
  41. <view class="label">
  42. <span style="letter-spacing: 2em;">性</span>
  43. <span>别:</span>
  44. </view>
  45. <view class="text">
  46. {{ info.xb }}
  47. </view>
  48. </view>
  49. <view class="info-item-box">
  50. <view class="label">
  51. <span>身份证号:</span>
  52. </view>
  53. <view class="text">
  54. {{ info.sfzh }}
  55. </view>
  56. </view>
  57. <view class="info-item-box">
  58. <view class="label">
  59. <span>文化程度:</span>
  60. </view>
  61. <view class="text">
  62. {{ info.whcd }}
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script setup>
  69. import { ref } from 'vue'
  70. import { onLoad } from '@dcloudio/uni-app'
  71. import { getZhongjie, getAnjie } from '@/api/user.js'
  72. import { useAuthStore } from '@/store/authStore'
  73. const authStore = useAuthStore()
  74. const certificateType = ref()
  75. const certificateTitle = ref()
  76. const creditCard = ref({
  77. creditNo: null,
  78. name: null,
  79. date: null,
  80. publisher: null,
  81. headUrl: null,
  82. url: null
  83. })
  84. const info = ref({
  85. zsbh: null,
  86. fzbm: null,
  87. fzrq: null,
  88. xm: null,
  89. xb: null,
  90. sfzh: null,
  91. whcd: null
  92. })
  93. onLoad((load) => {
  94. certificateType.value = load.type
  95. certificateTitle.value = load.title
  96. uni.setNavigationBarTitle({
  97. title: certificateTitle.value
  98. })
  99. creditCard.value = authStore.creditCard
  100. if (certificateType.value === 'zhongjie') {
  101. getZhongjie().then(res => {
  102. if (res && res.message === 'success') {
  103. info.value = res.data
  104. }
  105. })
  106. } else if (certificateType.value === 'anjie') {
  107. getAnjie().then(res => {
  108. if (res && res.message === 'success') {
  109. info.value = res.data
  110. }
  111. })
  112. }
  113. })
  114. </script>
  115. <style lang="scss" scoped>
  116. .container {
  117. height: 100vh;
  118. width: 100vw;
  119. background-color: $uni-bg-color-grey;
  120. padding: 20rpx;
  121. .photo-box {
  122. width: 100%;
  123. display: flex;
  124. justify-content: center;
  125. margin: 20rpx 0;
  126. .photo {
  127. width: 200rpx;
  128. height: 280rpx;
  129. object-fit: cover;
  130. border-radius: $uni-card-border-radius;
  131. }
  132. }
  133. .info-box {
  134. padding: 20rpx 0;
  135. .info-item-box {
  136. display: flex;
  137. background-color: $uni-bg-color;
  138. border: 1rpx solid #81B4F8;
  139. border-radius: $uni-card-border-radius;
  140. padding: 20rpx 30rpx;
  141. font-size: $uni-title-font-size-2;
  142. // font-weight: bold;
  143. letter-spacing: 2rpx;
  144. margin-bottom: 40rpx;
  145. .label {
  146. width: 21%;
  147. }
  148. .text {
  149. width: 79%;
  150. }
  151. }
  152. }
  153. }
  154. </style>