401 lines
10 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="footerBox">
<!--
:class="userInfo.accountType==5||userInfo.accountType==6 || userInfo.accountType==10?'footerBox2':''" -->
<view @click="tabClick(item.plugin)" class="footerItem" :class="activeTab==item.plugin?'active':''"
v-for="(item,index) in tabList" v-show="item.appShow==1 && item.isShow" :key="index">
<image class="tabIcon tabIcon1" mode="heightFix" :src="'/static/'+item.moduleIcon2+'.png'"></image>
<image class="tabIcon tabIcon2" mode="heightFix" :src="'/static/'+item.moduleIcon+'.png'"></image>
<view class="desc">
{{item.appName}}
</view>
</view>
</view>
</template>
<script>
import checkVersion from '@/pages/lq-upgrade/checkVersion.js'
export default {
props: ['activeTab'],
data() {
return {
tabList: [{
appName: '消息',
moduleIcon2: 'footerIcon1',
moduleIcon: 'footerIcon2',
plugin: 'mssage',
appShow: 1,
isShow: false
}, {
appName: '首页',
moduleIcon2: 'tabIcon-index',
moduleIcon: 'tabIcon-index-active',
plugin: 'projectEnd',
appShow: 1,
isShow: false
}, {
appName: '发起审批',
moduleIcon2: 'submit-n',
moduleIcon: 'submit',
plugin: 'submit',
appShow: 1,
isShow: false
}, {
appName: '工作台',
moduleIcon2: 'workspace-n',
moduleIcon: 'workspace',
plugin: 'workspace',
appShow: 1,
isShow: false
}, {
appName: '我的',
moduleIcon2: 'tabIcon-my2',
moduleIcon: 'tabIcon-my2-active',
plugin: 'my',
appShow: 1,
isShow: false
}],
userInfo: {
accountType: 1
},
haveModuleList: [],
systemInfo: {},
// activeTab: 0
};
},
mounted() {
// console.log(this.tabList)
this.$forceUpdate()
},
created() {
this.getModuleList();
this.systemInfo = uni.getStorageSync('systemInfo')
// #ifdef APP-PLUS
// this.viewVersionInfo()
// #endif
},
methods: {
getModuleList() {
var that = this
const projectSn = uni.getStorageSync('projectDetail') ? JSON.parse(uni.getStorageSync('projectDetail'))
.projectSn : uni.getStorageSync('projectDetail');
this.sendRequest({
url: "xmgl/baseModule/getModuleAndMenuList",
data: {
projectSn: projectSn,
moduleType: 7,
userId: JSON.parse(uni.getStorageSync('userInfo')).userId,
},
method: "post",
success(result) {
if (result.success) {
that.haveModuleList = result.result.moduleList
that.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
console.log(that.userInfo.accountType)
if (that.userInfo.accountType == 5 || that.userInfo.accountType == 6 || that
.userInfo
.accountType == 10) {
let findInfo = that.haveModuleList.find(item => item.modulePath ==
"/infoCenter/allInfo")
if (findInfo) {
that.tabList[0].isShow = true
}
let findWorkSpace = that.haveModuleList.find(item => item.modulePath ==
"/workSpace")
if (findWorkSpace) {
that.tabList[2].isShow = true
that.tabList[3].isShow = true
}
that.tabList[1].isShow = true
that.tabList[4].isShow = true
} else if (that.COMPANY == 'sanjiang') {
that.tabList.push({
appName: '首页总览',
moduleIcon2: 'sjjt_syzl',
moduleIcon: 'sjjt_syzl-tab',
plugin: 'projectManage',
appShow: 1,
isShow: true,
}, {
appName: '我的',
moduleIcon2: 'tabIcon-my',
moduleIcon: 'tabIcon-my-select',
plugin: 'my',
appShow: 1,
isShow: true,
})
} else if (that.userInfo.accountType == 11) {
// 供应商
that.tabList.push({
appName: '首页总览',
moduleIcon2: 'sjjt_syzl',
moduleIcon: 'sjjt_syzl-tab',
plugin: 'supplierHome',
appShow: 1,
isShow: true,
}, {
appName: '我的',
moduleIcon2: 'tabIcon-my',
moduleIcon: 'tabIcon-my-select',
plugin: 'supplierMy',
appShow: 1,
isShow: true,
})
} else {
try {
console.log(1111, that.userInfo.menuAuthority.moduleList)
var moduleList = that.userInfo.menuAuthority.moduleList
for (let i = 0; i < moduleList.length; i++) {
if (moduleList[i].moduleType == 1) {
console.log(moduleList[i])
that.tabList.push({
...moduleList[i],
isShow: true,
})
}
}
} catch (e) {
//TODO handle the exception
}
that.tabList.push({
appName: 'AI预警',
moduleIcon2: 'menu-icon',
moduleIcon: 'menu-icon_active',
plugin: 'aIEarlyWarn',
appShow: 1,
isShow: true,
})
that.tabList.push({
appName: '项目后台',
moduleIcon2: 'menu-icon',
moduleIcon: 'menu-icon_active',
plugin: 'menu',
appShow: 1,
isShow: true,
})
that.tabList.push({
appName: '高风险',
moduleIcon2: 'highRisk-icon',
moduleIcon: 'highRisk-icon_active',
plugin: 'highRisk',
appShow: 1,
isShow: true,
})
that.tabList.push({
appName: '我的',
moduleIcon2: 'tabIcon-my',
moduleIcon: 'tabIcon-my-select',
plugin: 'my',
appShow: 1,
isShow: true,
})
}
}
}
})
},
tabClick(plugin) {
console.log(plugin)
switch (plugin) {
case 'aIEarlyWarn':
uni.redirectTo({
url: '/pages/aIEarlyWarn/index'
})
break;
case 'menu':
uni.redirectTo({
url: '/pages/areaTree/areaTree?type=backend'
})
break;
case 'highRisk':
uni.redirectTo({
url: '/pages/projectEnd/workTicketManage/highRiskWorkTicket?type=backend'
})
break;
case 'projectManage':
uni.redirectTo({
url: '../../pages/projectManage/projectManage'
})
break;
case 'videoManage':
if (this.userInfo.accountType == 5) {
uni.redirectTo({
url: '/pages/videoManage/videoList?sn=' + that.userInfo.sn
})
} else {
uni.redirectTo({
url: '/pages/areaTree/areaTree'
})
}
break;
case 'my':
uni.redirectTo({
url: '/pages/my/my'
})
break;
case 'submit':
uni.redirectTo({
url: '/pages/submit/submit'
})
break;
case 'workspace':
uni.redirectTo({
url: '/pages/workspace/workspace'
})
break;
case 'supplierHome':
uni.redirectTo({
url: '/pages/supplier/supplier'
})
break;
case 'supplierMy':
uni.redirectTo({
url: '/pages/supplier/my/my'
})
break;
case 'personManage':
uni.redirectTo({
url: '../../pages/personManage/personManage'
})
break;
case 'projectEnd':
uni.redirectTo({
url: '/pages/projectEnd/projectIndex/projectIndex'
})
break;
case 'mssage':
uni.redirectTo({
url: '/pages/messageCenter/messageCenter'
})
break;
case 'deviceManage':
uni.redirectTo({
url: '../../pages/deviceManage/deviceManage'
})
break;
case 'markRoom':
uni.redirectTo({
url: '../../pages/markRoomManage/markRoomManage'
})
break;
case 'messageTask':
uni.redirectTo({
url: '/pages/messageTask/messageTask'
})
break;
}
},
viewVersionInfo() {
console.log('进入页面调用');
//fix 避开检查更新 罗劲章
// return false
var that = this
//获取当前应用版本
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
// console.log('版本号的数据信息', widgetInfo.version);//其实是应用版本名称
console.log('应用版本名称', widgetInfo.version);
that.versionName = widgetInfo.version
console.log('应用版本号', widgetInfo.versionCode);
that.versionNo = widgetInfo.versionCode
})
console.log('viewVersionInfo', that.url_config)
// uni.navigateTo({
// url:'versionInfo'
// })
const systemInfo = uni.getStorageSync('systemInfo')
if (
systemInfo.platform.indexOf('android') != -1 &&
typeof plus !== 'undefined'
) {
//获取最新版本
that.sendRequest({
url: 'xmgl/appVersion/getAppVersion',
data: {},
method: 'POST',
success(res2) {
console.log('获取当前app应用版本名称', that.versionName);
console.log('获取平台版本名称', res2.result.versionName);
let jxjAppVersionName = res2.result.versionName
console.log('获取当前app应用版本号', that.versionNo);
console.log('获取平台版本号', res2.result.versionNo);
let jxjAppVersionNo = res2.result.versionNo
if (res2.result && jxjAppVersionNo !== that.versionNo) {
let name = res2.result.versionName; //新版本名称
let code = res2.result.versionNo; //新版本号(数字)
let content = res2.result.versionDescribe; //更新内容
let url = JSON.parse(res2.result.downloadUrl)[0].url; //app下载链接演示请换成真正在下载链接
let forceUpdate = false; //是否强制更新
checkVersion({
name, //最新版本名称
code, //最新版本号
content, //更新内容
url, //下载链接
forceUpdate //是否强制升级
})
} else {
// uni.showToast({
// title: '您已经是最新版本啦!',
// icon: 'none'
// })
}
}
})
}
},
}
}
</script>
<style lang="scss" scoped>
.footerBox {
background-color: white;
display: flex;
width: 100%;
position: fixed;
height: 110rpx;
bottom: 0;
left: 0;
z-index: 9999;
border-top: 1px solid rgba(151, 151, 151, 0.15);
}
.footerItem {
font-size: 12px;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
color: rgba(148, 149, 173, 1);
.tabIcon {
width: fit-content;
height: 35rpx;
}
.tabIcon2 {
display: none;
}
&.active {
color: $uni-color-primary;
.tabIcon2 {
display: inline-block;
}
.tabIcon1 {
display: none;
}
}
.desc {
padding-top: 5rpx;
}
}
</style>