浏览代码

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
个人中心修改

1004749546@qq.com 4 年之前
父节点
当前提交
3351dbf576
共有 4 个文件被更改,包括 38 次插入16 次删除
  1. 1 1
      App.vue
  2. 8 0
      api/login.js
  3. 18 1
      pages/getOrder/getOrder.vue
  4. 11 14
      pages/userCenter/index.vue

+ 1 - 1
App.vue

@@ -1,6 +1,6 @@
 <script>
 	// const uat_URL = 'http://md.test.zyucgj.com/saas/clz/' // 预发布
-	const uat_URL = 'http://192.168.16.103:8103/cw-wechat/' // 本地
+	const uat_URL = 'http://192.168.16.105:8103/cw-wechat/' // 本地
 	const pro_URL = 'https://car.zyucgj.com/saas/clz/'  // 生产
 	const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
 	const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url

+ 8 - 0
api/login.js

@@ -34,3 +34,11 @@ export const checkLogin = () => {
   }
 };
 
+// 获取登录用户信息
+export const getUserInfo = params => {
+  return axios.request({
+    url: `customer/getDetail`,
+    data: params,
+    method: 'get'
+  })
+};

+ 18 - 1
pages/getOrder/getOrder.vue

@@ -49,7 +49,7 @@
 						<view class="item phone">
 							<text>手机号码</text>
 							<view class="right">
-								<text >18792703003</text>
+								<text >{{userPhone}}</text>
 							</view>
 						</view>
 					</view>
@@ -81,12 +81,14 @@
 
 <script>
 	import uniSteps from '@/components/uni-steps/uni-steps.vue'
+	import {getUserInfo} from '@/api/login.js'
 	export default {
 		components: {
 			uniSteps
 		},
 		data() {
 			return {
+				userPhone: '',
 				stepIndex: 0, // 当前步奏下标
 				serverIndex: 0, // 选择服务下标
 				itemList: [ // 服务列表
@@ -159,6 +161,7 @@
 			uni.removeStorageSync('stepIndex')
 			// 注册全局监听事件
 			uni.$once('read', this.read)
+			this.getUserPhone()
 		},
 		onUnload() {
 			uni.removeStorageSync('stepIndex')
@@ -169,6 +172,20 @@
 			console.log(this.stepIndex)
 		},
 		methods: {
+			// 获取用户信息
+			getUserPhone () {
+				getUserInfo().then(res =>{
+					console.log(res,'rrrrrrr')
+					if(res.status == 200) {
+						this.userPhone = res.data.mobile
+					} else {
+						uni.showToast({
+							title: res.message,
+							icon: 'none'
+						})
+					}
+				})
+			},
 			// 获取服务列表
 			getServerList () {
 				

+ 11 - 14
pages/userCenter/index.vue

@@ -3,10 +3,10 @@
 		<!-- 头部 -->
 		<view class="user-head">
 			<view class="user-photo">
-				<u-image width="90rpx" shape="circle" height="90rpx" :src="userInfo&&userInfo.avatarUrl"></u-image>
+				<open-data type="userAvatarUrl"></open-data>
 			</view>
 			<view class="user-info">
-				{{userInfo&&userInfo.nickName}}
+				<open-data type="userNickName"></open-data>
 			</view>
 		</view>
 		<!-- 列表 -->
@@ -30,21 +30,10 @@
 	export default {
 		data() {
 			return {
-				userInfo: {
-					avatarUrl:'',
-					nickName:''
-				}
+				
 			};
 		},
 		onShow() {
-			let _this = this
-			uni.getUserInfo({
-				provider: 'weixin',
-				success(e) {
-					console.log(e)
-					_this.userInfo = e.userInfo
-				}
-			})
 		},
 		methods:{
 			// 打开对应的页面
@@ -91,7 +80,15 @@
 				flex-grow: 1;
 				padding: 0 20rpx;
 			}
+			.user-photo{
+				width: 100rpx;
+				height: 100rpx;
+				border-radius: 50%;
+				overflow: hidden;
+				margin-right: 30rpx;
+			}
 		}
+		
 		.user-list{
 			padding:0 20rpx;
 		}