Przeglądaj źródła

更新规则与首页

vaecebyZ 9 miesięcy temu
rodzic
commit
579eaa14d9

+ 1 - 1
src/api/coupon.js

@@ -23,7 +23,7 @@ export function getCouponList(params) {
 export function detail(params) {
   return request({
     url: '/zswl-cloud-shop/couponInfo/detail',
-    method: 'get',
+    method: '',
     params
   })
 }

+ 49 - 0
src/api/invite.js

@@ -0,0 +1,49 @@
+import request from '@/utils/request'
+
+// 删除推广
+// /inviteReceiptsRole/delete
+export function inviteReceiptsRoleDelete({id}) {
+  return request({
+    url: '/zswl-cloud-bdb/inviteReceiptsRole/delete?id=' + id,
+    method: 'get',
+  })
+}
+
+// 查询详情
+// /inviteReceiptsRole/getOne
+export function inviteReceiptsRoleGetOne(data) {
+  return request({
+    url: '/zswl-cloud-bdb/inviteReceiptsRole/getOne',
+    method: 'post',
+    data
+  })
+}
+
+// 查询列表
+// /inviteReceiptsRole/page
+export function inviteReceiptsRolePage(params) {
+  return request({
+    url: '/zswl-cloud-bdb/inviteReceiptsRole/page',
+    method: 'get',
+    params
+  })
+}
+
+// 添加修改
+// /inviteReceiptsRole/update
+export function inviteReceiptsRoleUpdate(data) {
+  return request({
+    url: '/zswl-cloud-bdb/inviteReceiptsRole/update',
+    method: 'post',
+    data
+  })
+}
+// 首页用户数据
+// /user/statistics
+export function userStatistics(params) {
+  return request({
+    url: '/zswl-cloud-bdb/user/statistics',
+    method: 'get',
+    params
+  })
+}

+ 10 - 0
src/api/order.js

@@ -103,3 +103,13 @@ export function subOrdersConfirm(data) {
   })
 }
 
+// 首页订单统计
+// /order/platform/count
+export function orderCount(data) {
+  return request({
+    url: '/springbatchservice/order/platform/count',
+    method: 'post',
+    data
+  })
+}
+

+ 21 - 0
src/api/setting.js

@@ -0,0 +1,21 @@
+import request from '@/utils/request'
+
+  // 获取商户信息
+  // ​/transferRuler​/getRuler
+  export function getRuler(params) {
+    return request({
+      url: '/rewardserver/transferRuler/getRuler',
+      method: 'get',
+      params
+    })
+  }
+
+  // 修改店铺信息
+  // /transferRuler/saveOrUpdate
+  export function saveOrUpdate(data) {
+    return request({
+      url: '/rewardserver/transferRuler/saveOrUpdate',
+      method: 'post',
+      data
+    })
+  }

+ 10 - 1
src/api/study.js

@@ -148,7 +148,7 @@ export function delCommunity(params) {
 // 帖子详情
 export function detailCommunity(params) {
   return request({
-    url: '/zswl-cloud-shop/communityItem/detail',
+    url: '/zswl-cloud-shop/communityItem/webDetail',
     method: 'get',
     params
   })
@@ -306,4 +306,13 @@ export function reservationOperate(params) {
     method: 'get',
     params
   })
+}
+// 获取包括id得栏目
+// community/getAll
+export function getAllColumnId(params) {
+  return request({
+    url: '/zswl-cloud-shop/community/getAll',
+    method: 'get',
+    params
+  })
 }

+ 52 - 0
src/router/index.js

@@ -510,6 +510,38 @@ export let constantRoutes = [{
             icon: ''
           },
         }, 
+        {
+          id: 0,
+          path: '/operationManage/marketingManage/invitePromotion/index',
+          component: operationLayout,
+          meta: {
+            title: '推广邀请规则',
+            icon: ''
+          },
+          alwaysShow: true,
+          children: [
+            {
+              id: 1,
+              path: '/operationManage/marketingManage/invitePromotion/index',
+              name: '/operationManage/marketingManage/invitePromotion/index',
+              component: () => import('@/views/operationManage/marketingManage/invitePromotion/index.vue'),
+              meta: {
+                title: '规则管理',
+                icon: ''
+              },
+            },
+            {
+              id: 1,
+              path: '/operationManage/marketingManage/invitePromotion/add',
+              name: '/operationManage/marketingManage/invitePromotion/add',
+              component: () => import('@/views/operationManage/marketingManage/invitePromotion/add.vue'),
+              meta: {
+                title: '规则添加',
+                icon: ''
+              },
+            }
+          ]
+        }
       ]
       },
       {
@@ -1397,6 +1429,26 @@ export let constantRoutes = [{
             },
           },
         ]
+      },
+      {
+        id: 0,
+        path: '/setting/base',
+        component: operationLayout,
+        meta: {
+          title: '通用设置',
+          icon: ''
+        },
+        children: [{
+            id: 0,
+            path: '/setting/base',
+            name: '/setting/base',
+            component: () => import('@/views/setting/base.vue'),
+            meta: {
+              title: '通用设置',
+              icon: ''
+            },
+          },
+        ]
       }
     ]
   }

+ 12 - 0
src/utils/currency.js

