<template>
  <el-dialog
    :title="title"
    :visible.sync="dialogFormVisible"
    width="500px"
    :close-on-click-modal="false"
    @close="close"
  >
    <el-form ref="form" label-width="120px" class="list">
      <el-form-item label="用户名">
        <span>{{ refund.userName }}</span>
      </el-form-item>
      <el-form-item label="店铺名称">
        <span>{{ refund.merchantsName }}</span>
      </el-form-item>
      <el-form-item label="联系人">
        <span>{{ refund.person }}</span>
      </el-form-item>
      <el-form-item label="联系方式">
        <span>{{ refund.tel }}</span>
      </el-form-item>
      <el-form-item label=" 公司地址">
        <span>{{ refund.address }}</span>
      </el-form-item>
      <el-form-item label="营业执照">
        <template v-if="refund.businessLicense.length>0">
          <div v-for="(item,index) in refund.businessLicense" :key="index">
            <img :src="item.url">
          </div>
        </template>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import {
  getAccessToken
} from '@/utils/accessToken'
export default {
  name: '',
  data() {
    return {
      form: {
        region: '',
        desc: '',
        name: '',
        number: ''
      },
      refund: {
        userName: '',
        password: '',
        password1: '',
        address: '',
        merchantsName: '',
        person: '',
        tel: '',
        sex: '',
        businessLicense: []
      },
      title: '',
      dialogFormVisible: false,
      row: ''
    }
  },
  created() {
    if (JSON.parse(getAccessToken())) {
      this.refund = JSON.parse(getAccessToken())
    }
  },
  methods: {
    showEdit(row) {
      this.title = '查看详情'
      this.dialogFormVisible = true
    },
    close() {
      this.$refs['form'].resetFields()
      this.form = this.$options.data().form
      this.dialogFormVisible = false
    }
  }
}
</script>
<style lang="scss" scoped>
.el-dialog{
  .el-form{
    img{
      width: 40px;
      height: 40px;
      border-radius: 50%;
      vertical-align: middle;
      margin-left: 10px;
    }
  }
}
</style>
