提交 6dd65782 authored 作者: zyx's avatar zyx

update

import BaseACTION from './base_action'
import { Discuss } from '@api'
/**
* 小程序 跟 PC 区别
* 1. PC 直接使用 then,小程序 需要 callback
* 2. PC 直接返回 对象,小程序 外层再保证一次返回 { status: xxx, data: data }
*/
export default class DiscussAction extends BaseACTION {
/* 获取讨论题目列表,“我提出的问题”和“我参与的问题”信息 */
/**
* dataJson.limit - 获取数量
* dataJson.offset - 偏移量
*/
getDiscussList (path, dataJson) {
return Discuss.getDiscussList(path, dataJson).then(res => {
const _data = res
const json = _data.map(function (_, i) {
return {
id: _.id,
sid: _.semester_id,
cid: _.relate_id,
user: {
url: _.questioner.avatar || '',
name: _.questioner.nickname,
time: _.created_time
},
title: _.title,
text: _.contents,
askCnt: _.answer_count,
TouCnt: _.tag_total_count,
courseName: '在线学习课程',
comments: _.comments,
mine: _.mine,
isShow: false
}
})
// callback(json) // 可以不使用callback 因为使用then
return json
})
}
/* 获取讨论题目列表,“课程的问题”信息 */
/**
* dataJson.limit - 获取数量
* dataJson.offset - 偏移量
* dataJson.sort - 排序类型
*/
getCourseDiscussList (cid, sid, dataJson) {
return Discuss.getCourseDiscussList(cid, sid, dataJson).then(res => {
const _data = res
const json = _data.map(function (_, i) {
return {
id: _.id,
sid: _.semester_id,
cid: _.relate_id,
user: {
url: _.questioner.avatar || '',
name: _.questioner.nickname,
time: _.created_time
},
title: _.title,
text: _.contents,
askCnt: _.answer_count,
TouCnt: _.tag_total_count,
courseName: '在线学习课程',
comments: _.comments,
mine: _.mine,
isShow: false
}
})
// callback(json) // 可以不使用callback 因为使用then
return json
})
}
/* 获取问题详情 */
getDiscussDetail (qid) {
return Discuss.getDiscussDetail(qid).then(res => {
const _data = res
const json = {
ques: {
qid: _data.id,
sid: _data.semester_id,
user: {
url: _data.questioner.avatar || '',
name: _data.questioner.nickname,
time: _data.created_time
},
title: _data.title,
text: _data.contents,
askCnt: _data.answer_count || 0,
TouCnt: _data.tag_total_count || 0,
likeCnt: _data.tag_count || 0,
comCnt: _data.comments.length,
mine: _data.mine,
isShowComment: false,
has_tag: _data.has_tag,
tag_id: (_data.tag && _data.tag.id) || '',
comments: _data.comments.map(function (_, i) {
return {
cid: _.id,
user: {
url: _.observer.avatar || '',
name: _.observer.nickname,
time: _.created_time
},
text: _.comments,
mine: _.mine
}
})
},
answer: (_data.answers && _data.answers.map(function (_, i) {
return {
aid: _.id,
user: {
url: _.replier.avatar || '',
name: _.replier.nickname,
time: _.created_time
},
text: _.contents,
likeCnt: _.tag_count,
comCnt: _.comments.length,
mine: _.mine,
isShowComment: false,
has_tag: _.has_tag,
tag_id: (_.tag && _.tag.id) || '',
comments: _.comments.map(function (__, i) {
return {
cid: __.id,
user: {
url: __.observer.avatar || '',
name: __.observer.nickname,
time: __.created_time
},
text: __.comments,
mine: __.mine
}
})
}
})) || []
}
// callback(json) // 可以不使用callback 因为使用then
return json
})
}
/* 删除提问 */
deleteDiscuss (qid) {
return Discuss.deleteDiscuss(qid).then(res => {
const _data = res
if (_data.success) {
// callback(res) // 可以不使用callback 因为使用then
return res
}
})
}
/* 提出问题 */
publishQues (param) {
return Discuss.publishQues(param).then(res => {
// callback(res) // 可以不使用callback 因为使用then
return res
})
}
/* 回答问题 */
answerQues (param) {
return Discuss.answerQues(param).then(res => {
const _data = res
if (_data.success) {
// callback(res) // 可以不使用callback 因为使用then
return res
}
})
}
/* 删除回答 */
deleteAnswer (aid) {
return Discuss.deleteAnswer(aid).then(res => {
const _data = res
if (_data.success) {
// callback(res) // 可以不使用callback 因为使用then
return res
}
})
}
/* 回复评论 */
callbackComment (param) {
return Discuss.callbackComment(param).then(res => {
const _data = res
if (_data.success) {
// callback(res) // 可以不使用callback 因为使用then
return res
}
})
}
/* 删除评论 */
deleteComment (cid) {
return Discuss.deleteComment(cid).then(res => {
const _data = res
if (_data.success) {
// callback(res) // 可以不使用callback 因为使用then
return res
}
})
}
/* 点赞 */
like (param) {
return Discuss.like(param).then(res => {
const _data = res
if (_data.success) {
// callback(res) // 可以不使用callback 因为使用then
return res
}
})
}
/* 取消点赞 */
unlike (tagid) {
return Discuss.unlike(tagid).then(res => {
const _data = res
if (_data.success) {
// callback(res) // 可以不使用callback 因为使用then
return res
}
})
}
}
import BaseACTION from './base_action'
import { Feedback } from '@api'
export default class FeedbackAction extends BaseACTION {
/* 提交重修 */
rebuildSubmit (obj) { return Feedback.submitRebuild(obj).then(res => res) }
/* 意见反馈列表 */
feedbackList (obj) { return Feedback.feedbackList(obj).then(res => res) }
/* 意见反馈回复 */
feedbackReply (obj) { return Feedback.feedbackReply(obj).then(res => res) }
/* 意见反馈提交 */
feedbackCommit (obj) { return Feedback.feedbackCommit(obj).then(res => res) }
}
...@@ -3,19 +3,25 @@ import CourseAction from './CourseAction' ...@@ -3,19 +3,25 @@ import CourseAction from './CourseAction'
import GradeAction from './GradeAction' import GradeAction from './GradeAction'
import ReportAction from './ReportAction' import ReportAction from './ReportAction'
import PlayerAction from './PlayerAction' import PlayerAction from './PlayerAction'
import DiscussAction from './DiscussAction'
import FeedbackAction from './FeedbackAction'
const Other = new OtherAction() const Other = new OtherAction()
const Course = new CourseAction() const Course = new CourseAction()
const Grade = new GradeAction() const Grade = new GradeAction()
const Report = new ReportAction() const Report = new ReportAction()
const Player = new PlayerAction() const Player = new PlayerAction()
const Discuss = new DiscussAction()
const Feedback = new FeedbackAction()
const cAction = { const cAction = {
Other, Other,
Course, Course,
Grade, Grade,
Report, Report,
Player Player,
Discuss,
Feedback
} }
export default cAction export default cAction
import BaseAPI from './base_api'
export default class DiscussAPI extends BaseAPI {
/**
* 获取讨论题目列表,“我提出的问题”和“我参与的问题”信息
* dataJson.limit - 获取数量
* dataJson.offset - 偏移量
* @param {[string]} path
* @param {[object]} dataJson
*/
getDiscussList = (path, dataJson) => this.get('/v2/qa/questions' + path, dataJson)
/**
* 获取讨论题目列表,“课程的问题”信息
* dataJson.limit - 获取数量
* dataJson.offset - 偏移量
* dataJson.sort - 排序类型
* @param {[string]} cid
* @param {[string]} sid
* @param {[object]} dataJson
*/
getCourseDiscussList = (cid, sid, dataJson) => this.get(`/v2/qa/questions/course/${sid}/${cid}`, dataJson)
/**
* 获取问题详情
* @param {[string]} qid
*/
getDiscussDetail = (qid) => this.get(`/v2/qa/questions/${qid}`, {})
/**
* 删除提问
* @param {[string]} qid
*/
deleteDiscuss = (qid) => this.delete(`/v2/qa/questions/${qid}`, {})
/**
* 提出问题
* @param {[object]} param
*/
publishQues = (param) => this.post('/v2/qa/questions', param)
/**
* 回答问题
* @param {[object]} param
*/
answerQues = (param) => this.post('/v2/qa/answers', param, { headers: { 'Content-Type': 'application/json' } })
/**
* 删除回答
* @param {[string]} aid
*/
deleteAnswer = (aid) => this.delete(`/v2/qa/answers/${aid}`, {})
/**
* 回复评论
* @param {[object]} param
*/
callbackComment = (param) => this.post('/v2/qa/comments', param, { headers: { 'Content-Type': 'application/json' } })
/**
* 删除评论
* @param {[string]} cid
*/
deleteComment = (cid) => this.delete(`/v2/qa/comments/${cid}`)
/**
* 点赞
* @param {[object]} param
*/
like = (param) => this.post('/v2/qa/tags', param, { headers: { 'Content-Type': 'application/json' } })
/**
* 取消点赞
* @param {[string]} tagid
*/
unlike = (tagid) => this.delete(`/v2/qa/tags/${tagid}`, {})
}
import BaseAPI from './base_api'
export default class FeedbackAPI extends BaseAPI {
/**
* 提交 重修课程
*/
submitRebuild = (obj = {}) => this.post('/v2/education/retake', obj, { headers: { 'Content-Type': 'multipart/form-data' } })
/**
* 获取意见列表
* type_id [int]
* page [int]
* pageSize [int]
*/
feedbackList = (obj = {}) => this.get('/v2/feedback/lists', obj, { headers: { 'Content-Type': 'multipart/form-data' } })
/**
* 意见反馈回复
* feedback_id [int]
* contents [string]
*/
feedbackReply = (obj = {}) => this.post('/v2/feedback/reply', obj, { headers: { 'Content-Type': 'multipart/form-data' } })
/**
* 意见反馈提交
*/
feedbackCommit = (obj = {}) => this.post('/v2/feedback/commit', obj, { headers: { 'Content-Type': 'multipart/form-data' } })
}
...@@ -3,17 +3,23 @@ import CourseAPI from './course_api' ...@@ -3,17 +3,23 @@ import CourseAPI from './course_api'
import GradeAPI from './grade_api' import GradeAPI from './grade_api'
import ReportAPI from './report_api' import ReportAPI from './report_api'
import PlayerAPI from './player_api' import PlayerAPI from './player_api'
import DiscussAPI from './discuss_api'
import FeedbackAPI from './feedback_api'
const Other = new OtherAPI(webConf) const Other = new OtherAPI(webConf)
const Course = new CourseAPI(webConf) const Course = new CourseAPI(webConf)
const Grade = new GradeAPI(webConf) const Grade = new GradeAPI(webConf)
const Report = new ReportAPI(webConf) const Report = new ReportAPI(webConf)
const Player = new PlayerAPI(webConf) const Player = new PlayerAPI(webConf)
const Discuss = new DiscussAPI(webConf)
const Feedback = new FeedbackAPI(webConf)
export { export {
Other, Other,
Course, Course,
Grade, Grade,
Report, Report,
Player Player,
Discuss,
Feedback
} }
...@@ -61,7 +61,7 @@ export default { ...@@ -61,7 +61,7 @@ export default {
case '/app/learn/discussion': defaultActive = '1-2'; break case '/app/learn/discussion': defaultActive = '1-2'; break
case '/app/learn/report-active-list': defaultActive = '1-3'; break case '/app/learn/report-active-list': defaultActive = '1-3'; break
case '/app/grade/credit': defaultActive = '2-1'; break case '/app/grade/credit': defaultActive = '2-1'; break
case '/app/account/feedbackList': defaultActive = '3'; break case '/app/feedback/feedback-list': defaultActive = '3'; break
case '/app/service-hall/hall': defaultActive = '4'; break case '/app/service-hall/hall': defaultActive = '4'; break
} }
return { return {
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
case '1-2': this.$router.push({ path: '/app/learn/discussion' }); break case '1-2': this.$router.push({ path: '/app/learn/discussion' }); break
case '1-3': this.$router.push({ path: '/app/learn/report-active-list' }); break case '1-3': this.$router.push({ path: '/app/learn/report-active-list' }); break
case '2-1': this.$router.push({ path: '/app/grade/credit' }); break case '2-1': this.$router.push({ path: '/app/grade/credit' }); break
case '3': this.$router.push({ path: '/app/account/feedbackList' }); break case '3': this.$router.push({ path: '/app/feedback/feedback-list' }); break
case '4': this.$router.push({ path: '/app/service-hall/hall' }); break case '4': this.$router.push({ path: '/app/service-hall/hall' }); break
} }
}, },
......
<template>
<div>
<div class="con-title">系统反馈</div>
<div class="con-box">
<el-row type="flex" justify="center">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
<el-form ref="setApplyForm" :model="setApply" :rules="applyRules">
<el-form-item label="问题描述" prop="name">
<el-input v-model="setApply.name" placeholder="请输入问题描述" type="text" />
</el-form-item>
<div style="width: 100%; height: 10px;"></div>
<div class="label" style="font-size: 14px; line-height: 2;">问题详情:</div>
<textarea id="editor"></textarea>
<div style="width: 100%; height: 10px;"></div>
<el-form-item label="上传附件" prop="file">
<el-upload
ref="upFile"
class="upload-demo"
action=""
:multiple="false"
:limit="1"
:show-file-list="false"
:on-change="handleChange"
:http-request="uploadFile"
:file-list="filesArr">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">(可以上传 word、ppt、png、jpg、zip、rar等资源,多文件请先压缩打包成一个文件后,再上传)</div>
<template v-if="successFileUrl">
{{successFileUrl.replace(/.*\/([^\/]*\.[^.]+)$/gi, '$1')}}
</template>
</el-upload>
<template v-if="successFileUrl">
<a :href="successFileUrl">下载已上传附件</a>
</template>
</el-form-item>
<el-form-item label="提交给" prop="type_id">
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onApplyFrom">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import cAction from '@action'
import CKEDITOR from 'CKEDITOR'
export default {
components: {},
data () {
return {
ckeditor: null,
setApply: {
name: '',
content: ''
},
applyRules: {
name: [
{ required: true, message: '问题描述不能为空', trigger: 'blur' }
]
},
successFileUrl: '',
filesArr: [],
file: {
id: 'WU_FILE_0',
name: '',
type: '',
lastModifiedDate: '',
size: '',
file: ''
},
options: [
{ value: '0', label: '全部' },
{ value: '1', label: '教务' },
{ value: '2', label: '技术' }
],
value: '2'
}
},
mounted () {
this.initckeditor()
},
destroyed () {
/* 清空 ckeditor 需要调用方法删除 并 在DOM结构中也移除 */
this.ckeditor && this.ckeditor.destroy(true)
this.ckeditor = null
},
methods: {
handleChange (file, filelist) {
this.file.name = file.raw.name
this.file.type = file.raw.type
this.file.lastModifiedDate = file.raw.lastModifiedDate
this.file.size = file.raw.size
this.file.file = file.raw
},
uploadFile () {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Other.uploadFile(this.file).then(data => {
this.successFileUrl = data.url
this.filesArr.pop()
}).catch(e => { this.filesArr.pop(); this.$message.error(e.message) }).finally(() => { loading.close() })
},
onApplyFrom () {
this.$refs.setApplyForm.validate((valid) => {
if (valid) {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Feedback.feedbackCommit({
title: this.setApply.name,
contents: this.ckeditor.getData(),
type_id: this.value,
attachments: JSON.stringify([{
name: this.file.name,
url: this.successFileUrl
}])
}).then(data => {
if (data.success) {
this.$message({ type: 'success', message: '提交成功,等待反馈' })
this.ckeditor.setData('')
this.$refs.setApplyForm.resetFields()
this.$router.push({ path: '/app/feedback/feedback-list' })
}
}).catch(e => { this.filesArr.pop(); this.$message.error(e.message) }).finally(() => { loading.close() })
} else {
this.$message.error('请检查输入项,确认无误后,重新提交')
return false
}
})
},
/* 初始化 ckeditor */
initckeditor () {
!this.ckeditor && (this.ckeditor = CKEDITOR.replace('editor', {
height: 300,
uiColor: '#eeeeee',
filebrowserImageUploadUrl: '/api/ckeditor/img/upload',
// resize_enabled: typeof this.props.resizable === 'boolean' ? this.props.resizable : true,
toolbar: [
// { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview'] },
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
{ name: 'colors', items: ['TextColor', 'BGColor'] },
{ name: 'tools', items: ['Maximize', 'ShowBlocks'] },
// { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
{ name: 'editing', items: ['Find', 'Replace'] },
// { name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] },
'/',
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'] },
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl'] },
{ name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule'] }
]
}))
}
}
}
</script>
<style lang="scss" scoped>
/* 申请 */
.el-date-editor.el-input {
width: 100%;
}
.el-upload__tip {
line-height: 1.5;
}
</style>
<template>
<div>
<div class="con-title">系统反馈<el-button style="float: right; margin: 8px;" type="primary" size="mini" round @click="goCreate">提出问题</el-button></div>
<div class="con-box">
<template v-for="(item, index) in find">
<ul v-bind:key="index" class="tabs-list">
<li class="tabs-hd">{{item.name}}</li>
<template v-for="(item1, index1) in item.arrItem">
<li v-bind:key="index1">
<div :class="['tab', (item.selectIndex == index1 ? 'on' : '')]" @click="selFindSelect" :data-index='index1' :data-i="index" :data-key='item.key' :data-val='item1.val'>{{item1.name}}</div>
</li>
</template>
</ul>
</template>
</div>
<div class="con-box">
<el-collapse v-model="activeNames" @change="handleChange">
<template v-for="(item, index) in feedbackList">
<el-collapse-item v-bind:key="index" :name="index">
<template slot="title">
{{item.feedback_title}}<div style="position: absolute; right: 70px;" v-html="item.status"></div>
</template>
<div style="font-size: 15px; font-weight: 700;">问题描述:(发布时间:{{item.created_time}})</div>
<div style="text-indent: 20px;" v-html="item.feedback_contents"></div>
<div style="font-size: 15px; font-weight: 700;">下载附件:</div>
<div style="overflow: hidden; text-indent: 20px;">
<template v-if="item.isEmpty">
暂无附件内容
</template>
<template v-else>
<template v-for="(item1, index1) in item.feedback_attachments">
<template v-if="item1.url">
<a style="float: left; margin-right: 10px;" :href="item1.url">下载附件{{index1+1}}</a>
</template>
</template>
</template>
</div>
<div style="font-size: 15px; font-weight: 700;">问题回复:</div>
<template v-if="item.replies.length">
<template v-for="(item1, index1) in item.replies">
<div class="discuss-feedback-scroll">
<div v-bind:key='index' class='item-list'>
<div class='user'>
<template v-if="item1.avatar">
<img class='img' :src='item1.avatar' />
</template>
<template v-else>
<img class='img' src='../../assets/images/person-default.jpg' />
</template>
<div class='right'>
<div class='name'>{{item1.nickname}}</div>
<div class='time'>{{item1.created_time}}</div>
</div>
</div>
<div :class='["text"]' v-html="item1.reply_contents"></div>
</div>
</div>
</template>
<textarea v-model="item.replyContent"></textarea>
<el-button type="primary" size="mini" round @click="replyContent" :data-index='index'>回复</el-button>
</template>
<template v-else>
<div style="text-indent: 20px;">问题已发送给相应的技术或教务人员,正在处理中,请耐心等待。</div>
</template>
</el-collapse-item>
</template>
</el-collapse>
</div>
<div class="pagination-right" v-if="(pagination.totalCount / pagination.pageSize > 1)">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pagination.currentPage"
:page-size="pagination.pageSize"
layout="prev, pager, next, jumper"
:total="pagination.totalCount">
</el-pagination>
</div>
</div>
</template>
<script>
import cAction from '@action'
export default {
components: { },
data () {
return {
find: [{
name: '分类',
isShow: false,
selectIndex: 0,
key: 'type_id',
arrItem: [ // 从后台请求
{ val: '0', name: '全部' },
{ val: '1', name: '教务' },
{ val: '2', name: '技术' }
]
}],
param: {
type_id: 0,
page: 1,
pageSize: 10
},
pagination: {
totalCount: 5,
pageSize: 1,
currentPage: 1
},
activeNames: ['1'],
feedbackList: []
}
},
mounted () {
this.getAjaxList()
},
methods: {
getAjaxList () {
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Feedback.feedbackList(this.param).then(data => {
for (let i = 0; i < data.lists.length; i++) {
const temp = data.lists[i]
/* 对附件下载 做一下单独处理 */
try {
temp.feedback_attachments = JSON.parse(temp.feedback_attachments)
} catch (e) {
temp.feedback_attachments = []
}
temp.isEmpty = true
for (let j = 0; j < temp.feedback_attachments.length; j++) {
const temp1 = temp.feedback_attachments[j]
if (temp1.url) {
temp.isEmpty = false
}
}
/* 对状态 做一下单独处理 */
temp.status = temp.status === '0' ? '<em style="color: #f34b4b">待处理</em>' : temp.status === '1' ? '<em style="color: #f3c74b">处理中</em>' : temp.status === '2' ? '<em style="color: #44a706">处理完成</em>' : '暂无'
/* 对回复 做一下单独处理 */
temp.replyContent = ''
}
this.feedbackList = data.lists
this.pagination = data.pagination
}).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() })
},
goCreate () {
this.$router.push({ path: '/app/feedback/feedback-create' })
},
replyContent (e) {
const i = e.target.dataset.index
if (!this.feedbackList[i].replyContent) {
this.$message.error('回复内容不能为空!')
return
}
console.log(this.feedbackList[i].replyContent, this.feedbackList[i].id)
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Feedback.feedbackReply({
feedback_id: this.feedbackList[i].id,
contents: this.feedbackList[i].replyContent
}).then(data => {
if (data.success) {
this.$message.success('回复成功,等待新的答复')
}
}).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() })
},
/**
* 分类选择 - 选中某一项
*/
selFindSelect (e) {
const _data = e.currentTarget.dataset
const index = _data.index
const json = this.find
const i = _data.i
json[i].selectIndex = index
json[i].isShow = false
this.param[_data.key] = parseInt(_data.val)
/* 调用接口 */
this.getAjaxList()
},
handleChange (val) { },
/* 分页组件方法 */
handleSizeChange () { },
handleCurrentChange () {
this.param.page = this.pagination.currentPage
this.getAjaxList()
}
}
}
</script>
<style lang="scss" scoped>
/* 列表 筛选 */
ul.tabs-list {
float: left;
width: 100%;
margin: 0 0 0.15rem 0;
padding: 0;
font-size: 0.16rem;
line-height: 1.5;
border-top: 1px solid #e8e8e8;
&:last-child {
margin-bottom: 0;
}
.tabs-hd {
display: inline-block;
color: #fff;
padding: 5px 0 9px;
margin-top: -5px;
width: 94px;
text-align: center;
background: url(https://zws-imgs-pub.ezijing.com/754005be709bf2295bc55923c2b91fd8.png) no-repeat 0 0;
}
li {
float: left;
list-style: none;
padding: 0.1rem 0;
margin-right: 0.2rem;
.tab {
padding: 0 0.1rem;
cursor: pointer;
&.on {
background: #b49441;
color: #ffffff;
}
&:focus, &:hover {
color: #b49441;
background: #eeeeee;
}
}
}
}
/* 分页样式 */
.pagination-right {
float: right;
margin: 0 0.3rem 0 0;
}
textarea {
width: 100%;
height: 60px;
}
.discuss-feedback-scroll { padding: 5px; }
.discuss-feedback-scroll .item-list { position: relative; padding: 0.1rem; background: #fff; box-shadow: 0 2px 4px rgba(10, 4, 6, 0.1); cursor: pointer; }
.discuss-feedback-scroll .item-list .user { position: relative; overflow: hidden; }
.discuss-feedback-scroll .item-list .user .img { float: left; width: 0.5rem; height: 0.5rem; background: #e5e5e5; border-radius: 50%; }
.discuss-feedback-scroll .item-list .user .right { position: absolute; left: 0.52rem; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
.discuss-feedback-scroll .item-list .user .right .name { font-size: 0.14rem; color: #313131; text-overflow: ellipsis; overflow: hidden; word-break:break-all; }
.discuss-feedback-scroll .item-list .user .right .time { font-size: 0.14rem; color: #a0a0a0; }
.discuss-feedback-scroll .item-list .text { text-indent: 10px; font-size: 0.14rem; color: #535353; line-height: 1.5; text-align: justify; /* display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; text-overflow: ellipsis; overflow: hidden; */ word-break:break-all; overflow: hidden; }
</style>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<img class='img' :src='item.user.url' /> <img class='img' :src='item.user.url' />
</template> </template>
<template v-else> <template v-else>
<img class='img' src='../../assets/img/person-default.jpg' /> <img class='img' src='../../assets/images/person-default.jpg' />
</template> </template>
<div class='right'> <div class='right'>
<div class='name'>{{item.user.name}}</div> <div class='name'>{{item.user.name}}</div>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</template> </template>
<script> <script>
import cAction from '@actions' import cAction from '@action'
export default { export default {
components: { }, components: { },
...@@ -85,17 +85,17 @@ export default { ...@@ -85,17 +85,17 @@ export default {
}, },
methods: { methods: {
resizeRoot () { resizeRoot () {
let elems = document.querySelectorAll('.ellipsis') const elems = document.querySelectorAll('.ellipsis')
let fs = getComputedStyle(window.document.documentElement)['font-size'].replace('px', '') // eslint-disable-line let fs = getComputedStyle(window.document.documentElement)['font-size'].replace('px', '') // eslint-disable-line
elems.forEach((_, i) => { elems.forEach((_, i) => {
_.previousSibling.style.height = 'auto' _.previousSibling.style.height = 'auto'
let height = _.previousSibling.offsetHeight const height = _.previousSibling.offsetHeight
let realHeight = fs * 0.18 * 1.5 * 2 const realHeight = fs * 0.18 * 1.5 * 2
if (height > realHeight) { if (height > realHeight) {
this.discussList[i]['isShow'] = true this.discussList[i].isShow = true
_.previousSibling.style.height = realHeight + 'px' _.previousSibling.style.height = realHeight + 'px'
} else { } else {
this.discussList[i]['isShow'] = false this.discussList[i].isShow = false
} }
}) })
}, },
...@@ -107,7 +107,7 @@ export default { ...@@ -107,7 +107,7 @@ export default {
} }
} }
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' }) const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.discussAction.getDiscussList(pathUrl, this.param).then(json => { cAction.Discuss.getDiscussList(pathUrl, this.param).then(json => {
this.discussList = json this.discussList = json
}).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() }) }).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() })
}, },
...@@ -115,8 +115,8 @@ export default { ...@@ -115,8 +115,8 @@ export default {
* 切换 - tab * 切换 - tab
*/ */
tabSelect (e) { tabSelect (e) {
let index = e.currentTarget.dataset.index const index = e.currentTarget.dataset.index
let json = this.tabs const json = this.tabs
for (let i = 0; i < json.length; i++) { for (let i = 0; i < json.length; i++) {
json[i].isShow = false json[i].isShow = false
} }
...@@ -129,16 +129,15 @@ export default { ...@@ -129,16 +129,15 @@ export default {
* 跳转到对应 问题详情页 * 跳转到对应 问题详情页
*/ */
goDiscussDetail (e) { goDiscussDetail (e) {
let qid = e.currentTarget.dataset.id const qid = e.currentTarget.dataset.id
let sid = e.currentTarget.dataset.sid const sid = e.currentTarget.dataset.sid
let cid = e.currentTarget.dataset.cid const cid = e.currentTarget.dataset.cid
this.$router.push({ path: `/app/learn/discuss-detail/${sid}/${cid}/${qid}` }) this.$router.push({ path: `/app/learn/discuss-detail/${sid}/${cid}/${qid}` })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.tab-select { width: 100%; border-bottom: 1px solid #c9c9c9; overflow: hidden; background: #fff; } .tab-select { width: 100%; border-bottom: 1px solid #c9c9c9; overflow: hidden; background: #fff; }
......
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
_d.m3u8RequestId = window.G.m3u8RequestId _d.m3u8RequestId = window.G.m3u8RequestId
_d.UA = window.navigator.userAgent _d.UA = window.navigator.userAgent
var arr = JSON.stringify({ action: 'aliVideoErr', info: Base64.encode(str), auth: 'aliVideoErr', code: Base64.encode(e.paramData.error_code), err: Base64.encode(JSON.stringify(_d)) }).split('') var arr = JSON.stringify({ action: 'aliVideoErr', info: Base64.encode(str), auth: 'aliVideoErr', code: Base64.encode(e.paramData.error_code), err: Base64.encode(JSON.stringify(_d)) }).split('')
// var arr = JSON.stringify({ action: 'aliVideoErr', info: Base64.encode(str), auth: 'aliVideoErr', code: Base64.encode('4006') }).split('') // var arr = JSON.stringify({ 'action': 'aliVideoErr', info: Base64.encode(str), 'auth': 'aliVideoErr', 'code': Base64.encode('4006') }).split('')
var strArr = [] var strArr = []
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
strArr[i] = arr[i].charCodeAt() strArr[i] = arr[i].charCodeAt()
......
...@@ -44,8 +44,8 @@ export default [ ...@@ -44,8 +44,8 @@ export default [
{ path: 'course', component: () => import('../pages/learn/course.vue') }, { path: 'course', component: () => import('../pages/learn/course.vue') },
{ path: 'course-all', component: () => import('../pages/learn/courseAll.vue') }, { path: 'course-all', component: () => import('../pages/learn/courseAll.vue') },
{ path: 'course-detail/:sid/:cid', component: () => import('../pages/learn/courseDetail.vue'), props: true }, { path: 'course-detail/:sid/:cid', component: () => import('../pages/learn/courseDetail.vue'), props: true },
// { path: 'discuss-detail/:sid/:cid/:id', component: () => import('../pages/learn/discussDetail.vue'), props: true }, { path: 'discuss-detail/:sid/:cid/:id', component: () => import('../pages/learn/discussDetail.vue'), props: true },
// { path: 'discussion', component: () => import('../pages/learn/discussion.vue') }, { path: 'discussion', component: () => import('../pages/learn/discussion.vue') },
{ path: 'report-list', component: () => import('../pages/learn/reportList.vue') }, { path: 'report-list', component: () => import('../pages/learn/reportList.vue') },
{ path: 'report-active-list', component: () => import('../pages/learn/reportActiveList.vue') }, { path: 'report-active-list', component: () => import('../pages/learn/reportActiveList.vue') },
{ path: 'report-list-all/:rid', component: () => import('../pages/learn/reportListAll.vue'), props: true }, { path: 'report-list-all/:rid', component: () => import('../pages/learn/reportListAll.vue'), props: true },
...@@ -63,14 +63,14 @@ export default [ ...@@ -63,14 +63,14 @@ export default [
] ]
}, },
{ {
path: 'account', path: 'feedback',
redirect: 'error/404', redirect: 'error/404',
component: () => import('@/components/learnSysLayout/container.vue'), component: () => import('@/components/learnSysLayout/container.vue'),
children: [ children: [
// { path: 'set-pwd', component: () => import('../pages/account/setPwd.vue') }, // { path: 'set-pwd', component: () => import('../pages/account/setPwd.vue') },
// { path: 'update-pic', component: () => import('../pages/account/updatePic.vue') }, // { path: 'update-pic', component: () => import('../pages/account/updatePic.vue') },
// { path: 'feedbackList', component: () => import('../pages/account/feedbackList.vue') }, { path: 'feedback-list', component: () => import('../pages/feedback/feedbackList.vue') },
// { path: 'feedbackCreate', component: () => import('../pages/account/feedbackCreate.vue') } { path: 'feedback-create', component: () => import('../pages/feedback/feedbackCreate.vue') }
] ]
}, },
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论