identity-item.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <view class="identity-box">
  3. <view class="identity-item">
  4. <view class="item-img" @click="previewImage(identity_one)">
  5. <image v-if="identity_one" :src="identity_one" mode="aspectFill"></image>
  6. <image v-else src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/app-serve/2023-4-16/gk2xruydmj.png" mode="aspectFill"></image>
  7. <view class="img-text">身份证正面</view>
  8. </view>
  9. <view class="item-img" @click="previewImage(identity_two)">
  10. <image v-if="identity_two" :src="identity_two" mode="aspectFill"></image>
  11. <image v-else src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/app-serve/2023-4-16/gk2xsr9ud6.png" mode="aspectFill"></image>
  12. <view class="img-text">身份证反面</view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: "identity-item",
  20. components: {},
  21. props: {
  22. 'identityOne':{
  23. default:'',
  24. },
  25. 'identityTwo':{
  26. default:'',
  27. },
  28. },
  29. data() {
  30. return {
  31. identity_one:'',
  32. identity_two:'',
  33. }
  34. },
  35. watch: {
  36. 'identityOne':function (){
  37. this.setIdentityOne()
  38. },
  39. 'identityTwo':function (){
  40. this.setIdentityTwo()
  41. }
  42. },
  43. mounted() {
  44. this.setIdentityOne()
  45. this.setIdentityTwo()
  46. },
  47. methods: {
  48. previewImage(img){
  49. this.$emit('onShowImg',img)
  50. },
  51. setIdentityOne(){
  52. if(this.identityOne){
  53. if(this.identityOne!==this.identity_one){
  54. this.identity_one=this.identityOne
  55. }
  56. }
  57. },
  58. setIdentityTwo(){
  59. if(this.identityTwo){
  60. if(this.identityTwo!==this.identity_two){
  61. this.identity_two=this.identityTwo
  62. }
  63. }
  64. },
  65. closePopup(e){
  66. if(e.show===false){
  67. this.isUploading=false
  68. }
  69. },
  70. }
  71. }
  72. </script>
  73. <style scoped lang="scss">
  74. @import "static/css/common/wh-common";
  75. .identity-box{
  76. .identity-title{
  77. padding: 20rpx 0;
  78. font-size: 24rpx;
  79. color: #999;
  80. font-weight: 400;
  81. }
  82. .identity-item{
  83. display: flex;
  84. justify-content: space-between;
  85. padding-bottom: 20rpx;
  86. .item-img{
  87. width: calc(50% - 9rpx);
  88. image{
  89. width:100%;
  90. height: 190rpx;
  91. border-radius: 6rpx;
  92. }
  93. .img-text{
  94. margin-top: 19rpx;
  95. text-align: center;
  96. color: #232A35;
  97. font-size: 24rpx;
  98. font-weight: 400;
  99. }
  100. }
  101. }
  102. }
  103. </style>