整理个人主页不对的,或未完善的地方

This commit is contained in:
daihh
2022-10-14 16:17:18 +08:00
parent 394352ef3d
commit 216ac6b0a3
13 changed files with 342 additions and 187 deletions

View File

@@ -1,67 +1,67 @@
<template>
<div class="uc-header">
<div class="header-box" >
<div class="uc-header-box" >
<div class="personalData">
<!-- <div >
<img src="../../../public/images/Avatarwoman.png" alt="">
</div> -->
<div class="uesr-avaer">
<img :src="fileBaseUrl+userData.data.avatar" v-if="userData.data.avatar !== '' ">
<img :src="fileBaseUrl+userData.avatar" v-if="userData.avatar !== '' ">
<div v-else class="uavatar">
<div v-if="userData.data.sex === 1 "><img src="../../../public/images/Avatarman.png" alt=""></div>
<div v-if="userData.sex === 1 "><img src="../../../public/images/Avatarman.png" alt=""></div>
<div v-else><img src="../../../public/images/Avatarwoman.png" alt=""></div>
</div>
</div>
<div class="user-content">
<div class="content-top">
<h6 content-bottom><router-link to="/home/index"> {{userData.data.name}}</router-link>
<h6 content-bottom><router-link to="/home/index"> {{userData.name}}</router-link>
</h6>
<div class="grade">
<div>{{userData.level}}</div>
<span style="color: #A3680A;margin-left:12px;line-height: 24px;">经验值{{userData.evalue}}</span>
<div>{{statData.level}}</div>
<span style="color: #A3680A;margin-left:12px;line-height: 24px;">经验值{{statData.evalue}}</span>
</div>
<el-button round plain class="btn-user" size="small" v-if="pageId != userInfo.aid && !isFollowHas" @click="toFollow()">关注TA</el-button>
<el-button round plain class="btn-user" size="small" v-if="isFollowHas">已关注</el-button>
<el-button round plain class="btn-user" size="small"><router-link :to="'/home/leaving?id='+pageId">去留言</router-link></el-button>
</div>
<div class="content-bottom">
<p class="portal-summary-text">{{userData.data.sign}}</p>
<p class="portal-summary-text">{{userData.sign}}</p>
</div>
</div>
</div>
<div class="learningData">
<div class="learning-info">
<div class="learning-qus">当月学习时长</div>
<div class="learning-an"><span>{{uinfo.monthStudy}}</span>h</div>
<div class="learning-an"><span>{{statData.monthStudyHour}}</span>h</div>
</div>
<div class="learning-info">
<div class="learning-qus">累计学习时长</div>
<div class="learning-an"><span>{{uinfo.monthTotal}}</span>h</div>
<div class="learning-an"><span>{{statData.totalStudyHour}}</span>h</div>
</div>
<div class="learning-border" ></div>
<div class="learning-info" style="margin-left:22px">
<div class="learning-qus">当月学习天数</div>
<div class="learning-an"><span>{{uinfo.monthDay}}</span></div>
<div class="learning-an"><span>{{statData.monthStudyDays}}</span></div>
</div>
<div class="learning-info">
<div class="learning-qus">累计学习天数</div>
<div class="learning-an"><span>{{uinfo.monthTotalDay}}</span></div>
<div class="learning-an"><span>{{statData.totalStudyDays}}</span></div>
</div>
<div class="learning-border" ></div>
<div class="learning-info" style="margin-left:22px">
<div class="learning-qus">我的U币累计</div>
<div class="learning-an"><span>{{uinfo.uCurrency}}</span></div>
<div class="learning-an"><span>{{statData.uvalue}}</span></div>
</div>
<div class="list">
BOE 排行榜 >>
<div class="learning-info">
<div @click="jumrank" style="cursor: pointer;" class="ranking-link"> BOE 排行榜 >></div>
</div>
</div>
</div>
</div>
</template>
<script>
import {userAvatarText,cutFullName} from "@/utils/tools.js";
import { mapGetters } from 'vuex'
@@ -79,21 +79,20 @@
data(){
return {
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
uinfo:{
monthStudy:0,//当月学习时长
monthTotal: 0,
monthDay:0,
monthTotalDay:0,
uCurrency:0
statData:{
evalue: 0,//经验值
level: "LV1",//级别
monthStudyHour:0,//当月学习时长
totalStudyHour: 0, //累计学习时长
monthStudyDays:0, //当月学习天数
totalStudyDays:0, //累计学习天数
uvalue:0 //U币数量
},
orgInfo:'',
sex:'',
pageId:'',
isFollowHas:false,
userData:{
evalue: 0,
level: "",
data:{
aid: "",
avatar: "",
code: "",
@@ -101,40 +100,44 @@
orgInfo: "",
sex: 2,
sign: "",
}
}
}
},
mounted() {
this.pageId = this.$route.query.id;
this.sex = this.userInfo.sex;
this.sex = this.userInfo.sex;
// 判断路由是进入的学员默认页面就重置setCurIdentity
if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){
this.setCurIdentity(1);
}
this.orgInfo=cutFullName(this.userInfo.departFullName,1);
this.getInfo();
this.getLevel();
this.loadUserStat();
if(this.pageId !== this.userInfo.aid) {
this.followHas();
}
},
methods:{
getLevel(){//获取经验值和等级
apiStart.getUserStatTotalInfo(this.pageId).then(res=>{
if(res.status == 200) {
this.userData.evalue = res.result.experienceValue;
this.userData.level = res.result.level;
}
});
apiUser.getByIds([this.pageId]).then(res => {
if (res.status == 200) {
this.userData.data = res.result[0];
} else {
this.$message.error(res.message);
loadUserStat(){//获取经验值和等级
apiUser.getByIds([this.pageId]).then(res => {
if (res.status == 200) {
this.userData = res.result[0];
} else {
this.$message.error(res.message);
}
});
apiStart.getUserStatTotalInfo(this.userInfo.aid).then(res=>{
if(res.status == 200) {
this.statData.evalue = res.result.evalue;
this.statData.level = res.result.level;
this.statData.monthStudyHour = res.result.monthStudyHour;
this.statData.totalStudyHour = res.result.totalStudyHour;
this.statData.monthStudyDays = res.result.monthStudyDays;
this.statData.totalStudyDays = res.result.totalStudyDays;
this.statData.uvalue = res.result.uvalue;
this.medalList=res.result.medalList;
}
});
});
},
followHas() {//他人主页,判断关注状态
apiFollow.has(this.pageId).then(res=>{
@@ -155,36 +158,42 @@
}
})
},
getInfo(){
apiStart.userTotal(this.userInfo.aid,[10,11,30]).then(res=>{
if(res.status == 200 && res.result.length > 0) {
res.result.forEach(item => {
if(item.statType == 10) {
this.uinfo.monthStudy = item.months;
this.uinfo.monthTotal = item.total;
}
if(item.statType == 11) {
this.uinfo.monthDay = item.months;
this.uinfo.monthTotalDay = item.total;
}
if(item.statType == 30) {
this.uinfo.uCurrency = item.todays;
}
});
}
})
},
setCurIdentity(iden){
this.$store.dispatch('SetCurIdentity',iden);
},
jumrank(){
this.$router.push('/user/ranking');
},
toPage(url){
this.$router.push({path:url})
},
}
}
</script>
<style lang="scss" scoped>
<style lang="scss" scoped>
.ranking-link{
font-size: 16px;
font-weight: 600;
color: #333333;
margin-top: 20px;
}
.uc-header{
display: flex;
justify-content: space-between;
height: 210px;
background-color: #ffffff;
background-image: url('../../../public/images/userbgimg.png');
background-repeat: no-repeat;
background-size:445px 210px;
background-position: right 0;
}
.uc-header-box{
display: flex;
justify-content: space-between;
height: 210px;
margin: 0 auto;
}
.list{
font-size: 16px;
font-weight: 600;
@@ -192,7 +201,6 @@
margin-top: 20px;
}
.learningData{
width: 50%;
padding-top: 70px;
box-sizing: border-box;
margin-left:auto;
@@ -236,7 +244,7 @@
vertical-align: top;
}
}
.medalbutt{
color: #333333;
font-size: 14px;
@@ -260,10 +268,8 @@
}
// }
.personalData{
flex: 1;
padding-top: 40px;
padding-left: 115px;
box-sizing: border-box;
display: flex;
.uesr-avaer{
@@ -305,29 +311,13 @@
.editbutt{
font-size: 14px;
color: #333333;
}
}
}
}
.header-box{
display: flex;
justify-content: space-between;
height: 210px;
background: url('../../../public/images/userbgimg.png') no-repeat;
background-size:445px 210px;
background-position: right 0;
}
.uc-header{
height: 210px;
margin: 0 auto;
background: #fff;
// background-color: #c9c2c2;
}
.upicon{
text-align: center;
cursor: pointer;
@@ -382,9 +372,135 @@
border-radius: 50%;
width: 100px;
height: 100px;
}
}
}
@media screen and (max-width: 1366px){
.uc-header-box {
width: 1160px;
}
.learningData{
margin-left:auto;
.learning-info{
margin-left: 10px;
margin-right: 10px;
.learning-qus{
font-size: 12px;
}
.learning-an{
font-size: 12px;
}
}
}
.personalData{
.uesr-avaer{
margin-right: 10px;
}
.user-content{
.content-top{
.grade{
div{
width: 48px;
}
span{
font-size: 14px;
}
}
h6{
font-size: 26px;
}
span{
font-size: 14px;
margin-left: 5px;
margin-right: 10px;
}
.editbutt{
width: 80px;
height: 25px;
line-height: 5px;
text-align: center;
font-size: 12px;
}
}
}
}
.content-bottom{
.medalbutt{
margin-right: 20px;
}
}
}
@media screen and (max-width: 1680px) and (min-width:1367px){
.uc-header-box {
width: 1300px;
}
.learningData{
margin-left:auto;
.learning-info{
margin-left: 10px;
margin-right: 12px;
}
}
.personalData{
.uesr-avaer{
margin-right: 10px;
}
.user-content{
.content-top{
.grade{
div{
width: 48px;
}
span{
font-size: 14px;
}
}
h6{
font-size: 26px;
}
span{
font-size: 14px;
margin-left: 5px;
margin-right: 15px;
}
.editbutt{
width: 80px;
height: 25px;
line-height: 5px;
text-align: center;
font-size: 12px;
}
}
}
}
}
@media screen and (max-width: 1920px) and (min-width: 1681px){
.uc-header-box {
width: 1600px;
}
.learningData{
margin-left:auto;
.learning-info{
margin-left: 20px;
margin-right: 22px;
}
}
}
@media screen and (min-width: 1921px){
.uc-header-box {
width: 1800px;
}
.learningData{
margin-left:auto;
.learning-info{
margin-left: 30px;
margin-right: 30px;
}
}
}
</style>

