caojunjie 1 year ago
parent
commit
1b570c3313
3 changed files with 25 additions and 7 deletions
  1. 5 0
      https/api.js
  2. 2 2
      https/index.js
  3. 18 5
      pages/mine/index.vue

+ 5 - 0
https/api.js

@@ -198,4 +198,9 @@ export default {
 	orderDetails(params) {
 		return request('/business/order/details', 'get', params)
 	},
+	// 获取用户信息
+	userProfile(params) {
+		return request('/system/user/profile', 'get', params)
+	},
+
 }

+ 2 - 2
https/index.js

@@ -1,6 +1,6 @@
 export default {
-	// url: 'http://192.168.8.111:8080'
-	url: 'http://192.168.8.105:8080'
+	// url: 'http://192.168.8.108:8080'
+	url: 'http://192.168.8.103:8080'
 	// url: 'https://byy-api.ningmengdou.com',
 	// url: 'http://59.110.231.49:8880',
 	// url: 'http://192.168.0.189:8888'

+ 18 - 5
pages/mine/index.vue

@@ -2,14 +2,14 @@
 	<view class="mine-page">
 		<view class="topContent"></view>
 		<view class="avatar-box">
-			<u-avatar :src="require('@/static/head.png')" size="80"></u-avatar>
+			<u-avatar :src="userInfo.avatar?httpsImg + userInfo.avatar:require('@/static/head.png')" size="80"></u-avatar>
 		</view>
 		<view class="info-box">
 			<view class="info-item">姓名:<view class="text">{{userInfo.userName}}</view>
 			</view>
-			<view class="info-item">手机号:<view class="text">{{userInfo.userPhone}}</view>
+			<view class="info-item">手机号:<view class="text">{{userInfo.phonenumber}}</view>
 			</view>
-			<view class="info-item">邮箱:<view class="text">{{userInfo.userEmail}}</view>
+			<view class="info-item">邮箱:<view class="text">{{userInfo.email}}</view>
 			</view>
 		</view>
 		<view class="btn-box">
@@ -23,15 +23,28 @@
 </template>
 
 <script>
+	import https from '@/https/index.js'
 	export default {
 		data() {
 			return {
 				msgType: 'warn',
-				userInfo: uni.getStorageSync('userInfo')
+				userInfo: {},
+				httpsImg:'',
 			}
 		},
-		onShow() {},
+		onLoad() {
+			this.httpsImg = https.url
+		},
+		onShow() {
+			this.userProfilefun()
+		},
 		methods: {
+			// 获取个人信息
+			userProfilefun(){
+				this.$api.userProfile().then(res=>{
+					this.userInfo = res.data
+				})
+			},
 			logout() {
 				this.$refs.alertDialog.open()
 			},