creditCard.vue 6.0 KB

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