You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
349 lines
8.7 KiB
349 lines
8.7 KiB
<template>
|
|
<view class="mine-container">
|
|
<u-navbar back-icon-color='#fff' back-icon-name=''
|
|
:background="{ background: 'rgba(64, 158,255,'+bgOpacity+')'}" back-text="" title-color='#fff'
|
|
:immersive='true' :border-bottom='false' title="个人中心">
|
|
</u-navbar>
|
|
<view class="header-section">
|
|
<image src="../../static/images/bg.jpg" class="bg" mode=""></image>
|
|
<view class="info" v-if="store.name">
|
|
<image :src="store.avatar" class="cu-avatar" mode="" v-if="store.avatar"></image>
|
|
<view class="cu-avatar" v-else>
|
|
<u-icon name="account-fill" color="#d4d4d4" size="100"></u-icon>
|
|
</view>
|
|
|
|
<view class="user-info">
|
|
<view class="name">{{store.name}} <span v-if="store.post">{{store.post.name}}</span></view>
|
|
<view class="tips">{{store.dept.name}}</view>
|
|
</view>
|
|
</view>
|
|
<view class="info" v-else>
|
|
<view class="cu-avatar">
|
|
<u-icon name="account-fill" color="#d4d4d4" size="100"></u-icon>
|
|
</view>
|
|
<view class="user-info" @click="handleLogin">
|
|
<view class="name">点击登录</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-section">
|
|
<view class="mine-actions grid col-3 text-center">
|
|
<view class="action-item" @click="handleDeviceReport">
|
|
<image src="../../static/images/banner/icon1.png" mode="widthFix"></image>
|
|
<text class="text">我的报修</text>
|
|
</view>
|
|
<view class="action-item" @click="handleRepairOrder">
|
|
<image src="../../static/images/banner/icon2.png" mode="widthFix"></image>
|
|
<text class="text">我的维修</text>
|
|
</view>
|
|
<view class="action-item" @click="handleUpkeepOrder">
|
|
<image src="../../static/images/banner/icon3.png" mode="widthFix"></image>
|
|
<text class="text">我的保养</text>
|
|
</view>
|
|
|
|
<view class="action-item action-item1" @click="handleSpotCheckOrder">
|
|
<image src="../../static/images/banner/icon4.png" mode="widthFix"></image>
|
|
<text class="text">巡检点检</text>
|
|
</view>
|
|
<view class="action-item action-item1" @click="handleSparePartsApplication">
|
|
<image src="../../static/images/banner/icon5.png" mode="widthFix"></image>
|
|
<text class="text">我的领用</text>
|
|
</view>
|
|
<view class="action-item action-item1" @click="handleSparePartsApplicationApprove"
|
|
v-if="store.role == 'all_approve' || store.role == 'normal_approve'">
|
|
<image src="../../static/images/banner/icon7.png" mode="widthFix"></image>
|
|
<text class="text">领用审批</text>
|
|
</view>
|
|
<view class="action-item action-item1" @click="handleSparePartsService">
|
|
<image src="../../static/images/banner/icon6.png" mode="widthFix"></image>
|
|
<text class="text">备件维修</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="menu-list">
|
|
<view class="list-cell list-cell-arrow" @click="handleEditPassword">
|
|
<view class="menu-item-box">
|
|
<u-icon name="lock" color="#2979ff" size="32"></u-icon>
|
|
<view style="margin-left: 10rpx;">修改密码</view>
|
|
</view>
|
|
</view>
|
|
<view class="list-cell list-cell-arrow" @click="handleAgreement">
|
|
<view class="menu-item-box">
|
|
<u-icon name="error-circle" color="#2979ff" size="32"></u-icon>
|
|
<view style="margin-left: 10rpx;">用户协议</view>
|
|
</view>
|
|
</view>
|
|
<view class="list-cell list-cell-arrow" @click="handlePrivacyPolicy">
|
|
<view class="menu-item-box">
|
|
<u-icon name="file-text-fill" color="#2979ff" size="32"></u-icon>
|
|
<view style="margin-left: 10rpx;">隐私政策</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- <view class="list-cell list-cell-arrow" @click="handleHelp">
|
|
<view class="menu-item-box">
|
|
<u-icon name="info-circle" color="#2979ff" size="32"></u-icon>
|
|
<view style="margin-left: 10rpx;">版本更新</view>
|
|
</view>
|
|
</view> -->
|
|
<!-- <view class="list-cell list-cell-arrow" @click="handleAbout">
|
|
<view class="menu-item-box">
|
|
<u-icon name="heart" color="#2979ff" size="32"></u-icon>
|
|
<view style="margin-left: 10rpx;">关于我们</view>
|
|
</view>
|
|
</view> -->
|
|
</view>
|
|
|
|
<view class="btn" @click="handleLogout" v-if="store">退出登录</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import {
|
|
ref,
|
|
getCurrentInstance
|
|
} from 'vue'
|
|
import { useCountStore } from '@/store'
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
// 获取自定义的store
|
|
const store = useCountStore()
|
|
|
|
|
|
const name = ref(store.name)
|
|
const bgOpacity = ref(0)
|
|
const user = ref()
|
|
function handleToInfo() {
|
|
proxy.$tab.navigateTo('/pages/mine/info/index')
|
|
}
|
|
function handleDeviceReport() {
|
|
proxy.$tab.navigateTo('/pages/deviceReport/myDeviceReport')
|
|
}
|
|
function handleRepairOrder() {
|
|
proxy.$tab.navigateTo('/pages/repairOrder/myOrder')
|
|
}
|
|
function handleUpkeepOrder() {
|
|
proxy.$tab.navigateTo('/pages/upkeepOrder/myOrder')
|
|
}
|
|
function handleSpotCheckOrder() {
|
|
proxy.$tab.navigateTo('/pages/spotCheckOrder/myOrder')
|
|
}
|
|
function handleSparePartsApplication() {
|
|
proxy.$tab.navigateTo('/pages/sparePartsApplication/mySparePartsApplication?flag=1')
|
|
}
|
|
function handleSparePartsApplicationApprove() {
|
|
proxy.$tab.navigateTo('/pages/sparePartsApplicationApprove/mySparePartsApplicationApprove?flag=1')
|
|
}
|
|
function handleSparePartsService() {
|
|
proxy.$tab.navigateTo('/pages/sparePartsServiceWorkOrderList/mySparePartsService')
|
|
}
|
|
function handleAgreement() {
|
|
proxy.$tab.navigateTo('/pages/mine/agreement')
|
|
}
|
|
function handlePrivacyPolicy() {
|
|
proxy.$tab.navigateTo('/pages/mine/privacyPolicy')
|
|
}
|
|
function handleLogout() {
|
|
proxy.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
|
store.LogOut().then(() => {
|
|
proxy.$tab.reLaunch('/pages/login')
|
|
}).catch(() => { })
|
|
}).catch(() => { })
|
|
}
|
|
function handleLogin() {
|
|
proxy.$tab.navigateTo('/pages/login')
|
|
}
|
|
function handleEditPassword() {
|
|
proxy.$tab.navigateTo('/pages/mine/changePassword')
|
|
}
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page {
|
|
background-color: #f5f6f7;
|
|
}
|
|
|
|
.mine-container {
|
|
width: 100%;
|
|
height: 100%;
|
|
|
|
|
|
.header-section {
|
|
color: white;
|
|
position: relative;
|
|
|
|
image {
|
|
width: 100%;
|
|
height: calc(var(--status-bar-height) + 370rpx);
|
|
}
|
|
|
|
.info {
|
|
position: absolute;
|
|
top: calc(var(--status-bar-height) + 110rpx);
|
|
left: 80rpx;
|
|
right: 80rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.cu-avatar {
|
|
border: 4rpx solid #eaeaea;
|
|
width: 140rpx;
|
|
height: 140rpx;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: white;
|
|
|
|
|
|
.icon {
|
|
font-size: 80rpx;
|
|
color: #f5f5f5;
|
|
}
|
|
}
|
|
|
|
.user-info {
|
|
margin-left: 30rpx;
|
|
flex: 1;
|
|
|
|
.name {
|
|
line-height: 60rpx;
|
|
font-size: 36rpx;
|
|
font-weight: bold;
|
|
line-height: 60rpx;
|
|
margin-right: 20rpx;
|
|
|
|
span {
|
|
font-weight: normal;
|
|
font-size: 28rpx;
|
|
padding-left: 20rpx;
|
|
}
|
|
}
|
|
|
|
.tips {
|
|
padding: 10rpx 20rpx;
|
|
background: #3952ae;
|
|
color: white;
|
|
border-radius: 50rpx;
|
|
font-size: 24rpx;
|
|
display: inline-block;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
.content-section {
|
|
position: relative;
|
|
top: -100rpx;
|
|
|
|
.mine-actions {
|
|
margin: 30rpx 30rpx;
|
|
padding: 40rpx 0px;
|
|
border-radius: 16rpx;
|
|
background-color: white;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
|
|
.action-item {
|
|
width: calc(100% / 3);
|
|
|
|
image {
|
|
width: 80rpx;
|
|
}
|
|
|
|
.text {
|
|
display: block;
|
|
font-size: 26rpx;
|
|
}
|
|
}
|
|
|
|
.action-item1 {
|
|
margin-top: 26rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.btn {
|
|
width: calc(100vw - 60rpx);
|
|
margin: 0 auto;
|
|
background-color: rgb(64, 158, 255);
|
|
color: #FFFFFF;
|
|
height: 90rpx;
|
|
line-height: 90rpx;
|
|
text-align: center;
|
|
border-radius: 10rpx;
|
|
font-size: 32rpx;
|
|
}
|
|
|
|
.list-cell-arrow::before {
|
|
content: ' ';
|
|
height: 10px;
|
|
width: 10px;
|
|
border-width: 2px 2px 0 0;
|
|
border-color: #c0c0c0;
|
|
border-style: solid;
|
|
-webkit-transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
|
|
transform: matrix(0.5, 0.5, -0.5, 0.5, 0, 0);
|
|
position: absolute;
|
|
top: 50%;
|
|
margin-top: -6px;
|
|
right: 30rpx;
|
|
}
|
|
|
|
.list-cell {
|
|
position: relative;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
background-color: #fff;
|
|
color: #333;
|
|
padding: 26rpx 30rpx;
|
|
}
|
|
|
|
.list-cell:first-child {
|
|
border-radius: 8rpx 8rpx 0 0;
|
|
}
|
|
|
|
.list-cell:last-child {
|
|
border-radius: 0 0 8rpx 8rpx;
|
|
}
|
|
|
|
.list-cell::after {
|
|
content: '';
|
|
position: absolute;
|
|
border-bottom: 1px solid #eaeef1;
|
|
-webkit-transform: scaleY(0.5) translateZ(0);
|
|
transform: scaleY(0.5) translateZ(0);
|
|
transform-origin: 0 100%;
|
|
bottom: 0;
|
|
right: 0;
|
|
left: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
|
|
.menu-list {
|
|
margin: 15px 15px;
|
|
|
|
.menu-item-box {
|
|
width: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.menu-icon {
|
|
color: #007AFF;
|
|
font-size: 16px;
|
|
margin-right: 5px;
|
|
}
|
|
|
|
.text-right {
|
|
margin-left: auto;
|
|
margin-right: 34rpx;
|
|
color: #999;
|
|
}
|
|
}
|
|
}
|
|
</style>
|