Browse Source

loading 调整

wangxy 3 months ago
parent
commit
2fd7a9794c
1 changed files with 15 additions and 11 deletions
  1. 15 11
      pages/client/my/myInfo.vue

+ 15 - 11
pages/client/my/myInfo.vue

@@ -7,15 +7,11 @@
 		</view>
 		<!-- 头像 -->
 		<view class="user-img-box">
-			
-			<uni-file-picker limit="1" :del-icon="false" disable-preview :auto-upload="false"
+			<view class="user-title">头像</view>
+			<uni-file-picker return-type="object" v-model="data.images" :del-icon="false" mode="grid" disable-preview :auto-upload="false"
 				@select="handleSelect" file-mediatype="image" class="phone-file-picker user-file-picker">
-				<text class="user-title">头像</text>
-				<img class="head-img" :src="data.icon" v-if="data.icon">
-				<icon class="phone-default-userImg" v-else></icon>
-				<icon class="user-jt-icon"></icon>
 			</uni-file-picker>
-			<!-- <view>图片地址:{{data.icon}}</view> -->
+			<icon class="user-jt-icon"></icon>
 		</view>
 		<!-- 姓名 -->
 		<view class="form-label-input">
@@ -55,10 +51,16 @@
 	import {getAliyunPolicy} from "@/api/jiazheng.js"
 	import {ref,reactive} from "vue"
 	import {onLoad} from "@dcloudio/uni-app"
+	import defaultImage from "@/static/images/my/user-default-img.png"
+	
+	const defaultImage1 = ref({
+		url:defaultImage, extname: 'png', name: 'moren.png'
+	})
 
 	const imageStyles = ref({
-		width: 120,
-		height: 120,
+		width: '50rpx',
+		height: '50rpx',
+		background: 'red'
 	});
 
 	const data = reactive({
@@ -68,7 +70,8 @@
 		realName: '',
 		idcard: '',
 		userName: '',
-		userId: null
+		userId: null,
+		images: null
 	})
 
 	onLoad((options) => {
@@ -126,7 +129,7 @@
 									title: '上传成功',
 									icon: 'success'
 								});
-								
+								data.images = { url: data.icon, extname: 'png', name: 'touxiang.png' }
 							} else {
 								uni.showToast({
 									icon: 'none',
@@ -233,6 +236,7 @@
 			data.realName = res.data.realName; 
 			data.userName = res.data.userName;
 			data.userId = res.data.userId;
+			data.images = data.icon?{ url: data.icon, extname: 'png', name: 'touxiang.png' }:defaultImage1.value
 		})
 	}
 </script>