creditCard.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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.photo"></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. id: null,
  80. creditNo: null,
  81. name: null,
  82. date: null,
  83. publisher: null,
  84. photo: null,
  85. qrCode: null
  86. }
  87. },
  88. size: {
  89. type: String,
  90. default: 'mini' // mini | normal
  91. }
  92. })
  93. function onGuideClick() {
  94. emit('guide')
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .credit-card-container {
  99. height: 100%;
  100. width: 100%;
  101. .title-box {
  102. height: 20%;
  103. text-align: center;
  104. .title {}
  105. .text {}
  106. }
  107. .image-box {
  108. height: 40%;
  109. display: flex;
  110. .image-item-box {
  111. width: 50%;
  112. display: flex;
  113. flex-direction: column;
  114. justify-content: center;
  115. .photo {
  116. height: 100%;
  117. width: 100%;
  118. object-fit: cover;
  119. }
  120. .qrcode {
  121. height: 100%;
  122. width: 100%;
  123. object-fit: cover;
  124. }
  125. }
  126. }
  127. .info-box {
  128. height: 30%;
  129. .info-item-box {
  130. display: flex;
  131. .label {
  132. width: 39%;
  133. }
  134. .text {
  135. width: 61%;
  136. }
  137. }
  138. }
  139. .publisher-box {
  140. height: 8%;
  141. text-align: center;
  142. }
  143. }
  144. .mini {
  145. @include backgroundImg('http://www.gzrea.org.cn:8543/icon/wxmp/zhengshu/credit-card-empty.png');
  146. padding: 15rpx 10rpx;
  147. .title-box {
  148. font-weight: bold;
  149. font-size: $uni-font-size-4;
  150. .title {
  151. }
  152. .text {
  153. }
  154. }
  155. .desc-box {
  156. height: 60%;
  157. display: flex;
  158. justify-content: center;
  159. align-items: center;
  160. text-align: center;
  161. .text {
  162. font-size: $uni-font-size-3;
  163. font-weight: bold;
  164. }
  165. }
  166. .image-box {
  167. padding: 0 10rpx;
  168. gap: 20rpx;
  169. .image-item-box {
  170. .qrcode-box {
  171. height: 70%;
  172. width: 100%;
  173. }
  174. .text {
  175. height: 20%;
  176. text-align: center;
  177. font-size: $uni-font-size-4;
  178. font-weight: bold;
  179. }
  180. }
  181. }
  182. .info-box {
  183. padding: 10rpx;
  184. .info-item-box {
  185. font-size: $uni-font-size-5;
  186. line-height: 25rpx;
  187. font-weight: bold;
  188. }
  189. }
  190. .publisher-box {
  191. position: relative;
  192. left: -9rpx;
  193. padding-top: 10rpx;
  194. font-size: $uni-font-size-6;
  195. font-weight: bold;
  196. transform: scale(0.7);
  197. }
  198. }
  199. .normal {
  200. padding: 25rpx 20rpx;
  201. .title-box {
  202. height: 18%;
  203. font-weight: bold;
  204. letter-spacing: 5rpx;
  205. line-height: 60rpx;
  206. .title {
  207. font-size: calc($uni-title-font-size-1 + 3rpx);
  208. }
  209. .text {
  210. font-size: calc($uni-title-font-size-1);
  211. }
  212. }
  213. .image-box {
  214. height: 40%;
  215. padding: 0 20rpx;
  216. gap: 20rpx;
  217. .image-item-box {
  218. .qrcode-box {
  219. height: 75%;
  220. width: 100%;
  221. }
  222. .text {
  223. height: 10%;
  224. text-align: center;
  225. font-size: $uni-title-font-size-2;
  226. font-weight: bold;
  227. }
  228. }
  229. }
  230. .info-box {
  231. height: 35%;
  232. padding: 30rpx 20rpx;
  233. .info-item-box {
  234. font-size: $uni-title-font-size-1;
  235. line-height: 80rpx;
  236. font-weight: bold;
  237. }
  238. }
  239. .publisher-box {
  240. padding-top: 10rpx;
  241. font-size: $uni-title-font-size-3;
  242. font-weight: bold;
  243. }
  244. }
  245. @mixin backgroundColor($color) {
  246. background: $color;
  247. background: -moz-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  248. background: -webkit-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  249. background: -o-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  250. background: -ms-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  251. 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');
  252. background-blend-mode: darken;
  253. background-repeat: no-repeat;
  254. background-size: 100% 100%;
  255. }
  256. .blue {
  257. @include backgroundColor(rgb(43, 178, 255));
  258. }
  259. .red {
  260. @include backgroundColor(rgb(255, 53, 54));
  261. }
  262. .green {
  263. @include backgroundColor(rgb(61, 210, 59));
  264. }
  265. </style>