talk_appAmin/pages/mine/index.vue

231 lines
5.5 KiB
Vue
Raw Normal View History

2024-04-23 23:01:35 +08:00
<template>
2024-06-27 08:57:50 +08:00
<view class="container">
<view>
<!-- 顶部导航栏 -->
<u-navbar leftText=" " title=" " :placeholder="true" :safeAreaInsetTop="true" :bgColor="bgColor">
<template #left>
<view class="text1">个人信息</view>
</template>
<template #right>
<view class="text1" @click="gotoSetting"></view>
</template>
</u-navbar>
2024-06-08 14:36:51 +08:00
</view>
2024-06-27 08:57:50 +08:00
<view class="bj"></view>
<view class="cardss">
<up-avatar :src="avatar" size="150rpx"></up-avatar>
<view class="userinfo">
<view class="utext">{{ nickInfo(nickName) }}</view>
<view class="utext">账号{{ name }}</view>
<view class="utext">管理地区{{ deptManageName }}</view>
2024-04-23 23:01:35 +08:00
</view>
</view>
</view>
2024-06-27 08:57:50 +08:00
<image :src="wave" class="wave"></image>
<view class="btn " @click="handleLogout">
<view class="textbtn">退出登录</view>
2024-06-14 22:50:24 +08:00
</view>
2024-04-23 23:01:35 +08:00
</template>
2024-05-06 00:06:10 +08:00
<script setup>
import { useStore } from 'vuex'
import { useRouter } from 'vue-router'
import { ref, getCurrentInstance } from 'vue';
2024-06-08 17:06:47 +08:00
import { getDicts } from "@/api/system/dict/data";
2024-06-27 08:57:50 +08:00
import { onShow, onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
2024-06-09 15:37:59 +08:00
import image from 'uview-plus/libs/config/props/image';
2024-05-06 00:06:10 +08:00
const { proxy } = getCurrentInstance();
2024-06-15 13:16:45 +08:00
const QNDomain = proxy.$store.state.user.QNDomain
2024-06-27 08:57:50 +08:00
const bgColor = ref('rgba(170, 0, 0, 0)');
2024-06-09 15:37:59 +08:00
const isOfficial = ref(true)
2024-06-14 22:50:24 +08:00
const kfopen = ref(false)
2024-06-08 14:36:51 +08:00
const iconConfig = proxy.iconConfig;
2024-06-27 08:57:50 +08:00
const wave = iconConfig.wave;
2024-06-08 14:36:51 +08:00
2024-06-09 15:37:59 +08:00
2024-04-23 23:01:35 +08:00
2024-06-14 21:55:07 +08:00
const auditInfo = ref(proxy.$store.state.userInfo.auditInfo)//审核状态
2024-06-08 14:36:51 +08:00
const name = ref(proxy.$store.state.user.name)
2024-06-27 08:57:50 +08:00
const deptManage = ref(proxy.$store.state.user.deptManage)
const deptManageName = ref(proxy.$store.state.user.deptManageName)
2024-06-08 14:36:51 +08:00
const nickName = ref(proxy.$store.state.user.nickName)
2024-06-14 21:55:07 +08:00
const sex = ref(uni.getStorageSync("SET_SEX"))
2024-06-09 15:37:59 +08:00
const infoSchool = ref(proxy.$store.state.userInfo.infoSchool)//学校
2024-06-15 15:19:23 +08:00
const area = ref(proxy.$store.state.userInfo.area)//学校
const backgroundImage = ref(proxy.$store.state.userInfo.backgroundImage)//背景
2024-06-09 15:37:59 +08:00
const infoRank = ref(proxy.$store.state.userInfo.infoRank)
const remark = ref(proxy.$store.state.userInfo.remark)//签名
const infoAssist = ref(proxy.$store.state.userInfo.infoAssist)//获赞
const followCount = ref(proxy.$store.state.userInfo.followCount)//关注
const fanCount = ref(proxy.$store.state.userInfo.fanCount)//粉丝
const qm = (e) => {
if (e === "" | e === null) {
return "这个人很懒什么都没有留下……"
} else {
return e
}
}
const dictSexInfo = ref('')
2024-06-27 08:57:50 +08:00
const nickInfo = (nickName) => {
if (nickName.length > 10) {
return nickName.substring(0, 10) + "...";
} else {
return nickName;
}
}
2024-06-09 15:37:59 +08:00
onLoad((options) => {
2024-06-14 21:55:07 +08:00
proxy.$store.dispatch('GetUserInfo');
2024-06-27 08:57:50 +08:00
console.log("xinxi1:", deptManageName);
2024-06-09 15:37:59 +08:00
getDicts('sys_user_sex').then(e => {
dictSexInfo.value = e.data
})
})
const dictSex = (state) => {
2024-06-14 21:55:07 +08:00
const dict = dictSexInfo.value.find((dict) => dict.dictValue == state);
2024-06-09 15:37:59 +08:00
return dict ? dict.dictLabel : '未知状态';
}
2024-06-08 14:36:51 +08:00
const version = ref(getApp().globalData.config.appInfo.version)
const avatar = ref(proxy.$store.state.user.avatar)
function handleLogout() {
proxy.$modal.confirm('确定注销并退出系统吗?').then(() => {
proxy.$store.dispatch('LogOut').then(() => {
proxy.$tab.reLaunch('/pages/index')
})
})
}
2024-06-15 15:19:23 +08:00
onPullDownRefresh((options) => {
proxy.$router.go(0)
})
2024-06-08 14:36:51 +08:00
2024-06-14 21:55:07 +08:00
2024-06-27 08:57:50 +08:00
const gotoSetting =() => {
proxy.$tab.navigateTo('/pages/mine/setting/index')
}
2024-06-14 21:55:07 +08:00
2024-06-14 22:50:24 +08:00
const zxkf = () => {
console.log("在线客服");
}
const phonekf = () => {
console.log("电话客服");
}
2024-06-14 21:55:07 +08:00
2024-06-08 14:36:51 +08:00
function handleToLogin() {
2024-06-08 18:05:38 +08:00
proxy.$tab.reLaunch('/pages/login')
2024-06-08 14:36:51 +08:00
}
const handleToUserInfo = () => {
proxy.$tab.navigateTo('/pages/mine/info/userInfo')
}
function windowHeight() {
return uni.getSystemInfoSync().windowHeight - 50
}
function handleToInfo() {
proxy.$tab.navigateTo('/pages/mine/info/index')
}
function handleToEditInfo() {
proxy.$tab.navigateTo('/pages/mine/info/edit')
}
function handleToSetting() {
proxy.$tab.navigateTo('/pages/mine/setting/index')
}
function handleToAvatar() {
proxy.$tab.navigateTo('/pages/mine/avatar/index')
}
function handleHelp() {
proxy.$tab.navigateTo('/pages/mine/help/index')
}
function handleAbout() {
proxy.$tab.navigateTo('/pages/mine/about/index')
}
function handleJiaoLiuQun() {
proxy.$modal.showToast('QQ群①133713780、②146013835')
}
function handleBuilding() {
proxy.$modal.showToast('模块建设中~')
}
2024-06-27 08:57:50 +08:00
const imageInfo = () => {
let info = QNDomain + backgroundImage.value
return info
2024-06-15 13:16:45 +08:00
}
2024-06-14 22:50:24 +08:00
2024-04-23 23:01:35 +08:00
</script>
2024-06-27 08:57:50 +08:00
<style lang="scss" scoped>
2024-04-23 23:01:35 +08:00
page {
2024-06-27 08:57:50 +08:00
background-color: #ffffff;
2024-06-08 14:36:51 +08:00
}
2024-06-27 08:57:50 +08:00
.text1 {
font-weight: 400;
2024-06-09 15:37:59 +08:00
2024-06-27 08:57:50 +08:00
font-size: 36rpx;
2024-06-08 14:36:51 +08:00
2024-06-27 08:57:50 +08:00
color: #FFFFFF;
2024-06-08 14:36:51 +08:00
}
2024-06-27 08:57:50 +08:00
.container {
position: relative;
2024-06-08 14:36:51 +08:00
}
2024-06-09 15:37:59 +08:00
2024-06-27 08:57:50 +08:00
.bj {
position: fixed;
top: 0rpx;
left: 0rpx;
width: 750rpx;
height: 390rpx;
background-color: #6aa2ff;
2024-05-06 00:06:10 +08:00
}
2024-06-09 15:37:59 +08:00
2024-06-27 08:57:50 +08:00
.cardss {
position: relative;
margin-top: 64rpx;
margin-left: 32rpx;
2024-06-14 22:50:24 +08:00
display: flex;
2024-06-27 08:57:50 +08:00
2024-06-14 22:50:24 +08:00
align-items: center;
2024-06-09 15:37:59 +08:00
2024-06-27 08:57:50 +08:00
.userinfo {
margin-left: 24rpx;
2024-06-09 15:37:59 +08:00
display: flex;
2024-06-27 08:57:50 +08:00
flex-direction: column;
justify-content: space-between;
.utext {
font-weight: 400;
font-size: 36rpx;
color: #FFFFFF;
2024-06-09 15:37:59 +08:00
}
}
}
2024-06-14 22:50:24 +08:00
2024-06-27 08:57:50 +08:00
.wave {
width: 750rpx;
height: 200rpx;
2024-06-14 22:50:24 +08:00
}
2024-06-27 08:57:50 +08:00
.btn {
margin: 110rpx auto;
2024-06-14 22:50:24 +08:00
2024-06-27 08:57:50 +08:00
width: 686rpx;
height: 88rpx;
border-radius: 40rpx 40rpx 40rpx 40rpx;
background: #6aa2ff;
2024-06-14 22:50:24 +08:00
display: flex;
justify-content: center;
align-items: center;
2024-06-27 08:57:50 +08:00
.textbtn {
font-weight: 400;
font-size: 30rpx;
color: #FFFFFF;
}
2024-06-14 22:50:24 +08:00
}
2024-04-23 23:01:35 +08:00
</style>