From f71917022b1f1078c2670972c8dd9c7f89eb3744 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Wed, 08 Nov 2023 11:16:48 +0800
Subject: [PATCH] fix:查看详情权限修改
---
pages/actionChange/myInfor/index.vue | 47 +++++++++++++++++++++++++++++++++--------------
1 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/pages/actionChange/myInfor/index.vue b/pages/actionChange/myInfor/index.vue
index b63dc6c..f0169ba 100644
--- a/pages/actionChange/myInfor/index.vue
+++ b/pages/actionChange/myInfor/index.vue
@@ -2,15 +2,17 @@
<view class="mainContent">
<view class="headerAvatar">
<view class="">
- <u-avatar :text="firstFont" fontSize="40" randomBgColor size='100'></u-avatar>
+ <u-avatar :src="avatarUrl" fontSize="40" randomBgColor size='100'></u-avatar>
</view>
</view>
<view class="inforBox">
- <u-cell-group>
+ <u-cell-group :custom-style='fontStyleobj'>
<u-cell icon="server-man" title="������" :value="userInfor.userName"></u-cell>
<u-cell icon="account-fill" title="������" :value="userInfor.account"></u-cell>
<u-cell icon="integral-fill" title="������������" :value="unitName"></u-cell>
<u-cell icon="phone-fill" title="���������" :value="userInfor.mobile"></u-cell>
+ <u-cell icon="clock-fill" title="������������������" v-if="userInfor.device===1" isLink
+ url="/pages/actionChange/secondLevelData/index"></u-cell>
</u-cell-group>
</view>
<view class="bunts">
@@ -19,38 +21,49 @@
</view>
</template>
<script>
- import {
- created
- } from '../../../uni_modules/uview-ui/libs/mixin/mixin'
+ import store from '@/store/index.js'
export default {
data() {
return {
loading: false,
userInfor: {},
- unitList: []
+ avatarUrl: '',
+ unitList: [],
+ fontStyleobj: {
+ 'fontSize': '16px'
+ }
}
},
computed: {
unitName() {
let data = ''
- if (this.unitList.length > 0) {
- data = this.unitList.find(a => parseInt(a.unitId) === this.userInfor.unitId).unitName
+ if (Object.values(this.userInfor).length > 0 && this.unitList.length > 0) {
+ if (this.userInfor.unitId) {
+ data = this.unitList.find(a => parseInt(a.unitId) === this.userInfor.unitId).unitName
+ }
}
return data || ''
},
- firstFont() {
- return this.userInfor.userName[0] || '���'
- }
+ // firstFont() {
+ // let data = ''
+ // if (Object.values(this.userInfor).length > 0) {
+ // data = this.userInfor.userName[0]
+ // }
+ // return data || '���'
+ // }
},
created() {
this.$http.httpGet('/allocation/unit').then(res => {
this.unitList = res.data
})
- this.userInfor = this.$storage.getJson('userInfo')
- console.log('userInfor', this.userInfor.userName[0])
+ this.userInfor = JSON.parse(uni.getStorageSync('userInfor') || '{}')
+ console.log('this.userInforGet', this.userInfor)
+ let baseUrl = this.$storage.get('baseUrl')
+ this.avatarUrl = `${baseUrl}/file/preview/${this.userInfor.file.fileId}`
},
methods: {
goOut() {
+ let openId = uni.getStorageSync('openId')
uni.showModal({
title: '������',
content: '������������������',
@@ -60,10 +73,11 @@
userId: this.userInfor.userId
}).then(res => {
uni.clearStorageSync()
+ uni.setStorageSync('openId', openId)
uni.reLaunch({
url: '/pages/login/login',
})
- }).catch(uni.$u.toast('������������'))
+ })
}
}
})
@@ -88,4 +102,9 @@
.bunts {
margin-top: 57.69rpx;
}
+
+ /deep/ .u-cell__title-text,
+ /deep/.u-cell__value {
+ font-size: 30.77rpx !important;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.8.0