creditCard.vue 6.0 KB

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