identity.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. // 胶囊按钮距离页面顶部的距离
  38. const paddingTop = ref(0)
  39. // 身份认证类型数组
  40. const typeList = ref([
  41. {
  42. cardType: '教师认证'
  43. },
  44. {
  45. cardType: '暖心认证'
  46. }
  47. ])
  48. onMounted(() => {
  49. paddingTop.value = uni.getMenuButtonBoundingClientRect().top
  50. })
  51. // 点击每一项的回调
  52. const clickItem = (item) => {
  53. uni.navigateTo({
  54. url: `/pages/authenticate/authenticate?cardType=${item.cardType}`
  55. })
  56. }
  57. // 顶部返回图标回调
  58. const handleBack = () => {
  59. uni.navigateBack()
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .container {
  64. position: relative;
  65. height: 100vh;
  66. color: #001713;
  67. background-color: #fff;
  68. .banner {
  69. width: 100%;
  70. height: 482rpx;
  71. }
  72. .title {
  73. position: absolute;
  74. display: flex;
  75. align-items: center;
  76. width: 100vh;
  77. font-size: 40rpx;
  78. .title_back {
  79. margin-left: 26rpx;
  80. margin-right: 252rpx;
  81. }
  82. }
  83. .body {
  84. position: absolute;
  85. top: 220rpx;
  86. box-sizing: border-box;
  87. padding: 0 36rpx;
  88. width: 100%;
  89. .body_card {
  90. box-sizing: border-box;
  91. padding: 36rpx 48rpx;
  92. margin: 0 auto 80rpx;
  93. width: 100%;
  94. height: 248rpx;
  95. font-size: 24rpx;
  96. border-radius: 60rpx;
  97. border-radius: 30px;
  98. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  99. .card_type {
  100. display: flex;
  101. align-items: center;
  102. font-weight: bold;
  103. margin-top: 100rpx;
  104. .type_name {
  105. display: flex;
  106. align-items: center;
  107. font-size: 40rpx;
  108. .img {
  109. margin-right: 10rpx;
  110. width: 40rpx;
  111. height: 40rpx;
  112. }
  113. }
  114. .type_au {
  115. display: flex;
  116. align-items: center;
  117. margin-left: 40rpx;
  118. font-size: 24rpx;
  119. .text {
  120. margin-right: 5rpx;
  121. }
  122. }
  123. }
  124. .card_line {
  125. margin-top: 16rpx;
  126. width: 100%;
  127. height: 8rpx;
  128. border-radius: 10rpx;
  129. }
  130. .line_excellent {
  131. background: linear-gradient(90deg, #72a8d2 0%, #2b507a 100%);
  132. }
  133. .line_teacher {
  134. background: linear-gradient(90deg, #f1a045 0%, #bf6c0f 100%);
  135. }
  136. .line_warm {
  137. background: linear-gradient(90deg, #218dfb 0%, #0c70fb 100%);
  138. }
  139. }
  140. .excellent {
  141. color: #2b507a;
  142. background: linear-gradient(146.58deg, rgba(243, 245, 245, 0.5) 0%, rgba(229, 240, 244, 0.5) 100%);
  143. }
  144. .teacher {
  145. color: #9f5300;
  146. 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%);
  147. }
  148. .warm {
  149. color: #1580ed;
  150. background: linear-gradient(146.58deg, rgba(243, 245, 245, 0.5) 0%, rgba(201, 229, 255, 0.5) 100%);
  151. }
  152. }
  153. }
  154. </style>