xytSk-App/pages/mypage/mypage.vue

263 lines
5.1 KiB
Vue
Raw Normal View History

2024-06-05 17:26:16 +08:00
<template>
<view class="container">
<view class="userInfo">
<div class="icon">
2024-11-07 10:29:29 +08:00
<image class="image-left" style="width: 100%; height: 100%" :src="default_src" mode="aspectFill">
</image>
2024-06-05 17:26:16 +08:00
</div>
<div class="user">
2024-11-06 15:55:25 +08:00
<div class="username">{{this.userList.nickName}}</div>
<div class="userresponse">{{this.userList.dept.deptName}}</div>
2024-06-05 17:26:16 +08:00
</div>
</view>
<view class="funcBar">
2024-11-07 10:29:29 +08:00
<div class="funcList" v-for="(item, index) in func" :key="index">
2024-06-05 17:26:16 +08:00
<div @click="navigateToSubPage(index)">
<div class="funcIcon">
2024-11-07 10:29:29 +08:00
<image class="icon-left" style="width: 100%; height: 100%" :src="item.img" mode="aspectFit">
</image>
2024-06-05 17:26:16 +08:00
</div>
<div class="funcTxt">{{ item.name }}</div>
</div>
</div>
</view>
2024-11-07 10:48:41 +08:00
<view class="funcBar xjxList">
<view class="" style="padding: 5px 0 0 5px;">
历史记录
</view>
<view class="" style="display: flex;">
<div class="funcList" v-for="(item, index) in xjxList" :key="index" >
<div @click="navigateToSubPage(index)">
2024-11-07 17:46:03 +08:00
<div class="funcIcon" style="width:30px:;height:30px">
2024-11-07 10:48:41 +08:00
<image
class="icon-left"
style="width: 100%; height: 100%"
:src="item.img"
mode="aspectFit"
></image>
</div>
<div class="funcTxt">{{ item.name }}</div>
</div>
</div>
</view>
</view>
2024-06-05 17:26:16 +08:00
<view class="version">
<div class="content">
2024-11-06 15:55:25 +08:00
<div class="left" style="display:flex">
2024-06-05 17:26:16 +08:00
<uni-icons type="info" size="25" class="icon-left"></uni-icons>
版本号
</div>
<div class="mid"></div>
<div class="right">{{version}}</div>
</div>
</view>
<view class="null"></view>
<button type="primary" class="button" @click="logout">退</button>
</view>
</template>
<script>
2024-11-07 10:29:29 +08:00
const func = [{
img: '../../static/images/info.png',
name: '个人信息',
url: '/pages/personInfo/personInfo'
},
{
img: '../../static/images/password.png',
name: '修改密码',
url: '/pages/modifyPassword/modifyPassword'
},
2024-06-05 17:26:16 +08:00
]
2024-11-07 10:48:41 +08:00
const xjxList = [
2024-11-07 17:46:03 +08:00
{img: '../../static/images/xcrw1.png', name: '巡查任务', url:'/pages/mypage/compents/xcrw/index'},
{img: '../../static/images/wxyh1.png', name: '维修养护', url:'/pages/mypage/compents/wxyh/index'},
{img: '../../static/images/wtcl1.png', name: '问题处理', url:'/pages/mypage/compents/wtcl/index'},
2024-11-07 10:48:41 +08:00
]
2024-06-05 17:26:16 +08:00
export default {
data() {
return {
2024-06-07 17:39:07 +08:00
userList: uni.getStorageSync('value'),
2024-11-07 10:29:29 +08:00
username: '',
userresponse: '防汛办',
version: '011.14.23',
2024-06-05 17:26:16 +08:00
func: func,
2024-11-07 10:48:41 +08:00
xjxList:xjxList,
2024-06-06 17:41:41 +08:00
default_src: uni.getStorageSync('avatar'),
2024-06-05 17:26:16 +08:00
}
},
methods: {
2024-11-07 10:29:29 +08:00
navigateToSubPage(index) {
2024-06-05 17:26:16 +08:00
uni.navigateTo({
2024-11-07 10:48:41 +08:00
url: xjxList[index].url,
2024-06-05 17:26:16 +08:00
animationType:'pop-in',
})
2024-07-10 09:37:14 +08:00
},
2024-11-07 10:29:29 +08:00
logout() {
if (uni.getStorageSync('loginChecked') === true) {
2024-06-20 15:09:55 +08:00
uni.redirectTo({
url: '/pages/login/login'
})
} else {
uni.removeStorageSync('loginName')
uni.removeStorageSync('secretKey')
uni.removeStorageSync('Gs-Token')
uni.removeStorageSync('value')
uni.removeStorageSync('password')
2024-11-07 10:29:29 +08:00
uni.removeStorageSync('avatar')
2024-06-20 15:09:55 +08:00
uni.redirectTo({
url: '/pages/login/login'
})
}
2024-11-07 10:29:29 +08:00
2024-11-07 16:41:17 +08:00
},
2024-11-07 10:29:29 +08:00
},
2024-06-05 17:26:16 +08:00
}
</script>
<style>
2024-11-07 10:29:29 +08:00
.container {
2024-06-05 17:26:16 +08:00
display: flex;
flex-direction: column;
height: 100vh;
width: 100vw;
background-color: #f3f5f8;
}
2024-11-07 10:29:29 +08:00
.userInfo {
2024-06-05 17:26:16 +08:00
border-radius: 5px;
display: flex;
flex-direction: row;
align-items: center;
margin-top: 5vh;
margin-left: 2vw;
margin-bottom: 2vh;
width: 95%;
height: 15vh;
background-color: #fff;
2024-11-07 10:29:29 +08:00
2024-06-05 17:26:16 +08:00
}
2024-11-07 10:29:29 +08:00
.icon {
2024-06-05 17:26:16 +08:00
width: 50px;
height: 50px;
border-radius: 50%;
margin-left: 2vw;
background-color: #fff;
text-align: center;
color: #007afd;
line-height: 50px;
}
2024-11-07 10:29:29 +08:00
.image-left {
2024-06-06 17:41:41 +08:00
width: 80px;
height: 80px;
border-radius: 50%;
}
2024-11-07 10:29:29 +08:00
.user {
2024-06-05 17:26:16 +08:00
display: flex;
flex-direction: column;
margin-left: 6vw;
}
2024-11-07 10:29:29 +08:00
.username {
2024-06-05 17:26:16 +08:00
font-size: 20px;
font-weight: bold;
margin-bottom: 1vh;
}
2024-11-07 10:29:29 +08:00
.funcIcon {
2024-06-05 17:26:16 +08:00
width: 50px;
height: 50px;
margin-left: 4px;
margin-bottom: 1vh;
display: flex;
justify-content: center;
align-items: center;
}
2024-11-07 10:29:29 +08:00
2024-06-05 17:26:16 +08:00
.funcBar {
border-radius: 5px;
margin-bottom: 2vh;
margin-left: 2vw;
display: flex;
justify-content: row;
align-items: center;
width: 95%;
height: 15vh;
background-color: #fff;
}
2024-11-07 10:29:29 +08:00
2024-06-05 17:26:16 +08:00
.funcList {
2024-11-07 10:29:29 +08:00
text-align: center;
font-size: 14px;
margin: 2vw;
2024-06-05 17:26:16 +08:00
}
2024-11-07 10:29:29 +08:00
.version {
2024-06-05 17:26:16 +08:00
margin-left: 2vw;
border-radius: 5px;
display: flex;
flex-direction: column;
width: 95%;
height: 8vh;
background-color: #fff;
2024-11-07 10:29:29 +08:00
2024-06-05 17:26:16 +08:00
}
2024-11-07 10:29:29 +08:00
.content {
2024-06-05 17:26:16 +08:00
display: flex;
flex-direction: row;
}
2024-11-07 10:29:29 +08:00
.left {
width: 100px;
2024-06-05 17:26:16 +08:00
text-align: start;
margin-left: 1vw;
line-height: 8vh;
}
2024-11-07 10:29:29 +08:00
.icon-left {
2024-06-05 17:26:16 +08:00
align-items: center;
width: 30px;
/* background-color: red; */
}
2024-11-07 10:29:29 +08:00
.mid {
2024-06-05 17:26:16 +08:00
flex: 1;
line-height: 8vh;
}
2024-11-07 10:29:29 +08:00
.right {
width: 100px;
2024-06-05 17:26:16 +08:00
text-align: end;
line-height: 8vh;
margin-right: 10px;
}
2024-11-07 10:29:29 +08:00
.null {
2024-06-05 17:26:16 +08:00
height: 45vh;
}
2024-11-07 10:29:29 +08:00
.button {
2024-06-05 17:26:16 +08:00
border-radius: 10px;
display: flex;
2024-07-01 10:45:45 +08:00
justify-content: center;
2024-06-05 17:26:16 +08:00
flex-direction: column-reverse;
width: 92%;
height: 6vh;
font-size: 20px;
color: white;
background-color: #007afd;
}
2024-11-07 10:48:41 +08:00
.xjxList{
display: flex;
flex-direction: column;
align-items: start;
justify-content: start;
height: 20vh;
}
2024-06-05 17:26:16 +08:00
</style>