<template>
  <div >
    <Modal id="guild_water_modal" v-model="isPlatformMd" title="公会流水详情" class-name="vertical-center-modal" :width="900">
      <div style="height:340px;overflow:auto">
        <Table :columns="guildWaterList" border :data="guildWaterData"></Table>
        <div slot="footer"></div>
      </div>
    </Modal>
    <guildSale :isGuildSale.sync="isGuildSale" :gname='gname' :gnum='gnum' :gid='gid'></guildSale>
  </div>
</template>
<script>
import guildSale from "@@/user/guild_sale_detail";
export default {
  name: "platform",
  props: {
    isPlatform: Boolean,
    managerId:Number,
  },
  components:{guildSale},
  data() {
    return {
      isGuildSale:false,
      gname:'',
      gnum:null,
      gid:null,
      guildWaterList: [
        {
          title: "公会名称",
          key: "name"
        },
        {
          title: "总流水",
          render:(h,params)=>{
            return h('span',(Number(params.row.recharge_amount))/100)
          }
        },
        {
          title: '推广员数量',
          key:'channel_num',
          render: (h, params) => {
            if(Number(params.row.channel_num)>0){
              return h('span',{
                class:'a_text',
                on:{
                  click:()=>{
                    this.gname=params.row.name
                    this.gnum=params.row.channel_num
                    this.gid=params.row.id
                    this.isGuildSale=true
                  }
                }
              },params.row.channel_num)
            }else{
              return h('span','0')
            }
          }
        }
      ],
      guildWaterData: []
    };
  },
  computed: {
    isPlatformMd: {
      get(n) {
        if(this.isPlatform){
          this.getBusinessStudio()
        }
        return this.isPlatform;
      },
      set(val) {
        this.$emit("update:isPlatform", val);
      }
    }
  },
  watch: {},
  methods: {
    getBusinessStudio(page=1){
      this.pindex=page
      this.$api.getBusinessStudio({business_id:this.managerId}).then(data =>{
        if(data.code==200){
          this.guildWaterData=data.data
          this.count=data.count
        }
      })
    }
  },
  created() {},
};
</script>
<style lang="less">
#guild_water_modal .ivu-modal-confirm, 
#guild_water_modal .ivu-modal-body{
  padding: 30px 80px 30px 80px!important;
}
#guild_water_modal .ivu-modal-footer{
  display: none
}
#guild_water_modal .ivu-table th{
  color: rgba(96, 122, 149, 1)!important
}
#guild_water_modal .ivu-table td{
  color: rgba(96, 122, 149, 1)!important
}
#guild_water_modal .ivu-modal-header{
  background-color: rgba(52, 64, 78, 1);
  border-radius: 6px 6px 0px 0px;
  font-size:14px;
}
#guild_water_modal .ivu-modal-header-inner{
  font-size:14px;
  color: #fff;
  font-weight:400;
}
</style>


