creditCard.vue 6.5 KB

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