imageData.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="image dis f-wrap j-s">
  3. <view class="item dis f-c a-start mb-2">
  4. <view class="header-title mb-1">
  5. <text>行驶证主页</text>
  6. </view>
  7. <view class="image-view" v-for="(image,index) in imageCollection.imgList1" :key="index">
  8. <image class="file-img" :src="image.previewUrl" mode=""
  9. @tap="previewImage(image.previewUrl,'imgList1')"></image>
  10. <image class="delimgicon" src="/static/icon/delimgicon.png" mode=""
  11. @tap="delCheckImage(image,'carImageListId','imgList1')"></image>
  12. </view>
  13. <view v-if="imageCollection.imgList1.length==0" class="image-file dis f-c a-c j-c "
  14. @tap="chooseImage('C01','carImageListId','imgList1')">
  15. <u-icon name="camera-fill" color="#999" size="28"></u-icon>
  16. <text>上传</text>
  17. </view>
  18. </view>
  19. <view class="item dis f-c a-start mb-2">
  20. <view class="header-title mb-1">
  21. <text>行驶证副页</text>
  22. </view>
  23. <view class="image-view" v-for="(image,index) in imageCollection.imgList2" :key="index">
  24. <image class="file-img" :src="image.previewUrl" mode="" @tap="previewImage($event,'imgList2')"></image>
  25. <image class="delimgicon" src="/static/icon/delimgicon.png" mode=""
  26. @tap="delCheckImage(image,'carImageListId','imgList2')"></image>
  27. </view>
  28. <view v-if="imageCollection.imgList2.length==0" class="image-file dis f-c a-c j-c "
  29. @tap="chooseImage('C01','carImageListId','imgList2')">
  30. <u-icon name="camera-fill" color="#999" size="28"></u-icon>
  31. <text>上传</text>
  32. </view>
  33. </view>
  34. <view class="item dis f-c a-start mb-2">
  35. <view class="header-title mb-1">
  36. <text>车主身份证正面</text>
  37. </view>
  38. <view class="image-view" v-for="(image,index) in imageCollection.imgList3" :key="index">
  39. <image class="file-img" :src="image.previewUrl" mode="" @tap="previewImage($event,'imgList3')"></image>
  40. <image class="delimgicon" src="/static/icon/delimgicon.png" mode=""
  41. @tap="delCheckImage(image,'carImageListId','imgList3')"></image>
  42. </view>
  43. <view v-if="imageCollection.imgList3.length==0" class="image-file dis f-c a-c j-c "
  44. @tap="chooseImage('C01','carImageListId','imgList3')">
  45. <u-icon name="camera-fill" color="#999" size="28"></u-icon>
  46. <text>上传</text>
  47. </view>
  48. </view>
  49. <view class="item dis f-c a-start mb-2">
  50. <view class="header-title mb-1">
  51. <text>车主身份证反面</text>
  52. </view>
  53. <view class="image-view" v-for="(image,index) in imageCollection.imgList4" :key="index">
  54. <image class="file-img" :src="image.previewUrl" mode="" @tap="previewImage($event,'imgList4')"></image>
  55. <image class="delimgicon" src="/static/icon/delimgicon.png" mode=""
  56. @tap="delCheckImage(image,'carImageListId','imgList4')"></image>
  57. </view>
  58. <view v-if="imageCollection.imgList4.length==0" class="image-file dis f-c a-c j-c "
  59. @tap="chooseImage('C01','carImageListId','imgList4')">
  60. <u-icon name="camera-fill" color="#999" size="28"></u-icon>
  61. <text>上传</text>
  62. </view>
  63. </view>
  64. <view class="item dis f-c a-start mb-2">
  65. <view class="header-title mb-1">
  66. <text>投保人身份证正面</text>
  67. </view>
  68. <view class="image-view" v-for="(image,index) in imageCollection.imgList5" :key="index">
  69. <image class="file-img" :src="image.previewUrl" mode="" @tap="previewImage($event,'imgList5')"></image>
  70. <image class="delimgicon" src="/static/icon/delimgicon.png" mode=""
  71. @tap="delCheckImage(image,'carImageListId','imgList5')"></image>
  72. </view>
  73. <view v-if="imageCollection.imgList5.length==0" class="image-file dis f-c a-c j-c "
  74. @tap="chooseImage('C01','carImageListId','imgList5')">
  75. <u-icon name="camera-fill" color="#999" size="28"></u-icon>
  76. <text>上传</text>
  77. </view>
  78. </view>
  79. <view class="item dis f-c a-start mb-2">
  80. <view class="header-title mb-1">
  81. <text>投保人身份证反面</text>
  82. </view>
  83. <view class="image-view" v-for="(image,index) in imageCollection.imgList6" :key="index">
  84. <image class="file-img" :src="image.previewUrl" mode="" @tap="previewImage($event,'imgList6')"></image>
  85. <image class="delimgicon" src="/static/icon/delimgicon.png" mode=""
  86. @tap="delCheckImage(image,'carImageListId','imgList6')"></image>
  87. </view>
  88. <view v-if="imageCollection.imgList6.length==0" class="image-file dis f-c a-c j-c "
  89. @tap="chooseImage('C01','carImageListId','imgList6')">
  90. <u-icon name="camera-fill" color="#999" size="28"></u-icon>
  91. <text>上传</text>
  92. </view>
  93. </view>
  94. <view class="item dis f-c a-start mb-2">
  95. <view class="header-title mb-1">
  96. <text>被保人身份证正面</text>
  97. </view>
  98. <view class="image-view" v-for="(image,index) in imageCollection.imgList7" :key="index">
  99. <image class="file-img" :src="image.previewUrl" mode="" @tap="previewImage($event,'imgList7')"></image>
  100. <image class="delimgicon" src="/static/icon/delimgicon.png" mode=""
  101. @tap="delCheckImage(image,'carImageListId','imgList7')"></image>
  102. </view>
  103. <view v-if="imageCollection.imgList7.length==0" class="image-file dis f-c a-c j-c "
  104. @tap="chooseImage('C01','carImageListId','imgList7')">
  105. <u-icon name="camera-fill" color="#999" size="28"></u-icon>
  106. <text>上传</text>
  107. </view>
  108. </view>
  109. <view class="item dis f-c a-start mb-2">
  110. <view class="header-title mb-1">
  111. <text>被保人身份证反面</text>
  112. </view>
  113. <view class="image-view" v-for="(image,index) in imageCollection.imgList8" :key="index">
  114. <image class="file-img" :src="image.previewUrl" mode="" @tap="previewImage($event,'imgList8')"></image>
  115. <image class="delimgicon" src="/static/icon/delimgicon.png" mode=""
  116. @tap="delCheckImage(image,'carImageListId','imgList8')"></image>
  117. </view>
  118. <view v-if="imageCollection.imgList8.length==0" class="image-file dis f-c a-c j-c "
  119. @tap="chooseImage('C01','carImageListId','imgList8')">
  120. <u-icon name="camera-fill" color="#999" size="28"></u-icon>
  121. <text>上传</text>
  122. </view>
  123. </view>
  124. </view>
  125. </template>
  126. <script>
  127. export default {
  128. name: 'name', //插件名称
  129. props: {
  130. imageCollection: {
  131. type: Object,
  132. default: () => {},
  133. },
  134. },
  135. computed: {},
  136. data() {
  137. return {
  138. };
  139. },
  140. methods: {
  141. previewImage(e, imglist) {
  142. console.log(e, );
  143. console.log(imglist);
  144. this.$emit('previewImage', e, imglist)
  145. },
  146. chooseImage(type, imageIdList, imgurl) {
  147. this.$emit('chooseImage', type, imageIdList, imgurl)
  148. },
  149. delCheckImage(e, carImageListId, imgList) {
  150. this.$emit('delCheckImage', e, carImageListId, imgList)
  151. },
  152. }
  153. };
  154. </script>
  155. <!--使用scss,只在本组件生效-->
  156. <style lang="scss" scoped>
  157. .image {
  158. padding: 20rpx;
  159. box-sizing: border-box;
  160. .item {
  161. width: 48%;
  162. .header-title {
  163. font-size: 30rpx;
  164. color: #333;
  165. }
  166. .image-file {
  167. position: relative;
  168. width: 100%;
  169. height: 204rpx;
  170. background: #D9D9D9;
  171. border-radius: 10rpx 10rpx 10rpx 10rpx;
  172. }
  173. .image-view {
  174. position: relative;
  175. width: 100%;
  176. height: 204rpx;
  177. background: #D9D9D9;
  178. border-radius: 10rpx 10rpx 10rpx 10rpx;
  179. .file-img {
  180. width: 100%;
  181. height: 100%;
  182. border-radius: 10rpx 10rpx 10rpx 10rpx;
  183. }
  184. .delimgicon {
  185. width: 40rpx;
  186. height: 40rpx;
  187. position: absolute;
  188. right: 0;
  189. top: 0;
  190. }
  191. }
  192. }
  193. }
  194. </style>