bindCard.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view class="container">
  3. <!-- 卡片展示区域 -->
  4. <view class="bind-card" style="position: relative; overflow: hidden">
  5. <image class="card-bg-img" src="/static/BCardBand.png"></image>
  6. <view class="card-content" style="margin-top: 27rpx">
  7. <view class="card-content-top">
  8. <view class="card-header">
  9. <image
  10. :src="baseUrl + cardInfo.photoPath"
  11. style="width: 170rpx; height: 220rpx"
  12. mode="aspectFill"
  13. ></image>
  14. </view>
  15. <view class="card-info">
  16. <view class="info-item">
  17. <text class="label">姓&nbsp;&nbsp;&nbsp; 名:</text>
  18. <text class="value">{{ cardInfo.chineseName }}</text>
  19. </view>
  20. <view class="info-item">
  21. <text class="label">性&nbsp;&nbsp;&nbsp; 别:</text>
  22. <text class="value">{{
  23. cardInfo.gender == "0" ? "男" : "女"
  24. }}</text>
  25. </view>
  26. <view class="info-item">
  27. <text class="label">工作单位:</text>
  28. <text class="value">{{ cardInfo.yjrcXianDanWeiZhiWu }}</text>
  29. </view>
  30. <view class="info-item">
  31. <text class="label">证&nbsp;件&nbsp;号:</text>
  32. <text class="value">{{ cardInfo.idNum }}</text>
  33. </view>
  34. <view class="info-item">
  35. <text class="label">有效期至:</text>
  36. <text class="value">{{ cardInfo.cardYouxiaoDate }}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="card-content-bottom">
  41. 中共承德市委人才工作领导小组办公室 制发
  42. </view>
  43. </view>
  44. </view>
  45. <view class="carinfo-content">
  46. <view class="carInfo">
  47. <view
  48. v-if="
  49. cardYouxiaoDate(cardInfo.cardYouxiaoDate) > 0 ||
  50. cardInfo.cardYouxiaoDate == '长期'
  51. "
  52. class="carInfo-carDate"
  53. :style="{
  54. color:
  55. cardInfo.cardYouxiaoDate != '长期' &&
  56. cardYouxiaoDate(cardInfo.cardYouxiaoDate) > 0
  57. ? '#F56C6C'
  58. : '#409EFF',
  59. }"
  60. >
  61. <text style="color: #fff" v-if="cardInfo.cardYouxiaoDate == '长期'">
  62. 长期
  63. </text>
  64. <text style="color: #fff" v-else>已超期</text>
  65. </view>
  66. <view class="carInfo-item">
  67. <view class="carInfo-item-label">卡号:</view>
  68. <view class="carInfo-item-value">{{ cardInfo.cardNumber }}</view>
  69. </view>
  70. <view class="divider"></view>
  71. <view class="carInfo-item">
  72. <view class="carInfo-item-label">类型:</view>
  73. <view class="carInfo-item-value" v-if="cardInfo.cardType == 'A'"
  74. >{{ cardInfo.cardType }}类人才</view
  75. >
  76. <view class="carInfo-item-value" v-else>
  77. {{ cardInfo.bcardType }}类人才
  78. </view>
  79. </view>
  80. <view class="divider"></view>
  81. <view class="carInfo-item">
  82. <view class="carInfo-item-label">状态:</view>
  83. <view
  84. class="carInfo-item-value"
  85. :style="{ color: cardInfo.isZhuxiao == 0 ? '#409EFF' : '#F56C6C' }"
  86. >
  87. <text
  88. style="color: #f56c6c"
  89. v-if="
  90. cardInfo.cardYouxiaoDate != '长期' &&
  91. cardYouxiaoDate(cardInfo.cardYouxiaoDate) > 0
  92. "
  93. >
  94. 已超期
  95. </text>
  96. <text v-else>{{
  97. cardInfo.isZhuxiao == 0 ? "正常" : "已注销"
  98. }}</text>
  99. </view>
  100. </view>
  101. <view class="divider"></view>
  102. <view class="carInfo-item">
  103. <view class="carInfo-item-label">工作单位:</view>
  104. <view class="carInfo-item-value">{{
  105. cardInfo.yjrcXianDanWeiZhiWu
  106. }}</view>
  107. </view>
  108. <view class="divider"></view>
  109. <view class="carInfo-item">
  110. <view class="carInfo-item-label">联系电话:</view>
  111. <view class="carInfo-item-value">{{ cardInfo.shouJiNum }}</view>
  112. </view>
  113. <view class="divider"></view>
  114. <view class="carInfo-item">
  115. <view class="carInfo-item-label">人才类别:</view>
  116. <view class="carInfo-item-value">{{ cardInfo.renCaiType }}</view>
  117. </view>
  118. <view class="divider"></view>
  119. <view class="carInfo-item">
  120. <view class="carInfo-item-label">人才称号:</view>
  121. <view class="carInfo-item-value">{{ cardInfo.renCaiChengHao }}</view>
  122. </view>
  123. <view class="divider"></view>
  124. <view class="carInfo-item">
  125. <view
  126. class="carInfo-item-label"
  127. :style="{
  128. color:
  129. cardInfo.cardYouxiaoDate != '长期' &&
  130. cardYouxiaoDate(cardInfo.cardYouxiaoDate) > 0
  131. ? 'red'
  132. : '',
  133. }"
  134. >有效期至:</view
  135. >
  136. <view
  137. class="carInfo-item-value"
  138. :style="{
  139. color:
  140. cardInfo.cardYouxiaoDate != '长期' &&
  141. cardYouxiaoDate(cardInfo.cardYouxiaoDate) > 0
  142. ? 'red'
  143. : '',
  144. }"
  145. >{{ cardInfo.cardYouxiaoDate }}</view
  146. >
  147. </view>
  148. </view>
  149. </view>
  150. <!-- 绑定按钮 -->
  151. </view>
  152. </template>
  153. <script>
  154. export default {
  155. data() {
  156. return {
  157. cardInfo: {
  158. photoPath: "",
  159. chineseName: "",
  160. gender: "",
  161. yjrcXianDanWeiZhiWu: "",
  162. idNum: "",
  163. cardYouxiaoDate: "",
  164. cardNumber: "",
  165. cardType: "",
  166. bcardType: "",
  167. isZhuxiao: "",
  168. renCaiType: "",
  169. renCaiChengHao: "",
  170. shouJiNum: "",
  171. },
  172. baseUrl: getApp().globalData.baseUrl,
  173. };
  174. },
  175. onLoad(options) {
  176. this.getCardInfo(options);
  177. },
  178. methods: {
  179. cardYouxiaoDate(date) {
  180. return new Date().getTime() - new Date(date).getTime();
  181. },
  182. getCardInfo(options) {
  183. uni.showLoading({
  184. title: "加载中",
  185. });
  186. uni.request({
  187. url:
  188. this.baseUrl +
  189. "/wxsfrz/selRenCai?name=" +
  190. options.name +
  191. "&sfzh=" +
  192. options.sfzh,
  193. method: "POST",
  194. success: ({ data }) => {
  195. this.cardInfo = data.rclkTalentList;
  196. uni.hideLoading();
  197. },
  198. });
  199. },
  200. },
  201. };
  202. </script>
  203. <style lang="scss" scoped>
  204. .card-bg-img {
  205. position: absolute;
  206. width: 100%;
  207. height: 100%;
  208. }
  209. .carInfo {
  210. overflow: hidden;
  211. position: relative;
  212. .carInfo-carDate {
  213. display: inline-block;
  214. position: absolute;
  215. top: 6px;
  216. right: -34px;
  217. width: 200rpx;
  218. height: 50rpx;
  219. font-size: 24rpx;
  220. color: #fff;
  221. background: #f56c6c;
  222. text-align: center;
  223. line-height: 50rpx;
  224. transform: rotate(45deg);
  225. }
  226. }
  227. .card-content-bottom {
  228. font-size: 25rpx;
  229. color: #fff;
  230. margin-top: 20rpx;
  231. text-align: center;
  232. width: 100%;
  233. }
  234. .card-content-top {
  235. display: flex;
  236. align-items: center;
  237. .card-header {
  238. margin-right: 50rpx;
  239. }
  240. }
  241. .divider {
  242. margin: 20rpx 0 25rpx;
  243. width: 100%;
  244. height: 1rpx;
  245. background: #e1edf9;
  246. }
  247. .carInfo-item-label {
  248. font-size: 28rpx;
  249. color: #333;
  250. }
  251. .carInfo-item {
  252. padding: 0 10rpx;
  253. display: flex;
  254. justify-content: space-between;
  255. align-items: center;
  256. }
  257. .carInfo-item-value {
  258. font-size: 26rpx;
  259. color: #333;
  260. width: 471rpx;
  261. text-align: right;
  262. }
  263. .carInfo {
  264. margin: 30rpx auto 0;
  265. padding: 60rpx 25rpx;
  266. border-radius: 7rpx;
  267. background: #fff;
  268. box-shadow: #959da533 0px 8px 24px;
  269. }
  270. .container {
  271. min-height: 100vh;
  272. background: linear-gradient(180deg, #0066ff 0%, #4080ff 8%, #ffffff 50%);
  273. padding: 30rpx;
  274. padding-top: 50rpx;
  275. overflow: hidden;
  276. }
  277. .bind-card {
  278. height: 391rpx;
  279. margin: 20rpx auto 30rpx;
  280. border-radius: 10rpx;
  281. overflow: hidden;
  282. position: relative;
  283. .card-content {
  284. box-shadow: #959da533 0px 8px 24px;
  285. position: relative;
  286. padding: 30rpx;
  287. height: 100%;
  288. padding-left: 30rpx;
  289. margin-bottom: 30rpx;
  290. .card-title {
  291. font-size: 38rpx;
  292. color: black;
  293. margin-bottom: 8rpx;
  294. }
  295. .card-issuer {
  296. font-size: 22rpx;
  297. color: #666;
  298. margin-bottom: 30rpx;
  299. }
  300. .card-info {
  301. .info-item {
  302. display: flex;
  303. margin-bottom: 20rpx;
  304. font-size: 22rpx;
  305. letter-spacing: 2rpx;
  306. .label {
  307. color: black;
  308. width: 110rpx;
  309. }
  310. .value {
  311. color: #333;
  312. flex: 1;
  313. }
  314. }
  315. }
  316. }
  317. }
  318. </style>