This commit is contained in:
2025-03-28 16:27:26 +08:00
parent f654e16c18
commit a3e6a6d8b8
494 changed files with 4072 additions and 47246 deletions
+39 -6
View File
@@ -5,10 +5,15 @@
<view class="tui-item-box align-center">
<view class="tui-list-cell_name">头像</view>
<view class="tui-right">
<cloud-image v-if="userInfo.avatar_file" class="avatar"
<cloud-image v-if="userInfo.avatar_file && checkUrlProtocol(userInfo.avatar_file.url) === 'cloud'" class="avatar"
:src="userInfo.avatar_file.url"></cloud-image>
<image class="cu-avatar"
v-else-if="userInfo.avatar_file && checkUrlProtocol(userInfo.avatar_file.url) === 'http/https'"
:src="userInfo.avatar_file.url"
mode=""
v-else></image>
<image class="cu-avatar"
src="https://env-00jxt5y29hrd.normal.cloudstatic.cn/static/center/avatar.png?expire_at=1741157497&er_sign=9b8381ae7875137d28c57d502762691b"
src="https://qnycdn.mymoyu.top/static/avatar.jpg"
mode=""
v-else></image>
</view>
@@ -75,7 +80,7 @@
</view>
<tui-modal :show="modal1" :custom="true" @cancel="modal1 = !modal1" fadeIn >
<view class="tui-modal-custom">
<view class="tui-prompt-title">请输入昵称</view>
<view class="tui-prompt-title">{{ getMessage(currentEdit) }}</view>
<input v-show="currentEdit === 0" placeholder="请输入新昵称" class="tui-modal-input"
:class="{'tui-hidden-input':!modal1}"
v-model="updateForm.nickname" />
@@ -104,7 +109,7 @@
import {
store,
mutations
} from '@/uni_modules/uni-id-pages/common/store.js';
} from '@/pages3/uni_modules/uni-id-pages/common/store.js';
import tuiListView from "@/components/thorui/tui-list-view/tui-list-view.vue";
import tuiListCell from "@/components/thorui/tui-list-cell/tui-list-cell.vue";
@@ -149,12 +154,40 @@
// this.updateForm.gender = this.loginUser.gender;
},
methods: {
checkUrlProtocol(url) {
try {
const protocolSeparatorIndex = url.indexOf('://');
if (protocolSeparatorIndex === -1) {
return 'invalid';
}
const protocol = url.substring(0, protocolSeparatorIndex).toLowerCase();
if (protocol === 'http' || protocol === 'https') {
return 'http/https';
} else if (protocol === 'cloud') {
return 'cloud';
} else {
return 'other';
}
} catch (error) {
return 'invalid';
}
},
getMessage(currentEdit) {
if (currentEdit === 0) {
return "请输入你的昵称";
} else if (currentEdit === 1 ) {
return "请填写你的个人简介";
} else if (currentEdit === 2) {
return "请选择你的性别";
}
},
handleToRepassword () {
// if (!this.userInfo.mobile) {
// console.log("需要绑定手机号!");
// return;
// }
uni.navigateTo({url: `../../uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd` })
uni.navigateTo({url: `../../pages3/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd` })
},
handleShowModal (index) {
this.currentEdit = index
@@ -201,7 +234,7 @@
// 绑定手机号
handleBindMobile () {
uni.navigateTo({
url: `../../uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile`
url: `../../pages3/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile`
})
},
// 更换头像