@@ -0,0 +1,12 @@
+/*
+ currency.js - v2.0.4
+ http://scurker.github.io/currency.js
+
+ Copyright (c) 2021 Jason Wilson
+ Released under MIT license
+*/
+(function(e,g){"object"===typeof exports&&"undefined"!==typeof module?module.exports=g():"function"===typeof define&&define.amd?define(g):(e=e||self,e.currency=g())})(this,function(){function e(b,a){if(!(this instanceof e))return new e(b,a);a=Object.assign({},m,a);var d=Math.pow(10,a.precision);this.intValue=b=g(b,a);this.value=b/d;a.increment=a.increment||1/d;a.groups=a.useVedic?n:p;this.s=a;this.p=d}function g(b,a){var d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!0;var c=a.decimal;
+var h=a.errorOnInvalid,k=a.fromCents,l=Math.pow(10,a.precision),f=b instanceof e;if(f&&k)return b.intValue;if("number"===typeof b||f)c=f?b.value:b;else if("string"===typeof b)h=new RegExp("[^-\\d"+c+"]","g"),c=new RegExp("\\"+c,"g"),c=(c=b.replace(/\((.*)\)/,"-$1").replace(h,"").replace(c,"."))||0;else{if(h)throw Error("Invalid Input");c=0}k||(c=(c*l).toFixed(4));return d?Math.round(c):c}var m={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:function(b,
+a){var d=a.pattern,c=a.negativePattern,h=a.symbol,k=a.separator,l=a.decimal;a=a.groups;var f=(""+b).replace(/^-/,"").split("."),q=f[0];f=f[1];return(0<=b.value?d:c).replace("!",h).replace("#",q.replace(a,"$1"+k)+(f?l+f:""))},fromCents:!1},p=/(\d)(?=(\d{3})+\b)/g,n=/(\d)(?=(\d\d)+\d\b)/g;e.prototype={add:function(b){var a=this.s,d=this.p;return e((this.intValue+g(b,a))/(a.fromCents?1:d),a)},subtract:function(b){var a=this.s,d=this.p;return e((this.intValue-g(b,a))/(a.fromCents?1:d),a)},multiply:function(b){var a=
+this.s;return e(this.intValue*b/(a.fromCents?1:Math.pow(10,a.precision)),a)},divide:function(b){var a=this.s;return e(this.intValue/g(b,a,!1),a)},distribute:function(b){var a=this.intValue,d=this.p,c=this.s,h=[],k=Math[0<=a?"floor":"ceil"](a/b),l=Math.abs(a-k*b);for(d=c.fromCents?1:d;0!==b;b--){var f=e(k/d,c);0<l--&&(f=f[0<=a?"add":"subtract"](1/d));h.push(f)}return h},dollars:function(){return~~this.value},cents:function(){return~~(this.intValue%this.p)},format:function(b){var a=this.s;return"function"===
+typeof b?b(this,a):a.format(this,Object.assign({},a,b))},toString:function(){var b=this.s,a=b.increment;return(Math.round(this.intValue/this.p/a)*a).toFixed(b.precision)},toJSON:function(){return this.value}};return e});

+ 248 - 290
src/views/home/index.vue

@@ -8,316 +8,226 @@
 -->
 <template>
   <div class="home-page">
-    <div class="top-box">
-      <div class="left">
-        <div class="tab-box">
-          <div
-            class="tab"
-            :class="[active == 1 ? 'active' : '']"
-            @click="handleTab(1, 'active')"
-          >
-            累积用户总量
+    <!-- <div class="top-box">
+      <el-row style="width: 100%;">
+        <el-col :span="8" :offset="0">
+          <div>
+            <div class="text">待审核商品</div>
+            <div class="num"> 23 </div>
           </div>
-          <div
-            class="tab"
-            :class="[active == 2 ? 'active' : '']"
-            @click="handleTab(2, 'active')"
-          >
-            七日新增用户
+        </el-col>
+        <el-col :span="8" :offset="0">
+          <div>
+            <div class="text">待审核商品</div>
+            <div class="num"> 23 </div>
           </div>
-          <div
-            class="tab"
-            :class="[active == 3 ? 'active' : '']"
-            @click="handleTab(3, 'active')"
-          >
-            今日新增用户
+        </el-col>
+        <el-col :span="8" :offset="0">
+          <div>
+            <div class="text">待审核商品</div>
+            <div class="num"> 23 </div>
           </div>
-        </div>
-        <div id="chart" v-loading="vipLoading" style="width: 500px; height: 300px"></div>
-      </div>
-      <div class="right">
-        <div class="tab-box">
-          <div
-            class="tab"
-            :class="[active1 == 1 ? 'active' : '']"
-            @click="handleTab(1, 'active1')"
-          >
-            去年店铺增长
+        </el-col>
+      </el-row>
+    </div> -->
+
+    <div class="bottom">
+      <div class="title">订单数据 <span>更新于{{ updateTime }}</span></div>
+      <el-row>
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>支付订单数</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ today.orderCount }}</div>
+            <div class="lastDay">{{ yesterday.orderCount }}</div>
+          </div>
+        </el-col>
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>支付金额(元)</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ today.paymentAmount }}</div>
+            <div class="lastDay">{{ yesterday.paymentAmount }}</div>
+          </div>
+
+        </el-col>
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>退款金额</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ today.refundedAmount }}</div>
+            <div class="lastDay">{{ yesterday.refundedAmount }} </div>
+          </div>
+        </el-col>
+      </el-row>
+      <el-row style="margin-top: 40px;">
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>待核销订单</div>
+            <div>昨日</div>
           </div>
-          <div
-            class="tab"
-            :class="[active1 == 2 ? 'active' : '']"
-            @click="handleTab(2, 'active1')"
-          >
-            今年店铺增长
+          <div class="item">
+            <div class="today">{{ today.waitUse }}</div>
+            <div class="lastDay">{{ yesterday.waitUse }}</div>
           </div>
-        </div>
-        <div id="chart1" v-loading="shopLoading" style="height: 300px"></div>
-      </div>
+
+        </el-col>
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>已核销订单</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ today.used }}</div>
+            <div class="lastDay">{{ yesterday.used }} </div>
+          </div>
+        </el-col>
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>已经退款订单</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ today.refunded }}</div>
+            <div class="lastDay">{{ yesterday.refunded }}</div>
+          </div>
+        </el-col>
+      </el-row>
+
     </div>
 
