|
|
|
|
@ -23,8 +23,8 @@
|
|
|
|
|
<button aria-role="button" class="g_w_110 g_h_32 g_flex_c g_radius_17 g_c_f" style="border: 1px solid #fff; background-color: transparent; font-size: 14px" @click="handleOpenAvatar">更换头像</button>
|
|
|
|
|
<!-- #endif -->
|
|
|
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
|
|
|
<!-- <button open-type="chooseAvatar" @chooseavatar="handleStartChangeAvatar" aria-role="button" class="g_w_110 g_h_32 g_flex_c g_radius_17 g_c_f" style="border: 1px solid #fff; background-color: transparent; font-size: 14px">更换头像</button> -->
|
|
|
|
|
<button @click="handleOpenAvatar" aria-role="button" class="g_w_110 g_h_32 g_flex_c g_radius_17 g_c_f" style="border: 1px solid #fff; background-color: transparent; font-size: 14px">更换头像</button>
|
|
|
|
|
<button open-type="chooseAvatar" @chooseavatar="handleStartChangeAvatar" aria-role="button" class="g_w_110 g_h_32 g_flex_c g_radius_17 g_c_f" style="border: 1px solid #fff; background-color: transparent; font-size: 14px">更换头像</button>
|
|
|
|
|
<!-- <button @click="handleOpenAvatar" aria-role="button" class="g_w_110 g_h_32 g_flex_c g_radius_17 g_c_f" style="border: 1px solid #fff; background-color: transparent; font-size: 14px">更换头像</button> -->
|
|
|
|
|
<!-- #endif -->
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="isEdit" class="g_flex_row_center">
|
|
|
|
|
@ -49,7 +49,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
avatar: uni.getStorageSync("apply-avatar"),
|
|
|
|
|
avatar: uni.getStorageSync("apply-avatar") || 'https://bocai-cms.oss-cn-beijing.aliyuncs.com/web-resource/1shoudan/defaultAva.svg',
|
|
|
|
|
isEdit: false,
|
|
|
|
|
size: {
|
|
|
|
|
width: uni.getSystemInfoSync().windowWidth,
|
|
|
|
|
@ -90,6 +90,12 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
that.G.checkToken();
|
|
|
|
|
uni.setStorageSync("apply-avatar", res.image);
|
|
|
|
|
// 同步更新 apply-userinfo 中的头像,确保返回上一页时能显示最新头像
|
|
|
|
|
let userInfo = uni.getStorageSync("apply-userinfo");
|
|
|
|
|
if (userInfo && userInfo.user) {
|
|
|
|
|
userInfo.user.imgSrc = res.image;
|
|
|
|
|
uni.setStorageSync("apply-userinfo", userInfo);
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
uni.navigateBack();
|
|
|
|
|
}, 1500);
|
|
|
|
|
@ -141,6 +147,12 @@ export default {
|
|
|
|
|
icon: "success",
|
|
|
|
|
});
|
|
|
|
|
uni.setStorageSync("apply-avatar", res);
|
|
|
|
|
// 同步更新 apply-userinfo 中的头像,确保返回上一页时能显示最新头像
|
|
|
|
|
let userInfo = uni.getStorageSync("apply-userinfo");
|
|
|
|
|
if (userInfo && userInfo.user) {
|
|
|
|
|
userInfo.user.imgSrc = res;
|
|
|
|
|
uni.setStorageSync("apply-userinfo", userInfo);
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
uni.navigateBack();
|
|
|
|
|
}, 1500);
|
|
|
|
|
|