userInfoImage.vue 2.3 KB

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