<template>
  <div class="cmain">
    <div class="bos">
      <el-form ref="user" disabled :model="user" label-width="120px">
        <el-form-item label="用户姓名">
          <span class="pon" @click="info()">{{ user.name }}</span>
        </el-form-item>
        <el-form-item label="充值方式">
          <el-input value="微信充值" />
        </el-form-item>
      </el-form>
      <el-form ref="form" disabled :model="form" :rules="rules" label-width="120px">
        <el-form-item label="充值金额" prop="money">
          <el-input type="number" v-model="form.money">
            <template slot="append">元</template>
          </el-input>
        </el-form-item>
        <el-form-item label="充值状态">
          <el-input :value="form.state == 0 ? '未支付' : '充值成功'" />
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import info from '@/views/work/user/edit';
export default {
  data() {
    return {
      user: {},
      form: {},
      rules: {}
    };
  },
  props: {
    param: {
      type: Object,
      default: () => {
        return {};
      }
    },
    layerid: {
      type: String
    }
  },
  mounted() {
    if (this.param.id) {
      this.ajax({ url: '/work/pay/detail/' + this.param.id }).then((response) => {
        this.form = response.data.pay;
        this.user = response.data.user;
      });
    }
  },
  methods: {
    info() {
      this.iframe({ obj: info, param: { id: this.user.id, detail: true }, title: '用户详情', width: '55%', height: '65%' });
    }
  }
};
</script>
