This commit is contained in:
曹前明 2022-11-21 20:43:05 +08:00
parent 4f1d986016
commit b683362763
3 changed files with 25 additions and 36 deletions

View File

@ -19,7 +19,7 @@ Page({
sbtodonum:0, sbtodonum:0,
yhgznum:0, yhgznum:0,
serverUrl: getApp().globalData.serverUrl, serverUrl: getApp().globalData.serverUrl,
showAll:false, companyId:null,
// Banner数据 // Banner数据
images: [], images: [],
// 是否显示面板指示点 // 是否显示面板指示点
@ -40,7 +40,6 @@ Page({
nextMargin: 0, nextMargin: 0,
msgList: [ msgList: [
{ title: "欢迎参加安全环保专题网络考评!" },{title:"每晚10-11点不定期更新,请尽量不在此时间使用"}], { title: "欢迎参加安全环保专题网络考评!" },{title:"每晚10-11点不定期更新,请尽量不在此时间使用"}],
showAll:true
}, },
/** /**
@ -78,6 +77,8 @@ Page({
// }) // })
// } // }
this.getNew() this.getNew()
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
@ -93,6 +94,9 @@ Page({
var that = this var that = this
if(getApp().globalData.sessionId){ if(getApp().globalData.sessionId){
that.getNew() that.getNew()
this.setData({
companyId: getApp().globalData.userInfo.companyid
})
} }
@ -404,12 +408,6 @@ Page({
} }
}, },
tapexercise: function () { tapexercise: function () {
// if (this.data.showAll) { //练习功能
// wx.showModal({
// content: '本次活动该功能不便访问!',
// showCancel: false
// })
// } else
if (getApp().globalData.userInfo.perms != undefined) { if (getApp().globalData.userInfo.perms != undefined) {
if (getApp().globalData.userInfo.perms.indexOf(25) != -1) {//考试功能 if (getApp().globalData.userInfo.perms.indexOf(25) != -1) {//考试功能
wx.navigateTo({ wx.navigateTo({
@ -429,11 +427,6 @@ Page({
}) })
} }
}, },
open: function(e){
this.setData({
showAll:e.detail.value
})
},
tapinspect: function () { tapinspect: function () {
if (getApp().globalData.userInfo.perms != undefined) { if (getApp().globalData.userInfo.perms != undefined) {
if (getApp().globalData.userInfo.perms.indexOf(35) != -1) {//设备巡检 if (getApp().globalData.userInfo.perms.indexOf(35) != -1) {//设备巡检

View File

@ -21,7 +21,7 @@
<switch bindchange="open">打开全部功能</switch> <switch bindchange="open">打开全部功能</switch>
</view> --> </view> -->
<!-- <view class="weui-cells__title" wx:if="{{!showAll}}">数据采集</view> --> <!-- <view class="weui-cells__title" wx:if="{{!showAll}}">数据采集</view> -->
<view class="weui-grids" wx:if="{{showAll}}"> <view class="weui-grids" wx:if="{{companyId!=2}}">
<navigator url="/pages/checkjob/index" class="weui-grid" hover-class="weui-grid_active"> <navigator url="/pages/checkjob/index" class="weui-grid" hover-class="weui-grid_active">
<image class="weui-grid__icon" src="../images/task.png" /> <image class="weui-grid__icon" src="../images/task.png" />
<view class="weui-grid__label">检查任务</view> <view class="weui-grid__label">检查任务</view>
@ -46,7 +46,7 @@
<!-- <view class="weui-badge" style="position: absolute;top: 1em;right: 1em;" wx:if="{{yhgznum!=0}}">{{yhgznum}}</view> --> <!-- <view class="weui-badge" style="position: absolute;top: 1em;right: 1em;" wx:if="{{yhgznum!=0}}">{{yhgznum}}</view> -->
</navigator> </navigator>
</view> </view>
<view class="weui-grids" wx:if="{{showAll}}"> <view class="weui-grids" wx:if="{{companyId!=2}}">
<navigator url="/pages/observe/observe" class="weui-grid" hover-class="weui-grid_active"> <navigator url="/pages/observe/observe" class="weui-grid" hover-class="weui-grid_active">
<image class="weui-grid__icon" src="../images/watch.png" /> <image class="weui-grid__icon" src="../images/watch.png" />
<view class="weui-grid__label">行为观察</view> <view class="weui-grid__label">行为观察</view>
@ -63,7 +63,7 @@
<view class="weui-grid__label">合理化建议</view> <view class="weui-grid__label">合理化建议</view>
</navigator> </navigator>
</view> </view>
<view class="weui-grids" wx:if="{{showAll}}"> <view class="weui-grids" wx:if="{{companyId!=2}}">
<navigator url="/pages/public/public" class="weui-grid" hover-class="weui-grid_active"> <navigator url="/pages/public/public" class="weui-grid" hover-class="weui-grid_active">
<image class="weui-grid__icon" src="../images/public.png" /> <image class="weui-grid__icon" src="../images/public.png" />
<view class="weui-grid__label">公告</view> <view class="weui-grid__label">公告</view>
@ -84,7 +84,7 @@
</navigator> </navigator>
</view> </view>
<view class="weui-grids" wx:if="{{showAll}}"> <view class="weui-grids" wx:if="{{companyId!=2}}">
<navigator url="/pages/operation/operation" class="weui-grid" hover-class="weui-grid_active"> <navigator url="/pages/operation/operation" class="weui-grid" hover-class="weui-grid_active">
<image class="weui-grid__icon" src="../images/operation.png" /> <image class="weui-grid__icon" src="../images/operation.png" />
<view class="weui-grid__label">作业许可</view> <view class="weui-grid__label">作业许可</view>
@ -127,7 +127,7 @@
<view class="weui-grid__label">线下培训</view> <view class="weui-grid__label">线下培训</view>
<view class="weui-badge" style="position: absolute;top: 1em;right: 1em;" wx:if="{{dqdnum!=0}}">{{dqdnum}}</view> <view class="weui-badge" style="position: absolute;top: 1em;right: 1em;" wx:if="{{dqdnum!=0}}">{{dqdnum}}</view>
</navigator> </navigator>
<view class="weui-grid" hover-class="weui-grid_active" bindtap='tapexercise' wx:if="{{showAll}}"> <view class="weui-grid" hover-class="weui-grid_active" bindtap='tapexercise'>
<image class="weui-grid__icon" src="../images/exercise.png" /> <image class="weui-grid__icon" src="../images/exercise.png" />
<view class="weui-grid__label">模拟练习</view> <view class="weui-grid__label">模拟练习</view>
</view> </view>

View File

@ -1,5 +1,5 @@
{ {
"description": "项目配置文件", "description": "项目配置文件详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"es6": true, "es6": true,
@ -18,7 +18,7 @@
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"useMultiFrameRuntime": false, "useMultiFrameRuntime": true,
"useApiHook": false, "useApiHook": false,
"useApiHostProcess": false, "useApiHostProcess": false,
"babelSetting": { "babelSetting": {
@ -32,28 +32,24 @@
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true, "minifyWXSS": true,
"showES6CompileOption": false "showES6CompileOption": false,
"disableUseStrict": false,
"useCompilerPlugins": false,
"useStaticServer": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.20.0", "libVersion": "2.20.0",
"appid": "wx8cc62edbfed029b9", "appid": "wx8cc62edbfed029b9",
"projectname": "aqyj", "projectname": "aqyj",
"isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": { "condition": {},
"search": { "packOptions": {
"list": [] "ignore": [],
}, "include": []
"conversation": { },
"list": [] "editorSetting": {
}, "tabIndent": "insertSpaces",
"game": { "tabSize": 2
"currentL": -1,
"list": []
},
"miniprogram": {
"list": []
}
} }
} }