guojy 1 anno fa
parent
commit
98107f4b4d

+ 4 - 0
.mini-ide/compileMode.json

@@ -108,6 +108,10 @@
     {
       "title": "授权登录",
       "page": "pages/arLogin/arLogin"
+    },
+    {
+      "title": "续费",
+      "page": "pages/deploy/addMoney/addMoney"
     }
   ]
 }

+ 16 - 0
app.js

@@ -1,6 +1,7 @@
 import { showToast } from './utils/feedback'
 import { formatTime, arrRemoveObj, getTypeItem } from './utils/util'
 import * as socketApi from './utils/websocket'
+import { onSubscribeAppBack,openSubscribeMiniApp } from 'dingtalk-service-window-libs/lib/openSubscribeMiniApp'
 
 const baseUrl = "https://test-ding.g107.com/";//测试
 // const baseUrl = "https://app55493.eapps.dingtalkcloud.com/";//正式
@@ -30,6 +31,7 @@ App({
     imgHttpUrl: 'https://intesys.cms.g107.com/integral.php/Api/get_signature',
     corpId: '',
     yearArr: yearArr,
+    isSuperAdministrator:false,
     isAdministrator: false,//是否管理员
     isCreator: false,//是否是系统管理员
     corpMessage: '',//企业套餐信息
@@ -268,6 +270,9 @@ App({
                     that.globalData.isCreator = true;
                     isStart = true;
                   }
+                  if (item.name == 'admin' || item.name == 'creator' || item.name == 'point_manager') {
+                    that.globalData.isSuperAdministrator = true;
+                  }
                   if (item.name == 'admin' || item.name == 'creator' || item.name == 'point_manager' || item.name == 'dept_manager') {
                     that.globalData.isAdministrator = true;
                   }
@@ -357,7 +362,18 @@ App({
     that = this;
     that.updateApp();
     that.getTypes(function () { });
+    console.log(options.query.corpId)
     that.getCorp(options.query.corpId);
     that.globalData.corpId = options.query.corpId;
   },
+  onShow(options) {
+    onSubscribeAppBack(options, (data) => {
+        // 这里可以对返回数据做二次处理,之后需要把数据返回到page.onShow
+        // dd.alert({
+        //     title: 'onSubscribeAppBack data :',
+        //     content: JSON.stringify(data),
+        // });
+        return data;
+    });
+   },
 });

+ 70 - 0
package-lock.json

@@ -86,6 +86,17 @@
         "regenerator-runtime": "^0.13.4"
       }
     },
+    "ajv": {
+      "version": "8.12.0",
+      "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz",
+      "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==",
+      "requires": {
+        "fast-deep-equal": "^3.1.1",
+        "json-schema-traverse": "^1.0.0",
+        "require-from-string": "^2.0.2",
+        "uri-js": "^4.2.2"
+      }
+    },
     "axios": {
       "version": "0.21.4",
       "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
@@ -118,11 +129,42 @@
         "promise-polyfill": "^7.1.0"
       }
     },
+    "dingtalk-service-window-libs": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/dingtalk-service-window-libs/-/dingtalk-service-window-libs-0.3.0.tgz",
+      "integrity": "sha512-y0ahqCn3sXkIzu0FMgRtLRxyxKMUUv/2A13hCNHzhnAAVe5i6SO4fGGi1um7babEh6Vrx1+8bXedHPJVRBOEDA==",
+      "requires": {
+        "ajv": "^8.12.0",
+        "dingtalk-jsapi": "^3.0.20",
+        "eventemitter2": "^6.4.9",
+        "nanoid": "^4.0.2"
+      },
+      "dependencies": {
+        "dingtalk-jsapi": {
+          "version": "3.0.20",
+          "resolved": "https://registry.npmjs.org/dingtalk-jsapi/-/dingtalk-jsapi-3.0.20.tgz",
+          "integrity": "sha512-t9eoamS+bc8QE+MtKQvNlJlvKwUg/8YuHpeff/xU0Y7b6Werrd8mropPkZO8PqV8QcXDxwGmTpSe0SoOmdIIgw==",
+          "requires": {
+            "promise-polyfill": "^7.1.0"
+          }
+        },
+        "eventemitter2": {
+          "version": "6.4.9",
+          "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz",
+          "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg=="
+        }
+      }
+    },
     "eventemitter2": {
       "version": "6.4.5",
       "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.5.tgz",
       "integrity": "sha512-bXE7Dyc1i6oQElDG0jMRZJrRAn9QR2xyyFGmBdZleNmyQX0FqGYmhZIrIrpPfm/w//LTo4tVQGOGQcGCb5q9uw=="
     },
