|
@@ -7,15 +7,11 @@
|
|
</view>
|
|
</view>
|
|
<!-- 头像 -->
|
|
<!-- 头像 -->
|
|
<view class="user-img-box">
|
|
<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">
|
|
@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>
|
|
</uni-file-picker>
|
|
- <!-- <view>图片地址:{{data.icon}}</view> -->
|
|
|
|
|
|
+ <icon class="user-jt-icon"></icon>
|
|
</view>
|
|
</view>
|
|
<!-- 姓名 -->
|
|
<!-- 姓名 -->
|
|
<view class="form-label-input">
|
|
<view class="form-label-input">
|
|
@@ -55,10 +51,16 @@
|
|
import {getAliyunPolicy} from "@/api/jiazheng.js"
|
|
import {getAliyunPolicy} from "@/api/jiazheng.js"
|
|
import {ref,reactive} from "vue"
|
|
import {ref,reactive} from "vue"
|
|
import {onLoad} from "@dcloudio/uni-app"
|
|
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({
|
|
const imageStyles = ref({
|
|
- width: 120,
|
|
|
|
- height: 120,
|
|
|
|
|
|
+ width: '50rpx',
|
|
|
|
+ height: '50rpx',
|
|
|
|
+ background: 'red'
|
|
});
|
|
});
|
|
|
|
|
|
const data = reactive({
|
|
const data = reactive({
|
|
@@ -68,7 +70,8 @@
|
|
realName: '',
|
|
realName: '',
|
|
idcard: '',
|
|
idcard: '',
|
|
userName: '',
|
|
userName: '',
|
|
- userId: null
|
|
|
|
|
|
+ userId: null,
|
|
|
|
+ images: null
|
|
})
|
|
})
|
|
|
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
@@ -126,7 +129,7 @@
|
|
title: '上传成功',
|
|
title: '上传成功',
|
|
icon: 'success'
|
|
icon: 'success'
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+ data.images = { url: data.icon, extname: 'png', name: 'touxiang.png' }
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -233,6 +236,7 @@
|
|
data.realName = res.data.realName;
|
|
data.realName = res.data.realName;
|
|
data.userName = res.data.userName;
|
|
data.userName = res.data.userName;
|
|
data.userId = res.data.userId;
|
|
data.userId = res.data.userId;
|
|
|
|
+ data.images = data.icon?{ url: data.icon, extname: 'png', name: 'touxiang.png' }:defaultImage1.value
|
|
})
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|