creditCard.vue 6.5 KB

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