This commit is contained in:
zhaofang
2022-09-14 16:37:46 +08:00
parent 5146759a08
commit 03c7d17095
5 changed files with 94 additions and 52 deletions

View File

@@ -60,8 +60,8 @@
<div class="person-action" >
<!-- 消息 -->
<el-link v-if="current == 'qa'" class="person-action-index" type="primary" style="margin-right:10px; color:#333;" :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`" :underline="false">个人中心</el-link>
<el-link v-else class="person-action-index" type="primary" style="margin-right:10px; color:#fff;" :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`" :underline="false">个人中心</el-link>
<!-- <el-link v-if="current == 'qa'" class="person-action-index" type="primary" style="margin-right:10px; color:#333;" :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`" :underline="false">个人中心</el-link>
<el-link v-else class="person-action-index" type="primary" style="margin-right:10px; color:#fff;" :href="`${webBaseUrl}${isTiao ? '/uc/study/task' : '/uc/study/courses'}`" :underline="false">个人中心</el-link> -->
<!-- <el-link type="primary" @click="logout()" icon="el-icon-switch-button" :underline="false">退出</el-link> -->
<el-badge class="person-action-index message-count" :value="userMsg" :hidden="userMsg == 0">
<el-tooltip content="消息" placement="bottom" effect="light" :visible-arrow="false" popper-class="text-tooltip">
@@ -94,6 +94,12 @@
</div>
<div v-if="current == 'qa'" style="color:#000;font-size: 16px;font-weight: 600;">{{userInfo.name}}</div>
<div v-else style="color:#fff;font-size: 16px;font-weight: 600;">{{userInfo.name}}</div>
<div v-if="current == 'qa'" class="person-action-index" style="color:#000" @click="logout()">
<svg-icon style="margin-right: 4px;font-size:22px;" icon-class="black-out"></svg-icon>登出
</div>
<div v-else class="person-action-index" style="color:#fff" @click="logout()">
<svg-icon style="margin-right: 4px;font-size:22px;color: #000;" icon-class="white-out"></svg-icon>登出
</div>
</div>
</div>
</div>

View File

@@ -36,25 +36,25 @@
<div class="learningData">
<div class="learning-info">
<div class="learning-qus">当月学习时长</div>
<div class="learning-an"><span>12.7</span>小时</div>
<div class="learning-an"><span>{{uinfo.monthStudy}}</span>小时</div>
</div>
<div class="learning-info">
<div class="learning-qus">累计学习时长</div>
<div class="learning-an"><span>120.7.7</span>小时</div>
<div class="learning-an"><span>{{uinfo.monthTotal}}</span>小时</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>12.7</span>小时</div>
<div class="learning-an"><span>{{uinfo.monthDay}}</span>小时</div>
</div>
<div class="learning-info">
<div class="learning-qus">累计学习天数</div>
<div class="learning-an"><span>120.7.7</span></div>
<div class="learning-an"><span>{{uinfo.monthTotalDay}}</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>120.7.7</span></div>
<div class="learning-an"><span>{{uinfo.uCurrency}}</span></div>
</div>
<div class="list">
BOE 排行榜 >>
@@ -115,7 +115,7 @@
<script>
import {userAvatarText,cutFullName} from "@/utils/tools.js";
import { mapGetters } from 'vuex'
// import apiUserstart from '@/api/modules/userstart.js'
import apiStart from '@/api/phase2/stat.js'
export default {
name: 'UcHeader',
computed:{
@@ -127,7 +127,13 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
data(){
return {
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
uinfo:{},
uinfo:{
monthStudy:0,//当月学习时长
monthTotal: 0,
monthDay:0,
monthTotalDay:0,
uCurrency:0
},
orgInfo:'',
sex:'',
}
@@ -145,12 +151,23 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
},
methods:{
getInfo(){
// let data = {
// statType:'10,11'
// }
// apiUserstart.user(data).then(res=>{
// })
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.total;
}
});
}
})
},
setCurIdentity(iden){
this.$store.dispatch('SetCurIdentity',iden);