<!--
 * @Descripttion: 指标列表
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2020-11-09 09:36:51
 * @LastEditors: 无尘
 * @LastEditTime: 2020-11-09 10:31:17
-->

<template>
  <div class="common-app-right">
    <div>
    </div>

  </div>
</template>

<script>

import fetch from '@/api/target-manage-app.js';
const { getTargetList } = fetch;
// import showMsg from '@/common/js/showmsg.js';
export default {
  name: 'TargetList',
  components: {},
  props: {
    brandId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
      tableData: []
    };
  },
  // 生命周期 - 挂载完成（访问DOM元素）
  mounted() {
    const that = this;
    that.$emit('showTab', '/target-list');
    if (!!that.brandId) {
      that.getData();
    }
  },
  // methods
  methods: {
    /**
     * @description: 获取会员卡数据
     * @author: 无尘
     */
    getData() {
      const that = this;
      const para = {
        wxEnterpriseId: that.wxEnterpriseId,
        enterpriseId: that.brandId
      };
      getTargetList(para, { headers: { sign: that.brandId } })
        .then(res => {
          that.tableData = res.result || [];
        })
        .catch(function(error) {

        });
    },

  },
  watch: {
    brandId(val) {
      const that = this;
      if (val) {
        that.getData();
      }
    }
  }
};
</script>
<style lang='less' scoped>
  .font-22 {
    font-size: 22px;
  }
  .common-bottom-border {
    cursor: pointer;
    padding-bottom: 2px;
    border-bottom: 1px dashed #2f54eb;
    &.table-title {
      font-size: 14px;
      line-height: 20px;
      font-weight: 600;
      color: #303133;
    }
  }
</style>
