talk_appAmin/pages/mine/index.vue

237 lines
5.4 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>
<!-- 顶部导航栏 -->
2024-07-12 12:56:08 +08:00
<u-navbar :placeholder="true" :safeAreaInsetTop="true" :bgColor="bgColor" style="background-color: #6aa2ff;">
2024-07-07 23:12:29 +08:00
<template #left>
<view class="text1">个人信息</view>
</template>
<template #right>
<image
src="@/static/settingIcon.png"
class="icon"
@click="gotoSetting"></image>
</template>
</u-navbar>
2024-06-27 08:57:50 +08:00
2024-07-07 23:12:29 +08:00
</view>
2024-06-27 08:57:50 +08:00
<view class="bj"></view>
<view class="cardss">
2024-07-07 23:12:29 +08:00
<!-- 圆形头像 -->
2024-06-27 08:57:50 +08:00
<up-avatar :src="avatar" size="150rpx"></up-avatar>
<view class="userinfo">
<view class="utext1 move-down">{{ nickInfo(nickName) }}</view>
<view class="utext2 move-up2">账号{{ name }}</view>
<view class="utext2 move-up">管理地区{{ 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-07-07 23:12:29 +08:00
const settingIcon = iconConfig.settingIcon
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
})
})
2024-07-07 22:18:26 +08:00
onShow(() => {
deptManageName.value = proxy.$store.state.user.deptManageName
})
2024-06-09 15:37:59 +08:00
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-07-07 22:18:26 +08:00
const gotoSetting = () => {
2024-06-27 08:57:50 +08:00
proxy.$tab.navigateTo('/pages/mine/setting/index')
}
2024-06-14 21:55:07 +08:00
2024-06-08 14:36:51 +08:00
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 {
2024-07-07 22:18:26 +08:00
font-weight: 00;
2024-06-27 08:57:50 +08:00
font-size: 36rpx;
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;
left: 0rpx;
width: 750rpx;
2024-07-12 12:56:08 +08:00
height: 500rpx;
2024-06-27 08:57:50 +08:00
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;
align-items: center;
2024-06-09 15:37:59 +08:00
2024-06-27 08:57:50 +08:00
.userinfo {
2024-07-07 23:12:29 +08:00
margin-left: 40rpx;
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;
2024-07-07 22:18:26 +08:00
.utext1 {
2024-06-27 08:57:50 +08:00
font-weight: 400;
2024-07-07 23:12:29 +08:00
font-size: 16px;
2024-06-27 08:57:50 +08:00
color: #FFFFFF;
2024-07-07 23:12:29 +08:00
font-weight: 580;
margin-bottom: 14rpx; /* 添加底部间距 */
2024-06-09 15:37:59 +08:00
}
.move-down {
position: relative;
top: 11rpx; /* 根据需要调整数值 */
}
2024-07-07 22:18:26 +08:00
.utext2 {
margin-top: 30rpx;
font-weight: 600;
font-size: 24rpx;
color: #FFFFFF;
}
.move-up {
position: relative;
top: -14rpx; /* 根据需要调整数值 */
}
.move-up2 {
position: relative;
top: -9rpx; /* 根据需要调整数值 */
}
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;
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 {
2024-07-07 22:18:26 +08:00
font-weight: 600;
2024-06-27 08:57:50 +08:00
font-size: 30rpx;
color: #FFFFFF;
2024-07-07 23:12:29 +08:00
font-weight: 580;
2024-06-27 08:57:50 +08:00
}
2024-06-14 22:50:24 +08:00
}
2024-07-07 23:12:29 +08:00
.text1 {
/* 根据需要调整文本样式 */
font-size: 18px;
font-weight: 600;
color: #FFFFFF;
padding-left: 20rpx;
padding-top: 16px;
}
.icon {
width: 36px; /* 图标宽度 */
height: 44px; /* 图标高度 */
padding-right: 8px;
padding-top: 16px;
}
2024-04-23 23:01:35 +08:00
</style>