This commit is contained in:
2025-11-25 05:36:02 +08:00
parent 8e036cc171
commit b10e4b4336
65 changed files with 2672 additions and 2270 deletions
+157 -132
View File
@@ -1,144 +1,169 @@
<template>
<view class="page_container">
<custom-nav-bar title="关于我们" />
<view class="logo_area">
<image src="@/static/images/about_logo.png" mode=""></image>
<view>{{ v }}</view>
<view class="page_container">
<custom-nav-bar title="关于我们" />
<view class="logo_area">
<image src="@/static/images/about_logo.png" mode=""></image>
<view>{{ appversion }}</view>
<info-item @click="checkUpdate" class="check" title="检测更新" content="" />
<info-item @click="openurl('http://baidu.com')" class="check" title="官方网站" content="" />
<info-item @click="goto('/pages/common/article?type=article&name=coom&title=商务合作')" class="check" title="商务合作" content="" />
<info-item @click="goto('/pages/common/article?type=article&name=contract&title=用户协议')" class="check" title="用户协议" content="" />
<info-item @click="goto('/pages/common/article?type=article&name=privacy&title=隐私政策')" class="check" title="隐私政策" content="" />
<info-item @click="goto('/pages/common/article?type=article&name=aboutus&title=关于我们')" class="check" title="关于我们" content="" />
<info-item @click="clearcache" class="check" title="清除缓存" content="" />
<info-item @click="show = true" class="check" title="上传调试日志" content="" />
<info-item
@click="show = true"
class="check"
title="上传调试日志"
content=""
/>
<u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false" >
<view class="slot-content">
<u--input
placeholder="日志数量"
border="surround"
v-model="line"
></u--input>
</view>
</u-modal>
</view>
</view>
<u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false">
<view class="slot-content">
<u--input placeholder="日志数量" border="surround" v-model="line"></u--input>
</view>
</u-modal>
</view>
</view>
</template>
<script>
import IMSDK from "openim-uniapp-polyfill";
import { version } from '@/common/config'
import CustomNavBar from "@/components/CustomNavBar/index.vue";
import { PageEvents } from "@/constant";
import InfoItem from "../selfInfo/InfoItem.vue";
export default {
components: {
CustomNavBar,
InfoItem,
},
data() {
return {
show: false,
line: 10000,
version: "",
loading: false,
};
},
computed: {
v(){
return version
}
},
onLoad() {
this.getAppVersion();
uni.$on(PageEvents.CheckForUpdateResp, this.checkRespHandler);
},
onUnload() {
uni.$off(PageEvents.CheckForUpdateResp, this.checkRespHandler);
},
mounted() {
IMSDK.subscribe('uploadLogsProgress', this.uploadHandler);
},
beforeDestroy() {
IMSDK.unsubscribe('uploadLogsProgress', this.uploadHandler);
},
methods: {
uploadLog() {
this.show = false
IMSDK.asyncApi(
'uploadLogs',
IMSDK.uuid(),
{
line: this.line,
ex: ""
}
)
uni.showLoading({
title: '上传中',
mask: true,
});
},
uploadHandler({
data: { current, size },
}) {
console.log('uploadHandler',current,size)
if (current >= size) {
uni.hideLoading();
uni.showToast({
title: "上传成功",
icon: "none",
});
return;
}
},
getAppVersion() {
plus.runtime.getProperty(
plus.runtime.appid,
({ version }) => (this.appVersion = version),
);
},
updateCheck() {
this.loading = true;
uni.$emit(PageEvents.CheckForUpdate, true);
},
checkRespHandler() {
this.loading = false;
},
},
};
import IMSDK from "openim-uniapp-polyfill";
import {version } from '@/common/config'
import CustomNavBar from "@/components/CustomNavBar/index.vue";
import {PageEvents } from "@/constant";
import InfoItem from "../selfInfo/InfoItem.vue";
import {checkUpgrade} from "@/api/login.js"
export default {
components: {
CustomNavBar,
InfoItem,
},
data() {
return {
show: false,
line: 10000,
appversion: "",
loading: false,
};
},
onLoad() {
this.getAppVersion();
},
mounted() {
IMSDK.subscribe('uploadLogsProgress', this.uploadHandler);
},
beforeDestroy() {
IMSDK.unsubscribe('uploadLogsProgress', this.uploadHandler);
},
methods: {
uploadLog() {
this.show = false
IMSDK.asyncApi('uploadLogs',IMSDK.uuid(), {
line: this.line,
ex: ""
})
uni.showLoading({
title: '上传中',
mask: true,
});
},
uploadHandler({data: {current,size},}) {
console.log('uploadHandler', current, size)
if (current >= size) {
uni.hideLoading();
uni.showToast({
title: "上传成功",
icon: "none",
});
return;
}
},
getAppVersion() {
let system = uni.getSystemInfoSync();
const _this = this;
plus.runtime.getProperty(plus.runtime.appid,(inf) => {
console.log(inf);
_this.appversion = inf.version
});
},
checkRespHandler() {
this.loading = false;
},
goto(url){
uni.navigateTo({
url: url,
});
},
clearcache(){
},
openurl(url){
// #ifdef APP
plus.runtime.openWeb(url)
// #endif
// #ifdef H5
window.open(url);
// #endif
},
// 验证是否升级
checkUpdate() {
this.loading = true;
const _this = this;
let system = uni.getSystemInfoSync();
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
checkUpgrade({version:system.appVersion,platform:system.platform,version_wgt:inf.versionCode}).then(res=>{
_this.loading = false;
if(!res.data){
uni.showToast({
title:"已经是最新版本"
})
return ;
}
let skip_version = uni.getStorageSync('skip_version')
if(res && res.version!=skip_version){
uni.$emit('closeWebview')
_this.setShow(_this.current, false)
uni.navigateTo({
url: '/pages/common/upgrade?model=' + JSON.stringify(res),
animationType:"fade-in"
});
}
})
})
},
},
};
</script>
<style lang="scss">
.page_container {
background-color: #f8f8f8;
.page_container {
background-color: #f8f8f8;
.logo_area {
display: flex;
flex-direction: column;
align-items: center;
margin: 24rpx 24rpx 0 24rpx;
background: #fff;
border-radius: 6px;
padding: 48rpx 0 16rpx 0;
color: $uni-text-color;
.logo_area {
display: flex;
flex-direction: column;
align-items: center;
margin: 24rpx 24rpx 0 24rpx;
background: #fff;
border-radius: 6px;
padding: 48rpx 0 16rpx 0;
color: $uni-text-color;
image {
width: 72px;
height: 72px;
margin-bottom: 24rpx;
}
}
image {
width: 72px;
height: 72px;
margin-bottom: 24rpx;
}
}
.check {
margin-top: 26rpx;
border-top: 1px #e8eaef solid;
padding: 20rpx;
padding-bottom: 0;
width: 90%;
}
.check {
margin-top: 26rpx;
border-top: 1px #e8eaef solid;
padding: 20rpx;
padding-bottom: 0;
width: 90%;
}
.btn_row {
padding: 0 44rpx;
}
}
</style>
.btn_row {
padding: 0 44rpx;
}
}
</style>
+15 -12
View File
@@ -86,19 +86,22 @@
});
},
logoutConfirm() {
IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid())
.then(() => {
uni.removeStorage({
key: "IMToken",
});
uni.removeStorage({
key: "BusinessToken",
});
})
.catch((err) => console.log(err))
.finally(() => {
uni.$u.route("/pages/login/index");
console.log(1)
IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
console.log(2)
uni.removeStorage({
key: "IMToken",
});
uni.removeStorage({
key: "BusinessToken",
});
}).catch((err) => {
console.log(3)
console.log(err)
}).finally(() => {
console.log(4)
uni.$u.route("/pages/login/index");
});
},
profileMenuClick({idx}) {
switch (idx) {
+62 -65
View File
@@ -1,74 +1,71 @@
<template>
<view @click="clickItem" class="info_item">
<view class="left_label">
<text>{{ title }}</text>
</view>
<view class="right_value">
<slot name="value">
<text class="content">{{ content }}</text>
</slot>
<u-icon
v-if="showArrow"
name="arrow-right"
size="16"
color="#999"
></u-icon>
</view>
<u-loading-icon v-show="loading" class="loading_icon"></u-loading-icon>
</view>
<view @click="clickItem" class="info_item">
<view class="left_label">
<text>{{ title }}</text>
</view>
<view class="right_value">
<slot name="value">
<text class="content">{{ content }}</text>
</slot>
<u-icon v-if="showArrow" name="arrow-right" size="16" color="#999"></u-icon>
</view>
<u-loading-icon v-show="loading" class="loading_icon"></u-loading-icon>
</view>
</template>
<script>
export default {
name: "",
props: {
title: String,
content: String,
showArrow: {
type: Boolean,
default: true,
},
loading: {
type: Boolean,
default: false,
},
},
data() {
return {};
},
methods: {
clickItem() {
this.$emit("click");
},
},
};
export default {
name: "",
props: {
title: String,
content: String,
showArrow: {
type: Boolean,
default: true,
},
loading: {
type: Boolean,
default: false,
},
},
data() {
return {};
},
methods: {
clickItem() {
this.$emit("click");
},
},
};
</script>
<style lang="scss" scoped>
.info_item {
@include btwBox();
height: 82rpx;
padding: 0 44rpx;
color: $uni-text-color;
// border-bottom: 1px solid rgba(153,153,153,0.3);
position: relative;
.info_item {
@include btwBox();
height: 82rpx;
padding: 0 44rpx;
color: $uni-text-color;
// border-bottom: 1px solid rgba(153,153,153,0.3);
position: relative;
.right_value {
@include vCenterBox();
.content {
font-size: 28rpx;
color: #999;
}
.u-icon {
margin-left: 12rpx;
}
}
.right_value {
@include vCenterBox();
.loading_icon {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
</style>
.content {
font-size: 28rpx;
color: #999;
}
.u-icon {
margin-left: 12rpx;
}
}
.loading_icon {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}
</style>
+166 -202
View File
@@ -1,216 +1,180 @@
<template>
<view class="page_container">
<custom-nav-bar title="个人资料" />
<view class="page_container">
<custom-nav-bar title="个人资料" />
<view class="info_wrap">
<info-item
:loading="loadingState.faceURL"
@click="updateAvatar"
title="头像"
>
<my-avatar
:src="selfInfo.faceURL"
:desc="selfInfo.nickname"
size="30"
slot="value"
/>
</info-item>
<info-item
@click="updateNickname"
title="姓名"
:content="selfInfo.nickname"
/>
<info-item
:loading="loadingState.gender"
@click="updateGender"
title="性别"
:content="getGender"
/>
<info-item
:loading="loadingState.birth"
@click="() => (showDatePicker = true)"
title="生日"
:content="getBirth"
/>
</view>
<view class="info_wrap">
<info-item :loading="loadingState.faceURL" @click="updateAvatar" title="头像">
<my-avatar :src="selfInfo.faceURL" :desc="selfInfo.nickname" size="30" slot="value" />
</info-item>
<info-item @click="updateNickname" title="姓名" :content="selfInfo.nickname" />
<info-item :loading="loadingState.gender" @click="updateGender" title="性别" :content="getGender" />
<info-item :loading="loadingState.birth" @click="() => (showDatePicker = true)" title="生日"
:content="getBirth" />
</view>
<view class="info_wrap">
<info-item
:showArrow="false"
title="手机号码"
:content="selfInfo.phoneNumber || '-'"
/>
<info-item
:showArrow="false"
title="邮箱"
:content="selfInfo.email || '-'"
/>
</view>
<view class="info_wrap">
<info-item :showArrow="false" title="手机号码" :content="selfInfo.mobile || '-'" />
<info-item :showArrow="false" title="邮箱" :content="selfInfo.email || '-'" />
</view>
<u-datetime-picker
:minDate="0"
:maxDate="nowDate"
:show="showDatePicker"
@confirm="confirmDate"
@cancel="() => (showDatePicker = false)"
v-model="selfInfo.birth"
mode="date"
/>
</view>
<u-datetime-picker :minDate="0" :maxDate="nowDate" :show="showDatePicker" @confirm="confirmDate"
@cancel="() => (showDatePicker = false)" v-model="selfInfo.birth" mode="date" />
</view>
</template>
<script>
import { businessInfoUpdate } from "@/api/login";
import IMSDK from "openim-uniapp-polyfill";
import CustomNavBar from "@/components/CustomNavBar/index.vue";
import MyAvatar from "@/components/MyAvatar/index.vue";
import dayjs from "dayjs";
import InfoItem from "./InfoItem.vue";
import { getPurePath } from "@/util/common";
export default {
components: {
CustomNavBar,
MyAvatar,
InfoItem,
},
data() {
return {
showDatePicker: false,
loadingState: {
faceURL: false,
gender: false,
birth: false,
},
nowDate: Date.now(),
};
},
computed: {
selfInfo() {
return this.$store.getters.storeSelfInfo;
},
getGender() {
if (this.selfInfo.gender === 0) {
return "保密";
}
if (this.selfInfo.gender === 1) {
return "男";
}
return "女";
},
getBirth() {
const birth = this.selfInfo.birth ?? 0;
return dayjs(birth).format("YYYY-MM-DD");
},
},
methods: {
updateNickname() {
uni.navigateTo({
url: `/pages/common/markOrIDPage/index?isSelfNickname=true&sourceInfo=${JSON.stringify(
import {
businessInfoUpdate
} from "@/api/login";
import IMSDK from "openim-uniapp-polyfill";
import CustomNavBar from "@/components/CustomNavBar/index.vue";
import MyAvatar from "@/components/MyAvatar/index.vue";
import dayjs from "dayjs";
import InfoItem from "./InfoItem.vue";
import {
getPurePath
} from "@/util/common";
export default {
components: {
CustomNavBar,
MyAvatar,
InfoItem,
},
data() {
return {
showDatePicker: false,
loadingState: {
faceURL: false,
gender: false,
birth: false,
},
nowDate: Date.now(),
};
},
computed: {
selfInfo() {
return this.$store.getters.storeSelfInfo;
},
getGender() {
if (this.selfInfo.sex === 0) {
return "保密";
}
if (this.selfInfo.sex === 1) {
return "男";
}
return "女";
},
getBirth() {
console.log(this.selfInfo);
const birth = this.selfInfo.birthday ?? 0;
return dayjs(birth).format("YYYY-MM-DD");
},
},
methods: {
updateNickname() {
uni.navigateTo({
url: `/pages/common/markOrIDPage/index?isSelfNickname=true&sourceInfo=${JSON.stringify(
this.selfInfo,
)}`,
});
},
updateGender() {
uni.showActionSheet({
itemList: ["男", "女"],
success: async ({ tapIndex }) => {
this.loadingState.gender = true;
await this.updateSelfInfo(
{
gender: tapIndex + 1,
},
"gender",
);
},
});
},
updateAvatar() {
uni.chooseImage({
count: 1,
sizeType: ["compressed"],
success: async ({ tempFilePaths }) => {
const path = tempFilePaths[0];
const nameIdx = path.lastIndexOf("/") + 1;
const typeIdx = path.lastIndexOf(".") + 1;
const fileName = path.slice(nameIdx);
const fileType = path.slice(typeIdx);
this.loadingState.faceURL = true;
const {
data: { url },
} = await IMSDK.asyncApi(IMSDK.IMMethods.UploadFile, IMSDK.uuid(), {
filepath: getPurePath(tempFilePaths[0]),
name: fileName,
contentType: fileType,
uuid: IMSDK.uuid(),
});
console.log(url);
this.updateSelfInfo(
{
faceURL: url,
},
"faceURL",
);
this.loadingState.faceURL = false;
},
});
},
toQrCode() {
uni.navigateTo({
url: `/pages/common/userOrGroupQrCode/index`,
});
},
copyID() {
uni.setClipboardData({
data: this.selfInfo.userID,
success: () => {
uni.hideToast();
this.$nextTick(() => {
uni.$u.toast("复制成功");
});
},
});
},
async updateSelfInfo(data, key) {
try {
await businessInfoUpdate({
userID: this.selfInfo.userID,
...data,
});
await this.$store.dispatch("user/updateBusinessInfo");
uni.$u.toast("修改成功");
} catch (e) {
console.log(e);
uni.$u.toast("修改失败");
}
this.loadingState[key] = false;
},
confirmDate({ value }) {
this.loadingState.birth = true;
this.updateSelfInfo(
{
birth: value,
},
"birth",
);
this.showDatePicker = false;
},
},
};
});
},
updateGender() {
uni.showActionSheet({
itemList: ['保密',"男", "女"],
success: async ({
tapIndex
}) => {
this.loadingState.gender = true;
await this.updateSelfInfo({gender: tapIndex,},"gender",);
},
});
},
updateAvatar() {
uni.chooseImage({
count: 1,
sizeType: ["compressed"],
success: async ({
tempFilePaths
}) => {
const path = tempFilePaths[0];
const nameIdx = path.lastIndexOf("/") + 1;
const typeIdx = path.lastIndexOf(".") + 1;
const fileName = path.slice(nameIdx);
const fileType = path.slice(typeIdx);
this.loadingState.faceURL = true;
const {
data: {
url
},
} = await IMSDK.asyncApi(IMSDK.IMMethods.UploadFile, IMSDK.uuid(), {
filepath: getPurePath(tempFilePaths[0]),
name: fileName,
contentType: fileType,
uuid: IMSDK.uuid(),
});
console.log(url);
this.updateSelfInfo({
faceURL: url,
},
"faceURL",
);
this.loadingState.faceURL = false;
},
});
},
toQrCode() {
uni.navigateTo({
url: `/pages/common/userOrGroupQrCode/index`,
});
},
copyID() {
uni.setClipboardData({
data: this.selfInfo.userID,
success: () => {
uni.hideToast();
this.$nextTick(() => {
uni.$u.toast("复制成功");
});
},
});
},
async updateSelfInfo(data, key) {
try {
console.log(data);
await businessInfoUpdate({
userID: this.selfInfo.userID,
...data,
});
await this.$store.dispatch("user/updateBusinessInfo");
uni.$u.toast("修改成功");
} catch (e) {
console.log(e);
uni.$u.toast("修改失败");
}
this.loadingState[key] = false;
},
confirmDate({value}) {
this.loadingState.birth = true;
this.updateSelfInfo({birth: value,},"birth",);
this.showDatePicker = false;
},
},
};
</script>
<style lang="scss" scoped>
.page_container {
background-color: #f8f8f8;
.page_container {
background-color: #f8f8f8;
.info_wrap {
margin: 24rpx 24rpx 0 24rpx;
background: #fff;
border-radius: 6px;
.info_wrap {
margin: 24rpx 24rpx 0 24rpx;
background: #fff;
border-radius: 6px;
.qr_icon {
width: 22px;
height: 23px;
}
}
}
</style>
.qr_icon {
width: 22px;
height: 23px;
}
}
}
</style>