From 0a24ffeb3eff074c8f11e9f94fdf2c2cb4929799 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Fri, 10 Nov 2023 13:08:29 +0800
Subject: [PATCH] fix:小程序详情修改
---
pages/actionChange/myInfor/index.vue | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 104 insertions(+), 2 deletions(-)
diff --git a/pages/actionChange/myInfor/index.vue b/pages/actionChange/myInfor/index.vue
index 02409e3..f0169ba 100644
--- a/pages/actionChange/myInfor/index.vue
+++ b/pages/actionChange/myInfor/index.vue
@@ -1,8 +1,110 @@
<template>
+ <view class="mainContent">
+ <view class="headerAvatar">
+ <view class="">
+ <u-avatar :src="avatarUrl" fontSize="40" randomBgColor size='100'></u-avatar>
+ </view>
+ </view>
+ <view class="inforBox">
+ <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">
+ <u-button type="error" text="������" @click="goOut"></u-button>
+ </view>
+ </view>
</template>
-
<script>
+ import store from '@/store/index.js'
+ export default {
+ data() {
+ return {
+ loading: false,
+ userInfor: {},
+ avatarUrl: '',
+ unitList: [],
+ fontStyleobj: {
+ 'fontSize': '16px'
+ }
+ }
+ },
+ computed: {
+ unitName() {
+ let data = ''
+ 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() {
+ // 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 = 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: '������������������',
+ success: res => {
+ if (res.confirm) {
+ this.$http.httpGet('/AppUser/wx/exit', {
+ userId: this.userInfor.userId
+ }).then(res => {
+ uni.clearStorageSync()
+ uni.setStorageSync('openId', openId)
+ uni.reLaunch({
+ url: '/pages/login/login',
+ })
+ })
+ }
+ }
+ })
+ }
+ }
+ }
</script>
+<style lang="scss" scoped>
+ .mainContent {
+ padding: 20px;
+ }
-<style>
+ .headerAvatar {
+ display: flex;
+ justify-content: center;
+ }
+
+ .inforBox {
+ margin-top: 57.69rpx;
+ }
+
+ .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