View File

@@ -73,7 +73,12 @@ import { userAvatarText } from "@/utils/tools.js";
methods:{
toHome() {
// ,query:{id:item.objId || item.id}
this.$router.push({path:'/home/index?id='+this.aid})
if(this.aid){
this.$router.push({path:'/home/index?id='+this.aid})
}else{
this.$message.error("参数错误");
}
}
},
watch:{
@@ -85,6 +90,11 @@ import { userAvatarText } from "@/utils/tools.js";
this.userAvatar=this.baseUrl+newVal;
}
},
aid(newVal,oldVal){
if(newVal){
this.aid=newVal;
}
},
sex(newVal,oldVal){
this.usersex=newVal;
},

View File

@@ -72,7 +72,7 @@
<div class="comment" v-for="(com,comIdx) in list" :key="com.id">
<div class="comment-top">
<div class="comment-author">
<authorInfo :avatar="com.avatar" :name="com.sysCreateBy" :sex="com.sex" :info="com.orgInfo"></authorInfo>
<authorInfo :aid="com.sysCreateAid" :avatar="com.avatar" :name="com.sysCreateBy" :sex="com.sex" :info="com.orgInfo"></authorInfo>
</div>
</div>
<div class="comment-body" >
@@ -114,7 +114,7 @@
<div class="comment" v-for="(reply,replyIdx) in com.replyList" :key="reply.id" :class="replyIdx===com.replyList.length-1 ? 'comment-last' : ''">
<div class="comment-top">
<div class="comment-author">
<authorInfo :avatar="reply.avatar" :name="reply.sysCreateBy" :sex="reply.sex" :info="reply.orgInfo"></authorInfo>
<authorInfo :aid="reply.sysCreateAid" :avatar="reply.avatar" :name="reply.sysCreateBy" :sex="reply.sex" :info="reply.orgInfo"></authorInfo>
<span style="margin-left: 10px;color: #8590A6;font-size:14px; ">
<svg-icon style="font-size: 10px;margin-right: 0;" icon-class="triangle"></svg-icon>
</span>
@@ -168,7 +168,7 @@
<div class="comment" v-for="(reply,rIdx) in replyDiaglog.list" :key="rIdx">
<div class="comment-top">
<div class="comment-author">
<authorInfo :avatar="reply.avatar" :name="reply.sysCreateBy" :sex="reply.sex" :info="reply.orgInfo"></authorInfo>
<authorInfo :aid="reply.sysCreateAid" :avatar="reply.avatar" :name="reply.sysCreateBy" :sex="reply.sex" :info="reply.orgInfo"></authorInfo>
<span style="margin-left: 10px;color: #8590A6;font-size:14px; ">回复</span>
<span style="margin-left: 10px; font-size:14px">{{reply.replyName || reply.toAname}}</span>
</div>

