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

修改bug

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