-    <div class="bottom">
-      <div class="tab-box">
-        <div
-          class="tab"
-          :class="[active2 == 1 ? 'active' : '']"
-          @click="handleTab(1, 'active2')"
-        >
-          七日订单趋势
-        </div>
-        <div
-          class="tab"
-          :class="[active2 == 2 ? 'active' : '']"
-          @click="handleTab(2, 'active2')"
-        >
-          十五日订单趋势
-        </div>
-        <div
-          class="tab"
-          :class="[active2 == 3 ? 'active' : '']"
-          @click="handleTab(3, 'active2')"
-        >
-          三十日订单趋势
-        </div>
-      </div>
-      <div id="chart2" v-loading="orderLoading" style="width: 100%; height: 400px"></div>
+    <div class="bottom" style="margin-top: 30px;">
+      <div class="title">用户数据 <span>更新于{{ updateTime }}</span></div>
+      <el-row>
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>新增注册</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ userData.dayRegister }} </div>
+            <div class="lastDay">{{ userData.yesterdayRegister }} </div>
+          </div>
+        </el-col>
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>新增会员</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ userData.dayVip }} </div>
+            <div class="lastDay">{{ userData.yesterdayVip }} </div>
+          </div>
+
+        </el-col>
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>当前注册用户总数</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ userData.totalRegister }}</div>
+            <div class="lastDay">{{ userData.yesterdayRegister }} </div>
+          </div>
+        </el-col>
+      </el-row>
+      <el-row style="margin-top: 40px;">
+        <el-col class="item-box" :span="8" :offset="0">
+          <div class="item">
+            <div>当前会员总数</div>
+            <div>昨日</div>
+          </div>
+          <div class="item">
+            <div class="today">{{ userData.totalVip }} </div>
+            <div class="lastDay">{{ userData.yesterdayTotalVip }}</div>
+          </div>
+        </el-col>
+
+      </el-row>
     </div>
   </div>
 </template>
 
 <script>