+    "fast-deep-equal": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+      "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+    },
     "fecha": {
       "version": "2.3.3",
       "resolved": "https://registry.npm.taobao.org/fecha/download/fecha-2.3.3.tgz",
@@ -138,11 +180,21 @@
       "resolved": "https://registry.npm.taobao.org/hammerjs/download/hammerjs-2.0.8.tgz",
       "integrity": "sha1-BO93hiz/K7edMPdpIJWTAiK/YPE="
     },
+    "json-schema-traverse": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+      "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
+    },
     "moment": {
       "version": "2.29.3",
       "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.3.tgz",
       "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
     },
+    "nanoid": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz",
+      "integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw=="
+    },
     "object-assign": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
@@ -153,6 +205,11 @@
       "resolved": "https://registry.npm.taobao.org/promise-polyfill/download/promise-polyfill-7.1.2.tgz",
       "integrity": "sha1-qwUwHYwoU2MBYi1pInYyJppwyjs="
     },
+    "punycode": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
+      "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA=="
+    },
     "query-string": {
       "version": "5.1.1",
       "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz",
@@ -168,6 +225,11 @@
       "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.13.5.tgz?cache=0&sync_timestamp=1584052481783&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.13.5.tgz",
       "integrity": "sha1-2Hih0JS0MG0QuQlkhLM+vVXiZpc="
     },
+    "require-from-string": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+      "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="
+    },
     "strict-uri-encode": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
@@ -177,6 +239,14 @@
       "version": "1.13.0",
       "resolved": "https://registry.npm.taobao.org/tslib/download/tslib-1.13.0.tgz?cache=0&sync_timestamp=1589411820927&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.13.0.tgz",
       "integrity": "sha1-yIHhPMcBWJTtkUhi0nZDb6mkcEM="
+    },
+    "uri-js": {
+      "version": "4.4.1",
+      "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+      "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+      "requires": {
+        "punycode": "^2.1.0"
+      }
     }
   }
 }

+ 12 - 8
pages/arLogin/arLogin.axml

@@ -1,12 +1,16 @@
 <view>
-  <view class="noData" style="text-align:center">
-    <image mode="scaleToFill" src="../../image/logo.png" class="initImg"/>
+  <view a:if="{{isShow}}">  
+    <view class="noData" style="text-align:center">
+      <image mode="scaleToFill" src="../../image/logo.png" class="initImg"/>
+    </view>
+    <view class="flex-box-v flex-center-center fontColorC"  style="font-size:28rpx;margin:0.4rem 0">
+      <text>网页版[功道云积分制]登录确认</text>
+      <text>请确认使用本人账号登录</text>
+    </view>
+    <button type="primary" style="margin:0 0.4rem;" catchTap="loginAll">授权登录</button>
+    <view class="fontColorC footer" catchTap="loginAll2">取消登录</view>
   </view>
-  <view class="flex-box-v flex-center-center fontColorC"  style="font-size:28rpx;margin:0.4rem 0">
-    <text>网页版[功道云积分制]登录确认</text>
-    <text>请确认使用本人账号登录</text>
+  <view a:else>
+    <no-data content="暂无权限,请联系管理员"></no-data>
   </view>
-  <button type="primary" style="margin:0 0.4rem;">授权登录</button>
-
-  <view class="fontColorC footer">取消登录</view>
 </view>

+ 49 - 2
pages/arLogin/arLogin.js

@@ -1,4 +1,51 @@
+var app = getApp();
+var that;
 Page({
-  data: {},
-  onLoad() {},
+  data: {
+    code:'',
+    str:'企业信息同步中...',
+    isShow:false,
+  },
+  onLoad(e) {
+    that = this;
+    dd.setNavigationBar({ title: "授权登录" });
+    if (e.code) {
+      this.setData({ code: e.code })
+    }
+  },
+  onShow() {
+    if (app.globalData.userData&&app.globalData.isSuperAdministrator) {
+      that.setData({ //获取扫码进入参数 
+        isShow: true
+      })
+    } else {
+      app.login(app.globalData.corpId, function (is) {
+        if (is&&app.globalData.isSuperAdministrator) {
+          that.setData({ //获取扫码进入参数 
+            isShow: true
+          })
+        } else {
+          dd.reLaunch({
+            url: '../../noJurisdiction/noJurisdiction'
+          })
+        }
+      }, function () { })
+    }
+  },
+  loginAll2(){
+    app.globalData.showToast("已取消");
+    dd.reLaunch({
+      url: '../workbench/index/index'
+    })
+  },
+  loginAll(){
+    app.$post("api/auth/qr",{code:this.data.code}).then((res) => {
+      app.globalData.showToast("已登录");
+      setTimeout(() => {
+        dd.reLaunch({
+          url: '../workbench/index/index'
+        })
+      }, 1000);
+		})
+  },
 });

