This commit is contained in:
cansnow
2025-11-27 07:48:42 +08:00
parent ab625e6463
commit b4c9ae1b67
9 changed files with 1952 additions and 486 deletions
+45 -104
View File
@@ -1,34 +1,33 @@
<template>
<view class="page_container">
<view class="self_info_row"></view>
<view class="uni-white-bg">
<view class="self_info_row"></view>
<view class="info_card">
<my-avatar :src="selfInfo.faceURL" :desc="selfInfo.nickname" size="46" />
<view class="info_card">
<my-avatar :src="selfInfo.faceURL" :desc="selfInfo.nickname" size="64" />
<view class="id_row">
<text class="nickname">{{ selfInfo.nickname }}</text>
<view class="id_row_copy" @click="copy">
<text class="id">{{ selfInfo.userID }}</text>
<image style="width: 32rpx; height: 32rpx" src="@/static/images/id_copy.png" mode="" />
<view class="id_row">
<text class="nickname">{{ selfInfo.nickname }}</text>
<view class="id_row_copy" @click="copy">
<text class="id">{{ selfInfo.userID }}</text>
<image style="width: 32rpx; height: 32rpx" src="@/static/images/id_copy.png" mode="" />
</view>
</view>
<view class="qr" @click="toSelfQr">
<img src="static/images/self_info_qr.png" alt="" />
<img src="static/images/common_right.png" alt="" />
</view>
</view>
<view class="qr" @click="toSelfQr">
<img src="static/images/self_info_qr.png" alt="" />
<img src="static/images/common_right.png" alt="" />
</view>
</view>
<view class="action_box">
<view @click="profileMenuClick(item)" class="profile_menu_item" v-for="item in profileMenus"
:key="item.idx">
<view class="menu_left">
<image style="width: 48rpx; height: 48rpx" :src="item.icon" mode="" />
<text>{{ item.title }}</text>
</view>
<u-icon name="arrow-right" size="16" color="#999"></u-icon>
</view>
</view>
<uni-list style="margin: 20rpx auto;width: 100%;">
<uni-list-item title="我的信息" thumb="/static/images/profile_menu_info.png" to="/pages/profile/selfInfo/index" clickable showArrow ></uni-list-item>
<uni-list-item title="账号设置" thumb="/static/images/profile_menu_account.png" to="/pages/profile/messageNotification/index" clickable showArrow ></uni-list-item>
<uni-list-item title="关于我们" thumb="/static/images/profile_menu_about.png" to="/pages/profile/accountSetting/index" clickable showArrow ></uni-list-item>
</uni-list>
<uni-list>
<uni-list-item title="退出登录" thumb="/static/images/profile_menu_logout.png" @click="logout" clickable showArrow ></uni-list-item>
</uni-list>
<u-toast ref="uToast"></u-toast>
</view>
@@ -37,27 +36,14 @@
<script>
import IMSDK from "openim-uniapp-polyfill";
import MyAvatar from "@/components/MyAvatar/index.vue";
import util from "@/util";
export default {
components: {
MyAvatar,
},
data() {
return {
profileMenus: [{
idx: 0,
title: "我的信息",
icon: require("static/images/profile_menu_info.png"),
},
{
idx: 2,
title: "账号设置",
icon: require("static/images/profile_menu_account.png"),
},
{
idx: 3,
title: "关于我们",
icon: require("static/images/profile_menu_about.png"),
},
profileMenus: [
{
idx: 4,
title: "退出登录",
@@ -72,6 +58,7 @@
},
},
methods: {
...util,
copy() {
console.log(this.selfInfo)
uni.setClipboardData({
@@ -86,9 +73,7 @@
});
},
logoutConfirm() {
console.log(1)
IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
console.log(2)
uni.removeStorage({
key: "IMToken",
});
@@ -96,55 +81,29 @@
key: "BusinessToken",
});
}).catch((err) => {
console.log(3)
console.log(err)
}).finally(() => {
console.log(4)
uni.$u.route("/pages/login/index");
});
},
profileMenuClick({idx}) {
switch (idx) {
case 0:
uni.navigateTo({
url: "/pages/profile/selfInfo/index",
});
break;
case 1:
uni.navigateTo({
url: "/pages/profile/messageNotification/index",
});
break;
case 2:
uni.navigateTo({
url: "/pages/profile/accountSetting/index",
});
break;
case 3:
uni.navigateTo({
url: "/pages/profile/about/index",
});
break;
case 4:
uni.showModal({
title: "提示",
content: "确定要退出当前账号吗?",
confirmText: "确认",
cancelText: "取消",
success: (res) => {
if (res.confirm) {
this.logoutConfirm();
}
},
});
break;
default:
break;
}
logout(){
uni.showModal({
title: "提示",
content: "确定要退出当前账号吗?",
confirmText: "确认",
cancelText: "取消",
success: (res) => {
if (res.confirm) {
this.logoutConfirm();
}
},
});
},
toSelfQr() {
uni.navigateTo({
url: `/pages/common/userOrGroupQrCode/index`,
url: `/pages/common/userOrGroupQrCode`,
});
},
},
@@ -152,8 +111,9 @@
</script>
<style lang="scss" scoped>
@import '@/uni_modules/uni-scss/index.scss';
.page_container {
background-color: #f8f9fa;
background-color: #ececec;
.self_info_row {
display: flex;
@@ -162,7 +122,7 @@
align-items: center;
width: 100%;
height: 276rpx;
background-image: url("@/static/images/profile_top_bg.png");
//background-image: url("@/static/images/profile_top_bg.png");
background-repeat: round;
}
@@ -180,7 +140,7 @@
.id_row {
@include vCenterBox();
display: flex;
height: 46px;
//height: 46px;
margin-left: 16rpx;
flex-direction: column;
align-items: flex-start;
@@ -210,24 +170,5 @@
}
}
.action_box {
margin: 24rpx 24rpx 0 24rpx;
background: #fff;
border-radius: 6px;
}
.profile_menu_item {
@include btwBox();
padding: 24rpx 36rpx;
.menu_left {
@include vCenterBox();
color: $uni-text-color;
image {
margin-right: 24rpx;
}
}
}
}
</style>