View File

@@ -97,11 +97,11 @@
<div class="el-dropdown-link" style="display:flex" :style="{color:textColor}">
<div class="person-action-index">
<div v-if="userInfo.avatar !== '' " class="user-avatar">
<img :src="userInfo.avatar" style="width: 30px;height: 30px;"/>
<img :src="userInfo.avatar" style="width: 35px;height: 35px;"/>
</div>
<div v-else class="uavatar">
<div v-if="sex === 1 "><img src="../../public/images/Avatarman.png" alt=""></div>
<div v-else><img src="../../public/images/Avatarwoman.png" alt=""></div>
<div v-if="sex === 1 "><img src="../../public/images/Avatarman.png" alt="" style="width: 30px;height: 30px;"></div>
<div v-else><img src="../../public/images/Avatarwoman.png" alt="" style="width: 30px;height: 30px;"></div>
</div>
</div>
<div style="font-weight: 400;font-size: 16px; margin-top: 8px;">{{userInfo.name}}</div>
@@ -488,22 +488,22 @@ export default {
cursor: pointer;
color: #000000;
}
// .uavatar{
// div{
// border-radius: 50%;
// img{
// border-radius: 50%;
// width: 30px;
// height: 30px;
// }
// }
// width: 30px;
// height: 30px;
// line-height: 30px;
// font-size: 14px;
// margin-right: 8px;
// border-radius: 50%;
// }
.uavatar{
div{
border-radius: 50%;
img{
border-radius: 50%;
width: 30px;
height: 30px;
}
}
width: 30px;
height: 30px;
line-height: 30px;
font-size: 14px;
margin-right: 8px;
border-radius: 50%;
}
.user-avatar{
display: inline-block;
border-radius: 50%;

View File

@@ -282,7 +282,6 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
.uc-header{
height: 210px;
background-color: #fff;
background-image: url('../../../public/images/userbgimg.png') ;
background-repeat: no-repeat;

View File

@@ -155,13 +155,13 @@ export const constantRoutes = [{
component: (resolve) => require(['@/views/homepage/Index'], resolve),
name: 'homePage',
redirect: '/home/index',
meta: { title: '主页', icon: 'dashboard', noCache: true, affix: false },
meta: { title: '个人主页', icon: 'dashboard', noCache: true, affix: false },
children: [{
path: 'index',
hidden: true,
component: (resolve) => require(['@/views/homepage/page'], resolve),
name: 'page',
meta: { title: '主页', icon: 'dashboard', noCache: true, affix: true }
meta: { title: '个人主页', icon: 'dashboard', noCache: true, affix: true }
},
{
path: 'leaving',

View File

@@ -1,8 +1,8 @@
<template>
<div class="errPage-container">
<el-button icon="arrow-left" class="pan-back-btn" @click="back">
返回
</el-button>
<div>
<portal-header current="article"></portal-header>
<div class="errPage-container">
<el-row>
<el-col :span="12">
<h1 class="text-jumbo text-ginormous">
@@ -12,27 +12,30 @@
<h6>对不起您没有访问权限请不要进行非法操作您可以返回主页面</h6>
<ul class="list-unstyled">
<li class="link-type">
<router-link to="/">
<router-link to="/index">
回首页
</router-link>
</li>
</ul>
</el-col>
<el-col :span="12">
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import portalHeader from '@/components/PortalHeader.vue';
import portalFooter from '@/components/PortalFooter.vue';
export default {
name: 'Page401',
components: { portalHeader, portalFooter},
data() {
return {
}
},
methods: {

View File

@@ -1,31 +1,37 @@
<template>
<div class="wscn-http404-container">
<div class="wscn-http404">
<div class="pic-404">
</div>
<div class="bullshit">
<div class="bullshit__oops">
404错误!
<div>
<portal-header current="article"></portal-header>
<div class="wscn-http404-container">
<div class="wscn-http404">
<div class="pic-404">
</div>
<div class="bullshit">
<div class="bullshit__oops">
404错误!
</div>
<div class="bullshit__headline">
{{ message }}
</div>
<div class="bullshit__info">
对不起您正在寻找的页面不存在尝试检查URL的错误然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容
</div>
<router-link to="/index" class="bullshit__return-home">
返回首页
</router-link>
</div>
</div>
</div>
<div class="bullshit__headline">
{{ message }}
</div>
<div class="bullshit__info">
对不起您正在寻找的页面不存在尝试检查URL的错误然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容
</div>
<router-link to="/" class="bullshit__return-home">
返回首页
</router-link>
</div>
</div>
</div>
</template>
<script>
import portalHeader from '@/components/PortalHeader.vue';
import portalFooter from '@/components/PortalFooter.vue';
export default {
name: 'Page404',
components: { portalHeader, portalFooter},
computed: {
message() {
return '找不到网页!'
@@ -36,14 +42,12 @@ export default {
<style lang="scss" scoped>
.wscn-http404-container{
transform: translate(-50%,-50%);
position: absolute;
top: 40%;
left: 50%;
width: 500px;
margin: 0px auto;
padding-top: 100px;
}
.wscn-http404 {
position: relative;
width: 1200px;
padding: 0 50px;
overflow: hidden;
.pic-404 {

View File

@@ -1,33 +1,36 @@
<template>
<div class="errPage-container">
<el-button icon="arrow-left" class="pan-back-btn" @click="back">
返回
</el-button>
<el-row>
<el-col :span="12">
<h1 class="text-jumbo text-ginormous">
500错误!
</h1>
<h2>系统访问错误</h2>
<h6>对不起系统无法连接请检查网络或咨询管理人员</h6>
<ul class="list-unstyled">
<li class="link-type">
<a href="/web/">转向登录</a>
</li>
</ul>
</el-col>
<el-col :span="12">
<div>
<portal-header current="article"></portal-header>
<div class="errPage-container">
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<h1 class="text-jumbo text-ginormous">
页面路径错误或500错误!
</h1>
<h2>系统访问错误</h2>
<h6>对不起系统无法连接请检查网络或咨询管理人员</h6>
<ul class="list-unstyled">
<li class="link-type">
<a href="/pc/login">转向登录</a>
</li>
</ul>
</el-col>
<el-col :span="12">
</el-col>
</el-row>
</div>
<portal-footer></portal-footer>
</div>
</template>
<script>
import portalHeader from '@/components/PortalHeader.vue';
import portalFooter from '@/components/PortalFooter.vue';
export default {
name: 'Page401',
name: 'Page500',
components: { portalHeader, portalFooter},
data() {
return {

View File

@@ -3,7 +3,6 @@
<top></top>
<div style="height:72px"></div>
<UcHeader></UcHeader>
<div class="home-page-box">
<router-view />
<div class="home-page-right">
@@ -46,7 +45,7 @@
</div>
</div>
</template>
<script>
import top from '../../layout/components/TopNav/Index.vue'
import UcHeader from '@/components/HomePage/homePage.vue'
@@ -70,17 +69,28 @@
interestedList:[],
follow:{
initiative: 0,
passive: 0
passive: 0
}
}
},
created() {
if(!this.$route.query.id){
this.$router.push({path:'/404'})
}else{
this.init();
}
this.pageId = this.$route.query.id;
},
mounted() {
this.pageId = this.$route.query.id;
this.getMedal();
this.userhobbyInfo();
this.getFollow();
},
},
methods:{
init(){
this.getMedal();
this.userhobbyInfo();
this.getFollow();
},
getFollow(){
apiFollow.counts(this.pageId).then(res=>{
if(res.status == 200) {
@@ -117,7 +127,7 @@
}
}
</script>
<style lang="scss" scoped>
.home-page{
::v-deep .el-tabs__active-bar{
@@ -201,7 +211,7 @@
color: #666666;
}
}
}
.ach-title{
font-size: 18px;
@@ -265,4 +275,3 @@
}
}
</style>

View File

@@ -126,8 +126,17 @@
// }
// }
// },
mounted() {
created(){
if(this.$route.query.id && this.$route.query.id!=''){
this.init();
}else{
//this.$message.error("参数错误");
//跳转到错误页面
this.$router.push({path:'/404'})
}
},
mounted() {
},
methods:{
init(){

View File

@@ -18,7 +18,7 @@
<div class="title">{{articleDetailData.title}}</div>
<div class="label">
<div style="margin-top: 5px;">
<author :avatar="articleDetailData.avatar" :name="articleDetailData.name" :sex="articleDetailData.sex"></author>
<author :aid="articleDetailData.sysCreateAid" :avatar="articleDetailData.avatar" :name="articleDetailData.name" :sex="articleDetailData.sex"></author>
</div>
<div style="margin-top: 8px;padding-left: 15px;font-size: 14px;">
{{authorSign}}
@@ -147,6 +147,7 @@ export default {
articleId:'',
shareUsers:[],
articleDetailData:{
sysCreateAid:'',
avatar:'',
name:'',
orgInfo:'',

View File

@@ -18,7 +18,7 @@
<span style="text-align: right;" v-if="caseDetail.sysCreateTime"> <i class="el-icon-time"></i> {{ caseDetail.sysCreateTime.substring(0,10) }}</span>
</div>
<div class="label">
<author :onlyAvatar="true" :avatar="authorInfo.avatar" :sex="authorInfo.sex" ></author>
<author :aid="caseDetail.sysCreateAid" :onlyAvatar="true" :avatar="authorInfo.avatar" :sex="authorInfo.sex" ></author>
<span>案主{{ authorInfo.name }} ({{authorInfo.orgInfo}})</span>
<!-- <span>案主{{ authorInfo.name }}</span>
<span>工号{{ authorInfo.code }}</span>
@@ -205,6 +205,7 @@ export default {
basePath:process.env.VUE_APP_FILE_BASE_URL,
pdfPath:'',
caseDetail: {
sysCreateAid:'',
id:'',
filePath:''
},