提交 35f5c213 authored 作者: lihuihui's avatar lihuihui

修改bug

上级 df57cd66
......@@ -3,22 +3,34 @@ import { Other } from '@api'
export default class OtherAction extends BaseACTION {
/* 获取我的消息信息 */
getMyMsg () {
return Other.getMyMsg().then(res => {
const json = res.map(function (_, i) {
getMyMsg (obj) {
return Other.getMyMsg(obj).then(res => {
const json = {
count: res.count,
countNum: res.countNum || '',
list: res.list.map(function (_, i) {
return {
isRead: false,
id: _.id,
text: _.message_body,
time: _.created_time || '',
isShow: false // 该字段用来做 每条信息的打开、关闭
time: _.created_time,
isShow: _.read_time, // 该字段用来做 每条信息的打开、关闭
title: _.message_title
}
})
}
return json
})
}
/**
* 获取总消息数
*/
getNavMsg () { return Other.getNavMsg().then(res => res) }
/**
* wmp标记已读未读
*/
setMsgWmp (rid) { return Other.setMsgWmp(rid).then(res => res) }
/**
* 设置消息已读未读
*/
......
......@@ -9,7 +9,7 @@ export default class OtherAPI extends BaseAPI {
/**
* 获取我的消息信息
*/
getMyMsg = () => this.get('/v2/education/message/my', {})
getMyMsg = (obj = {}) => this.get('/v2/education/message/my', obj, {})
/* 支持三方登录 */
examAutoLogin = (obj) => this.post('/util/kaosx', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
/**
......@@ -17,6 +17,10 @@ export default class OtherAPI extends BaseAPI {
*/
setMyMsg = (rid) => this.post(`/v2/education/message/${rid}`, {})
getNavMsg = (rid) => this.get(`/v2/education/message/num?v=${new Date().getTime()}`, {})
/**
* wmp标记已读未读
*/
setMsgWmp = (rid) => this.get(`/v2/education/message/read/${rid}`, {})
/**
* 调用退出登录
*/
......
......@@ -11,7 +11,7 @@
<div class="right">
<div class="logo-name">{{ name }},欢迎您回到在线学习系统</div>
<div class="notify" @click="goNotify()">公告
<div class="num" v-if="num">{{num}}</div>
<div class="num" v-if="this.$store.getters.myMsg !=0">{{ this.$store.getters.myMsg }}</div>
</div>
</div>
</div>
......@@ -19,19 +19,20 @@
<script>
// import sLanguage from '@/components/languageSwitch/index.vue'
// import cAction from '../../action'
import cAction from '../../action'
export default {
components: {},
data () {
return {
name: '',
num: 1
name: ''
}
},
mounted () {
const userInfo = window.G.UserInfo
console.log(this)
this.name = userInfo !== undefined ? userInfo.student_info.personal_name : '' || userInfo !== undefined ? userInfo.nickname : '' || '你好'
cAction.Other.getMyMsg().then(json => {
this.$store.commit('myMsg', json.countNum)
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
},
methods: {
goNotify () {
......
......@@ -6,11 +6,11 @@
<aside-chapter :data="chapters"></aside-chapter>
</div>
</el-tab-pane>
<el-tab-pane label="讲义" name="1">
<!-- <el-tab-pane label="讲义" name="1">
<div class="tab-pane">
<aside-lecture :data="ppts"></aside-lecture>
</div>
</el-tab-pane>
</el-tab-pane> -->
</el-tabs>
</div>
</template>
......
......@@ -89,6 +89,7 @@ export default {
}
},
{ prop: 'approve_time1', label: '审核时间' },
{ prop: 'remark1', label: '备注' },
{
label: '操作',
attrs: { width: '200' },
......@@ -248,7 +249,7 @@ export default {
.then(data => {
if (data.success) {
this.$message({ type: 'success', message: '删除成功' })
this.setmPage()
this.$router.go(0)
}
})
.catch(e => {
......
......@@ -4,7 +4,15 @@
<div class="con-box">
<el-collapse accordion v-model="activeNames" @change="handleChange">
<template v-for="(item, index) in msgList">
<el-collapse-item v-bind:key="index" title="系统公告" :name="index">
<el-collapse-item v-bind:key="index" :name="index">
<template slot="title">
<template v-if="!item.isShow">
<el-badge is-dot class="item">{{ item.title }}</el-badge>
</template>
<template v-if="item.isShow">
{{ item.title }}
</template>
</template>
<div v-html="item.text"></div>
</el-collapse-item>
</template>
......@@ -31,17 +39,18 @@ export default {
methods: {
handleChange (val) {
if (typeof val === 'number' && this.msgList[val].isShow === 0) {
cAction.Other.setMyMsg(this.msgList[val].id).then(json => {
cAction.Other.setMsgWmp(this.msgList[val].id).then(json => {
this.getData()
cAction.Other.getNavMsg().then(data => {
this.$store.commit('myMsg', data.num)
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
}
},
getData () {
cAction.Other.getMyMsg().then(json => {
this.msgList = json
getData (obj) {
// const json = {
// read_time: 0
// }
cAction.Other.getMyMsg(obj).then(json => {
this.msgList = json.list
this.$store.commit('myMsg', json.countNum)
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
}
}
......
......@@ -40,10 +40,10 @@
<p class="ctrl-arrow" @click="changeSideBar('')"><span>&gt;</span></p>
<div class="ctrl-pl">
<ul class="pl-tab-hd">
<li :class="[(state.sideBar === SIDEBAR_CHAPTER ? 'on' : '')]"><a :href="('#' + SIDEBAR_CHAPTER)" @click="changeSideBar(SIDEBAR_CHAPTER)">章节</a></li>
<template v-if="state.isChapterVideo">
<li style="width:100%" :class="[(state.sideBar === SIDEBAR_CHAPTER ? 'on' : '')]"><a :href="('#' + SIDEBAR_CHAPTER)" @click="changeSideBar(SIDEBAR_CHAPTER)">章节</a></li>
<!-- <template v-if="state.isChapterVideo">
<li :class="['br-l-line', (state.sideBar === SIDEBAR_PPT ? 'on' : '')]"><a :href="('#' + SIDEBAR_PPT)" @click="changeSideBar(SIDEBAR_PPT)">讲义</a></li>
</template>
</template> -->
</ul>
<div class="pl-tab-bd">
<template v-if="state.sideBar === SIDEBAR_CHAPTER">
......@@ -69,12 +69,12 @@
<i class="el-icon-self-wenjian"></i>
<div>章节</div>
</a>
<template v-if="state.isChapterVideo">
<!-- <template v-if="state.isChapterVideo">
<a :href="('#' + SIDEBAR_PPT)" class="switch-handout" @click="changeSideBar(SIDEBAR_PPT)">
<i class="el-icon-self-PPT"></i>
<div>讲义</div>
</a>
</template>
</template> -->
</div>
</template>
</div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论