<template>
  <div>
    <div class="cameraDiv1" @click="uploadImgView">
      <div class="imgPre">
        <van-icon
          class="photobrowsing"
          name="expand-o"
          size="22px"
          color="#1989fa"
          v-if="imgArr != ''" />
        <img :src="imgArr" alt="" v-if="imgArr != ''" />
      </div>
      <p class="coverImg">
        <van-icon class="photo ico" name="photograph" size="16px" color="#969696">{{
          imgText
        }}</van-icon>
      </p>
    </div>
    <p style="text-align: center">{{ imgText }}</p>
  </div>
</template>

<script>
import { ImagePreview } from 'vant';
import { uploadImage } from '@/api/index';

export default {
  name: 'uploadImg',
  props: {
    uploadid: {
      type: String,
      default: '',
    },
    imgText: {
      type: String,
      default: '',
    },
    visitsId: {
      type: String,
      default: '',
    },
    taskId: {
      type: String,
      default: '',
    },
    collectionId: {
      type: String,
      default: '',
    },
    type: {
      type: Number,
      default: 1,
    },
    imgArr: {
      type: String,
      default: '',
    },
  },
  data() {
    return {
      shows: false,
      url: '',
    };
  },
  methods: {
    uploadImgView() {
      this.$toast('请输入名称！');
    },
  },
};
</script>

<style scoped>
.cameraDiv1 {
  position: relative;
  height: 164px;
  width: 100%;
}

.cameraDiv1 img {
  position: absolute;
  width: 100%;
  display: block;
  height: 164px;
  top: 0;
}

.imgPre {
  height: 164px;
  width: 100%;
  background-color: white;
  border-radius: 6px;
  overflow: hidden;
}

.photos1 {
  margin: 70px auto;
  left: 50%;
  margin-left: -14px;
}

.photobrowsing {
  position: absolute;
  padding: 4px;
  right: 0;
  top: 0;
  z-index: 99;
  background-color: rgba(255, 255, 255, 0.8);
  border-bottom-left-radius: 3px;
  border-top-left-radius: 3px;
}

.coverImg {
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  height: 164px;
  width: 100%;
}

.coverImg .ico {
  top: 42%;
}
</style>
