guhongwei 2 years ago
parent
commit
6c4bb71222

+ 15 - 0
src/router/module/app.js

@@ -74,4 +74,19 @@ export default [
     meta: { title: '信息管理', is_filter: false },
     component: () => import('@/views/app/users/add.vue'),
   },
+  {
+    path: '/app/vip/setting',
+    meta: { title: 'vip设置', is_filter: false },
+    component: () => import('@/views/app/vip/setting/index.vue'),
+  },
+  {
+    path: '/app/vip/setting/add',
+    meta: { title: '信息管理', is_filter: false },
+    component: () => import('@/views/app/vip/setting/add.vue'),
+  },
+  {
+    path: '/app/vip/money',
+    meta: { title: '消费记录', is_filter: false },
+    component: () => import('@/views/app/vip/money/index.vue'),
+  },
 ];

+ 4 - 0
src/store/index.js

@@ -27,6 +27,8 @@ import scenetype from '@common/src/store/app/scenetype';
 import scenedata from '@common/src/store/app/scenedata';
 import videos from '@common/src/store/app/videos';
 import discuss from '@common/src/store/app/discuss';
+import vipsetting from '@common/src/store/app/vipsetting';
+import moneylog from '@common/src/store/app/moneylog';
 
 Vue.use(Vuex);
 
@@ -56,5 +58,7 @@ export default new Vuex.Store({
     scenedata,
     videos,
     discuss,
+    vipsetting,
+    moneylog,
   },
 });

+ 13 - 0
src/views/app/users/add.vue

@@ -7,6 +7,9 @@
         </el-col>
         <el-col :span="24" class="two">
           <data-form :fields="fields" :form="form" :rules="{}" @save="toSave" :span="24">
+            <template #is_vip>
+              <el-option v-for="i in isnoList" :key="i._id" :label="i.label" :value="i.value"></el-option>
+            </template>
             <template #gender>
               <el-option v-for="i in genderList" :key="i._id" :label="i.label" :value="i.value"></el-option>
             </template>
@@ -36,11 +39,16 @@ export default {
         { label: '联系电话', model: 'phone' },
         { label: '性别', model: 'gender', type: 'select' },
         { label: '头像', model: 'logo_url', custom: true },
+        { label: '是否为vip', model: 'is_vip', type: 'select' },
+        { label: 'vip开始时间', model: 'vip_start_time', type: 'datetime' },
+        { label: 'vip结束时间', model: 'vip_end_time', type: 'datetime' },
       ],
       form: {},
       // 字典
       // 性别
       genderList: [],
