2024-12-27 15:03:48 +08:00
|
|
|
|
<script setup>
|
2025-02-23 13:32:05 +08:00
|
|
|
|
// 设置
|
2024-12-27 15:03:48 +08:00
|
|
|
|
import {
|
|
|
|
|
ref,
|
|
|
|
|
computed,
|
|
|
|
|
} from 'vue'
|
|
|
|
|
import {
|
|
|
|
|
useStore
|
|
|
|
|
} from 'vuex'
|
|
|
|
|
import {
|
|
|
|
|
onLoad,
|
|
|
|
|
} from '@dcloudio/uni-app'
|
|
|
|
|
// 工具库
|
|
|
|
|
import util from '@/common/js/util.js'
|
2025-02-08 18:25:43 +08:00
|
|
|
|
// api
|
|
|
|
|
import api from '@/api/index.js'
|
2024-12-27 15:03:48 +08:00
|
|
|
|
// 腾讯云聊天
|
|
|
|
|
import TencentCloudChat from '@tencentcloud/chat';
|
|
|
|
|
// 仓库
|
|
|
|
|
const store = useStore()
|
|
|
|
|
// 用户信息
|
2025-02-08 18:25:43 +08:00
|
|
|
|
const userinfo = computed(() => store.state.userinfo)
|
2024-12-27 15:03:48 +08:00
|
|
|
|
// 添加好友方式
|
|
|
|
|
const allowType = [{
|
2025-02-08 18:25:43 +08:00
|
|
|
|
id: 'AllowType_Type_AllowAny',
|
2024-12-27 15:03:48 +08:00
|
|
|
|
name: '允许任何人添加',
|
|
|
|
|
}, {
|
2025-02-08 18:25:43 +08:00
|
|
|
|
id: 'AllowType_Type_NeedConfirm',
|
2024-12-27 15:03:48 +08:00
|
|
|
|
name: '需要确认才能添加',
|
|
|
|
|
}, {
|
2025-02-08 18:25:43 +08:00
|
|
|
|
id: 'AllowType_Type_DenyAny',
|
2024-12-27 15:03:48 +08:00
|
|
|
|
name: '不允许任何人添加 ',
|
|
|
|
|
}, ]
|
|
|
|
|
// 添加好友下标
|
|
|
|
|
const allowTypeIndex = ref(0)
|
|
|
|
|
// im用户信息
|
|
|
|
|
const imUserinfo = ref({})
|
|
|
|
|
// app版本号
|
|
|
|
|
const appVersion = ref(0)
|
|
|
|
|
|
|
|
|
|
onLoad(() => {
|
|
|
|
|
util.isLogin(() => {
|
|
|
|
|
// 获取添加好友方式
|
|
|
|
|
getAddType()
|
|
|
|
|
})
|
|
|
|
|
// #ifdef APP
|
|
|
|
|
let system = uni.getSystemInfoSync()
|
|
|
|
|
appVersion.value = system.appVersion
|
|
|
|
|
// #endif
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 修改加好友方式
|
|
|
|
|
function handleAllowType(ev) {
|
|
|
|
|
const index = ev.detail.value
|
|
|
|
|
if (index === allowTypeIndex.value) return
|
|
|
|
|
allowTypeIndex.value = index
|
|
|
|
|
// 更新个人资料
|
|
|
|
|
updateMyProfile()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取添加好友方式
|
|
|
|
|
function getAddType() {
|
2025-02-08 18:25:43 +08:00
|
|
|
|
api.mine.getImUserInfo({
|
|
|
|
|
query: {
|
|
|
|
|
userIds: userinfo.value.id
|
|
|
|
|
}
|
|
|
|
|
}).then(rs => {
|
|
|
|
|
if (rs.code === 200) {
|
|
|
|
|
console.log('rs', rs)
|
|
|
|
|
const result = JSON.parse(rs.msg)
|
|
|
|
|
allowTypeIndex.value = allowType.findIndex(item => item.id === result.UserProfileItem[0]
|
|
|
|
|
.ProfileItem[0].Value)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
util.alert({
|
|
|
|
|
content: rs.msg,
|
|
|
|
|
showCancel: false
|
|
|
|
|
})
|
2024-12-27 15:03:48 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-08 18:25:43 +08:00
|
|
|
|
// 更新im个人资料
|
2024-12-27 15:03:48 +08:00
|
|
|
|
function updateMyProfile() {
|
|
|
|
|
// 修改个人标配资料
|
2025-02-08 18:25:43 +08:00
|
|
|
|
api.mine.setImUserInfo({
|
|
|
|
|
query: {
|
|
|
|
|
'allowType': allowType[allowTypeIndex.value].id,
|
|
|
|
|
userId: userinfo.value.id,
|
|
|
|
|
},
|
|
|
|
|
}).then(rs => {
|
|
|
|
|
if (rs.code != 200)
|
|
|
|
|
util.alert({
|
|
|
|
|
content: rs.msg,
|
|
|
|
|
showCancel: false
|
|
|
|
|
})
|
2024-12-27 15:03:48 +08:00
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 登录跳转
|
|
|
|
|
function loginLink(url) {
|
|
|
|
|
util.isLogin().then(() => {
|
|
|
|
|
link(url)
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
link('/pages/login/login')
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 跳转
|
|
|
|
|
function link(url) {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 退出登录
|
|
|
|
|
function logOff() {
|
|
|
|
|
util.alert({
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: '确定退出登录?',
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.confirm) {
|
2025-02-16 22:35:46 +08:00
|
|
|
|
api.login.logout({
|
|
|
|
|
query: {
|
|
|
|
|
phoneNumber: userinfo.phoneNumber,
|
|
|
|
|
}
|
|
|
|
|
}).then(rs => {})
|
|
|
|
|
|
2024-12-27 15:03:48 +08:00
|
|
|
|
// 退出登录
|
|
|
|
|
util.logout(() => {
|
|
|
|
|
// #ifdef APP
|
|
|
|
|
plus.runtime.restart()
|
|
|
|
|
// #endif
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<template>
|
|
|
|
|
<!-- 设置页 -->
|
|
|
|
|
<view class="app">
|
|
|
|
|
<view class="area">
|
2025-02-16 22:35:46 +08:00
|
|
|
|
<template v-if="userinfo.id">
|
|
|
|
|
<view class="line rows" @click="loginLink('/pages/mine/userinfo')">
|
|
|
|
|
<view class="avatar">
|
|
|
|
|
<image class="head-portrait wh80" :src="userinfo.avatar" mode="aspectFill" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info f1 ml20">
|
|
|
|
|
<view class="">{{userinfo.userNickname}}</view>
|
|
|
|
|
<!-- <view class="account mt10 c999 f26">账号:{{userinfo.account}}</view> -->
|
|
|
|
|
</view>
|
2024-12-18 15:46:27 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="line rows">
|
|
|
|
|
<view class="">修改账号</view>
|
|
|
|
|
<view class="f1 tar c999 f28">{{userinfo.account}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="line rows">
|
|
|
|
|
<view class="">绑定手机号</view>
|
|
|
|
|
<view class="f1 tar c999 f28">{{userinfo.phoneNumber}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="line rows" @click="link('/pages/mine/realname')">
|
|
|
|
|
<view class="key">实名认证</view>
|
|
|
|
|
<view class="col f1 ml20 tar c999 f28">
|
|
|
|
|
<view class="" v-if="userinfo.isRealName">已认证</view>
|
|
|
|
|
<view class="" v-else>未认证</view>
|
|
|
|
|
</view>
|
|
|
|
|
<uni-icons class="ml20" type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-02-16 22:35:46 +08:00
|
|
|
|
<template v-if="userinfo.id">
|
2024-12-29 19:06:34 +08:00
|
|
|
|
<view class="area">
|
2025-02-21 17:56:36 +08:00
|
|
|
|
<view class="line rows" @click="link('/pages/mine/setting/usePay')" v-if="0">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="">先用后付</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-01-04 20:33:45 +08:00
|
|
|
|
<view class="line rows" @click="link('/pages/mine/setting/secondPwd')">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="">二级密码</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-01-14 20:37:57 +08:00
|
|
|
|
<view class="line rows" @click="link('/pages/mine/setting/sequence')">
|
|
|
|
|
<view class="">支付顺序</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="line rows">
|
|
|
|
|
<view class="">登录密码</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-02-16 22:35:46 +08:00
|
|
|
|
<!-- <view class="line rows">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="">邮箱</view>
|
|
|
|
|
<uni-icons type="right" />
|
2025-02-16 22:35:46 +08:00
|
|
|
|
</view> -->
|
2024-12-18 15:46:27 +08:00
|
|
|
|
|
2024-12-29 19:06:34 +08:00
|
|
|
|
<view class="line rows ptb20 plr10" @click="link('/pages/mine/setting/teen')">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="">青少年模式</view>
|
|
|
|
|
<view class="f1 tar">
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-02-16 22:35:46 +08:00
|
|
|
|
<!-- 支付宝 微信 -->
|
|
|
|
|
<view class="line rows" @click="link('/pages/mine/setting/binding')">
|
|
|
|
|
<view class="">我的绑定</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="line rows" @click="link('/pages/mine/setting/bankCard')">
|
|
|
|
|
<view class="">我的银行卡</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-02-08 18:25:43 +08:00
|
|
|
|
<view class="line" v-if="userinfo.id">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<picker :range="allowType" range-key="name" @change="handleAllowType" :value="allowTypeIndex">
|
|
|
|
|
<view class=" rows">
|
|
|
|
|
<view class="">好友验证方式</view>
|
|
|
|
|
<view class="value mlr20 f1 tar c666 f28">
|
|
|
|
|
{{allowType[allowTypeIndex].name}}
|
|
|
|
|
</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
</picker>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<view class="area">
|
2024-12-27 15:03:48 +08:00
|
|
|
|
<view class="line rows" @click="link('/pages/mine/setting/safeCenter')">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="">安全中心</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-01-05 15:43:14 +08:00
|
|
|
|
<view class="line rows" @click="link('/pages/mine/setting/feedback')">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="">意见反馈</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-01-05 15:43:14 +08:00
|
|
|
|
<view class="line rows" @click="link(util.setUrl('/pages/index/article',{id: 2,}))">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="">关于我们</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-01-05 15:43:14 +08:00
|
|
|
|
<view class="line rows" @click="link(util.setUrl('/pages/index/article',{id: 3,}))">
|
2024-12-18 15:46:27 +08:00
|
|
|
|
<view class="">用户协议</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="line rows" @click="link(util.setUrl('/pages/index/article',{id: 1,}))">
|
|
|
|
|
<view class="">隐私政策</view>
|
|
|
|
|
<uni-icons type="right" />
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- #ifdef APP -->
|
|
|
|
|
<view class="line rows ptb20 plr10">
|
|
|
|
|
<view class="">版本号</view>
|
|
|
|
|
<view class="c999 f28">{{appVersion}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- #endif -->
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-01-19 13:55:21 +08:00
|
|
|
|
<view class="fmid fdc mtb50">
|
|
|
|
|
<image class="wh150 br20" src="/static/logo.png" mode="aspectFill" />
|
|
|
|
|
<view class="mt20 c333 f26">塔罗科技网络(山东)有限公司旗下品牌---九亿</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-02-16 22:35:46 +08:00
|
|
|
|
<template v-if="userinfo.id">
|
|
|
|
|
<!-- 退出登录 -->
|
|
|
|
|
<view class="mtb30 c999">
|
|
|
|
|
<view @click="logOff" class="btn">退出登录</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
2024-12-18 15:46:27 +08:00
|
|
|
|
|
|
|
|
|
<view class="fill" style="height: 30rpx;"></view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
//
|
|
|
|
|
.area {
|
|
|
|
|
margin: 30rpx;
|
|
|
|
|
padding: 0 30rpx;
|
|
|
|
|
color: #333;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
|
|
|
|
|
.line {
|
|
|
|
|
padding: 20rpx 10rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.line+.line {
|
|
|
|
|
border-top: 1px solid #eeeeee;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.head-portrait {
|
|
|
|
|
background: #999999;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
margin-right: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|