|
@@ -44,6 +44,9 @@ Page({
|
|
noticeTitle:'',
|
|
noticeTitle:'',
|
|
isGz:false,
|
|
isGz:false,
|
|
islog:true,
|
|
islog:true,
|
|
|
|
+ announcementList:[],
|
|
|
|
+ isShowYy:false,
|
|
|
|
+ isShowAn:true,
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
that = this;
|
|
that = this;
|
|
@@ -55,12 +58,23 @@ Page({
|
|
that.getUserData();
|
|
that.getUserData();
|
|
that.getGg();
|
|
that.getGg();
|
|
that.getNotice();
|
|
that.getNotice();
|
|
|
|
+ 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({
|
|
that.setData({
|
|
isAdministrator: app.globalData.isAdministrator,
|
|
isAdministrator: app.globalData.isAdministrator,
|
|
getRole_four: app.globalData.isCreator,
|
|
getRole_four: app.globalData.isCreator,
|
|
isSubject: app.globalData.userData.is_personal == 1 ? true : false,
|
|
isSubject: app.globalData.userData.is_personal == 1 ? true : false,
|
|
- mainCorpId: app.globalData.userData.main_corp_id
|
|
|
|
|
|
+ mainCorpId: app.globalData.userData.main_corp_id,
|
|
|
|
+ isShowYy:isShowYy,
|
|
|
|
+ isShowAn:getCache('isShowAn')? false:true,
|
|
})
|
|
})
|
|
|
|
+ if(that.data.isShowYy&&that.data.isShowAn){
|
|
|
|
+ that.getAnnouncement();
|
|
|
|
+ }
|
|
if(!getCache('init_rule_check')){
|
|
if(!getCache('init_rule_check')){
|
|
app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
|
|
app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
|
|
}
|
|
}
|
|
@@ -88,13 +102,23 @@ Page({
|
|
if(!getCache('init_rule_check')){
|
|
if(!getCache('init_rule_check')){
|
|
app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
|
|
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;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
that.setData({
|
|
that.setData({
|
|
isAdministrator: app.globalData.isAdministrator,
|
|
isAdministrator: app.globalData.isAdministrator,
|
|
getRole_four: app.globalData.isCreator,
|
|
getRole_four: app.globalData.isCreator,
|
|
isSubject: app.globalData.userData.is_personal == 1 ? true : false,
|
|
isSubject: app.globalData.userData.is_personal == 1 ? true : false,
|
|
- mainCorpId: app.globalData.userData.main_corp_id
|
|
|
|
|
|
+ mainCorpId: app.globalData.userData.main_corp_id,
|
|
|
|
+ isShowYy:isShowYy,
|
|
|
|
+ isShowAn:getCache('isShowAn')? false:true,
|
|
})
|
|
})
|
|
|
|
+ if(that.data.isShowYy&&that.data.isShowAn){
|
|
|
|
+ that.getAnnouncement();
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
dd.reLaunch({
|
|
dd.reLaunch({
|
|
url: '../../noJurisdiction/noJurisdiction'
|
|
url: '../../noJurisdiction/noJurisdiction'
|
|
@@ -103,8 +127,27 @@ Page({
|
|
},function(){},true)
|
|
},function(){},true)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ closeAn(){
|
|
|
|
+ setCache('isShowAn',true);
|
|
|
|
+ this.setData({
|
|
|
|
+ isShowYy:false,
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ openaN(e){
|
|
|
|
+ var index = e.target.dataset.index;
|
|
|
|
+ dd.navigateTo({
|
|
|
|
+ url: '../noticeDetailTow/noticeDetailTow?id=' + this.data.announcementList[index].id+'&index='+index
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getAnnouncement(){
|
|
|
|
+ app.$get("api/announcement/list",{type:3}).then((res) => {
|
|
|
|
+ let list=res.data.data.list;
|
|
|
|
+
|
|
|
|
+ that.setData({ announcementList:list})
|
|
|
|
+ })
|
|
|
|
+ },
|
|
gettrees(fn) {
|
|
gettrees(fn) {
|
|
- app.$get2("api/integral/rule/trees", {cycle_type: 1 }).then((res)=>{
|
|
|
|
|
|
+ app.$get2("api/integral/rule/trees", {cycle_type: 3 }).then((res)=>{
|
|
var rule_tree = res.data.data.rule_tree
|
|
var rule_tree = res.data.data.rule_tree
|
|
if(rule_tree.length==0&&app.globalData.isCreator){
|
|
if(rule_tree.length==0&&app.globalData.isCreator){
|
|
fn(false)
|
|
fn(false)
|
|
@@ -121,17 +164,14 @@ Page({
|
|
islog:false
|
|
islog:false
|
|
})
|
|
})
|
|
app.globalData.socketApi.sendData({type:'init_rule'}, function(e){
|
|
app.globalData.socketApi.sendData({type:'init_rule'}, function(e){
|
|
- console.log(e)
|
|
|
|
- that.setData({
|
|
|
|
- islog:true
|
|
|
|
- })
|
|
|
|
|
|
+ that.setData({islog:true})
|
|
if (e.type == 'init_rule') {
|
|
if (e.type == 'init_rule') {
|
|
if(e.code==1&&e.result.done){
|
|
if(e.code==1&&e.result.done){
|
|
that.setData({ isGz:false})
|
|
that.setData({ isGz:false})
|
|
app.globalData.showToast('已导入');
|
|
app.globalData.showToast('已导入');
|
|
app.globalData.socketApi.closewebsocket();
|
|
app.globalData.socketApi.closewebsocket();
|
|
}else{
|
|
}else{
|
|
- app.globalData.showToast(e.msg);
|
|
|
|
|
|
+ // app.globalData.showToast(e.msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|