|
|
@@ -0,0 +1,109 @@
|
|
|
+<template>
|
|
|
+ <view class="user" hover-class="navigator-hover">
|
|
|
+ <view class="profile-photo">
|
|
|
+ <up-image :show-loading="true" :src="user.profilePhoto" width="120rpx" height="120rpx" />
|
|
|
+ </view>
|
|
|
+ <view class="user-info">
|
|
|
+ <view class="user-name">{{ user.name }}</view>
|
|
|
+ <view class="user-phone">{{ user.phonenumber }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="iconfont icon-shezhi" />
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, reactive, getCurrentInstance } from 'vue'
|
|
|
+const { $Http } = getCurrentInstance().proxy;
|
|
|
+import { onLoad } from '@dcloudio/uni-app';
|
|
|
+
|
|
|
+let user = reactive({
|
|
|
+ name: '',
|
|
|
+ phonenumber: '',
|
|
|
+ profilePhoto: "",
|
|
|
+});
|
|
|
+
|
|
|
+onLoad(() => {
|
|
|
+ getProperty()
|
|
|
+ getUserMsg()
|
|
|
+ const userInfo = uni.getStorageSync('userMsg')
|
|
|
+ user.name = userInfo.name
|
|
|
+ user.phonenumber = userInfo.phonenumber
|
|
|
+ user.profilePhoto = userInfo.profilePhoto || '/static/image/user.png'
|
|
|
+});
|
|
|
+
|
|
|
+//headportrait
|
|
|
+
|
|
|
+function getUserMsg() {
|
|
|
+ $Http.basic({
|
|
|
+ "classname": "common.usercenter.usercenter",
|
|
|
+ "method": "queryUserMsg",
|
|
|
+ "content": { "nocache": true }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("res", res);
|
|
|
+ if (res.code == 1) {
|
|
|
+ user.name = res.data.name
|
|
|
+ user.phonenumber = res.data.phonenumber
|
|
|
+ user.profilePhoto = user.profilePhoto
|
|
|
+
|
|
|
+ let userMsg = uni.getStorageSync('userMsg')
|
|
|
+ userMsg.name = res.data.name
|
|
|
+ userMsg.phonenumber = res.data.phonenumber
|
|
|
+ userMsg.profilePhoto = res.data.profilePhoto || '/static/image/user.png'
|
|
|
+ uni.setStorageSync('userMsg', userMsg)
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function getProperty() {
|
|
|
+ $Http.basic({
|
|
|
+ id: 2025082115363003,
|
|
|
+ content: {
|
|
|
+ sa_customersid: 1
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log('个人资产', res);
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.user {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background-color: #fff;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 40rpx;
|
|
|
+
|
|
|
+ .profile-photo {
|
|
|
+ width: 120rpx;
|
|
|
+ height: 120rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .user-info {
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 40rpx;
|
|
|
+ padding-top: 10rpx;
|
|
|
+
|
|
|
+ .user-name {
|
|
|
+ line-height: 42rpx;
|
|
|
+ font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+
|
|
|
+ .user-phone {
|
|
|
+ line-height: 38rpx;
|
|
|
+ font-family: Microsoft YaHei, Microsoft YaHei;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #999999;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|