347617796@qq.com 4 lat temu
rodzic
commit
47f224cf5d

+ 9 - 2
Component/aParse/aParse.acss

@@ -6,7 +6,7 @@
     line-height: 1.8;
 }
 view{
-    word-break:break-all; overflow:auto;
+    word-break:break-all;
 }
 .aParse-inline{
     display: inline;
@@ -101,11 +101,14 @@ view{
 .aParse-ul{
     margin: 20rpx 10rpx;
 }
-
+.aParse-li{
+    width: 100%
+}
 .aParse-li,.aParse-li-inner{
     display: flex;
     align-items: baseline;
     margin: 10rpx 0;
+     width: 100%
 }
 .aParse-li-text{
     
@@ -192,3 +195,7 @@ view{
 .aParse-figure {
   overflow: hidden;
 }
+.aParse-p{
+    color: #666;
+    font-size: 0.28rem
+}

+ 2 - 2
Component/aParse/aParse.js

@@ -23,12 +23,12 @@ function aParse(bindName = 'aParseData', type = 'html', data = '<div class="colo
   var transData = {};//存放转化后的数据
   if (type == 'html') {
     transData = HtmlToJson.html2json(data, bindName);
-    console.log(JSON.stringify(transData, ' ', ' '));
+    // console.log(JSON.stringify(transData, ' ', ' '));
   } else if (type == 'md' || type == 'markdown') {
     var converter = new showdown.Converter();
     var html = converter.makeHtml(data);
     transData = HtmlToJson.html2json(html, bindName);
-    console.log(JSON.stringify(transData, ' ', ' '));
+    // console.log(JSON.stringify(transData, ' ', ' '));
   }
   transData.view = {};
   transData.view.imagePadding = 0;

+ 2 - 2
Component/aParse/html2json.js

@@ -97,14 +97,14 @@ function html2json(html, bindName) {
                     var name = attr.name;
                     var value = attr.value;
                     if (name == 'class') {
-                        console.dir(value);
+                        // console.dir(value);
                         //  value = value.join("")
                         node.classStr = value;
                     }
                     // has multi attibutes
                     // make it array of attribute
                     if (name == 'style') {
-                        console.dir(value);
+                        // console.dir(value);
                         //  value = value.join("")
                         node.styleStr = value;
                     }

+ 3 - 3
package-lock.json

@@ -87,9 +87,9 @@
       }
     },
     "dingtalk-jsapi": {
-      "version": "2.13.20",
-      "resolved": "https://registry.npm.taobao.org/dingtalk-jsapi/download/dingtalk-jsapi-2.13.20.tgz",
-      "integrity": "sha1-DLN/cZiU4BrenyHTC0itnDdmpwQ=",
+      "version": "2.13.23",
+      "resolved": "https://registry.npm.taobao.org/dingtalk-jsapi/download/dingtalk-jsapi-2.13.23.tgz",
+      "integrity": "sha1-O2IykfH/sPXBuJtg1vjfJ2Y2cWA=",
       "requires": {
         "promise-polyfill": "^7.1.0"
       }

+ 1 - 1
pages/deploy/index/index.axml

@@ -47,7 +47,7 @@
       <view class="flex-box flex-v-ce li" data-index="5" onTap="openView">
         <image class="img-left" mode="scaleToFill" src="../../../image/sj.png"></image>
         <view class="flex-box flex-v-ce flex-1 li-right">
-          <view class="title flex-1">升级公告</view>
+          <view class="title flex-1">系统公告</view>
           <image mode="scaleToFill" src="../../../image/right.png" class="img-right"></image>
         </view>
       </view>

+ 32 - 0
pages/deploy/upgrade/upgrade.acss

@@ -6,4 +6,36 @@
 }
 .li view:nth-child(2){
   font-size: 28rpx;
+}
+.picker{
+  position: fixed;
+  top: 0;
+  left: 0;
+  right: 0;
+  border-bottom: 1px solid #f1f1f1;
+  text-align: center;
+  background: #fff;
+  height: 1rem;
+}
+.row-extra{
+  padding:0 0.18rem;
+  position: relative;
+  display: inline;
+  height: 1rem;
+  line-height: 1rem;
+}
+.scroll{
+  height: calc(100vh - 100rpx);
+}
+.after {
+  position: absolute;
+  top: 50%;
+  right: -20rpx;
+  margin-top: -0.1rem;
+  border: 0.06rem solid;
+  border-color: transparent transparent #C0C4CC #C0C4CC;
+  -webkit-transform: rotate(-45deg);
+  transform: rotate(-45deg);
+  opacity: .8;
+  content: '';
 }

+ 11 - 3
pages/deploy/upgrade/upgrade.axml

@@ -1,9 +1,17 @@
 <view>
   <view class="body">
-    <view class="li" a:for="{{list}}" catchTap="openDetail" data-id="{{item.id}}">
-      <view class="font-flex-word">{{item.version}}</view>
-      <view class="fontColorT">发布时间:{{item.create_time}}</view>
+    <view class="picker">
+      <picker onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{objectArray}}" range-key="name">
+        <view class="row-extra">{{objectArray[arrIndex].name}}<text class="after"></text></view>
+      </picker>
     </view>
+    <view style="height: 1rem;"></view>
+    <scroll-view scroll-y="{{true}}" class="scroll" a:if="{{list.length>0}}" onScrollToLower="onScrollToLower">
+      <view class="li" a:for="{{list}}" catchTap="openDetail" data-id="{{item.id}}">
+        <view class="font-flex-word">{{item.title}}</view>
+        <view class="fontColorT">发布时间:{{item.create_time}}</view>
+      </view>
+    </scroll-view>
     <no-data a:if="{{list.length==0}}"></no-data>
   </view>
 </view>

+ 53 - 8
pages/deploy/upgrade/upgrade.js

@@ -3,19 +3,64 @@ var that;
 Page({
   data: {
     list:[],
-    page:1
+    page:1,
+    objectArray: [
+      {
+        id: 0,
+        name: '全部',
+      },
+      {
+        id: 1,
+        name: '版本更新',
+      },
+      {
+        id: 2,
+        name: '系统公告',
+      },
+    ],
+    arrIndex: 0,
   },
   onLoad() {
     that = this;
-    dd.setNavigationBar({ title: "版本更新" });
+    dd.setNavigationBar({ title: "系统公告" });
     this.getList();
   },
-  getList(){
-    app.$get("api/version/list",{page:this.data.page,page_size:100,cate:1}).then((res) => {
-      var obj=res.data.data.list;
-      this.setData({
-        list:obj
-      })
+  bindObjPickerChange(e) {
+    this.setData({
+      arrIndex: e.detail.value,
+      page:1,
+      isData: false
+    });
+    that.getList();
+  },
+    //上啦加载
+  onScrollToLower() {
+    if (!that.data.isData) {
+      this.setData({ page: ++that.data.page })
+      this.getList(true);
+    }
+  },
+  getList(is){
+    app.$get("api/announcement/list",{page:this.data.page,page_size:20,type:that.data.arrIndex}).then((res) => {
+      var data=res.data.data.list;
+      if (is) {
+        if (data.length == 0) {
+          this.setData({
+            isData: true
+          })
+          return;
+        }
+        var list = that.data.list;
+        this.setData({
+          list: list.concat(data)
+        })
+      } else {
+        this.setData({ list: [] });
+        this.setData({
+          list: data,
+          isData: false
+        })
+      }
     })
   },  
   //跳转

+ 1 - 1
pages/deploy/upgradeDetail/upgradeDetail.axml

@@ -1,6 +1,6 @@
 <import src="../../../Component/aParse/aParse.axml"/>
 <view>
-  <view class="title">{{obj.version}}</view>
+  <view class="title">{{obj.title}}</view>
   <view style="padding:28rpx;">
       <template is="aParse" data="{{aParseData:article.nodes}}"/>
   </view>

+ 3 - 3
pages/deploy/upgradeDetail/upgradeDetail.js

@@ -7,7 +7,7 @@ Page({
   },
   onLoad(e) {
     that = this;
-    dd.setNavigationBar({ title: "更新内容" });
+    dd.setNavigationBar({ title: "公告内容" });
     if (e.id) {
       this.getList(e.id);
     }
@@ -22,8 +22,8 @@ Page({
 * 4.target为Page对象,一般为this(必填)
 * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)
 */
-    app.$get("api/version/info", { version_id: id }).then((res) => {
-      AParse.aParse('article', 'html', res.data.data.update_msg, that, 5);
+    app.$get("api/announcement/info", { announcement_id: id }).then((res) => {
+      AParse.aParse('article', 'html',res.data.data.focus+'<div style="height:20px"></div>'+res.data.data.update_msg, that, 5);
       this.setData({
         obj: res.data.data
       })

+ 33 - 10
pages/statistics/C_ranking/C_ranking.js

@@ -14,11 +14,12 @@ Page({
     dateObj: {
       date: '',
       type: ''
-    }
+    },
+    parameter: {}
   },
   onLoad(e) {
     that = this;
-    console.log(e.date_interval)
+    this.setData({ parameter: e })
     if (e.date_interval == 3) {
       this.setData({
         [`dateObj.type`]: "1",
@@ -48,13 +49,35 @@ Page({
         selectDateVal: app.globalData.month,
       })
     }
-
-    if (e.id) {
-      this.setData({ id: e.id });
-      dd.setNavigationBar({ title: e.name });
-      this.getData();
+    if (app.globalData.userData) {
+      if (e.id) {
+        that.setData({ id: e.id });
+        dd.setNavigationBar({ title: e.name });
+        that.getData();
+      }
+    } else {
+      app.login(app.globalData.corpId, function (is) {
+        if (is) {
+          if (e.id) {
+            that.setData({ id: e.id });
+            dd.setNavigationBar({ title: e.name });
+            that.getData();
+          }
+        } else {
+          dd.reLaunch({
+            url: '../noJurisdiction/noJurisdiction'
+          })
+        }
+      })
     }
   },
+  onShareAppMessage() {
+    return {
+      title: this.data.parameter.name,
+      desc: this.data.parameter.name,
+      path: 'pages/statistics/C_ranking/C_ranking?id=' + this.data.parameter.id + '&name=' + this.data.parameter.name + '&date_interval=' + this.data.parameter.date_interval
+    };
+  },
   //选择时间
   onConfirmDate(data) {
     this.setData({
@@ -73,11 +96,11 @@ Page({
         dateIndex: data.type
       })
     } else {
-      var str=data.date.slice(0,4)
-      var str2=data.date.slice(data.date.length-2)
+      var str = data.date.slice(0, 4)
+      var str2 = data.date.slice(data.date.length - 2)
       this.setData({
         selectDateVal: data.date,
-        month: str+str2,
+        month: str + str2,
         dateIndex: data.type
       })
     }

+ 1 - 1
pages/statistics/check_top/check_top.axml

@@ -27,7 +27,7 @@
         <view class="index" a:elif="{{index==2}}">
           <image mode="scaleToFill" src="../../../image/3.png"/>
         </view>
-        <view class="index" a:else>{{index}}</view>
+        <view class="index" a:else>{{(index+1)}}</view>
         <view class="flex-1 flex-box flex-v-ce">
           <img-box name="{{item.name}}" imgUrl="{{item.img_url}}" height="80rpx" width="80rpx" fSize="24rpx"></img-box>
           <view class="users">

+ 25 - 10
pages/statistics/my_task/my_task.js

@@ -16,20 +16,35 @@ Page({
     },
   },
   onLoad(e) {
+    that = this;
     if (e.index) {
       this.setData({
         activeIndex: e.index,
       })
     }
-    that = this;
-    this.getToDay();
     dd.setNavigationBar({ title: "我的任务" });
   },
   onShow() {
-    if (this.data.page == 1) {
-      dd.hideLoading();
-      this.setData({list:[]})
-      that.getData();
+    if (app.globalData.userData) {
+      if (this.data.page == 1) {
+        dd.hideLoading();
+        that.getToDay();
+        that.getData();
+      }
+    } else {
+      app.login(app.globalData.corpId, function (is) {
+        if (is) {
+          that.getToDay();
+          if (that.data.page == 1) {
+            dd.hideLoading();
+            that.getData();
+          }
+        } else {
+          dd.reLaunch({
+            url: '../noJurisdiction/noJurisdiction'
+          })
+        }
+      })
     }
   },
   //显示选择员工
@@ -135,17 +150,17 @@ Page({
     })
   },
   //过滤List,通常用于删除了某条数据,刷新列表
-  filtrationList(index,id) {
+  filtrationList(index, id) {
     if (index == 1) {
       this.getToDay()
-    } else if(index==2&&this.data.page!=1){
-      var list=this.data.list;
+    } else if (index == 2 && this.data.page != 1) {
+      var list = this.data.list;
       for (let i in list) {
         if (list[i].id == id) {
           list.splice(i, 1)
         }
       }
-      this.setData({ list:list})
+      this.setData({ list: list })
     }
   },
   openDetail(e) {

+ 13 - 4
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.acss

@@ -63,22 +63,31 @@
 }
 .bottom{
   background: #fff;
-  position: sticky;
+  position: fixed;
   bottom: 0;
+  left: 0;
+  right: 0;
   z-index: 2;
   text-align: center;
-  padding: 16rpx;
+  padding: 10rpx;
+  padding-bottom: 30rpx;
   border-top: 1px solid #f1f1f1;
 
 }
-.bottom view:nth-child(1){
+.bottom text{
+  display: block;
+  padding: 16rpx 0;;
+  text-align: left;
+}
+.bottom  .defBtn{
   color: #26A2FF;
   border: 1px solid #26A2FF;
   padding: 16rpx 0;
   border-radius: 5rpx;
   margin-right: 16px;
+  background: #fff;
 }
-.bottom view:nth-child(2){
+.bottom .blueBtn{
   color: #fff;
   background: #26A2FF;
   padding: 16rpx 0;

+ 9 - 4
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.axml

@@ -62,8 +62,13 @@
       </view>
     </view>
   </view>
-      <!-- 调用过程组件 -->
-    <view class="">
-      <process process="{{dataDetail.process}}" a:if="{{dataDetail.process.length>0}}"/>
-    </view>
+  <!-- <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.applyor_id==userId&&dataDetail.process.length==1&&(dataDetail.event_type==3||dataDetail.event_type==4)}}">
+      <text class="flex-2 fontColorF">撤销后数据将不可恢复</text>
+      <view></view>
+      <view class="flex-1 blueBtn" catchTap="openCx">撤销奖扣</view>
+  </view> -->
+  <!-- 调用过程组件 -->
+  <view class="">
+    <process process="{{dataDetail.process}}" a:if="{{dataDetail.process.length>0}}"/>
+  </view>
 </view>

+ 34 - 3
pages/statistics/prizeBuckleDetail/prizeBuckleDetail.js

@@ -3,17 +3,48 @@ var app = getApp()
 var that;
 Page({
   data: {
-    date: app.globalData.month
-
+    date: app.globalData.month,
+    review_id:'',
+    userId:''
   },
   onLoad(e) {
     that = this;
     dd.setNavigationBar({ title: "事件详情" });
-    console.log()
+    that.setData({
+      userId:app.globalData.userData.id
+    })
     if(e.id){
+        that.setData({
+          review_id:e.id
+        })
         that.getDetail(e.id);
     }
   },
+  openCx() {
+    dd.confirm({
+      title: '撤销奖扣',
+      content: '您确定撤销此项吗?',
+      confirmButtonText: '确定',
+      cancelButtonText: '取消',
+      success: (result) => {
+        if (result.confirm) {
+          app.$post("api/integral/review/prize/destroy", { target_id: that.data.review_id,type:1 }).then((res) => {
+            app.globalData.showToast("已撤销");
+            // var pages=getCurrentPages();//当上一页的page不等于一时,执行上一页的方法
+            // var active=pages[pages.length-2];
+            // if(active.data.page!=1){
+            //     active.refreshData(that.data.review_id);
+            // }
+            setTimeout(() => {
+              dd.navigateBack({
+                delta: 1
+              })
+            }, 1000);
+          })
+        }
+      },
+    });
+  },
   showImg(e){
       var index=e.target.dataset.index;
       var item=e.target.dataset.item

+ 41 - 3
pages/workbench/approveDetail/approveDetail.axml

@@ -70,17 +70,55 @@
         <!-- 调用过程组件 -->
     <process process="{{dataDetail.process}}" a:if="{{dataDetail.process.length>0}}"/>
   </view>
-  <view class="bottom flex-box flex-flex-center-center" a:if="{{!is}}">
+    <!-- 积分任务 -->
+  <view class="bottom flex-box flex-flex-center-center" a:if="{{!is&&dataDetail.review_status!=1&&dataDetail.source_type==1}}">
     <block a:if="{{dataDetail.status==0}}">
       <view class="flex-1 defBtn" catchTap="openBh">驳回</view>
       <view class="flex-3 blueBtn" catchTap="submit">通过</view>
     </block>
-    <block a:if="{{dataDetail.status==1||dataDetail.status==2}}">
+    <block a:if="{{(dataDetail.status==1||dataDetail.status==2)&&dataDetail.review_status==0}}">
       <text class="flex-2 fontColorF">撤回后需重新审批</text>
       <view></view>
-      <view class="flex-1 blueBtn" catchTap="openCx">撤</view>
+      <view class="flex-1 blueBtn" catchTap="openCx">撤</view>
     </block>
   </view>
+  <!-- 积分申请 -->
+  <view class="bottom flex-box flex-flex-center-center" a:if="{{!is&&dataDetail.review_status!=1&&dataDetail.source_type==2}}">
+    <block a:if="{{dataDetail.status==0}}">
+      <view class="flex-1 defBtn" catchTap="openBh">驳回</view>
+      <view class="flex-3 blueBtn" catchTap="submit">通过</view>
+    </block>
+    <block a:if="{{(dataDetail.status==1||dataDetail.status==2)&&dataDetail.review_status==0}}">
+      <text class="flex-2 fontColorF">撤回后需重新审批</text>
+      <view></view>
+      <view class="flex-1 blueBtn" catchTap="openCx">撤回</view>
+    </block>
+  </view>
+  <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.applyor_id==userData.id&&dataDetail.status==0&&dataDetail.source_type==2}}">
+    <text class="flex-2 fontColorF">撤销申请后数据将不可恢复</text>
+    <view></view>
+    <view class="flex-1 blueBtn" catchTap="openCx">撤销申请</view>
+  </view>
+  <!-- 积分奖扣 -->
+  <view class="bottom flex-box flex-flex-center-center" a:if="{{!is&&dataDetail.review_status!=1&&dataDetail.source_type==3}}">
+    <block a:if="{{dataDetail.status==0}}">
+      <view class="flex-1 defBtn" catchTap="openBh">驳回</view>
+      <view class="flex-3 blueBtn" catchTap="submit">通过</view>
+    </block>
+    <block a:if="{{(dataDetail.status==1||dataDetail.status==2)&&dataDetail.review_status==0}}">
+      <text class="flex-2 fontColorF">撤回后需重新审批</text>
+      <view></view>
+      <view class="flex-1 blueBtn" catchTap="openCx">撤回</view>
+    </block>
+  </view>
+
+  <view class="bottom flex-box flex-flex-center-center" a:if="{{dataDetail.applyor_id==userData.id&&dataDetail.status==0&&dataDetail.source_type==3}}">
+    <text class="flex-2 fontColorF">撤销奖扣后数据将不可恢复</text>
+    <view></view>
+    <view class="flex-1 blueBtn" catchTap="openCx">撤销奖扣</view>
+  </view>
+
+  
   <!-- 弹出框 -->
   <view class="windows" a:if="{{isBh}}">
     <view class="windows-box">

+ 2 - 3
pages/workbench/approveDetail/approveDetail.js

@@ -6,14 +6,13 @@ Page({
     review_id: '',
     isBh: false,//是否显示驳回弹窗
     textArea: "",
-     disabled: false,
+    disabled: false,
   },
   onLoad(e) {
     that = this;
-
     dd.setNavigationBar({ title: "详情" });
     if (e.id) {
-      that.setData({ review_id: e.id });
+      that.setData({ review_id: e.id,userData:app.globalData.userData });
       that.getData();
     }
     if (e.is) {

+ 32 - 4
pages/workbench/index/index.acss

@@ -1,10 +1,28 @@
+@import "../../../Component/aParse/aParse.acss";
 .top {
   width: 100%;
   height: 70rpx;
   background-color: #26A2FF;
   margin-bottom: 100rpx;
 }
-
+.title{
+  text-align: center;
+  font-size: 0.28rem;
+  color: #222;
+  padding:0.32rem;
+}
+.btns view{
+    text-align: center;
+    padding:0.32rem;
+    border-top: 1px solid #f1f1f1;
+    font-size: 0.28rem
+}
+.btns view:nth-child(1){
+    border-right: 1px solid #f1f1f1;
+}
+.btns view:nth-child(2){
+   color: #26A2FF;
+}
 .head {
   position: absolute;
   top: 0;
@@ -170,9 +188,12 @@
 
 .windows-box {
   background: #fff;
-  margin: 0 10%;
-  margin-top: 50%;
   border-radius: 20rpx;
+  position: absolute;
+  left: 10%;
+  right: 10%;
+  top: 40%;
+  margin-top: -25%;
 }
 
 .windows-title {
@@ -192,10 +213,17 @@
 }
 
 .windows-content {
-  height: 100rpx;
+  height: 1rem;
   padding: 0 28rpx;
   font-size: 32rpx;
 }
+.windows-content2 {
+  height: auto;
+  max-height: 4rem;
+  overflow-y: auto;
+  padding:28rpx;
+  font-size: 32rpx;
+}
 
 .f2-chart {
   /* width: 100%; */

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

@@ -1,3 +1,4 @@
+<import src="../../../Component/aParse/aParse.axml"/>
 <view>
   <view class="head flex-box flex-center-center">
     <view class="flex-1" data-index="1" onTap="openView">
@@ -120,4 +121,17 @@
       </view>
     </view>
   </view>
+  <view a:if="{{isUpdate}}" class="windows">
+    <view class="windows-box">
+      <view class="title font-flex-word">{{title}}</view>
+      <view class="windows-content2">
+        <!--<view class="title">{{title}}</view> -->
+        <template is="aParse" data="{{aParseData:article.nodes}}"/>
+      </view>
+      <view class="btns flex-box flex-v-ce">
+        <view class="flex-1" catchTap="colseText">我知道了</view>
+        <view class="flex-1" catchTap="openText">查看详情</view>
+      </view>
+    </view>
+  </view>
 </view>

+ 53 - 26
pages/workbench/index/index.js

@@ -3,6 +3,7 @@ var that;
 var chart1;
 var chart2;
 var chart3;
+var AParse = require('../../../Component/aParse/aParse.js');
 Page({
   data: {
     userData: {},
@@ -27,16 +28,19 @@ Page({
       { name: '发布悬赏', imgUrl: '../../../image/caback6.png', url: '../../statistics/offerAreward/offerAreward', code: 'creator admin' },
       { name: '发放奖票', imgUrl: '../../../image/add_ticket.png', url: '../../statistics/grant/grant', code: 'creator admin' },
       { name: '全部', imgUrl: '../../../image/all2.png', url: 'all', code: 'creator admin employee' },
-    ]
+    ],
+    isUpdate:false,
+    title:'',//系统消息标题
+    textId:''//系统消息ID
   },
   onLoad() {
     that = this;
     chart1, chart2, chart3 = '';
   },
-
-  onShow(query) {
+  onShow() {
     if (app.globalData.userData) {
       that.getUserData();
+      that.getGg();
       that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
     } else {
       app.login(app.globalData.corpId, function (is) {
@@ -48,6 +52,7 @@ Page({
           }else if(!app.globalData.isCreator&&!app.globalData.isAdministrator){
             that.setMenuList("employee");
           }
+          that.getGg();
           that.getUserData();
           that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
         } else {
@@ -66,33 +71,52 @@ Page({
       })
       return
     }
-    // if(url=='../apply/apply'){
-    //   var item = {
-    //     cycle_type: 1,
-    //     id: 578,
-    //     is_attendance: 0,
-    //     max_point: 10,
-    //     min_point: 10,
-    //     prize_type: 0,
-    //     pt_Obj: {
-    //       code: "BF",
-    //       id: 3,
-    //       name: "B分",
-    //     },
-    //     pt_id: 3,
-    //     range_type: 1,
-    //     remark: "分类1-测试缓存",
-    //     rule_id: 185,
-    //   }
-    //   dd.navigateTo({
-    //     url: '../apply/apply?item='+JSON.stringify(item)
-    //   })
-    //   return
-    // }
     dd.navigateTo({
       url: url
     })
   },
+  openText(){
+    that.colseText();
+    dd.navigateTo({
+      url: '../../deploy/upgradeDetail/upgradeDetail?id='+that.data.textId
+    })
+  },
+  //获取缓存的公告
+  getReviewerObj(fuc) {
+    dd.getStorage({
+      key: 'isShowMessage',
+      success: function (res) {
+        if (res.data) {
+          fuc(res.data);
+        } else {
+          fuc({});
+        }
+      }
+    });
+  },
+  // 获取公告
+  getGg(){
+    if(that.data.title){
+      return
+    }
+    app.$get("api/announcement/list", {page: 1, page_size: 1}).then((res) => {
+      var data = res.data.data.list[0];
+      AParse.aParse('article', 'html', data.focus, that, 5); 
+      that.setData({
+        title:data.title,
+        textId:data.id
+      });
+      that.getReviewerObj(function(res){
+          if(res!=data.id){
+              that.colseText();
+              dd.setStorage({
+                    key: 'isShowMessage',
+                    data: data.id,
+              });
+          }
+      })
+    })
+  },
   setMenuList(str){
       var arr=[];
       that.data.menuList.forEach(item=>{
@@ -104,6 +128,9 @@ Page({
         menuList:arr
       })
   },
+  colseText(){
+    this.setData({isUpdate: !this.data.isUpdate })
+  },
   showText() {
     this.setData({ isBh: !this.data.isBh })
   },

+ 7 - 0
pages/workbench/my_approve/my_approve.js

@@ -31,6 +31,13 @@ Page({
     ],
     arrIndex: 0,
   },
+  onShareAppMessage() {
+    return {
+      title: '我的审批功能分享',
+      desc: '我的审批功能分享。',
+      path: 'pages/workbench/my_approve/my_approve'
+    };
+  },
   onLoad() {
     that = this;
     dd.setNavigationBar({ title: "我的审批" });

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

@@ -52,7 +52,7 @@
         <view class="fontColorT text2">扣分人次</view>
       </view>
       <view class="f2-chart">
-        <f2 onInit="onInitChart2"></f2>
+        <f2 onInit="onInitChart2" a:if="{{showtu}}"></f2>
       </view>
     </view>
   </view>

+ 21 - 1
pages/workbench/prize_buckle/prize_buckle.js

@@ -21,7 +21,27 @@ Page({
         employee_id: e.id
       })
     }
-    that.getUserData();
+  },
+  onShow() {
+    if (app.globalData.userData) {
+      that.setData({
+        showtu: true
+      })
+      that.getUserData();
+    } else {
+      app.login(app.globalData.corpId, function (is) {
+        if (is) {
+          that.setData({
+            showtu: true
+          })
+          that.getUserData();
+        } else {
+          dd.reLaunch({
+            url: '../noJurisdiction/noJurisdiction'
+          })
+        }
+      })
+    }
   },
   onInitChart(F2, config) {
     chart1 = new F2.Chart(config);