+ 5 - 1
pages/arLogin/arLogin.json

@@ -1,3 +1,7 @@
 {
-  "usingComponents": {}
+  "component": true,
+    "usingComponents": {
+    "img-box": "/Component/img-box/index",
+    "no-data": "/Component/noData/noData"
+  }
 }

+ 1 - 0
pages/begin/begin.axml

@@ -2,6 +2,7 @@
   <view class="noData flex-box-v flex-center-center">
     <image mode="scaleToFill" src="../../image/logo.png" class="initImg"/>
     <text class="text">{{str}}</text>
+    <button type="primary" a:if="{{str=='企业授权已过期'}}" class="btn" catchTap="loginAll2">去续费</button>
     <button type="primary" a:if="{{num==3}}" class="btn" catchTap="loginAll">同步企业信息</button>
   </view>
 </view>

+ 16 - 2
pages/begin/begin.js

@@ -1,5 +1,7 @@
 var app = getApp();
 var that;
+import 'dingtalk-jsapi/entry/mobile';
+import openLink from 'dingtalk-jsapi/api/biz/util/openLink';
 Page({
   data: {
     num:0,
@@ -9,8 +11,13 @@ Page({
    that = this;
    that.loginAll();
   },
+  loginAll2(){
+    openLink({
+     url: 'https://h5.dingtalk.com/open-market/share.html?shareGoodsCode=D34E5A30A9AC7FC6327AB5E6D2D145418457E59F16C3FC9649BF22BF44CFA3D039FDE4A69694381C&token=523cb2f0e79525ea9b1719c0c5765a6b&shareUid=C5EB7B5C85793F3D909B2AC4771E12D7#/'
+    })
+  },
   loginAll(){
-      app.login(app.globalData.corpId, function (is,is2) {
+      app.login(app.globalData.corpId, function (is) {
           if(is){
             dd.reLaunch({
               url: '../workbench/index/index'
@@ -21,19 +28,26 @@ Page({
             })
           }
       },function(data){
-        if(data.code==3000||data.code==2001){
+        if(data.code==3000){
           if(that.data.num==3){ return false}
           setTimeout(function(){ 
             let num=that.data.num;
             that.setData({ num:num+1 })
             that.loginAll();
           }, 3000);
+        }else if(data.code==2001){
+          that.setData({
+            num:0,
+            str:'企业授权已过期'
+          })
         }else{
              that.setData({
               num:0,
               str:data.msg
             })
         }
+        
+
       },true)
   },
 });

+ 1 - 1
pages/deploy/integralRule/integralRule.js

@@ -20,7 +20,7 @@ Page({
         { name: '全部', id: 0 }
       ],
     })
-    dd.setNavigationBar({ title: "积分分类" });
+    dd.setNavigationBar({ title: "积分规则" });
   },
   onShow() {
     this.setData({ types: app.globalData.types })

+ 1 - 1
pages/deploy/setCheck/setCheck.js

@@ -4,7 +4,7 @@ Page({
   data: {},
   onLoad() {
     that = this;
-    dd.setNavigationBar({ title: "考勤分" });
+    dd.setNavigationBar({ title: "考勤分规则" });
   },
   onShow(){
     this.getData();

+ 2 - 2
pages/statistics/getTask/getTask.js

@@ -11,14 +11,14 @@ Page({
   },
   onLoad() {
     that = this;
-    dd.setNavigationBar({ title: "悬赏任务大厅" });
+    dd.setNavigationBar({ title: "领任务" });
     this.setData({
       userId: app.globalData.userData.id
     })
   },
   onShareAppMessage() {
     return {
-      title: '悬赏任务大厅',
+      title: '领任务',
       desc: '有新的悬赏任务发布啦,大家快来抢!',
       path: 'pages/statistics/getTask/getTask'
     };

+ 1 - 3
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.axml

@@ -100,14 +100,12 @@
   <view  a:if="{{dataDetail.dc_remark.flow}}">
     <review process="{{dataDetail.dc_remark.flow}}" status="{{dataDetail.dc_status}}" />
   </view>
-
-
   <view class="bottom flex-box flex-flex-center-center" a:if="{{is&&!is2}}">
     <view class="flex-1 blueBtn" catchTap="openJp" a:if="{{dataDetail.has_ticket==0}}">发放奖票</view>
     <view class="flex-1 blueBtn2" catchTap="openDetail" a:else>查看奖票</view>
   </view>
   <block a:else>
-    <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.recorder_id==userId&&dataDetail.process.length==1&&(dataDetail.event_type==3||dataDetail.event_type==4)}}">
+    <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.recorder_id==userId&&(dataDetail.event_type==3||dataDetail.event_type==4)}}">
       <text class="flex-2 fontColorB">撤销后数据将不可恢复</text>
       <view></view>
       <view class="flex-1 blueBtn" catchTap="openCx">撤销奖扣</view>

+ 1 - 1
pages/statistics/userRamking/userRamking.js

@@ -19,7 +19,7 @@ Page({
     //     }
     //   },
     // });
-    dd.setNavigationBar({ title: "更多排名" });
+    dd.setNavigationBar({ title: "排行榜" });
   },
   onShow(){
     this.getData();

+ 17 - 0
pages/workbench/index/index.acss

@@ -1,5 +1,22 @@
 @import "../../../Component/aParse/aParse.acss";
 
+
+.vlink-box{
+  position:fixed;
+  bottom: 0;
+  right: 0;
+  left: 0;
+  z-index: 2;
+  background-color: #463839;
+  border-radius: 5px;
+  padding: 0 0.32rem;
+}
+.add-vlink{
+  background-color: #fff;
+  border-radius: 25px;
+  font-size: 28rpx;
+  padding: 4rpx 10rpx;
+}
 .zn{
   background-color: #fff;
 

+ 16 - 0
pages/workbench/index/index.axml

@@ -21,6 +21,14 @@
   </view>
   <view class="headed margin-bottom">
     <view class="top"></view>
+    <view class="flex-box-ce" style="background-color: #fdf6ec;color: #FF9600;padding:10rpx 32rpx;font-size:28rpx;margin-bottom:0.4rem" a:if="{{isShowDate}}">
+      <image mode="scaleToFill" src="../../../image/lb.png" style="width:30rpx;height:30rpx;position:relative;top:-2px"></image>
+      <view style="padding:0 20rpx;" class="flex-1 font-flex-word" onTap="openUrl2">系统将于{{day}}天后到期</view>
+      <view catchTap="dayConfig" class="blue" data-index="1" style="padding-right:20rpx;">续费/升级</view>
+      <view catchTap="dayConfig" data-index="2">
+        <image mode="scaleToFill" style="width:34rpx;height:34rpx;position: relative;top: 4rpx;" src="../../../image/close.png" class="img-right"></image>
+      </view>
+    </view>
     <view class="menuList flex-box flex-d-wrap">
       <view a:for="{{menuList}}" class="menu-item" data-url="{{item.url}}" onTap="openUrl">
         <image mode="scaleToFill" src="{{item.imgUrl}}"></image>
@@ -207,4 +215,12 @@
       </view>
     </view>
   </view>
+  <!-- 关注弹窗 -->
+  <view class="vlink-box flex-box-ce" a:if="{{isShowVlink}}">
+    <view catchTap="vlinkConfig"><icon type="clear" size="18" style="position:relative;top:6rpx;padding:0.2rem 0"/></view>
+    <view style="padding:0 0.2rem"><image mode="scaleToFill" style="width:50rpx;height:50rpx;" src="../../../image/logo.png"></image></view>
+    <view class="flex-1" style="color:#fff;font-size:32rpx">关注功道云,管理资料免费领</view>
+    <view catchTap="onTap" class="add-vlink">立即关注</view>
+  </view>
+
 </view>

+ 117 - 34
pages/workbench/index/index.js

@@ -7,6 +7,7 @@ var AParse = require('../../../Component/aParse/aParse.js');
 import 'dingtalk-jsapi/entry/union';
 import { setCache, getCache } from '../../../utils/util'
 import { contactAdminToUseApp } from 'dingtalk-design-libs';
+import { openSubscribeMiniApp, disposeSubscribeData} from 'dingtalk-service-window-libs/lib/openSubscribeMiniApp';
 import moment from 'moment' // 时间库
 Page({
   data: {
@@ -46,38 +47,46 @@ Page({
     isGz:false,
     islog:true,
     announcementList:[],
-    isShowYy:false,
+    isSuperAdministrator:app.globalData.isSuperAdministrator, //是否是超级管理员
     isShowAn:true,
 
     selectPlItem:{},
+    isShowDate:false,
+    dateArr:[
+      {dateIndex:1,max:60,min:31,},
+      {dateIndex:2,max:30,min:8},
+      {dateIndex:3,max:7,min:4},
+      {dateIndex:4,max:3,min:0},
+    ],
+    day:0,
+    dateIndex:0,
+    isShowVlink:false,//是否显示关注
   },
   onLoad() {
     that = this;
     chart1, chart2, chart3 = '';
   },
   onShow() {
+    disposeSubscribeData((options)=>{
+      if(options.subscribe=='cancel'){
+        this.vlinkConfig()
+      }else{
+        // app.globalData.showToast("已关注");
+        this.vlinkConfig()
+      }
+      // dd.alert({
+      //     title:'disposeSubscribeData',
+      //     content:JSON.stringify(options)
+      // })
+    })
     if (app.globalData.userData) {
       dd.setNavigationBar({ title: app.globalData.userData.name });
       that.getUserData();
       that.getGg();
       that.getNotice();
       that.opneWebSocket();
-      let isShowYy=false;
-      app.globalData.userData.employee_detail.role_list.forEach(item=>{
-        if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
-            isShowYy=true;
-        }
-      })
-      that.setData({
-        isAdministrator: app.globalData.isAdministrator,
-        getRole_four: app.globalData.isCreator,
-        isSubject: app.globalData.userData.is_personal == 1 ? true : false,
-        mainCorpId: app.globalData.userData.main_corp_id,
-        isShowYy:isShowYy,
-        isShowAn:getCache('isShowAn')? false:true,
-      })
-      if(that.data.isShowYy&&that.data.isShowAn){
-            that.getAnnouncement();
+      if(app.globalData.isSuperAdministrator){ //套餐
+        that.getCorp();
       }
       if(!getCache('init_rule_check')){
         app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
@@ -89,39 +98,50 @@ Page({
       } else if (!app.globalData.isCreator && !app.globalData.isAdministrator) {
         that.setMenuList("employee");
       }
+      that.setData({
+        isAdministrator: app.globalData.isAdministrator,
+        getRole_four: app.globalData.isCreator,
+        isSubject: app.globalData.userData.is_personal == 1 ? true : false,
+        mainCorpId: app.globalData.userData.main_corp_id,
+        isShowAn:getCache('isShowAn')? false:true,
+      })
+      if(app.globalData.isSuperAdministrator&&that.data.isShowAn){ //指南
+        that.getAnnouncement();
+      }
+      if(app.globalData.isSuperAdministrator&&app.globalData.userData.vlink.status=='UNFOLLOW'&&!getCache('vlink')){ //关注
+        this.setData({
+          isShowVlink:true
+        })
+      }
     } else {
       app.login(app.globalData.corpId,function (is) {
         if (is) {
           dd.setNavigationBar({ title: app.globalData.userData.name });
-          if (app.globalData.isCreator) {
-            that.setMenuList("creator");
-          } else if (app.globalData.isAdministrator) {
-            that.setMenuList("admin");
-          } else if (!app.globalData.isCreator && !app.globalData.isAdministrator) {
-            that.setMenuList("employee");
-          }
           that.getUserData();
           that.getGg();
           that.getNotice();
           that.opneWebSocket();
+          if(app.globalData.isSuperAdministrator){
+            that.getCorp();
+          }
           if(!getCache('init_rule_check')){
             app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
           }
-          let isShowYy=false;
-          app.globalData.userData.employee_detail.role_list.forEach(item=>{
-            if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
-                isShowYy=true;
-            }
-          })
+          if (app.globalData.isCreator) {
+            that.setMenuList("creator");
+          } else if (app.globalData.isAdministrator) {
+            that.setMenuList("admin");
+          } else if (!app.globalData.isCreator && !app.globalData.isAdministrator) {
+            that.setMenuList("employee");
+          }
           that.setData({
             isAdministrator: app.globalData.isAdministrator,
             getRole_four: app.globalData.isCreator,
             isSubject: app.globalData.userData.is_personal == 1 ? true : false,
             mainCorpId: app.globalData.userData.main_corp_id,
-            isShowYy:isShowYy,
             isShowAn:getCache('isShowAn')? false:true,
           })
-          if(that.data.isShowYy&&that.data.isShowAn){
+          if(app.globalData.isSuperAdministrator&&that.data.isShowAn){
             that.getAnnouncement();
           }
         } else {
@@ -132,10 +152,74 @@ Page({
       },function(){},true)
     }
   },
+  onTap() {
+    return openSubscribeMiniApp({
+        panelHeight: 'percent40',
+        path: 'pages/index/index',
+        float: true,
+        extraData: {
+               clientId: '55493',
+               authToken: 'v00dfd6ff9ca66a4ae187dab8a5b6004495',
+       },
+       options:{
+         // snsMessageSendAuthEnable参数仅对个人小程序有效,非个人小程序请勿设置此参数。
+         // 在使用 snsMessageSendAuthEnable 参数时
+         // 需要为应用申请OfficialAccount.SnsMessage.Send权限后方可使用。
+          //  snsMessageSendAuthEnable:true
+       }
+    });
+  },
+  vlinkConfig(){
+    setCache('vlink',true);
+    this.setData({
+      isShowVlink:false
+    })
+  },
+  dayConfig(e){
+    var index = e.target.dataset.index;
+    if(index==1){
+      dd.navigateTo({
+        url: '../../deploy/addMoney/addMoney'
+      })
+    }else{
+      setCache('dateIndex',that.data.dateIndex);
+      that.setData({
+        isShowDate:false,
+      })
+    }
+  },
+  //获取套餐信息
+  getCorp() {
+      app.$get2('api/order/corp', {corp_id:app.globalData.corpId}).then(res => {
+        let corpMessage = res.data.data;
+        const startDate = moment(corpMessage.expire_time).format('YYYY-MM-DD');
+        const endDate = moment().format('YYYY-MM-DD');
+        let day=moment(startDate).diff(endDate, 'day');
+        // let day=4
+        this.data.dateArr.forEach(item=>{
+          if(item.max>=day&&item.min<=day){
+            let dateIndex=getCache('dateIndex')
+            if(!dateIndex){
+              that.setData({
+                dateIndex:item.dateIndex,
+                isShowDate:true,
+                day:day
+              })
+            }else if(dateIndex!=item.dateIndex){
+              that.setData({
+                dateIndex:item.dateIndex,
+                isShowDate:true,
+                day:day
+              })
+            }
+          }
+        })
+      });
+  },
   closeAn(){
     setCache('isShowAn',true);
     this.setData({
-      isShowYy:false,
+      isSuperAdministrator:false,
     })
   },
   openaN(e){
@@ -147,7 +231,6 @@ Page({
   getAnnouncement(){
     app.$get2("api/announcement/list",{type:3}).then((res) => {
         let list=res.data.data.list;
-
         that.setData({ announcementList:list})
     })
   },

+ 1 - 1
pages/workbench/statistics_A/statistics_A.axml

@@ -29,7 +29,7 @@
   </view>
   <view class="main">
       <view class="flex-box">
-         <view class="title flex-1">月A分事件</view>
+         <view class="title flex-1">{{monthStr}}月A分事件</view>
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill"  src="../../../image/right.png"/></view>
       </view>
       <view>

+ 2 - 2
pages/workbench/statistics_B/statistics_B.axml

@@ -33,7 +33,7 @@
   </view>
   <view class="main margin-bottom">
       <view class="flex-box">
-         <view class="title flex-1">月奖分最多</view>
+         <view class="title flex-1">{{monthStr}}月奖分最多</view>
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill"  src="../../../image/right.png"/></view>
       </view>
       <view>
@@ -50,7 +50,7 @@
   </view>
     <view class="main">
       <view class="flex-box">
-         <view class="title flex-1">月扣分最多</view>
+         <view class="title flex-1">{{monthStr}}月扣分最多</view>
          <view class="gengduo" catchTap="openMore">更多<image mode="scaleToFill" src="../../../image/right.png"/></view>
       </view>
       <view>