creditCard.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view class="credit-card-container" :class="`${size}`">
  3. <view class="title-box">
  4. <view class="title">
  5. 广州市房地产中介服务人员
  6. </view>
  7. <view class="text">
  8. 信用信息卡
  9. </view>
  10. </view>
  11. <view class="desc-box" v-if="!isLogin">
  12. <view class="text">
  13. 请登录后查看
  14. </view>
  15. </view>
  16. <view class="desc-box" v-if="isLogin && !data.creditNo" @click="onGuideClick()">
  17. <view class="text">
  18. 用户暂未办理信用信息卡<br/>点击了解办理指引&gt;
  19. </view>
  20. </view>
  21. <view class="image-box" v-if="isLogin && data.creditNo">
  22. <view class="image-item-box">
  23. <image class="photo" :src="data.headUrl"></image>
  24. </view>
  25. <view class="image-item-box">
  26. <view class="qrcode-box">
  27. <image class="qrcode" :src="`${FILE_URL}/zhengshu/qrCode.png`"></image>
  28. </view>
  29. <view class="text">
  30. 扫码查信用
  31. </view>
  32. </view>
  33. </view>
  34. <view class="info-box" v-if="isLogin && data.creditNo">
  35. <view class="info-item-box">
  36. <view class="label">
  37. <span style="letter-spacing: 2em;">姓</span><span>名:</span>
  38. </view>
  39. <view class="text">
  40. {{ data.name }}
  41. </view>
  42. </view>
  43. <view class="info-item-box">
  44. <view class="label">
  45. <span style="letter-spacing: 2em;">卡</span><span>号:</span>
  46. </view>
  47. <view class="text">
  48. {{ data.creditNo ?? '-' }}
  49. </view>
  50. </view>
  51. <view class="info-item-box">
  52. <view class="label">
  53. <span class="label-text">发卡时间:</span>
  54. </view>
  55. <view class="text">
  56. {{ data.date ?? '-' }}
  57. </view>
  58. </view>
  59. </view>
  60. <view class="publisher-box" v-if="isLogin && data.id">
  61. {{ data.publisher }}&nbsp;制
  62. </view>
  63. </view>
  64. </template>
  65. <script setup>
  66. import { ref, defineProps, computed, defineEmits } from 'vue'
  67. import { getToken } from '@/utils/auth.js'
  68. import configService from '@/utils/baseurl.js'
  69. const FILE_URL = configService.FILE_URL;
  70. const emit = defineEmits(['guide'])
  71. const props = defineProps({
  72. isLogin: {
  73. type: Boolean,
  74. default: false
  75. },
  76. data: {
  77. type: Object,
  78. default: {
  79. creditNo: null,
  80. name: null,
  81. date: null,
  82. publisher: null,
  83. headUrl: null,
  84. url: null
  85. }
  86. },
  87. size: {
  88. type: String,
  89. default: 'mini' // mini | normal
  90. }
  91. })
  92. function onGuideClick() {
  93. emit('guide')
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .credit-card-container {
  98. height: 100%;
  99. width: 100%;
  100. .title-box {
  101. height: 20%;
  102. text-align: center;
  103. .title {}
  104. .text {}
  105. }
  106. .image-box {
  107. height: 40%;
  108. display: flex;
  109. .image-item-box {
  110. width: 50%;
  111. display: flex;
  112. flex-direction: column;
  113. justify-content: center;
  114. .photo {
  115. height: 100%;
  116. width: 100%;
  117. object-fit: cover;
  118. }
  119. .qrcode {
  120. height: 100%;
  121. width: 100%;
  122. object-fit: cover;
  123. }
  124. }
  125. }
  126. .info-box {
  127. height: 30%;
  128. .info-item-box {
  129. display: flex;
  130. .label {
  131. width: 39%;
  132. }
  133. .text {
  134. width: 61%;
  135. }
  136. }
  137. }
  138. .publisher-box {
  139. height: 8%;
  140. text-align: center;
  141. }
  142. }
  143. .mini {
  144. @include backgroundImg('http://www.gzrea.org.cn:8543/icon/wxmp/zhengshu/credit-card-empty.png');
  145. padding: 15rpx 10rpx;
  146. .title-box {
  147. font-weight: bold;
  148. font-size: $uni-font-size-4;
  149. .title {
  150. }
  151. .text {
  152. }
  153. }
  154. .desc-box {
  155. height: 60%;
  156. display: flex;
  157. justify-content: center;
  158. align-items: center;
  159. text-align: center;
  160. .text {
  161. font-size: $uni-font-size-3;
  162. font-weight: bold;
  163. }
  164. }
  165. .image-box {
  166. padding: 0 10rpx;
  167. gap: 20rpx;
  168. .image-item-box {
  169. .qrcode-box {
  170. height: 70%;
  171. width: 100%;
  172. }
  173. .text {
  174. height: 20%;
  175. text-align: center;
  176. font-size: $uni-font-size-4;
  177. font-weight: bold;
  178. }
  179. }
  180. }
  181. .info-box {
  182. padding: 10rpx;
  183. .info-item-box {
  184. font-size: $uni-font-size-5;
  185. line-height: 25rpx;
  186. font-weight: bold;
  187. }
  188. }
  189. .publisher-box {
  190. position: relative;
  191. left: -9rpx;
  192. padding-top: 10rpx;
  193. font-size: $uni-font-size-6;
  194. font-weight: bold;
  195. transform: scale(0.7);
  196. }
  197. }
  198. .normal {
  199. padding: 25rpx 20rpx;
  200. .title-box {
  201. height: 18%;
  202. font-weight: bold;
  203. letter-spacing: 5rpx;
  204. line-height: 60rpx;
  205. .title {
  206. font-size: calc($uni-title-font-size-1 + 3rpx);
  207. }
  208. .text {
  209. font-size: calc($uni-title-font-size-1);
  210. }
  211. }
  212. .image-box {
  213. height: 40%;
  214. padding: 0 20rpx;
  215. gap: 20rpx;
  216. .image-item-box {
  217. .qrcode-box {
  218. height: 75%;
  219. width: 100%;
  220. }
  221. .text {
  222. height: 10%;
  223. text-align: center;
  224. font-size: $uni-title-font-size-2;
  225. font-weight: bold;
  226. }
  227. }
  228. }
  229. .info-box {
  230. height: 35%;
  231. padding: 30rpx 20rpx;
  232. .info-item-box {
  233. font-size: $uni-title-font-size-1;
  234. line-height: 80rpx;
  235. font-weight: bold;
  236. }
  237. }
  238. .publisher-box {
  239. padding-top: 10rpx;
  240. font-size: $uni-title-font-size-3;
  241. font-weight: bold;
  242. }
  243. }
  244. @mixin backgroundColor($color) {
  245. background: $color;
  246. background: -moz-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  247. background: -webkit-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  248. background: -o-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  249. background: -ms-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  250. background: repeating-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%), url('http://www.gzrea.org.cn:8543/icon/wxmp/zhengshu/credit-card-perview.png');
  251. background-blend-mode: darken;
  252. background-repeat: no-repeat;
  253. background-size: 100% 100%;
  254. }
  255. .blue {
  256. @include backgroundColor(rgb(43, 178, 255));
  257. }
  258. .red {
  259. @include backgroundColor(rgb(255, 53, 54));
  260. }
  261. .green {
  262. @include backgroundColor(rgb(61, 210, 59));
  263. }
  264. </style>