userInfoImage.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. .imageBorder {
  70. border: 2px solid #ddd;
  71. box-sizing: border-box;
  72. padding: 10upx;
  73. }
  74. .cardImages .imgArea {
  75. // width: 100%;
  76. // height: 420rpx;
  77. width: 310rpx;
  78. height: 260upx;
  79. }
  80. .cardImages .imgArea>image {
  81. width: 100%;
  82. height: 100%;
  83. }
  84. </style>