identity.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="container">
  3. <image class="banner" src="@/static/images/mine/back.png" mode="aspectFill" />
  4. <view class="title" :style="{ top: `${paddingTop * 2}rpx` }">
  5. <view class="title_back" @click="handleBack">
  6. <wd-icon name="thin-arrow-left" color="#001713" size="18"></wd-icon>
  7. </view>
  8. 身份认证
  9. </view>
  10. <view class="body">
  11. <!-- 每一个认证类型区域 -->
  12. <view
  13. class="body_card"
  14. v-for="(item, index) in typeList"
  15. :key="index"
  16. :class="[{ excellent: item.cardType == '优行认证' }, { teacher: item.cardType == '教师认证' }, { warm: item.cardType == '暖心认证' }]"
  17. @click="clickItem(item)"
  18. >
  19. <view class="card_type">
  20. <view class="type_name">
  21. <image v-if="item.cardType == '优行认证'" class="img" src="/static/images/transportation/logo.png" mode="aspectFill"></image>
  22. <image v-if="item.cardType == '教师认证'" class="img" src="/static/images/transportation/logo2.png" mode="aspectFill"></image>
  23. <image v-if="item.cardType == '暖心认证'" class="img" src="/static/images/transportation/logo3.png" mode="aspectFill"></image>
  24. {{ item.cardType }}
  25. </view>
  26. </view>
  27. <view
  28. class="card_line"
  29. :class="[{ line_excellent: item.cardType == '优行认证' }, { line_teacher: item.cardType == '教师认证' }, { line_warm: item.cardType == '暖心认证' }]"
  30. ></view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup>
  36. import { onMounted, ref } from 'vue'
  37. import { myRequest } from '@/utils/api.ts'
  38. // 胶囊按钮距离页面顶部的距离
  39. const paddingTop = ref(0)
  40. // 用户信息
  41. const userInfo = uni.getStorageSync('carUserInfo')
  42. //认证信息
  43. const mineXin = ref({})
  44. // 身份认证类型数组
  45. const typeList = ref([
  46. {
  47. cardType: '教师认证'
  48. },
  49. {
  50. cardType: '暖心认证'
  51. }
  52. ])
  53. onMounted(() => {
  54. paddingTop.value = uni.getMenuButtonBoundingClientRect().top
  55. getMyVetry()
  56. })
  57. // 查看我的认证信息
  58. async function getMyVetry() {
  59. const res = await myRequest({
  60. url: '/vertifyqueryOwn.action',
  61. data: {
  62. mobile: userInfo.mobile ,
  63. }
  64. })
  65. if(res.code==200){
  66. if(res.data[0].type==1){
  67. mineXin.value=res.data[0]
  68. }else if(res.data[0].type==2){
  69. mineXin.value=res.data[0]
  70. }
  71. }else if(res.message=='未查询到认证信息'){
  72. }
  73. }
  74. // 点击每一项的回调
  75. const clickItem = (item) => {
  76. if(item.cardType=='教师认证'){
  77. if(mineXin.value.type==1){
  78. const info = encodeURIComponent(JSON.stringify(mineXin.value))
  79. uni.navigateTo({
  80. url:`/pages/authenticate/authenticate?info=${info}&cardType=${item.cardType}`,
  81. })
  82. return
  83. }
  84. }else{
  85. if(mineXin.value.type==2){
  86. const info = encodeURIComponent(JSON.stringify(mineXin.value))
  87. uni.navigateTo({
  88. url:`/pages/authenticate/authenticate?info=${info}&cardType=${item.cardType}`,
  89. })
  90. return
  91. }
  92. }
  93. uni.navigateTo({
  94. url: `/pages/authenticate/authenticate?cardType=${item.cardType}`
  95. })
  96. }
  97. // 顶部返回图标回调
  98. const handleBack = () => {
  99. uni.navigateBack()
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .container {
  104. position: relative;
  105. height: 100vh;
  106. color: #001713;
  107. background-color: #fff;
  108. .banner {
  109. width: 100%;
  110. height: 482rpx;
  111. }
  112. .title {
  113. position: absolute;
  114. display: flex;
  115. align-items: center;
  116. width: 100vh;
  117. font-size: 40rpx;
  118. .title_back {
  119. margin-left: 26rpx;
  120. margin-right: 252rpx;
  121. }
  122. }
  123. .body {
  124. position: absolute;
  125. top: 220rpx;
  126. box-sizing: border-box;
  127. padding: 0 36rpx;
  128. width: 100%;
  129. .body_card {
  130. box-sizing: border-box;
  131. padding: 36rpx 48rpx;
  132. margin: 0 auto 80rpx;
  133. width: 100%;
  134. height: 248rpx;
  135. font-size: 24rpx;
  136. border-radius: 60rpx;
  137. border-radius: 30px;
  138. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  139. .card_type {
  140. display: flex;
  141. align-items: center;
  142. font-weight: bold;
  143. margin-top: 100rpx;
  144. .type_name {
  145. display: flex;
  146. align-items: center;
  147. font-size: 40rpx;
  148. .img {
  149. margin-right: 10rpx;
  150. width: 40rpx;
  151. height: 40rpx;
  152. }
  153. }
  154. .type_au {
  155. display: flex;
  156. align-items: center;
  157. margin-left: 40rpx;
  158. font-size: 24rpx;
  159. .text {
  160. margin-right: 5rpx;
  161. }
  162. }
  163. }
  164. .card_line {
  165. margin-top: 16rpx;
  166. width: 100%;
  167. height: 8rpx;
  168. border-radius: 10rpx;
  169. }
  170. .line_excellent {
  171. background: linear-gradient(90deg, #72a8d2 0%, #2b507a 100%);
  172. }
  173. .line_teacher {
  174. background: linear-gradient(90deg, #f1a045 0%, #bf6c0f 100%);
  175. }
  176. .line_warm {
  177. background: linear-gradient(90deg, #218dfb 0%, #0c70fb 100%);
  178. }
  179. }
  180. .excellent {
  181. color: #2b507a;
  182. background: linear-gradient(146.58deg, rgba(243, 245, 245, 0.5) 0%, rgba(229, 240, 244, 0.5) 100%);
  183. }
  184. .teacher {
  185. color: #9f5300;
  186. background: linear-gradient(148.48deg, rgba(254, 228, 182, 0.5) 0%, rgba(253, 205, 121, 0.5) 59.21%, rgba(248, 212, 140, 0.5) 100%);
  187. }
  188. .warm {
  189. color: #1580ed;
  190. background: linear-gradient(146.58deg, rgba(243, 245, 245, 0.5) 0%, rgba(201, 229, 255, 0.5) 100%);
  191. }
  192. }
  193. }
  194. </style>