| | |
| | | <template> |
| | | <view class="container"> |
| | | <view class="head"> |
| | | <!-- <u-navbar :is-fixed="false" :border-bottom="false" title="个人中心" :background="{ background: 'transprent' }" title-color="#FFFFFF"> |
| | | <view @click="$u.func.route('/pages/system/setting')" slot="right"> |
| | | <image src="/static/images/user/setting.png" class="set-icon" mode="widthFix"></image> |
| | | </view> |
| | | </u-navbar> --> |
| | | <image src="/static/img/center-bg.png" class="head-bg" /> |
| | | |
| | | <!-- 用户信息 --> |
| | | <view class="user-box"> |
| | | <view class="left"> |
| | | <image v-if="userInfo.avatar" :src="setAvatar(userInfo.avatar)" class="avatar" mode="aspectFill"></image> |
| | | <image v-if="userInfo.avatar" :src="setAvatar(userInfo.avatar)" class="avatar" mode="aspectFill"> |
| | | </image> |
| | | <image v-else src="/static/icon/user-01.png" class="avatar" mode="aspectFill"></image> |
| | | <view class="user-name">{{ userInfo.real_name }}</view> |
| | | <view class="user-name" v-if="isLogin">{{ userInfo.real_name }}</view> |
| | | <view class="user-name" v-if="!isLogin">未登录</view> |
| | | <!-- <view class="tag">{{ userInfo.tenant_id }}</view> --> |
| | | </view> |
| | | <view @click="navigator('/subPackage/user/editUserInfo/editUserInfo')" class="edit-btn">编辑资料</view> |
| | | <view v-if="isLogin" @click="navigator('/subPackage/user/editUserInfo/editUserInfo')" class="edit-btn"> |
| | | 编辑资料</view> |
| | | <view v-if="!isLogin" @click="navToLogin()" class="edit-btn">前往登录 ></view> |
| | | </view> |
| | | <!-- 操作按钮 --> |
| | | <view class="nav" v-if="roleType == 1 && addressType == 1"> |
| | | <view class="nav" v-if="roleType == 1 && addressType == 1 && isLogin"> |
| | | <navigator url="/subPackage/user/family/list" hover-class="none" class="nav-item"> |
| | | <!-- <image src="/static/images/user/n1.png" class="icon" mode=""></image> --> |
| | | <u-icon name="account" color="#fff" size="28"></u-icon> |
| | | <u-icon name="account" color="#fff" size="28"></u-icon> |
| | | <view class="name">我的家人</view> |
| | | </navigator> |
| | | <navigator url="/subPackage/house/roomControl/index" hover-class="none" class="nav-item"> |
| | | <!-- <image src="/static/images/user/n2.png" class="icon" mode=""></image> --> |
| | | <u-icon name="home" color="#fff" size="28"></u-icon> |
| | | <u-icon name="home" color="#fff" size="28"></u-icon> |
| | | <view class="name">我的房屋</view> |
| | | </navigator> |
| | | <navigator url="/subPackage/user/district/index" hover-class="none" class="nav-item"> |
| | | <!-- <image src="/static/images/user/n3.png" class="icon" mode=""></image> --> |
| | | <u-icon name="map" color="#fff" size="28"></u-icon> |
| | | <u-icon name="map" color="#fff" size="28"></u-icon> |
| | | <view class="name">我的小区</view> |
| | | </navigator> |
| | | <navigator url="/subPackage/bs/views/zhsb?from=2" hover-class="none" class="nav-item"> |
| | | <!-- <image src="/static/images/user/n4.png" class="icon" mode=""></image> --> |
| | | <u-icon name="file-text" color="#fff" size="28"></u-icon> |
| | | <u-icon name="file-text" color="#fff" size="28"></u-icon> |
| | | <view class="name">出租信息</view> |
| | | </navigator> |
| | | </view> |
| | | </view> |
| | | <!-- 功能列表 --> |
| | | <!-- <view class="cell-box"> |
| | | <u-cell-group :border="false"> |
| | | <u-cell-item title="我的评价"> |
| | | <image slot="icon" src="/static/images/user/c1.png" class="icon" mode=""></image> |
| | | </u-cell-item> |
| | | <u-cell-item title="常见问题"> |
| | | <image slot="icon" src="/static/images/user/c2.png" class="icon" mode=""></image> |
| | | </u-cell-item> |
| | | <u-cell-item title="客服中心" :border-bottom="false"> |
| | | <image slot="icon" src="/static/images/user/c3.png" class="icon" mode=""></image> |
| | | </u-cell-item> |
| | | </u-cell-group> |
| | | </view> --> |
| | | <view class="cell-box"> |
| | | <u-cell-group :border="false" icon="star" :customStyle="{fontSize:'26rpx',color:'#585b61'}"> |
| | | <u-cell title="切换角色" isLink url="/subPackage/user/role/index"> |
| | | <view class="cell-box" v-if="isLogin"> |
| | | <u-cell-group :border="false" icon="star" :customStyle="{fontSize:'26rpx',color:'#585b61'}"> |
| | | <u-cell title="切换角色" isLink url="/subPackage/user/role/index"> |
| | | <image slot="icon" src="/static/icon/menu-center-02.png" class="icon" mode=""></image> |
| | | </u-cell> |
| | | <u-cell title="修改密码" :border="false" isLink url="/subPackage/user/password/index"> |
| | | <u-cell title="修改密码" :border="false" isLink url="/subPackage/user/password/index"> |
| | | <image slot="icon" src="/static/icon/menu-center-03.png" class="icon" mode=""></image> |
| | | </u-cell> |
| | | <!-- <u-cell title="测试页面" :border="false" isLink url="/subPackage/house/roomDetails/detail"> |
| | | <image slot="icon" src="/static/icon/menu-center-03.png" class="icon" mode=""></image> |
| | | </u-cell> --> |
| | | <!-- <u-cell-item title="评分"> |
| | | <image slot="icon" src="/static/images/user/c5.png" class="icon" mode=""></image> |
| | | </u-cell-item> |
| | | <u-cell-item title="反馈"> |
| | | <image slot="icon" src="/static/images/user/c6.png" class="icon" mode=""></image> |
| | | </u-cell-item> |
| | | <u-cell-item title="关于" :border-bottom="false"> |
| | | <image slot="icon" src="/static/images/user/c7.png" class="icon" mode=""></image> |
| | | </u-cell-item> --> |
| | | </u-cell-group> |
| | | </view> |
| | | <view class="cell-box" > |
| | | <view class="cell-box" v-if="isLogin"> |
| | | <u-cell-group :border="false"> |
| | | <u-cell title="退出登录" :border="false" @click="logOut" isLink> |
| | | <u-cell title="退出登录" :border="false" @click="logOut" isLink> |
| | | <image slot="icon" src="/static/icon/menu-center-04.png" class="icon" mode=""></image> |
| | | </u-cell> |
| | | </u-cell-group> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { fetchUserInfo } from "@/api/user.js" |
| | | import { minioBaseUrl } from "@/common/setting.js" |
| | | import { |
| | | fetchUserInfo |
| | | } from "@/api/user.js" |
| | | import { |
| | | minioBaseUrl |
| | | } from "@/common/setting.js" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | } |
| | | ], |
| | | roleType: 1, |
| | | addressType:1, |
| | | user_info:{} |
| | | addressType: 1, |
| | | user_info: {} |
| | | }; |
| | | }, |
| | | |
| | | |
| | | onShow() { |
| | | // this.getUserInfo(); |
| | | let role = uni.getStorageSync('activeRole') |
| | |
| | | } |
| | | this.addressType = uni.getStorageSync("siteInfo").addressType; |
| | | }, |
| | | |
| | | |
| | | mounted() { |
| | | this.setHeadHeight() |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | |
| | | setAvatar(avatar){ |
| | | |
| | | |
| | | setAvatar(avatar) { |
| | | return `${minioBaseUrl}${avatar}` |
| | | }, |
| | | |
| | | |
| | | getUserInfo(){ |
| | | |
| | | |
| | | getUserInfo() { |
| | | let id = uni.getStorageSync("userInfo").user_id; |
| | | // console.log("userInfo===>", uni.getStorageSync("userInfo")) |
| | | // return; |
| | | fetchUserInfo(id).then(res=>{ |
| | | console.log(res) |
| | | if(res.code == 200){ |
| | | console.log(JSON.parse(res.data)); |
| | | return; |
| | | let data = res.data; |
| | | fetchUserInfo(id).then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | console.log(JSON.parse(res.data)); |
| | | return; |
| | | let data = res.data; |
| | | let userInfo = res.data; |
| | | |
| | | |
| | | data = JSON.parse(data); |
| | | if(data.avatar){ |
| | | data.avatar = `${minioBaseUrl}${data.avatar}` |
| | | } |
| | | this.user_info = data; |
| | | this.$u.vuex('userInfo',JSON.parse(userInfo)) |
| | | } |
| | | }) |
| | | if (data.avatar) { |
| | | data.avatar = `${minioBaseUrl}${data.avatar}` |
| | | } |
| | | this.user_info = data; |
| | | this.$u.vuex('userInfo', JSON.parse(userInfo)) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | setHeadHeight() { |
| | | const that = this |
| | | |
| | | |
| | | uni.getSystemInfo({ |
| | | success: function(res) { |
| | | that.headHeight = Number(res.statusBarHeight) + Number(res.platform == 'ios' ? 44 : 48) + 582 |
| | | that.headHeight = Number(res.statusBarHeight) + Number(res.platform == 'ios' ? 44 : |
| | | 48) + 582 |
| | | } |
| | | }); |
| | | |
| | | |
| | | }, |
| | | |
| | | |
| | | navigator(url) { |
| | | this.$u.func.globalNavigator(url) |
| | | }, |
| | | |
| | | |
| | | navToLogin() { |
| | | uni.redirectTo({ |
| | | url: "/pages/login/login-account" |
| | | }) |
| | | }, |
| | | |
| | | |
| | | logOut() { |
| | | uni.showModal({ |
| | | title: "提示", |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | margin-right: 22rpx; |
| | | } |
| | | } |
| | | |
| | | /deep/ .u-cell__title-text{ |
| | | font-size:28rpx !important; |
| | | |
| | | /deep/ .u-cell__title-text { |
| | | font-size: 28rpx !important; |
| | | font-family: PingFang SC; |
| | | font-weight: 500; |
| | | color: #585b61; |
| | | } |
| | | </style> |
| | | </style> |