picDialog.vue 1.1 KB
<template>
  <!-- 查看大图 -->
  <div class="view_picture">
    <el-dialog
      :visible="picVisible"
      @update:visible="$emit('update:picVisible',false)"
      :close-on-click-modal="false"
      :before-close="handleClose"
      title="查看大图"
      append-to-body
      center
    >
      <div class="pic_box">
        <img :src="viwImg" alt />
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {post} from "@/api/http";
export default {
  props: ["picVisible", "id"],
  data() {
    return {
      viwImg: ""
    };
  },
  methods: {
    handleClose: function() {
      localStorage.removeItem("viewPic");
      this.$emit("update:picVisible", false);
    },
    // 职业详情
    getProfessionDetail() {
      let url = "/api/profession/getProfessionDetail/";
      let params = {
        id: this.id
      };
      post(url, params).then(res => {
        this.viwImg = res.profession.thumb
      });
    },
  },
  mounted() {
    this.getProfessionDetail();
  }
};
</script>
<style scoped>
.pic_box {
  margin: 0 auto;
  margin: 25px 0;
}
.pic_box img{
  width:100%;
}
</style>