<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.manageMode == 0 ? "平台" : "个体经营者"
                }}</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.provinceName }}{{ ruleForm.ruleForm
                  }}{{ ruleForm.areaName }}{{ 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 v-if="ruleForm.manageMode == 1">
            <el-col :span="8">
              <el-form-item label="经营者名称：">
                <span>{{ ruleForm.operatorName }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="经营者账号：">
                <span>{{ ruleForm.operatorPhone }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
             </el-col>
          </el-row> -->
          <el-row>
            <el-col :span="8">
              <el-form-item label="背景图片：">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="ruleForm.background?.split(';')[0]"
                  :preview-src-list="ruleForm.background?.split(';')"
                >
                </el-image> </el-form-item
            ></el-col>
            <el-col :span="8">
              <el-form-item label="是否开启第三方骑手配送：">
                <span>{{ ruleForm.isThirdPartyDelivery ? "是" : "否" }}</span>
              </el-form-item></el-col
            >
            <el-col :span="8">
              <el-form-item label="营业状态：">
                <span>{{
                  ruleForm.businessStatus == 0 ? "休息" : "经营中"
                }}</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>