<template>

    <el-form
        ref="formRef"
        :model="form"
        label-width="100px"
        style="display: flex; "
    >
<!--      <el-form-item label="门店头像" prop="businessAvatar">-->
<!--        {{form.businessAvatar}}-->
<!--      </el-form-item>-->

      <div style="flex: 1">
        <el-form-item label="门店名" prop="businessName">
          <el-input v-model="form.businessName" />
        </el-form-item>
        <el-form-item label="营业执照" prop="license">
          <img :src="form.license" width="80" height="80"/>
        </el-form-item>
        <el-form-item label="店主名" prop="shopkeeper">
          <el-input v-model="form.shopkeeper" />
        </el-form-item>
        <el-form-item label="门店手机号" prop="businessPhone">
          <el-input v-model="form.businessPhone" />
        </el-form-item>

      </div>
      <div style="flex: 1">
        <el-form-item label="身份证" prop="frontIdCard" style="display: flex">
          <div style="flex: 1">
            <div>
              <img :src="form.frontIdCard" width="80" height="80"/>
            </div>
            <div>
              正面
            </div>
          </div>
          <div style="flex: 1;">
            <div>
              <img :src="form.backIdCard" width="80" height="80"/>
            </div>
            <div>
              反面
            </div>
          </div>
        </el-form-item>
<!--        <el-form-item label="身份证反面" prop="backIdCard">-->

<!--        </el-form-item>-->
        <el-form-item label="店铺地址" prop="address">
          <el-input v-model="form.address" />
        </el-form-item>
        <el-form-item label="银行卡号" prop="bankCard">
          <el-input v-model="form.bankCard" show-password/>
        </el-form-item>
      </div>
    </el-form>
  <div style="margin-top: 100px">
    <div style="margin: 10px">  是否审核通过</div>
    <div style="display: flex;">
      <div style="margin-left: 50px;" > <el-button   type="danger" > 审核通过</el-button></div>
      <div style="margin-left: 20px"><el-button type="danger" plain>审核不通过</el-button></div>
    </div>
  </div>

<!--      <el-form-item label="门店简介" prop="businessProfile">-->
<!--        {{form.businessProfile}}-->
<!--      </el-form-item>-->
<!--      <el-form-item label="商家相册" prop="businessImages">-->
<!--        {{form.businessImages}}-->
<!--      </el-form-item>-->
<!--      <el-form-item label="分类ID" prop="categoryId">-->
<!--        {{form.categoryId}}-->
<!--      </el-form-item>-->


<!--      <el-form-item label="开始营业时间" prop="startBusiness">-->
<!--        {{form.startBusiness}}-->
<!--      </el-form-item>-->
<!--      <el-form-item label="结束营业时间" prop="endBusiness">-->
<!--        {{form.endBusiness}}-->
<!--      </el-form-item>-->
<!--      <el-form-item label="创建时间" prop="createTime">-->
<!--        {{form.createTime}}-->
<!--      </el-form-item>-->

    <!--    <template #footer>-->
    <!--<span class="dialog-footer">-->
    <!--<el-button @click="handleClose">取消</el-button>-->
    <!--<el-button type="primary" @click="handleConfirm">确认</el-button>-->
    <!--</span>-->
    <!--    </template>-->

</template>
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import axios from "@/util/axios";
import { ElMessage } from "element-plus";
import {useRoute} from "vue-router"


let params=useRoute().query
const form=ref({
  id:null,
  address: "",
  backIdCard: "",
  bankCard: "",
  businessAvatar: "",
  businessImages: "",
  businessName: "",
  businessPhone: "",
  businessProfile: "",
  categoryId: null,
  endBusiness: "",
  frontIdCard: "",
  license: "",
  shopkeeper: "",
  startBusiness: "",
  createTime:""
})

const formRef=ref(null);
const initFormData=async()=>{

 //  console.log(params.id)
  const res=await axios.post("business/list/page",{id: params.id})
   console.log(res.data.data)
   form.value=res.data.data.records[0];
   //form.value=res.data.data;
}
 initFormData();
// watch(
//
//     ()=>{
//       //  console.log("id="+props.bussinessId);
//
//      // console.log(id.value)
//       initFormData(id)
//     }
// )

</script>
<style scoped>

</style>