talk_appAmin/pages/mine/index.vue

522 lines
14 KiB
Vue
Raw Normal View History

2024-04-23 23:01:35 +08:00
<template>
2024-06-08 14:36:51 +08:00
<view>
<view class="cards">
2024-06-08 17:06:47 +08:00
<image class="bg" :src="bjt" v-if="!name"></image>
2024-06-15 13:16:45 +08:00
<image class="bg" :src="imageInfo()" v-else-if="backgroundImage != ''"></image>
2024-06-08 17:06:47 +08:00
<image class="bg" :src="bjt2" v-else></image>
2024-06-08 14:36:51 +08:00
<view>
<view v-if="!name">
<view class="userInfoNot" @click="handleToLogin">
2024-06-09 15:37:59 +08:00
<up-avatar size="148rpx"></up-avatar>
2024-06-08 14:36:51 +08:00
<up-text text="请登录" size="44rpx" color="#FFFFFF" bold="400" margin="24rpx"></up-text>
2024-04-23 23:01:35 +08:00
</view>
</view>
2024-06-08 14:36:51 +08:00
<view v-else>
<view class="userInfoNot">
2024-06-09 15:37:59 +08:00
<view class="avatarInfo">
<up-avatar :src="avatar" size="148rpx"></up-avatar>
2024-06-14 21:55:07 +08:00
<image v-if="auditInfo == 3" class="official" :src="tu36"></image>
2024-06-09 15:37:59 +08:00
</view>
<view class="simpleInfo-text">
<view class="textgrid1">
<view class="grid11">{{ nickName }}</view>
2024-06-14 21:55:07 +08:00
<image :src="mupdate" style="width: 32rpx; height: 32rpx;" @click="handleToEditInfo"></image>
2024-06-09 15:37:59 +08:00
</view>
<view class="textgrid2">
<view class="textInfo grid21">{{ dictSex(sex) }}</view>
<view class="textInfo grid22">LV{{ infoRank }}</view>
<view class="textInfo grid23">ID:{{ name }}</view>
</view>
<view class="textgrid3">
<view class="grid31">[签名]{{ qm(remark) }}</view>
</view>
</view>
</view>
</view>
<view class="school">
<view class="school1">
<image :src="tu51addres" style="width: 16rpx; height: 20rpx;"></image>
2024-06-15 15:19:23 +08:00
<view class="textInfo">{{ area }}</view>
2024-06-08 14:36:51 +08:00
</view>
2024-05-06 00:06:10 +08:00
</view>
2024-06-08 14:36:51 +08:00
<view class="smallUserInfo">
<view class="small1">
2024-06-14 21:55:07 +08:00
<up-text :text="info(infoAssist)" size="36rpx" color="#FFFFFF" bold="400" align="center"></up-text>
2024-06-08 14:36:51 +08:00
<up-text text="点赞" size="28rpx" color="#FFFFFF" align="center"></up-text>
2024-05-06 00:06:10 +08:00
</view>
2024-06-08 14:36:51 +08:00
<view class="small1">
2024-06-14 21:55:07 +08:00
<up-text :text="info(followCount)" size="36rpx" color="#FFFFFF" bold="400" align="center"></up-text>
2024-06-08 14:36:51 +08:00
<up-text text="关注" size="28rpx" color="#FFFFFF" align="center"></up-text>
</view>
<view class="small1">
2024-06-14 21:55:07 +08:00
<up-text :text="info(fanCount)" size="36rpx" color="#FFFFFF" bold="400" align="center"></up-text>
2024-06-08 14:36:51 +08:00
<up-text text="粉丝" size="28rpx" color="#FFFFFF" align="center"></up-text>
2024-05-06 00:06:10 +08:00
</view>
</view>
2024-06-08 14:36:51 +08:00
</view>
2024-04-23 23:01:35 +08:00
</view>
2024-06-08 14:36:51 +08:00
<view class="cardz1">
<text class="text1">我的话题</text>
<view>
<up-grid :border="false" col="5" @click="grid1Click1">
2024-06-09 15:37:59 +08:00
<up-grid-item v-for="(listItem, listIndex) in list1" :key="listIndex" customStyle="padding-top: 24rpx; ">
2024-06-08 14:36:51 +08:00
<image :src="listItem.icon" style="width: 66rpx; height: 66rpx;"></image>
<text style="font-size: 24rpx;color: #999999;margin-top: 20rpx;">{{ listItem.title }}</text>
</up-grid-item>
</up-grid>
</view>
2024-05-06 00:06:10 +08:00
</view>
2024-06-08 14:36:51 +08:00
<view class="cardz1">
<text class="text1">我的活动</text>
<view>
<up-grid :border="false" col="5" @click="grid1Click2">
2024-06-09 15:37:59 +08:00
<up-grid-item v-for="(listItem, listIndex) in list2" :key="listIndex" customStyle="padding-top: 24rpx; ">
2024-06-08 14:36:51 +08:00
<image :src="listItem.icon" style="width: 66rpx; height: 66rpx;"></image>
<text style="font-size: 24rpx;color: #999999;margin-top: 20rpx;">{{ listItem.title }}</text>
</up-grid-item>
</up-grid>
2024-04-23 23:01:35 +08:00
</view>
2024-06-08 14:36:51 +08:00
</view>
<view class="cardz3">
<text class="text1">更多功能</text>
<view>
<up-grid :border="false" col="4" @click="grid1Click3">
2024-06-09 15:37:59 +08:00
<up-grid-item v-for="(listItem, listIndex) in list3" :key="listIndex" customStyle="padding-top: 24rpx; ">
2024-06-08 14:36:51 +08:00
<image :src="listItem.icon" style="width: 66rpx; height: 66rpx;"></image>
<text style="font-size: 24rpx;color: #999999;margin-top: 20rpx;">{{ listItem.title }}</text>
</up-grid-item>
</up-grid>
2024-04-23 23:01:35 +08:00
</view>
</view>
</view>
2024-06-14 22:50:24 +08:00
<view>
<up-overlay :show="kfopen" @click="kfopen = false">
<view class="wrap">
<view class="kf">
<view class="kfInfo">联系客服</view>
<view class="card">
<view @click="zxkf">
<image :src="kfPhone2" style="width: 150rpx; height: 150rpx;"></image>
<view class="textkf">在线客服</view>
</view>
<view style="width: 150rpx; height: 150rpx;"></view>
<view @click="phonekf">
<image :src="kfPhone1" style="width: 150rpx; height: 150rpx;"></image>
<view class="textkf">电话客服</view>
</view>
</view>
</view>
</view>
</up-overlay>
</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-15 15:19:23 +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-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;
const bjt = iconConfig.bjt;
2024-06-14 22:50:24 +08:00
const kfPhone1 = iconConfig.kfPhone1;
const kfPhone2 = iconConfig.kfPhone2;
2024-06-08 17:06:47 +08:00
const bjt2 = iconConfig.bjt2;
2024-06-09 15:37:59 +08:00
const mupdate = iconConfig.mupdate;
const tu36 = iconConfig.tu36;
//定位
const tu51addres = iconConfig.tu51addres;
2024-06-08 14:36:51 +08:00
//+更多
const gd11 = iconConfig.gd11;
const gd12 = iconConfig.gd12;
const gd13 = iconConfig.gd13;
const gd14 = iconConfig.gd14;
const gd21 = iconConfig.gd21;
const gd22 = iconConfig.gd22;
const gd23 = iconConfig.gd23;
const gd24 = iconConfig.gd24;
//+我的话题
const ht11 = iconConfig.ht11;
const ht12 = iconConfig.ht12;
const ht13 = iconConfig.ht13;
const ht14 = iconConfig.ht14;
const ht15 = iconConfig.ht15;
// +我的活动
const hd11 = iconConfig.hd11;
const hd12 = iconConfig.hd12;
const hd13 = iconConfig.hd13;
const hd14 = iconConfig.hd14;
const hd15 = iconConfig.hd15;
const list1 = ref([
2024-06-09 15:37:59 +08:00
{ icon: ht11, title: '全部话题' },
{ icon: ht12, title: '已发布' },
{ icon: ht13, title: '审核中' },
{ icon: ht14, title: '未通过' },
{ icon: ht15, title: '草稿箱' }
2024-06-08 14:36:51 +08:00
])
const list2 = ref([
2024-06-09 15:37:59 +08:00
{ icon: hd11, title: '全部活动' },
{ icon: hd12, title: '已发布' },
{ icon: hd13, title: '审核中' },
{ icon: hd14, title: '未通过' },
{ icon: hd15, title: '草稿箱' }
2024-06-08 14:36:51 +08:00
])
const list3 = ref([
2024-06-09 15:37:59 +08:00
{ icon: gd11, title: '外卖订单' },
{ icon: gd12, title: '我的兼职' },
{ icon: gd13, title: '证件证明' },
{ icon: gd14, title: '地址管理' },
{ icon: gd21, title: '优惠卡券' },
{ icon: gd22, title: '联系客服' },
{ icon: gd23, title: '邀请好友' },
{ icon: gd24, title: '系统设置' }
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)
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('')
onLoad((options) => {
2024-06-14 21:55:07 +08:00
proxy.$store.dispatch('GetUserInfo');
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
const grid1Click1 = (e) => {
console.log(e)
if (e == 4) {
proxy.$tab.navigateTo('/pages/mine/myPost/draft/draft')
} else {
proxy.$tab.navigateTo('/pages/mine/myPost/myPost?type=' + e)
}
2024-06-08 14:36:51 +08:00
}
const grid1Click2 = (e) => {
2024-06-14 22:50:24 +08:00
if (e == 4) {
2024-06-13 23:15:52 +08:00
proxy.$tab.navigateTo('/pages/mine/myActivity/draft')
2024-06-14 22:50:24 +08:00
} else {
proxy.$tab.navigateTo('/pages/mine/myActivity/index?type=' + e)
2024-06-13 23:15:52 +08:00
}
2024-06-08 14:36:51 +08:00
}
const grid1Click3 = (e) => {
2024-06-14 22:50:24 +08:00
if (e == 7) {
2024-06-13 23:15:52 +08:00
proxy.$tab.navigateTo('/pages/mine/setting/index')
}
2024-06-14 22:50:24 +08:00
else if (e == 2) {
proxy.$tab.navigateTo('/pages/mine/studentCard/index')
} else if (e == 5) {
kfopen.value = true;
2024-06-13 23:15:52 +08:00
}
2024-06-18 19:06:14 +08:00
else if (e == 3){
proxy.$tab.navigateTo('/pages/signln/signaddress')
}
2024-06-08 14:36:51 +08:00
console.log(e);
}
2024-06-14 21:55:07 +08:00
const info = (e) => {
2024-06-14 22:50:24 +08:00
if (e >= 10000) {
2024-06-14 21:55:07 +08:00
return (e / 10000).toFixed(1) + '万';
} else {
return e;
}
2024-06-08 14:36:51 +08:00
}
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-15 13:16:45 +08:00
const imageInfo = ()=> {
let info = QNDomain+ backgroundImage.value
return info
}
2024-06-14 22:50:24 +08:00
2024-04-23 23:01:35 +08:00
</script>
<style lang="scss">
page {
2024-06-08 14:36:51 +08:00
background-color: #F4F5F6;
}
.cards {
position: relative;
.userInfoNot {
position: absolute;
top: 200rpx;
left: 32rpx;
display: flex;
justify-content: center;
align-items: center;
2024-06-09 15:37:59 +08:00
.avatarInfo {
position: relative;
.official {
position: absolute;
width: 48rpx;
height: 48rpx;
bottom: 0;
right: 0;
}
}
.simpleInfo-text {
margin-left: 24rpx;
text-align: left;
.textgrid1 {
display: flex;
align-items: center;
.grid11 {
font-weight: 600;
font-size: 44rpx;
color: #FFFFFF !important;
margin-right: 10rpx;
}
}
.textgrid2 {
display: flex;
align-items: center;
.textInfo {
font-size: 24rpx;
color: #FFFFFF !important;
}
.grid21 {
margin-right: 24rpx;
}
.grid22 {
margin-right: 24rpx;
}
.grid23 {}
}
.textgrid3 {
.grid31 {
font-size: 24rpx;
text-align: left;
color: #FFFFFF !important;
}
}
}
2024-06-08 14:36:51 +08:00
}
.smallUserInfo {
position: absolute;
left: 47rpx;
bottom: 26rpx;
width: 656rpx;
height: 66rpx;
display: flex;
justify-content: space-between;
align-items: flex-end;
.small1 {}
}
}
.bg {
width: 100%;
height: 500rpx;
}
.cardz1 {
width: 686rpx;
height: 212rpx;
border-radius: 24rpx;
background: #ffffff;
margin: 24rpx auto;
padding-top: 24rpx; // 在父元素上添加 padding
.text1 {
font-weight: 400;
font-size: 28rpx;
text-align: left;
color: #010101 !important;
margin: 0 24rpx; // 调整 margin 确保 top margin 不会折叠
}
}
2024-06-09 15:37:59 +08:00
2024-06-08 14:36:51 +08:00
.cardz3 {
width: 686rpx;
height: 356rpx;
border-radius: 24rpx;
background: #ffffff;
margin: 24rpx auto;
padding-top: 24rpx; // 在父元素上添加 padding
2024-05-06 00:06:10 +08:00
2024-06-08 14:36:51 +08:00
.text1 {
font-weight: 400;
font-size: 28rpx;
text-align: left;
color: #010101 !important;
margin: 0 24rpx; // 调整 margin 确保 top margin 不会折叠
}
2024-05-06 00:06:10 +08:00
}
2024-06-09 15:37:59 +08:00
.school {
position: absolute;
top: 362rpx;
right: 32rpx;
height: 28rpx;
border-radius: 14rpx;
opacity: 0.5;
background: #000000 !important;
2024-06-14 22:50:24 +08:00
display: flex;
/* 添加 flex 布局 */
align-items: center;
/* 垂直居中 */
justify-content: center;
/* 水平居中 */
2024-06-09 15:37:59 +08:00
.school1 {
display: flex;
align-items: center;
margin: 4rpx 18rpx;
2024-06-14 22:50:24 +08:00
2024-06-09 15:37:59 +08:00
.textInfo {
margin-left: 8rpx;
font-size: 18rpx;
color: #FFFFFF !important;
2024-06-14 22:50:24 +08:00
line-height: 28rpx;
/* 确保文字垂直居中 */
2024-06-09 15:37:59 +08:00
}
}
}
2024-06-14 22:50:24 +08:00
.wrap {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.kf {
width: 648rpx;
height: 396rpx;
border-radius: 24rpx 24rpx 24rpx 24rpx;
background: #ffffff;
.card{
display: flex;
justify-content: center;
align-items: center;
}
.textkf {
font-weight: 600;
font-size: 28rpx;
text-align: center;
color: #000000 !important;
margin-top: 25rpx;
}
}
.kfInfo {
font-weight: 600;
font-size: 36rpx;
text-align: center;
color: #000000 !important;
margin-top: 30rpx;
margin-bottom: 62rpx;
}
2024-04-23 23:01:35 +08:00
</style>