<template>
  <div>
    <obj-modal
      ref="modal"
      labelWidth="150px"
      :modalConfig="modalConfig"
      :modalData="modalData"
      :modalHandles="modalHandles"
    >
      <div slot="dialog__content">
        <el-form
          :model="ruleForm"
          ref="ruleForm"
          label-width="150px"
          class="demo-ruleForm"
        >
          <el-row>
            <el-col :span="8">
              <el-form-item label="摊位名称：">
                <span>{{ ruleForm.name }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="所在菜市场：">
                <span>{{ ruleForm.marketName }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="状态：">
                <span>{{ ruleForm.status == 0 ? "禁用" : "启用" }}</span>
              </el-form-item></el-col
            >
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="地址：">
                <span>{{ ruleForm.address }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="经度：">
                <span>{{ ruleForm.longitude }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="纬度：">
                <span>{{ ruleForm.latitude }}</span>
              </el-form-item></el-col
            >
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="营业执照：">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="ruleForm?.license"
                  :preview-src-list="[ruleForm.license]"
                >
                </el-image> </el-form-item
            ></el-col>
            <el-col :span="8">
              <el-form-item label="身份证人像面：">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="ruleForm.idCardFace"
                  :preview-src-list="[ruleForm.idCardFace]"
                >
                </el-image> </el-form-item
            ></el-col>
            <el-col :span="8">
              <el-form-item label="身份证国徽面：">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="ruleForm.idCardBadge"
                  :preview-src-list="[ruleForm.idCardBadge]"
                >
                </el-image> </el-form-item
            ></el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="店铺照片：">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="ruleForm.imgs?.split(';')[0]"
                  :preview-src-list="ruleForm.imgs?.split(';')"
                >
                </el-image> </el-form-item
            ></el-col>
            <el-col :span="8">
              <el-form-item label="是否自动营业：">
                <span>{{ ruleForm.isAutoBusiness ? "是" : "否" }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="联系电话：">
                <span>{{ ruleForm.contactPhone }}</span>
              </el-form-item></el-col
            >
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="经营状态：">
                <span>{{
                  ruleForm.businessStatus == 0 ? "休息" : "经营中"
                }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="评分：">
                <span>{{ ruleForm.score }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="收藏数量：">
                <span>{{ ruleForm.collectCount }}</span>
              </el-form-item></el-col
            >
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="点赞数量：">
                <span>{{ ruleForm.likeItCount }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="加入时间：">
                <span>{{ ruleForm.createTime }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <!-- <el-form-item label="下单时间：">
                <span>{{ ruleForm.createTime }}</span>
              </el-form-item> -->
            </el-col>
          </el-row>
        </el-form>
      </div>
      <!-- 选择商品 -->
    </obj-modal>
  </div>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
export default {
  components: {},
  props: {},
  data() {
    return {
      isAdd: true,
      //表格属性
      modalConfig: {
        title: "订单详情",
        show: false,
        width: "1200px",
        fullscreen: true,
      },
      modalData: {},
      ruleForm: {},
      tableData: [],
    };
  },
  watch: {
    // "modalConfig.show"(newVal) {
    //   if (newVal) {
    //     //关闭弹窗清空校验
    //     setTimeout(() => {
    //       this.$refs.ruleForm.resetFields();
    //     });
    //   }
    // },
  },
  methods: {
    queryTableData(pageNo, pageSize) {},
    toggle(e) {
      if (this.modalConfig.show == false) {
        this.modalConfig.show = true;
      } else {
        this.modalConfig.show = false;
      }
      if (e) {
        this.init(cloneDeep(e.row));
      }
      return {
        add: () => {
          this.modalConfig.title = "店铺详情";
          this.isAdd = true;
        },
        update: () => {
          this.modalConfig.title = "店铺详情";
          this.isAdd = false;
        },
      };
    },
    init(row) {
      console.log(row);
      this.ruleForm = row;
    },
    handleSelectionChange(e) {
      console.log(e);
    },
    getRefundStatus(val) {
      if (val == 0) {
        return "正常";
      } else if (val == 1) {
        return "退款中";
      } else if (val == 2) {
        return "完全退款";
      } else if (val == 3) {
        return "部分退款";
      } else if (val == 4) {
        return "拒绝用户退款";
      } else if (val == -1) {
        return "退款失败";
      } else if (val == -2) {
        return "用户申请退款中";
      }
    },
  },
  computed: {
    modalHandles() {
      return [
        {
          label: "关闭",
          handle: () => {
            this.toggle();
          },
        },
        // {
        //   label: "确认",
        //   type: "primary",
        //   // submit: true,
        //   handle: () => {
        //   },
        // },
      ];
    },
  },
  asyncComputed: {},
};
</script>
<style lang="scss" scoped>
</style>