+      // 是否
+      isnoList: [],
     };
   },
   async created() {
@@ -73,6 +81,11 @@ export default {
       if (this.$checkRes(res)) {
         this.$set(this, `genderList`, res.data);
       }
+      // 是否
+      res = await this.dQuery({ type: 'is_no' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isnoList`, res.data);
+      }
     },
     // 返回
     toBack() {

+ 26 - 1
src/views/app/users/index.vue

@@ -3,7 +3,11 @@
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col :span="24" class="one">
-          <c-search :is_search="true" :fields="fields" @search="btSearch"> </c-search>
+          <c-search :is_search="true" :fields="fields" @search="btSearch">
+            <template #is_vip>
+              <el-option v-for="i in isnoList" :key="i._id" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </c-search>
         </el-col>
         <el-col :span="24" class="thr">
           <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @edit="toEdit" @del="toDel"> </data-table>
@@ -28,6 +32,18 @@ export default {
       searchInfo: {},
       fields: [
         { label: '序号', options: { type: 'index' } },
+        {
+          label: '是否VIP',
+          model: 'is_vip',
+          type: 'select',
+          format: (i) => {
+            let data = this.isnoList.find((r) => r.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
+
         { label: '账号', model: 'account', isSearch: true },
         { label: '昵称', model: 'nick_name', isSearch: true },
         { label: '联系电话', model: 'phone', isSearch: true },
@@ -40,6 +56,8 @@ export default {
             else return '暂无';
           },
         },
+        { label: 'vip开始时间', model: 'vip_start_time' },
+        { label: 'vip结束时间', model: 'vip_end_time' },
       ],
       opera: [
         { label: '修改', method: 'edit' },
@@ -50,6 +68,8 @@ export default {
       // 字典
       // 性别
       genderList: [],
+      // 是否
+      isnoList: [],
     };
   },
   async created() {
@@ -86,6 +106,11 @@ export default {
       if (this.$checkRes(res)) {
         this.$set(this, `genderList`, res.data);
       }
+      // 是否
+      res = await this.dQuery({ type: 'is_no' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isnoList`, res.data);
+      }
     },
   },
   computed: {

+ 4 - 0
src/views/app/videos/add.vue

@@ -7,6 +7,9 @@
         </el-col>
         <el-col :span="24" class="two">
           <data-form :fields="fields" :form="form" :rules="{}" @save="toSave" :span="12">
+            <template #is_vip>
+              <el-option v-for="i in isnoList" :key="i._id" :label="i.label" :value="i.value"></el-option>
+            </template>
             <template #firm_id>
               <el-option v-for="i in firmList" :key="i._id" :label="i.title" :value="i._id"></el-option>
             </template>
@@ -57,6 +60,7 @@ export default {
   data: function () {
     return {
       fields: [
+        { label: '是否vip', model: 'is_vip', type: 'select' },
         { label: '名称', model: 'title' },
         { label: '简介', model: 'brief', type: 'textarea' },
         { label: '时长', model: 'time_num' },

+ 14 - 0
src/views/app/videos/index.vue

@@ -4,6 +4,9 @@
       <el-col :span="24" class="main animate__animated animate__backInRight">
         <el-col :span="24" class="one">
           <c-search :is_search="true" :fields="fields" @search="btSearch">
+            <template #is_vip>
+              <el-option v-for="i in isnoList" :key="i._id" :label="i.label" :value="i.value"></el-option>
+            </template>
             <template #head_actor>
               <el-option v-for="i in actorList" :key="i._id" :label="i.title" :value="i._id"></el-option>
             </template>
@@ -42,6 +45,17 @@ export default {
       searchInfo: {},
       fields: [
         { label: '序号', options: { type: 'index' } },
+        {
+          label: '是否VIP',
+          model: 'is_vip',
+          type: 'select',
+          format: (i) => {
+            let data = this.isnoList.find((r) => r.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
         { label: '名称', model: 'title', isSearch: true },
         {
           label: '领衔演员',

+ 73 - 0
src/views/app/vip/money/index.vue

@@ -0,0 +1,73 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_search="true" :fields="fields" @search="btSearch"> </c-search>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('moneylog');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '订单号', model: 'money_no' },
+        { label: '用户名称', model: 'user_name', isSearch: true },
+        { label: '交易类型', model: 'type', isSearch: true },
+        { label: '交易金额', model: 'money', isSearch: true },
+        { label: '交易时间', model: 'create_time' },
+      ],
+      opera: [],
+      list: [],
+      total: 0,
+    };
+  },
+  async created() {
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'delete']),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    btSearch(query) {
+      this.$set(this, `searchInfo`, query);
+      this.search();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 101 - 0
src/views/app/vip/setting/add.vue

@@ -0,0 +1,101 @@
+<template>
+  <div id="add">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_title="true" :is_back="true" @toBack="toBack"></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-form :fields="fields" :form="form" :rules="{}" @save="toSave" :span="24">
+            <template #is_use>
+              <el-option v-for="i in isuseList" :key="i._id" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #img_url="{ item }">
+              <c-upload v-model="form[item.model]" url="/files/projectadmin/imgurl/upload" accept="" listType="text" :limit="1"></c-upload>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('vipsetting');
+const { mapActions: dictdata } = createNamespacedHelpers('dictdata');
+export default {
+  name: 'add',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      fields: [
+        { label: '名称', model: 'title' },
+        { label: '简介', model: 'brief', type: 'textarea' },
+        { label: '金额', model: 'money', type: 'number' },
+        { label: '天数', model: 'days', type: 'number' },
+        { label: '排序', model: 'sort', type: 'number' },
+        { label: '是否启用', model: 'is_use', type: 'select' },
+      ],
+      form: {},
+      // 是否启用
+      isuseList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['fetch', 'create', 'update']),
+    ...dictdata({ dQuery: 'query' }),
+    async search() {
+      if (this.id) {
+        let res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `form`, res.data);
+        }
+      }
+    },
+    // 保存信息
+    async toSave({ data }) {
+      let res;
+      if (data.id) res = await this.update(data);
+      else res = await this.create(data);
+      if (this.$checkRes(res, `维护信息成功`, res.errmsg)) this.toBack();
+    },
+    // 字典
+    async searchOther() {
+      let res;
+      // 是否启用
+      res = await this.dQuery({ type: 'is_use' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isuseList`, res.data);
+      }
+    },
+    // 返回
+    toBack() {
+      window.history.go('-1');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 120 - 0
src/views/app/vip/setting/index.vue

@@ -0,0 +1,120 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_search="true" :fields="fields" @search="btSearch">
+            <template #place>
+              <el-option v-for="i in placeList" :key="i._id" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <c-button @toAdd="toAdd"></c-button>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @edit="toEdit" @del="toDel"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('vipsetting');
+const { mapActions: dictdata } = createNamespacedHelpers('dictdata');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '名称', model: 'title', isSearch: true },
+        { label: '简介', model: 'brief' },
+        { label: '金额', model: 'money' },
+        { label: '天数', model: 'days' },
+        { label: '排序', model: 'sort' },
+
+        {
+          label: '是否启用',
+          model: 'is_use',
+          format: (i) => {
+            let data = this.isuseList.find((r) => r.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+      ],
+      opera: [
+        { label: '修改', method: 'edit' },
+        { label: '删除', method: 'del', confirm: true, type: 'danger' },
+      ],
+      list: [],
+      total: 0,
+      // 字典
+      // 是否启用
+      isuseList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'delete']),
+    ...dictdata({ dQuery: 'query' }),
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    btSearch(query) {
+      this.$set(this, `searchInfo`, query);
+      this.search();
+    },
+    // 新增
+    toAdd() {
+      this.$router.push({ path: '/app/vip/setting/add' });
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$router.push({ path: '/app/vip/setting/add', query: { id: data._id } });
+    },
+    async toDel({ data }) {
+      let res = await this.delete(data._id);
+      if (this.$checkRes(res, '删除信息成功', res.errmsg)) this.search();
+    },
+    // 字典表
+    async searchOther() {
+      let res;
+      // 是否启用
+      res = await this.dQuery({ type: 'is_use' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isuseList`, res.data);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 1 - 1
vue.config.js

@@ -23,7 +23,7 @@ module.exports = {
         target: 'http://broadcast.waityou24.cn',
       },
       '/projectadmin/api': {
-        target: 'http://broadcast.waityou24.cn', //http://127.0.0.1:10102  http://www.freeskyghw.cn  http://47.93.34.200
+        target: 'http://192.168.1.144:10102', //http://192.168.1.144:10102  http://www.freeskyghw.cn  http://47.93.34.200
         changeOrigin: true,
         ws: false,
       },