<template>
  <div class="subPage">
    <div class="inputCardNo flex-h">
      <div class="flex-item">
        <div>
          <el-input
            placeholder="请输入VIP卡号"
            v-model="postData.CardNo"
            clearable>
          </el-input>
        </div>
      </div>
      <el-button type="success" @click='activateVip'>激活</el-button>
    </div>
    <el-dialog
      title="VIP卡激活"
      :visible.sync="centerDialogVisible"
      width="30%"
      center>
      <div>
        <ul class="activateList">
          <li class="flex-h">
            <span>卡号：</span>
            <div class="flex-item">
              <div>
                <span>{{activateData.CardNo}}</span>
              </div>
            </div>
          </li>
          <li class="flex-h">
            <span>金额：</span>
            <div class="flex-item">
              <div>
                <span>{{activateData.Price}}</span>
              </div>
            </div>
          </li>
          <li class="flex-h">
            <span>销售：</span>
            <div class="flex-item" style="margin-right:10px;">
              <div>
                <el-input
                  placeholder="请输入销售手机号"
                  v-model="sellerPhone"
                  clearable>
                </el-input>
              </div>
            </div>
            <el-button type="success" @click='searchSeller'>查询</el-button>
          </li>
          <li class="flex-h">
            <span>销售姓名：</span>
            <div class="flex-item">
              <div>
                <span>{{activateData.SellerName}}</span>
              </div>
            </div>
          </li>
          <li class="flex-h">
            <span>绑定用户：</span>
            <div class="flex-item">
              <div>
                <el-input
                  placeholder="请输入手机号"
                  v-model="activateData.UserPhone"
                  clearable>
                </el-input>
              </div>
            </div>
          </li>
          <li class="flex-h">
            <span>用户姓名：</span>
            <div class="flex-item">
              <div>
                <el-input
                  placeholder="请输入真实姓名"
                  v-model="activateData.UserName"
                  clearable>
                </el-input>
              </div>
            </div>
          </li>
        </ul>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="centerDialogVisible = false">激 活</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: '',
  data () {
    return {
      centerDialogVisible: true,
      postData: {
        CardNo: '', // 卡号
      },
      activateData: {
        CardNo: '111111111', // 卡号
        Price: '1000', // 金额
        SellerName: '', // 销售姓名
        CaseName: 'xxx', // 案场名称
        UserPhone: '', // 用户手机号
        UserName: '', // 用户姓名
      },
      sellerPhone: '', // 销售手机号
    }
  },
  computed: {
    ...mapState({
      cases: x => x.app.cases.list,
      defaultCaseId: x => x.app.cases.default,
      OrgId: x => x.app.user.OrgId,
    }),
    CaseId: {
      get () {
        return this.postData.CaseId === '' ? this.defaultCaseId || '' : this.postData.CaseId
      },
      set (val) {
        this.postData.CaseId = val
      }
    }
  },
  created () { },
  components: {},
  methods: {
    searchSeller () { // 查询销售
    },
    activateVip () { // 激活vip
      this.centerDialogVisible = true
    },
  },
  mounted () { }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.subPage {
  .inputCardNo {
    width: 400px;
    margin: 40px auto 0;
    white-space: nowrap;
    > div {
      margin-right: 20px;
    }
  }
  .activateList {
    > li {
      padding: 10px 0;
      span {
        line-height: 40px;
      }
      > span {
        min-width: 80px;
      }
    }
  }
}
</style>
