Browse Source

存薪宝开关

liyangzhi 4 years ago
parent
commit
b730f0412d
2 changed files with 48 additions and 0 deletions
  1. 4 0
      components/menu/data.js
  2. 44 0
      pages/main/index/cunxinbao.vue

+ 4 - 0
components/menu/data.js

@@ -59,6 +59,10 @@ export default [{
         title: "项目详情",
         path: baseUrl + "project_form",
         hidden: true
+      },
+      {
+        title: "存薪宝",
+        path: baseUrl + "cunxinbao"
       }
     ]
   },

+ 44 - 0
pages/main/index/cunxinbao.vue

@@ -0,0 +1,44 @@
+<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>