userInfoImage.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <service-widget @btnClick="btn_click"></service-widget>
  5. <public-module></public-module>
  6. <view class="IDcardInfo p-3 my-3" style="background-color: #FFFFFF;">
  7. <view class="cardImages d-flex j-sb">
  8. <view>
  9. <view class="imgArea" :class="(IdCardBefore=='')?'idCardBefore':'imageBorder'">
  10. <template v-if="IdCardBefore!=''">
  11. <image :src="IdCardBefore" mode="aspectFill"></image>
  12. </template>
  13. </view>
  14. <view class="d-flex a-center j-center mt-2 font-weight main-text-color">身份证人像面</view>
  15. </view>
  16. <view>
  17. <view class="imgArea" :class="(IdCardAfter=='')?'idCardAfter':'imageBorder'">
  18. <template v-if="IdCardAfter!=''">
  19. <image :src="IdCardAfter" mode="aspectFill"></image>
  20. </template>
  21. </view>
  22. <view class="d-flex a-center j-center mt-2 font-weight main-text-color">身份证国徽面</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. mapState
  31. } from "vuex"
  32. export default {
  33. data() {
  34. return {
  35. IdCardBefore: "",
  36. IdCardAfter: "",
  37. }
  38. },
  39. computed: {
  40. ...mapState(['userInfo']),
  41. },
  42. onLoad() {
  43. this.$http.get('/insTaskImage/findById?imgtype=T1&taskid=' + this.userInfo.sysUser.id).then(res => {
  44. if (res.data.imgList.length > 0) {
  45. this.IdCardBefore = res.data.imgList[0];
  46. } else {
  47. this.IdCardBefore = '';
  48. }
  49. })
  50. this.$http.get('/insTaskImage/findById?imgtype=T2&taskid=' + this.userInfo.sysUser.id).then(res => {
  51. if (res.data.imgList.length > 0) {
  52. this.IdCardAfter = res.data.imgList[0];
  53. } else {
  54. this.IdCardAfter = '';
  55. }
  56. })
  57. },
  58. methods: {
  59. btn_click() {
  60. uni.navigateTo({
  61. url: '/pages/chat/chat'
  62. })
  63. },
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. @import '@/style/mixin.scss';
  69. .idCardBefore {
  70. background: rgba($themeColor, 0.1) url('/static/image/user/identy2.png') center center no-repeat;
  71. background-size: auto 70%;
  72. padding: 10upx;
  73. box-sizing: border-box;
  74. }
  75. .idCardAfter {
  76. background: rgba($themeColor, 0.1) url('/static/image/user/identy1.png') center center no-repeat;
  77. background-size: auto 70%;
  78. padding: 10upx;
  79. box-sizing: border-box;
  80. }
  81. .imageBorder {
  82. border: 2px solid #ddd;
  83. box-sizing: border-box;
  84. padding: 10upx;
  85. }
  86. .cardImages .imgArea {
  87. // width: 100%;
  88. // height: 420rpx;
  89. width: 310rpx;
  90. height: 260upx;
  91. }
  92. .cardImages .imgArea>image {
  93. width: 100%;
  94. height: 100%;
  95. }
  96. </style>