From 155f2b80f2a9b6f900c73f6e4461e9cebb7cd028 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期二, 10 十月 2023 17:12:20 +0800
Subject: [PATCH] #

---
 pages/user/user.vue |  124 +++++++++++++++++++++++++++++-----------
 1 files changed, 89 insertions(+), 35 deletions(-)

diff --git a/pages/user/user.vue b/pages/user/user.vue
index c02f676..cb5bc04 100644
--- a/pages/user/user.vue
+++ b/pages/user/user.vue
@@ -1,54 +1,108 @@
 <template>
-	<view class="">
-		<scroll-view class="scroll-Y">
-			<button size="mini" @click="up">btn</button>
-			<y-input title="鍟嗗搧鐮�" @input="show" v-model="matnr" placeholder=" 鎵爜 / 杈撳叆"/>
-			<y-input title="搴撲綅鐮�" @input="show" v-model="locno"/>
-			<y-input title="鎵樼洏鐮�" v-model="barcode" />
-			<y-input title="璁㈠崟鐮�" v-model="orderNo"></y-input>
-		</scroll-view>
+	<view>
+		<view class="user" @click="userDetail">
+			<!-- 澶村儚 -->
+			<view class="user-avatar">
+				<img src="" alt="">
+				<!-- <image src="" mode="aspectFit"></image> -->
+			</view>
+			<!-- 淇℃伅 -->
+			<view class="user-info">
+				<view class="user-name">{{username}}</view>
+				<view class="user-company">涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�</view>
+			</view>
+			<!-- 鏇村 -->
+			<view class="user-icons">
+				<uni-icons type="right"></uni-icons>
+			</view>
+		</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data () {
+	export default{
+		data() {
 			return {
-				scrollY:true,
-				matnr:'1100878-10000-21074558989',
-				locno: '0100509',
-				barcode: '80006098',
-				orderNo: 'JK20220923'
-				
+				username: ''
 			}
 		},
+		onShow() {
+			this.getDetail()
+		},
 		methods: {
-			open() {
-				this.$refs.yPopup.open('center')
+			userDetail() {
+				uni.navigateTo({
+					url:'/pages/user/user_detail/userDetail'
+				})
 			},
-			up() {
-				this.matnr = ''
-				console.log(this.matnr);
+			getDetail() {
+				let that = this
+				uni.request({
+					url: that.baseUrl + '/user/detail/auth',
+					header: {'token' : uni.getStorageSync('token')},
+					method: 'POST',
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							that.username = res.data.username
+						} else if (res.code === 403) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../../login/login'
+								});
+							}, 1000);
+						} else {
+							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+						}
+						console.log(res.data);
+					}
+				})
 			},
-			show() {
-				console.log(this.matnr,this.locno);
-			}
 		}
-	
 	}
 </script>
 
 <style>
-	.vv {
-		width: 100%;height: 100rpx;
-		
-	}
-	.bb {
-		position: fixed;
-		top: 0;
-		left: 0;
+	.user {
 		width: 100%;
-		height: 100%;
-		overflow: hidden;
+		height: 200rpx;
+		background-color: #fff;
+		display: grid;
+		grid-template-columns: 1fr 4fr 1fr;
+	}
+	.user-avatar {
+		height: 200rpx;
+		width: 200rpx;
+		/* background-color: aquamarine; */
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+	.user-avatar img {
+		height: 100rpx;
+		border-radius: 20rpx;
+	}
+	.user-info {
+		height: 200rpx;
+		display: grid;
+		grid-template-rows: 2fr 2fr;
+		/* background-color: aqua; */
+	}
+	.user-name {
+		height: 100rpx;
+		width: 100%;
+		display: flex;
+		align-items: flex-end;
+		font-size: 30rpx;
+		font-weight: 700;
+	}
+	.user-company {
+		height: 100rpx;
+	}
+	.user-icons {
+		display: flex;
+		align-items: center;
+		justify-content: center;
 	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1