creditCard.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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" :key="data.headUrl" @click="previewImage(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. :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.id">
  69. {{ data.publisher }}&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. .image-item-box {
  123. width: 50%;
  124. display: flex;
  125. flex-direction: column;
  126. justify-content: center;
  127. .photo {
  128. height: 100%;
  129. width: 100%;
  130. object-fit: cover;
  131. }
  132. .qrcode {
  133. height: 100%;
  134. width: 100%;
  135. object-fit: cover;
  136. }
  137. }
  138. }
  139. .info-box {
  140. height: 30%;
  141. .info-item-box {
  142. display: flex;
  143. .label {
  144. width: 39%;
  145. }
  146. .text {
  147. width: 61%;
  148. }
  149. }
  150. }
  151. .publisher-box {
  152. height: 8%;
  153. text-align: center;
  154. }
  155. }
  156. .mini {
  157. @include backgroundImg('http://www.gzrea.org.cn:8543/icon/wxmp/zhengshu/credit-card-empty.png');
  158. padding: 15rpx 10rpx;
  159. .title-box {
  160. font-weight: bold;
  161. font-size: $uni-font-size-4;
  162. .title {
  163. }
  164. .text {
  165. }
  166. }
  167. .desc-box {
  168. height: 60%;
  169. display: flex;
  170. justify-content: center;
  171. align-items: center;
  172. text-align: center;
  173. .text {
  174. font-size: $uni-font-size-3;
  175. font-weight: bold;
  176. }
  177. }
  178. .image-box {
  179. padding: 0 10rpx;
  180. gap: 20rpx;
  181. .image-item-box {
  182. .qrcode-box {
  183. height: 70%;
  184. width: 100%;
  185. }
  186. .text {
  187. height: 20%;
  188. text-align: center;
  189. font-size: $uni-font-size-4;
  190. font-weight: bold;
  191. }
  192. }
  193. }
  194. .info-box {
  195. padding: 10rpx;
  196. .info-item-box {
  197. font-size: $uni-font-size-5;
  198. line-height: 25rpx;
  199. font-weight: bold;
  200. }
  201. }
  202. .publisher-box {
  203. position: relative;
  204. left: -9rpx;
  205. padding-top: 10rpx;
  206. font-size: $uni-font-size-6;
  207. font-weight: bold;
  208. transform: scale(0.7);
  209. }
  210. }
  211. .normal {
  212. padding: 25rpx 20rpx;
  213. .title-box {
  214. height: 18%;
  215. font-weight: bold;
  216. letter-spacing: 5rpx;
  217. line-height: 60rpx;
  218. .title {
  219. font-size: calc($uni-title-font-size-1 + 3rpx);
  220. }
  221. .text {
  222. font-size: calc($uni-title-font-size-1);
  223. }
  224. }
  225. .desc-box {
  226. height: 60%;
  227. display: flex;
  228. justify-content: center;
  229. align-items: center;
  230. text-align: center;
  231. .text {
  232. font-size: $uni-title-font-size-1;
  233. font-weight: bold;
  234. }
  235. }
  236. .image-box {
  237. height: 40%;
  238. padding: 0 20rpx;
  239. gap: 20rpx;
  240. .image-item-box {
  241. .qrcode-box {
  242. height: 75%;
  243. width: 100%;
  244. }
  245. .text {
  246. height: 10%;
  247. text-align: center;
  248. font-size: $uni-title-font-size-2;
  249. font-weight: bold;
  250. }
  251. }
  252. }
  253. .info-box {
  254. height: 35%;
  255. padding: 30rpx 20rpx;
  256. .info-item-box {
  257. font-size: $uni-title-font-size-1;
  258. line-height: 80rpx;
  259. font-weight: bold;
  260. }
  261. }
  262. .publisher-box {
  263. padding-top: 10rpx;
  264. font-size: $uni-title-font-size-3;
  265. font-weight: bold;
  266. }
  267. }
  268. @mixin backgroundColor($color) {
  269. background: $color;
  270. background: -moz-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  271. background: -webkit-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  272. background: -o-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  273. background: -ms-linear-gradient(49deg, rgba(234,252,254,1) 0%, rgba(255, 255, 255, 1) 49%, $color 100%);
  274. 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');
  275. background-blend-mode: darken;
  276. background-repeat: no-repeat;
  277. background-size: 100% 100%;
  278. }
  279. .blue {
  280. @include backgroundColor(rgb(43, 178, 255));
  281. }
  282. .red {
  283. @include backgroundColor(rgb(255, 53, 54));
  284. }
  285. .green {
  286. @include backgroundColor(rgb(61, 210, 59));
  287. }
  288. </style>