ImgView.vue 1.9 KB

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