-import * as echarts from "echarts";
-import {shopCountDetails,vipCountDetails,orderCountDetails} from '@/api/home';
-import {getTime} from '@/utils/index'
+
+import { orderCount } from '@/api/order';
+import { userStatistics } from '@/api/invite';
+
 export default {
   name: "home",
   components: {},
   data() {
     return {
-      active: 1,
-      active1: 1,
-      active2: 1,
-      chart: null,
-      chart1: null,
-      chart2: null,
-      vipLoading:false,
-      shopLoading:false,
-      orderLoading:false,
-      vipData:[],
-      shopData:[],
-      orderData:[],
-      vipQuery:{
-        "endTime": new Date(getTime(0)+' 23:59:59').getTime(),
-        "startTime": new Date('2023-01-01 00:00:00').getTime()
+      userData: {
+        dayRegister: 0,
+        dayVip: 0,
+        totalRegister: 0,
+        totalVip: 0,
+        yesterdayRegister: 0,
+        yesterdayTotalVip: 0,
+        yesterdayVip: 0,
       },
-      shopQuery:{
-        "endTime": new Date(new Date().getFullYear()+'-01-01 23:59:59').getTime() - 1000*60*60*24,//去年最后一天
-        "startTime": new Date( (new Date().getFullYear()- 1) +'-01-01 00:00:00').getTime(),//去年第一天
-        "timeType": "MONTHS"
+      today: {
+        orderCount: 0,
+        waitUse: 0,
+        used: 0,
+        refunded: 0,
+        paymentAmount: 0,
+        refundedAmount: 0
       },
-      orderQuery:{
-        "endTime": new Date(getTime(0)+' 23:59:59').getTime(),//今天
-        "startTime":new Date(getTime(-6)+' 00:00:00').getTime(),//七天前
-        "timeType": "DAY"
+      yesterday: {
+        orderCount: 0,
+        waitUse: 0,
+        used: 0,
+        refunded: 0,
+        paymentAmount: 0,
+        refundedAmount: 0
       },
- 
+      updateTime: '',
     };
   },
   computed: {
-     option(){
-      let colorList = ['#FF9216','#FF2B27','#2836FE']
-      let data = []
-      this.vipData.map((item,index)=>{
-        data.push({
-          name:item.moment,
-          value:item.count,
-          itemStyle:{
-            color:colorList[index]
-          }
-        })
-      })
-        let obj = {
-        tooltip: {
-          trigger: "item",
-        },
-        legend: {
-          top: "25%",
-          right: "right",
-        },
-        series: [
-          {
-            name: "",
-            type: "pie",
-            radius: ["40%", "70%"],
-            avoidLabelOverlap: false,
-            label: {
-              show: false,
-              position: "center",
-            },
-            emphasis: {
-              label: {
-                show: true,
-                fontSize: 20,
-                fontWeight: "bold",
-              },
-            },
-            labelLine: {
-              show: false,
-            },
-            data
-          },
-        ],
-      }
-      
-      return obj
-     } ,
-     option1(){
-      let date = []
-      let data = []
-      this.shopData.map((item,index)=>{
-        date.push(item.moment)
-        data.push(item.count)
-      })
-      let obj = {
-        tooltip: {
-          trigger: "item",
-        },
-        xAxis: {
-          type: "category",
-          data: date,
-        },
-        yAxis: {
-          type: "value",
-        },
-        series: [
-          {
-            data,
-            type: "bar",
-            itemStyle:{color:'#2836FE'}
-          },
-        ],
-      }
-      return obj
-
-     },
-     option2(){
-          let date = []
-      let data = []
-      this.shopData.map((item,index)=>{
-        date.push(item.moment)
-        data.push(item.count)
-      })
-      let obj =  {
-        xAxis: {
-          type: "category",
-          data:date,
-          boundaryGap: false
-        },
-        yAxis: {
-          type: "value",
-        },
-        tooltip: {
-          trigger: "axis",
-        },
-        
-        series: [
-          {
-            data,
-            type: "line",
-            smooth: true,
-            itemStyle:{color:'#5B8FF9'},
-            areaStyle: {
-              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-                {
-                  offset: 0,
-                  color: "rgb(233, 234, 255)",
-                },
-                {
-                  offset: 1,
-                  color: "rgb(233, 234, 255)",
-                },
-              ]),
-            },
-          },
-        ],
-      }
-      return obj
 
-     }
   },
   methods: {
-    handleTab(val, key) {
-      console.log(getTime(-1)+' 00:00:00'); 
-      this[key] = val;
-      if(key == 'active'){
-        if(val == 1){
-          this.vipQuery.startTime = new Date('2023-01-01 00:00:00').getTime()
-        }
-        else if(val == 2){
-          this.vipQuery.startTime = new Date(getTime(-6)+' 00:00:00').getTime()
-        }else if(val == 3){
-          this.vipQuery.startTime = new Date(getTime(0)+' 00:00:00').getTime()
-        }
-          this.vipQuery.endTime = new Date(getTime(0)+' 23:59:59').getTime()
-        this.vipCountDetails()
-      }else if(key == 'active1'){
-        if(val == 1){
-          this.shopQuery = {
-            "endTime": new Date(new Date().getFullYear()+'-01-01 23:59:59').getTime() - 1000*60*60*24,//去年最后一天
-            "startTime": new Date( (new Date().getFullYear()- 1) +'-01-01 00:00:00').getTime(),//去年第一天
-            "timeType": "MONTHS"
-          }
-        }else{
-          this.shopQuery = {
-            "endTime": new Date((new Date().getFullYear()+1)+'-01-01 23:59:59').getTime() - 1000*60*60*24,//今年最后一天
-            "startTime": new Date( new Date().getFullYear() +'-01-01 00:00:00').getTime(),//今年第一天
-            "timeType": "MONTHS"
-          }
-        }
-        this.shopCountDetails()
 
-      }
-    },
-    vipCountDetails(){
-      this.vipLoading = true
-      vipCountDetails(this.vipQuery).then(res=>{
-        this.vipLoading = false
-        if(res.state == 'Success'){
-          this.vipData = res.content.vipDetail
-          this.chart = echarts.init(document.getElementById("chart"));
-          this.chart.setOption(this.option);
-        }
-      })
-    },
-    shopCountDetails(){
-      this.shopLoading = true
-      shopCountDetails(this.shopQuery).then(res=>{
-        this.shopLoading = false
-        if(res.state == 'Success'){
-          this.shopData = res.content
-          this.chart1 = echarts.init(document.getElementById("chart1"));
-          this.chart1.setOption(this.option1);
-        }
-      })
-    },
-    orderCountDetails(){
-      this.orderLoading = true
-      orderCountDetails(this.orderQuery).then(res=>{
-        this.orderLoading = false
-        if(res.state == 'Success'){
-          this.orderData = res.content
-          this.chart2 = echarts.init(document.getElementById("chart2"));
-          this.chart2.setOption(this.option2);
-        }
-      })
-    },
-    
+
   },
-  created() {},
+  created() { },
   mounted() {
-    this.vipCountDetails()
-    this.shopCountDetails()
-    this.orderCountDetails()
+    this.updateTime = new Date().toLocaleString();
+    const thisDayStartTime = new Date(new Date().toLocaleDateString()).getTime();
+    const thisDayEndTime = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
+    const yesterdayStartTime = thisDayStartTime - 24 * 60 * 60 * 1000;
+    const yesterdayEndTime = thisDayEndTime - 24 * 60 * 60 * 1000;
+
+    orderCount({
+      startTime: thisDayStartTime,
+      endTime: thisDayEndTime
+    }).then(res => {
+      if (res.state == 'Success') {
+        this.today = res.content;
+      }
+    });
+    orderCount({
+      startTime: yesterdayStartTime,
+      endTime: yesterdayEndTime
+    }).then(res => {
+      if (res.state == 'Success') {
+        this.yesterday = res.content;
+      }
+    });
+    userStatistics().then(res => {
+      if (res.state == 'Success') {
+        this.userData = res.content;
+      }
+    })
 
   },
 };
@@ -328,45 +238,93 @@ export default {
   width: 100%;
   height: calc(100vh - 50px);
   background: #f6f6f6;
+
   .tab-box {
     display: flex;
     align-items: center;
     position: relative;
     top: 20px;
     z-index: 2;
+
     .tab {
       padding: 8px 10px;
       margin: 0 15px;
       font-size: 14px;
       border-radius: 4px;
       cursor: pointer;
-      color: rgba(0,0,0,0.6);;
+      color: rgba(0, 0, 0, 0.6);
       background: #F6F6F6;
     }
+
     .active {
       background: #E8E9FE;
       color: #2836FE;
     }
   }
+
   .top-box {
     display: flex;
     justify-content: space-between;
+    background: #fff;
+    padding: 20px 24px;
     margin-bottom: 20px;
+    border-radius: 8px;
 
-    .left {
-      background: #fff;
-      margin-right: 30px;
-      border-radius: 8px;
+    .text {
+      font-size: 16px;
+      margin-bottom: 10px;
     }
-    .right {
-      flex: 1;
-      background: #fff;
-      border-radius: 8px;
+
+    .num {
+      font-size: 25px;
     }
   }
+
   .bottom {
     background: #fff;
     border-radius: 8px;
+    padding: 20px 0;
+
+    .title {
+      font-size: 16px;
+      margin-left: 24px;
+      margin-bottom: 20px;
+
+      span {
+        font-size: 14px;
+        color: #999;
+        margin-left: 10px;
+      }
+    }
+
+    .item-box {
+      padding: 0 20px;
+      border-left: 1px solid #f0f0f0;
+
+      &:first-child {
+        border-left: none;
+      }
+
+      .item {
+        display: flex;
+        justify-content: space-between;
+
+        &:first-child {
+          margin-bottom: 15px;
+        }
+
+        .today {
+          font-size: 20px;
+        }
+
+        .lastDay {
+          color: #999;
+        }
+      }
+    }
+
+
+
   }
 }
 </style>

+ 2 - 2
src/views/login/index.vue

@@ -70,8 +70,8 @@ export default {
     }
     return {
       loginForm: {
-        account: '',
-        password: '',
+        account: '13245678904',
+        password: 'admin123456.',
         
       },
       loginRules: {

+ 223 - 0
src/views/operationManage/marketingManage/invitePromotion/add.vue

@@ -0,0 +1,223 @@
+<!--
+ * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
+ * @Date: 2023-05-26 16:37:34
+ * @LastEditors: wenjie 1454560336@qq.com
+ * @LastEditTime: 2024-08-01 17:53:54
+ * @FilePath: \admin-manage\src\views\operationManage\shopManage\shopAdd.vue
+ * @Description: 
+ * 
+ * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
+-->
+<template>
+  <div class="shopAdd app-container" v-loading="loading">
+    <el-form :model="setQuery" ref="setQuery" :rules="rules" v-loading="pageLoading" :disabled="disabled"
+      label-width="130px">
+
+
+      <el-form-item label="套餐等级:" prop="setMealCode">
+        <el-select v-model="setQuery.setMealCode" size="small" filterable class="item-width-300"
+          placeholder="请选择套餐等级">
+          <el-option v-for="item in mealNameOptions" :key="item.value" :label="item.label" :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="奖励规则:">
+        <el-radio-group v-model="setQuery.computation">
+          <el-radio label="FIXED">固定返现</el-radio>
+          <!-- <el-radio label="RATIO">百分比返现</el-radio> -->
+        </el-radio-group>
+      </el-form-item>
+
+      <el-form-item label="奖励金额:" prop="baseTotal">
+        <el-input type="number" placeholder="请输入奖励金额" v-model="setQuery.baseTotal" :maxlength="11"
+          class="item-width-300">
+        </el-input>
+      </el-form-item>
+
+      <el-form-item label="到账时间:" prop="day">次月
+        <el-input v-model="setQuery.day" size="small" class="item-width-300"></el-input>
+        号进行发放
+      </el-form-item>
+
+
+      <el-form-item label="成功邀请条件:" required>
+        邀请新用户注册首次订购会员,开通5天 <br />
+
+        邀请新用户注册首次订购会员,且持续订购开通5天
+      </el-form-item>
+
+
+    </el-form>
+
+    <!-- 新增和编辑模式 -->
+    <div class="btn-group" v-if="mode == 'add' || mode == 'edit'">
+      <el-button @click="cancel">取 消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">提交</el-button>
+    </div>
+    <!-- 详情时的按钮 -->
+    <div class="btn-group" v-else>
+      <el-button @click="cancel">取 消</el-button>
+    </div>
+
+
+  </div>
+</template>
+
+<script>
+import { getSetMealNameAndId } from '@/api/common'
+import { inviteReceiptsRoleUpdate, inviteReceiptsRoleGetOne } from "@/api/invite"
+
+export default {
+
+  data() {
+    return {
+
+
+      mode: 'detail',//编辑模式
+
+      setQuery: {
+        baseTotal: '',
+        day: '',
+        setMealCode: '',
+        computation: 'FIXED',
+        "firstPurchaseDay": 5,
+        "duration": 5,
+        "first": true,
+        "keep": true
+      },
+
+      disabled: false,
+      pageLoading: false, //页面loading
+      loading: false,
+      rules: {
+        setMealCode: [
+          { required: true, message: "请选选择套餐等级", trigger: "change" },
+        ],
+        day: [
+          { required: true, message: '请输入到账日期', trigger: 'blur' }
+        ],
+        baseTotal: [
+          { required: true, message: "请输入奖励金额", trigger: "blur" },
+        ],
+        computation: [
+          { required: true, message: "请选择奖励规则", trigger: "change" }
+        ]
+      },
+
+      mealNameOptions: []
+    };
+  },
+
+  methods: {
+    getSetMealNameAndId() {
+      getSetMealNameAndId().then(res => {
+        if (res.state == 'Success') {
+          // this.mealNameOptions = 
+          Object.keys(res.content).map(key => {
+            this.mealNameOptions.push({
+              label: res.content[key],
+              value: key
+            })
+          })
+
+        }
+      })
+    },
+    cancel() {
+      this.$router.push({
+        path: "/operationManage/marketingManage/invitePromotion/index",
+      });
+    },
+    edit() {
+      this.$router.push({
+        path: "/operationManage/marketingManage/invitePromotion/add",
+        query: {
+          title: "规则编辑",
+          id: this.$route.query.id,
+        },
+      });
+    },
+    save() {
+      this.$refs.setQuery.validate((v) => {
+        if (v) {
+          if (this.loading) return
+          this.loading = true;
+          let obj = JSON.parse(JSON.stringify(this.setQuery))
+          obj.baseTotal = obj.baseTotal * 100
+          inviteReceiptsRoleUpdate(obj).then((res) => {
+            this.loading = false;
+            if (res.state == "Success") {
+              this.$notify({
+                title: "成功",
+                message: "操作成功",
+                type: "success",
+              });
+
+              this.$router.push("/operationManage/marketingManage/invitePromotion/index");
+            }
+          });
+        } else {
+          this.$message.error('请检查是否有必填项未填');
+        }
+      });
+    },
+
+
+    detail() {
+      this.setQuery = JSON.parse(this.$route.query.data)
+      this.setQuery.baseTotal = this.setQuery.baseTotal / 100
+    },
+
+
+
+
+
+  },
+  created() {
+    this.getSetMealNameAndId()
+    if (this.$route.query.title == "规则编辑") {
+      this.disabled = false;
+      this.mode = 'edit'
+      this.detail();
+    } else if (this.$route.query.title == "规则详情") {
+      this.disabled = true;
+      this.mode = 'detail'
+      this.detail();
+    } else {
+      this.disabled = false;
+      this.mode = 'add'
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.shopAdd {
+  padding-bottom: 40px;
+
+  .position {
+    cursor: pointer;
+    font-size: 20px;
+  }
+
+  .btn-group {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+
+  #container {
+    width: 100%;
+    height: 600px;
+  }
+
+  .address-input-box {
+    display: flex;
+
+    .address-input {
+      flex: 1;
+    }
+  }
+}
+</style>

+ 194 - 0
src/views/operationManage/marketingManage/invitePromotion/index.vue

@@ -0,0 +1,194 @@
+<template>
+  <div class="shopManage app-container">
+    <div class="search">
+      <div>
+        <el-input v-model="query.setMealName" size="small" placeholder="请输入套餐等级"
+          class="item-width-200"></el-input>
+
+        <el-button class="ml10" type="primary" size="small" icon="el-icon-search" @click="handleSearch">
+          搜索
+        </el-button>
+      </div>
+
+      <el-button class="add-btn" type="primary" size="small" @click="handleAdd(0)">
+        添加
+      </el-button>
+
+    </div>
+
+    <el-table :data="tableData" tooltip-effect="dark" border v-loading="loading" style="width: 100%">
+      <el-table-column align="center" label="套餐等级" prop="setMealName" show-overflow-tooltip>
+      </el-table-column>
+
+      <el-table-column prop="computation" align="center" label="奖励规则" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ computation[scope.row.computation] }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="baseTotal" align="center" label="奖励金额(元)" show-overflow-tooltip>
+        <template slot-scope="scope">
+          {{ currency(scope.row.baseTotal, {
+            fromCents: true,
+            symbol: '¥',
+          }).format() }}
+        </template>
+      </el-table-column>
+      <el-table-column prop="day" align="center" label="到账时间" show-overflow-tooltip>
+        <template slot-scope="scope">
+          次月{{ scope.row.day }}号进行发放
+        </template>
+      </el-table-column>
+      <el-table-column prop="createTime" align="center" label="创建时间" show-overflow-tooltip>
+      </el-table-column>
+
+
+
+      <el-table-column prop="address" width="180px" fixed="right" align="center" label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
+          <el-button type="text" size="small" @click="handleDel(scope.row.id)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="page-box">
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" background
+        :current-page="query.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="query.pageSize"
+        layout="total, sizes, prev, pager, next, jumper" :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import currency from "@/utils/currency";
+import { inviteReceiptsRoleDelete, inviteReceiptsRolePage } from "@/api/invite"
+export default {
+  name: "shopManage",
+  data() {
+    return {
+      that: this,
+      codeImg: '',//收款码
+      downName: '',//下载名称
+      showCode: false,
+      codeLoading: false,
+      tableData: [],
+      currency,
+      loading: false,
+      query: {
+        setMealName: "",
+        currentPage: 1,
+        pageSize: 10,
+      },
+      computation: {
+        "FIXED": "固定返现",
+        "RATIO": "百分比返现"
+      },
+      total: 0,
+    };
+  },
+
+
+  methods: {
+    handleSearch() {
+      this.query.currentPage = 1
+      this.inviteReceiptsRolePage();
+
+    },
+    filterColor(val) {
+      if (val == 0) {
+        return 'gray'
+      } else if (val == 1) {
+        return 'gray'
+      } else if (val == 2) {
+        return 'green'
+      } else if (val == 3) {
+        return 'red'
+      }
+    },
+    handleAdd(val) {
+      this.$router.push({
+        path: "/operationManage/marketingManage/invitePromotion/add" + (val || ""),
+      });
+    },
+
+    handleEdit(row) {
+      let data = JSON.stringify(row);
+      this.$router.push({
+        path: "/operationManage/marketingManage/invitePromotion/add",
+        query: {
+          title: "规则编辑",
+          data,
+        },
+      });
+    },
+    handleDetail(id, title) {
+      this.$router.push({
+        path: "/operationManage/marketingManage/invitePromotion/add",
+        query: {
+          title: "规则详情",
+          id,
+        },
+      });
+    },
+
+
+    handleDel(id) {
+      this.$confirm(`此操作将删除该数据, 是否继续?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        inviteReceiptsRoleDelete({
+          id
+        }).then((res) => {
+          if (res.state == "Success") {
+            this.$notify({
+              title: "成功",
+              message: "操作成功",
+              type: "success",
+            });
+            this.inviteReceiptsRolePage();
+          }
+        });
+      });
+    },
+
+    handleSizeChange(val) {
+      this.query.currentPage = 1;
+      this.query.pageSize = val;
+      this.inviteReceiptsRolePage();
+    },
+    handleCurrentChange(val) {
+      this.query.currentPage = val;
+      this.inviteReceiptsRolePage();
+    },
+
+    inviteReceiptsRolePage() {
+      this.loading = true;
+      inviteReceiptsRolePage(this.query).then((res) => {
+        this.loading = false;
+        if (res.state == "Success") {
+          this.tableData = res.content.records;
+          this.total = res.content.total;
+        }
+      });
+    },
+
+  },
+  created() {
+    this.inviteReceiptsRolePage();
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.shopManage {
+  .search {
+    justify-content: space-between;
+
+    .add-btn {
+      // margin-right: 20px;
+    }
+  }
+}
+</style>

+ 283 - 0
src/views/setting/base.vue

@@ -0,0 +1,283 @@
+<template>
+  <div class="setting app-container">
+    <h3>提现设置</h3>
+    <el-form :model="setQuery" ref="setQuery" inline v-loading="loading" label-width="200px" :rules="rules">
+      <el-row>
+        <el-form-item label="单笔提现规则 最低提现金额" prop="minTotal">
+          <el-input type="number" v-model="setQuery.minTotal"></el-input>
+          <div>微信商家转账到零钱,现金营销场景最高额度为单笔200元。</div>
+        </el-form-item>
+        <el-form-item label-width="120px" label="元,最高提现金额" prop="up">
+          <el-input type="number" v-model="setQuery.maxTotal"></el-input>
+        </el-form-item> <el-form-item label-width="0" label="元"></el-form-item>
+      </el-row>
+      <el-row>
+        <el-form-item label="单日提现额度" size="normal" prop="dayMaxTotal">
+          <el-input type="number" v-model="setQuery.dayMaxTotal">
+            <template slot="append">元</template>
+          </el-input>
+          <div>微信商家转账到零钱,一个商户号单日向同一用户的最高转账额度为2万元,不可提高。</div>
+        </el-form-item>
+      </el-row>
+      <el-row>
+        <el-form-item label="提现手续费" prop="commission">
+          <el-input type="number" v-model="setQuery.commission">
+            <template slot="append">%</template>
+          </el-input>
+        </el-form-item>
+      </el-row>
+      <el-row>
+        <el-form-item label="提现频次" size="normal" prop="timeUnit">
+          <el-select v-model="setQuery.timeUnit" @change="checkType()">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+            </el-option>
+          </el-select>
+          的
+          <template v-if="setQuery.timeUnit == 'MONTH'">
+            <el-select v-model="setQuery.startDay" clearable placeholder="开始日">
+              <el-option v-for="item in dayOption" :key="item.value" :label="item.label" :value="item.value">
+              </el-option>
+            </el-select>
+            至
+            <el-select v-model="setQuery.endDay" clearable placeholder="结束日">
+              <el-option v-for="item in dayOption" :key="item.value" :label="item.label" :value="item.value">
+              </el-option>
+            </el-select>
+          </template>
+          <template v-else>
+            <el-time-select placeholder="起始时间" v-model="startTime" @change="changeStart" :picker-options="{
+              start: '00:00',
+              step: '00:10',
+              end: '24:00'
+            }">
+            </el-time-select>
+            到
+            <el-time-select placeholder="结束时间" v-model="endTime" @change="changeTime" :picker-options="{
+              start: '00:00',
+              step: '00:10',
+              end: '24:00',
+              minTime: startTime
+            }">
+            </el-time-select>
+          </template>
+
+
+        </el-form-item>
+        <el-form-item label="可申请提现" label-width="90px" size="normal">
+          <el-input type="number" v-model="setQuery.size" size="normal"></el-input>
+        </el-form-item>
+        <el-form-item label="次" label-width="0" size="normal">
+        </el-form-item>
+      </el-row>
+    </el-form>
+
+    <div class="btn-group">
+      <el-button>取 消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">确 定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+
+
+import { saveOrUpdate, getRuler } from "@/api/setting"
+import currency from "@/utils/currency";
+export default {
+
+  data() {
+    return {
+      loading: false,
+      startTime: '',
+      endTime: '',
+      setQuery: {
+        timeUnit: 'DAY', //时间单位 DAY MONTH 
+
+        minTotal: '', //单笔最小提现金额
+        size: '', //提现次数
+        maxTotal: '',//单笔最大提现金额
+        id: '',
+
+        endMinute: '', //每日结束分
+        endHour: '', //每日结束时
+        startMinute: '', //每日开始分
+        startHour: '', //每日开始时
+
+        startDay: '', //每月开始号数
+        endDay: '',//每月结束号数
+
+        dayMaxTotal: '',//单日最大转账金额
+        commission: '' //提现手续费
+      },
+      options: [
+        {
+          label: '每天',
+          value: 'DAY'
+        },
+        {
+          label: '每月',
+          value: 'MONTH'
+        }
+      ],
+      dayOption: [
+
+      ],
+      rules: {
+        timeUnit: [
+          {
+            required: true,
+            message: '提现频次不能为空',
+            trigger: 'blur'
+          }
+        ],
+        minTotal: [
+          { required: true, message: '单笔最小提现金额不能为空', trigger: 'blur' },
+        ],
+        size: [
+          { required: true, message: '提现次数不能为空', trigger: 'blur' },
+        ],
+        maxTotal: [
+          { required: true, message: '单笔最大提现金额不能为空', trigger: 'blur' },
+        ],
+        endMinute: [
+          { required: true, message: '每日结束分不能为空', trigger: 'blur' },
+        ],
+        endHour: [
+          { required: true, message: '每日结束时不能为空', trigger: 'blur' },
+        ],
+        startMinute: [
+          { required: true, message: '每日开始分不能为空', trigger: 'blur' },
+        ],
+        startHour: [
+          { required: true, message: '每日开始时不能为空', trigger: 'blur' },
+        ],
+        startDay: [
+          { required: true, message: '每月开始号数不能为空', trigger: 'blur' },
+        ],
+        endDay: [
+          { required: true, message: '每月结束号数不能为空', trigger: 'blur' },
+        ],
+        dayMaxTotal: [
+          { required: true, message: '单日最大转账金额不能为空', trigger: 'blur' },
+        ],
+        commission: [
+          { required: true, message: '提现手续费不能为空', trigger: 'blur' },
+        ]
+      }
+
+    }
+  },
+  methods: {
+    save() {
+
+      this.$refs.setQuery.validate((v) => {
+        this.checkType(1)
+        if (v) {
+          this.loading = true
+          saveOrUpdate({
+            ...this.setQuery,
+            maxTotal: currency(this.setQuery.maxTotal).intValue,
+            minTotal: currency(this.setQuery.minTotal).intValue,
+            dayMaxTotal: currency(this.setQuery.dayMaxTotal).intValue
+          }).then(res => {
+            this.loading = false
+
+            if (res.state == 'Success') {
+
+              this.$notify({
+                title: '成功',
+                message: '操作成功',
+                type: 'success'
+              });
+
+            }
+          })
+        }
+      });
+    },
+    changeTime() {
+      if (this.startTime) return
+      this.$message({
+        message: '请先选择开始时间',
+        type: "error",
+        duration: 5000,
+      });
+      this.endTime = ''
+    },
+    changeStart() {
+      this.endTime = ''
+    },
+    checkType(edit) {
+
+      if (this.setQuery.timeUnit == 'DAY') {
+        this.setQuery.startDay = ''
+        this.setQuery.endDay = ''
+
+        if (edit) {
+          const [startHour, startMinute] = this.startTime.split(':')
+          const [endHour, endMinute] = this.endTime.split(':')
+
+          this.setQuery.startHour = startHour
+          this.setQuery.endHour = endHour
+          this.setQuery.startMinute = startMinute
+          this.setQuery.endMinute = endMinute
+        }
+      } else {
+        this.setQuery.startHour = ''
+        this.setQuery.endHour = ''
+        this.setQuery.startMinute = ''
+        this.setQuery.endMinute = ''
+      }
+    }
+  },
+  created() {
+    // 月份天数
+    for (let index = 0; index < 31; index++) {
+      this.dayOption.push(
+        {
+          label: index + 1 + '号',
+          value: index + 1
+        }
+      )
+    }
+
+    getRuler().then(res => {
+      if (res.content) {
+        this.setQuery = res.content;
+        this.setQuery.maxTotal = currency(res.content.maxTotal, {
+          fromCents: true
+        })
+        this.setQuery.minTotal = currency(res.content.minTotal, {
+          fromCents: true
+        })
+        this.setQuery.dayMaxTotal = currency(res.content.dayMaxTotal, {
+          fromCents: true
+        })
+        if (this.setQuery.timeUnit == 'DAY') {
+          console.log()
+
+          this.startTime = (this.setQuery.startHour + "").padStart(2, 0) +
+            ':' + (this.setQuery.startMinute + "").padStart(2, 0)
+          this.endTime = (this.setQuery.endHour + "").padStart(2, 0) +
+            ':' + (this.setQuery.endMinute + "").padStart(2, 0)
+        }
+      }
+    })
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.setting {
+  padding-bottom: 40px;
+
+
+
+
+  .btn-group {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+}
+</style>

+ 8 - 9
src/views/studyManage/communityManage/addArticle.vue

@@ -84,7 +84,7 @@ import Upload from '@/components/Upload'
 import Vue from 'vue'
 import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
 import { requestUploadImg, finishUploadImg } from '@/api/common';
-import {addOrUpdateCommunity,detailCommunity,getTab} from '@/api/study';
+import {addOrUpdateCommunity,detailCommunity,getAllColumnId} from '@/api/study';
 import OSS from "ali-oss";
 
 export default Vue.extend({
@@ -186,23 +186,22 @@ export default Vue.extend({
                 if(res.state == 'Success'){
                   this.setQuery.communityDetail = res.content.communityDetail
                   this.setQuery.communityTitle = res.content.communityTitle
-                  this.setQuery.communityId = res.content.communityId
+                  this.setQuery.communityId = res.content.communityId +""
                   this.setQuery.coverImg = res.content.coverImg
                 }
             })
         },
         // 获取分类列表
         getTab(){
-            getTab().then(res=>{
+            getAllColumnId().then(res=>{
                 if(res.state == 'Success'){
-                  for (const key in res.content) {
-                    if (Object.hasOwnProperty.call(res.content, key)) {
-                        this.options.push({
-                            value:Number(key),
-                            label:res.content[key]
+                  for (const item of res.content) {
+                    this.options.push({
+                            value:item.columnId,
+                            label:item.communityName
                         })
-                    }
                   }
+                
                 }
             })
         }

+ 3 - 2
src/views/studyManage/communityManage/index.vue

@@ -8,9 +8,10 @@
           v-model="date"
           size="small"
           class="item-width-350"
-          value-format="yyyy-MM-dd hh:mm:ss"
+          value-format="yyyy-MM-dd HH:mm:ss"
           type="datetimerange"
           range-separator="至"
+          :default-time="['00:00:00', '23:59:59']"
           start-placeholder="开始日期"
           end-placeholder="结束日期">
         </el-date-picker>
@@ -97,7 +98,7 @@
      
        <el-table-column prop="address" align="center" label="操作">
         <template slot-scope="scope">
-          <el-button type="text" size="small" @click="handleDetail(scope.row)">查看</el-button>
+          <el-button type="text" size="small" @click="handleDetail(scope.row)">编辑</el-button>
           <el-button type="text" size="small" @click="handleTop(scope.row.id)">置顶</el-button>
           <el-button type="text" size="small" @click="handleState(scope.row.id,scope.row.state == 1?2:1)">{{scope.row.state == 1?'显示':'隐藏' }}</el-button>
           <el-button type="text" class="red" size="small" @click="handleDel(scope.row.id)">删除</el-button>

+ 1 - 1
src/views/studyManage/courseManage/index.vue

@@ -94,7 +94,7 @@
         <template slot-scope="scope">
           <el-button type="text" size="small" @click="handleDetail(scope.row.id)">查看</el-button>
           <el-button type="text" size="small" @click="handleEdit(scope.row.id)">编辑</el-button>
-          <el-button type="text" size="small" @click="handleStatus(scope.row.id,scope.row.status == 1?2:1)">{{scope.row.status == 1?'取消发布':'立即发布' }}</el-button>
+          <el-button type="text" size="small" @click="handleStatus(scope.row.id,scope.row.status == 1?2:1)">{{scope.row.status == 1?'立即发布':'取消发布' }}</el-button>
           <el-button type="text" size="small" @click="handleState(scope.row.id,scope.row.state == 1?2:1)">{{scope.row.state == 1?'显示':'隐藏' }}</el-button>
           <el-button type="text" class="red" size="small" @click="handleDel(scope.row.id)">删除</el-button>
         </template>

+ 1 - 1
src/views/studyManage/tabManage/index.vue

@@ -158,7 +158,7 @@ export default {
         if (res.state == "Success") {
           res.content.map((item) => {
             this.options.push({
-              value: item.id,
+              value: `${item.id}`,
               label: item.columnName,
             });
           });