ImgView.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div>
  3. <div class="cameraDiv1" @click="uploadImgView">
  4. <div class="imgPre">
  5. <van-icon
  6. class="photobrowsing"
  7. name="expand-o"
  8. size="22px"
  9. color="#1989fa"
  10. v-if="imgArr != ''" />
  11. <img :src="imgArr" alt="" v-if="imgArr != ''" />
  12. </div>
  13. <p class="coverImg">
  14. <van-icon class="photo ico" name="photograph" size="16px" color="#969696">{{
  15. imgText
  16. }}</van-icon>
  17. </p>
  18. </div>
  19. <p style="text-align: center">{{ imgText }}</p>
  20. </div>
  21. </template>
  22. <script>
  23. import { ImagePreview } from 'vant';
  24. import { uploadImage } from '@/api/index';
  25. export default {
  26. name: 'uploadImg',
  27. props: {
  28. uploadid: {
  29. type: String,
  30. default: '',
  31. },
  32. imgText: {
  33. type: String,
  34. default: '',
  35. },
  36. visitsId: {
  37. type: String,
  38. default: '',
  39. },
  40. taskId: {
  41. type: String,
  42. default: '',
  43. },
  44. collectionId: {
  45. type: String,
  46. default: '',
  47. },
  48. type: {
  49. type: Number,
  50. default: 1,
  51. },
  52. imgArr: {
  53. type: String,
  54. default: '',
  55. },
  56. },
  57. data() {
  58. return {
  59. shows: false,
  60. url: '',
  61. };
  62. },
  63. methods: {
  64. uploadImgView() {
  65. this.$toast('请输入名称!');
  66. },
  67. },
  68. };
  69. </script>
  70. <style scoped>
  71. .cameraDiv1 {
  72. position: relative;
  73. height: 164px;
  74. width: 100%;
  75. }
  76. .cameraDiv1 img {
  77. position: absolute;
  78. width: 100%;
  79. display: block;
  80. height: 164px;
  81. top: 0;
  82. }
  83. .imgPre {
  84. height: 164px;
  85. width: 100%;
  86. background-color: white;
  87. border-radius: 6px;
  88. overflow: hidden;
  89. }
  90. .photos1 {
  91. margin: 70px auto;
  92. left: 50%;
  93. margin-left: -14px;
  94. }
  95. .photobrowsing {
  96. position: absolute;
  97. padding: 4px;
  98. right: 0;
  99. top: 0;
  100. z-index: 99;
  101. background-color: rgba(255, 255, 255, 0.8);
  102. border-bottom-left-radius: 3px;
  103. border-top-left-radius: 3px;
  104. }
  105. .coverImg {
  106. text-align: center;
  107. position: absolute;
  108. top: 0;
  109. left: 0;
  110. height: 164px;
  111. width: 100%;
  112. }
  113. .coverImg .ico {
  114. top: 42%;
  115. }
  116. </style>