<template>
  <div class="mainContainer">
    <div class="mainTableTools">
      <el-row>
        <span>存薪宝设置：</span>
        <el-switch v-model="status" active-text="已开启" inactive-text="已关闭" @change="setStatus"></el-switch>
      </el-row>
    </div>
  </div>
</template>

<script>

  export default {
    data() {
      return {
        status: true
      }
    },
    computed: {
      
    },
    mounted() {
      this.getInfo();
    },
    methods: {
      async getInfo() {
        let res = await this.$post("/api/admin/UserFinancial/cunxinbaoInfo");
        if (res && res.status === 1) {
          this.status = res.data.status === 1 ? true : false;
        }
      },
      async setStatus(status) {
        status = status === true ? 1 : 0;
        await this.$post("/api/admin/UserFinancial/cunxinbaoSet", {status: status});
      },

    }
  };
</script>

<style scoped>
  
</style>