<template>
|
<view class="content">
|
<image class="bg-img" src="../../static/minebg.jpg"></image>
|
<view class="mains">
|
<view class="user">
|
<image src="../../static/logo.png" mode=""></image>
|
<view class="name">{{userInfo.Czymc?userInfo.Czymc:'当前登录的用户'}}</view>
|
<view class="other">
|
<view class="texta">欢迎使用</view>
|
<view>智云L-MES制造执行系统</view>
|
</view>
|
</view>
|
<view style="width: 100%;height: 20rpx;"></view>
|
<view class="box" v-for="(item,index) in itemData" :key="index" @tap="toUrl(item)">
|
<image :src="item.img" mode=""></image>
|
<view class="texts">
|
{{item.text}}
|
</view>
|
<uni-icons type="forward" color="#888" style="position: absolute;right: 70rpx;" size="18"></uni-icons>
|
</view>
|
|
<view class="btn" @tap="logout">退 出 登 录</view>
|
<view class="vers">{{vers}}</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import WebSocketServices from "../../utils/WebSocketServices";
|
import { getUserInfo } from "@/utils/auth.js";
|
import {
|
CommonUtils
|
} from '@/utils/common'
|
export default {
|
data() {
|
return {
|
userInfo:getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
|
vers:uni.getStorageSync('vers'),
|
checkCount:0,
|
itemData:[{
|
img:'../../static/icon00.png',
|
text:'待我审核',
|
url:'/pages/ZLGL/checkFlowList/QC_CheckBillflowList',
|
id:0
|
},{
|
img:'../../static/icon01.png',
|
text:'已审核',
|
url:'/pages/ZLGL/checkFlowList/QC_CheckedBillflowList',
|
id:1
|
},{
|
img:'../../static/icon06.png',
|
text:'未读消息',
|
url:'',
|
id:2
|
},{
|
img:'../../static/icon07.png',
|
text:'已读消息',
|
url:'',
|
id:3
|
},
|
{
|
img:'../../static/icon05.png',
|
text:'修改密码',
|
url:'/pages/xiugaimima/index',
|
id:4
|
},
|
{
|
img:'../../static/icon05.png',
|
text:'我的工资(预估)',
|
url:'/pages/gongxuOut/moneystatistics',
|
id:4
|
}
|
]
|
}
|
},
|
async onLoad() {
|
console.log(this.userInfo)
|
await this.cmdSearchFirst()
|
await this.cmdSearchLast()
|
this.itemData[0].text = `待我审核(${this.checkCount})`
|
},
|
methods: {
|
toUrl(item){
|
if(item.url){
|
uni.navigateTo({
|
url:item.url
|
})
|
}else{
|
// uni.showToast({
|
// title:'功能开发中。。。',
|
// icon:'none'
|
// })
|
}
|
},
|
logout(){
|
uni.showModal({
|
title: '提示',
|
content: '是否确认退出登录',
|
success: function (res) {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
// 断开Socket连接
|
// WebSocketServices.closeSocket();
|
// 销毁 userInfo 缓存
|
uni.removeStorageSync("userinfo")
|
uni.reLaunch({
|
url:'/pages/index/login'
|
})
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
},
|
//获取待审批总数首件
|
async cmdSearchFirst() {
|
|
try {
|
let res = await CommonUtils.doRequest2Sync({
|
url: '/LEMS/CheckFlowList',
|
data: {
|
"sWhere": ' ',
|
"billType":8505,
|
"type":2,
|
"userid": getUserInfo()["Czybm"]
|
},
|
})
|
if (!res) {
|
return
|
}
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count > 0) {
|
this.checkCount += res.data.data.length
|
console.log(res.data.data.length)
|
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: Message
|
})
|
}
|
} catch (err) {
|
console.warn(err);
|
uni.showToast({
|
title: '接口请求失败:' + err,
|
icon: 'none'
|
})
|
}
|
},
|
//末件全部
|
async cmdSearchLast(){
|
try {
|
let res = await CommonUtils.doRequest2Sync({
|
url: '/LEMS/CheckFlowList',
|
data: {
|
"sWhere": ' ',
|
"billType":8507,
|
"type":2,
|
"userid": getUserInfo()["Czybm"]
|
},
|
})
|
if (!res) {
|
return
|
}
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count > 0) {
|
this.checkCount += res.data.data.length
|
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: Message
|
})
|
}
|
} catch (err) {
|
console.warn(err);
|
uni.showToast({
|
title: '接口请求失败:' + err,
|
icon: 'none'
|
})
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
page{
|
width: 100%;
|
height: 100%;
|
overflow: hidden;
|
}
|
.bg-img{
|
position: fixed;
|
width: 100%;
|
height: 100%;
|
top: 0;
|
left: 0;
|
z-index: -1;
|
}
|
.mains{
|
width: 720rpx;
|
margin: 10rpx auto;
|
display: flex;
|
flex-wrap: wrap;
|
.user{
|
width: 660rpx;
|
margin: 100rpx auto 0 auto;
|
background: #FFFFFF;
|
box-shadow: 0rpx 10rpx 54rpx 0rpx rgba(112,112,112,0.24);
|
border-radius: 10rpx;
|
position: relative;
|
text-align: center;
|
image{
|
width: 130rpx;
|
height: 130rpx;
|
border-radius: 100%;
|
margin-top: 40rpx;
|
background-color: #f0f3f7;
|
}
|
.name{
|
font-size: 37rpx;
|
color: #333333;
|
font-weight: 600;
|
margin-top: 18rpx;
|
line-height: 120%;
|
}
|
.other{
|
width: 100%;
|
font-size: 26rpx;
|
color: #565656;
|
margin: 30rpx 0 40rpx 44rpx;
|
line-height: 120%;
|
text-align: start;
|
.texta{
|
font-size: 30rpx;
|
margin-bottom: 12rpx;
|
}
|
}
|
}
|
|
.box{
|
width: 100%;
|
margin: 40rpx 66rpx 0 66rpx;
|
margin-bottom: 0;
|
padding-bottom: 20rpx;
|
display: flex;
|
align-items: center;
|
border-bottom: 1px solid #f0f0f0;
|
image{
|
width: 37rpx;
|
height: 35rpx;
|
}
|
.texts{
|
font-size: 30rpx;
|
color: #333333;
|
margin-left: 30rpx;
|
}
|
}
|
|
.btn{
|
width: 540rpx;
|
height: 92rpx;
|
line-height: 92rpx;
|
margin: 0 auto;
|
margin-top: 68rpx;
|
background: #78CEFD;
|
box-shadow: 0rpx 0rpx 44rpx 7rpx rgba(120,206,253,0.3);
|
border-radius: 10rpx;
|
font-weight: 400;
|
color: #FEFEFE;
|
font-size: 36rpx;
|
text-align: center;
|
}
|
|
.vers{
|
box-sizing: border-box;
|
padding-top: 30rpx;
|
position: relative;
|
// z-index: 99;
|
// bottom: 0;
|
// left: 0;
|
font-size: 28rpx;
|
color: #888;
|
margin-bottom: 20rpx;
|
text-align: center;
|
width: 100%;
|
}
|
}
|
</style>
|