Commit e8bc5fc7 authored by 王's avatar

期数管理bug

parent 1af2d454
......@@ -215,6 +215,7 @@
this.newDialog.show = true;
},
onEdit(row){
console.log('onEdit', row);
let weekList = [];
if(row.rest_week_day){
row.rest_week_day.split(',').forEach((val)=>{
......@@ -234,7 +235,8 @@
title: row.title,
goods_id: row.goods_id,
rest_week_day: weekList,
teacher_ids: teacherList
teacher_ids: teacherList,
course_id: row.course_id
}
this.newDialog.title = '编辑期数';
this.newDialog.show = true;
......
......@@ -263,8 +263,6 @@
this.form.start_num=''
getLessonDetailApi(id,{}).then((res) => {
this.itemOptions = res.detail[res.type]
console.log('getLessonDetail id', id)
console.log('getLessonDetailthis.itemOptions', this.itemOptions)
})
},
getGoodsOption(){
......@@ -282,9 +280,8 @@
this.form = this.dialogObj.form;
this.getTeachers();
this.getGoodsOption();
console.log('this.dialogObj.form', this.dialogObj.form)
if(this.dialogObj.form.goods_id){
this.getLessonDetail(this.dialogObj.form.goods_id);
if(this.dialogObj.form.course_id){
this.getLessonDetail(this.dialogObj.form.course_id);
}
this.teacherList = this.dialogObj.form.teacher_ids;
}
......
......@@ -32,11 +32,12 @@
</el-table-column>
<el-table-column
label="用户信息"
min-width="140"
className="userInfo"
>
<template slot-scope="scope">
id:{{scope.row.user_id}}
<br>
名称:{{scope.row.user_nickname}}
<img class="avatar" :src="scope.row.user_avatar">
{{scope.row.user_nickname}}(ID:{{scope.row.user_id}})
</template>
</el-table-column>
<el-table-column
......@@ -172,4 +173,17 @@
.refund{
padding: 20px 0;
}
.avatar {
width:50px;
height: 50px;
border-radius: 50%;
}
</style>
<style>
.userInfo >div{
display: flex;
flex-flow: row nowrap;
justify-content: flex-start;
align-items: center;
}
</style>
......@@ -31,9 +31,12 @@
<a v-else-if="scope.row.type === 'image' && scope.row.content" :href="scope.row.content" target="_blank">
<img class="shotcut" :src="scope.row.content">
</a>
<div v-else-if="scope.row.variable">
<div v-else-if="scope.row.type === 'image' && scope.row.variable">
老师二维码
</div>
<div v-else-if="scope.row.type === 'news'">
图文消息
</div>
</template>
</el-table-column>
<el-table-column
......@@ -148,8 +151,10 @@
return '文字'
} else if(value === 'image') {
return '图片'
} else if(value === 'news'){
return '图文'
} else {
return val
return val
}
},
contentFilter(row){
......
......@@ -8,8 +8,11 @@
<div class="content">
<div class="inner" v-loading="loading">
<ul class="weui-desktop-msg-sender__tabs">
<li class="weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_text" :class="type === 'news' ? 'weui-desktop-msg-sender__tab_selected' : ''" @click="type = 'news'">图文</li>
<li class="weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_text" :class="type === 'text' ? 'weui-desktop-msg-sender__tab_selected' : ''" @click="type = 'text'">文字</li>
<li class="weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_img" :class="type === 'image' ? 'weui-desktop-msg-sender__tab_selected' : ''" @click="type = 'image'">图片</li>
<li class="weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_img" :class="type === 'voice' ? 'weui-desktop-msg-sender__tab_selected' : ''" @click="type = 'voice'">语音</li>
<li class="weui-desktop-msg-sender__tab weui-desktop-msg-sender__tab_img" :class="type === 'video' ? 'weui-desktop-msg-sender__tab_selected' : ''" @click="type = 'video'">视频</li>
</ul>
<div class="inner-bottom">
<div class="img-action" v-if="type === 'image'">
......@@ -50,6 +53,119 @@
<page :total="total" v-model="nowPage" :limit="limit" @pageChange="onPageChange"/>
</div>
</div>
<div class="img-action" v-if="type === 'news'">
<template v-if="newsContent && newsContent.content">
<div class="news-media">
<div v-for="(child, childIndex) in newsContent.content.news_item" style="position: relative">
<div v-if="newsContent.content.news_item.length === 1" class="single-cover">
<div class="title">{{child.title}}</div>
<img :src="child.thumb_url" style="width: 100%;margin-top: 20px;"/>
<div class="digest">{{child.digest}}</div>
<a class="preview" :href="child.url" target="_blank">
预览文章
</a>
</div>
<div v-else-if="newsContent.content.news_item.length > 1" class="clear-both bottomCover" style="position: relative">
<div v-if="childIndex === 0" class="muti-cover">
<img style="width: 100%;margin-top: 20px;" :src="child.thumb_url"/>
<div class="bottom-title">{{child.title}}</div>
</div>
<div class="next-cover clear-both" v-else>
<span class="next-title">{{child.title}}</span>
<img class="next-img" :src="child.thumb_url"/>
</div>
<a class="preview" :href="child.url" target="_blank">
预览文章
</a>
</div>
</div>
</div>
</template>
<div class="display-b">
<div class="img-create-access" v-if="!showMedia">
<a href="javascript:;" class="img-create-access__link" @click="getMediaList(type)">从素材库中选择</a>
</div>
</div>
<div v-if="showMedia && mediaList.length > 0">
<el-table
:data="mediaList"
@row-click="onChooseMedia"
style="width: 100%">
<el-table-column
prop="name"
label="名称">
</el-table-column>
<el-table-column
prop="media_id"
label="mediaId">
</el-table-column>
<el-table-column
label="URL"
className="news-media">
<template slot-scope="scope">
<!--<a :href="scope.row.url" target="_blank">-->
<!--<img style="width: 60px;" :src="scope.row.url"/>-->
<!--</a>-->
<div v-for="(child, childIndex) in scope.row.content.news_item" style="position: relative">
<div v-if="scope.row.content.news_item.length === 1" class="single-cover">
<div class="title">{{child.title}}</div>
<img :src="child.thumb_url" style="width: 100%;margin-top: 20px;"/>
<div class="digest">{{child.digest}}</div>
<a class="preview" :href="child.url" target="_blank">
预览文章
</a>
</div>
<div v-else-if="scope.row.content.news_item.length > 1" class="clear-both bottomCover" style="position: relative">
<div v-if="childIndex === 0" class="muti-cover">
<img style="width: 100%;margin-top: 20px;" :src="child.thumb_url"/>
<div class="bottom-title">{{child.title}}</div>
</div>
<div class="next-cover clear-both" v-else>
<span class="next-title">{{child.title}}</span>
<img class="next-img" :src="child.thumb_url"/>
</div>
<a class="preview" :href="child.url" target="_blank">
预览文章
</a>
</div>
</div>
</template>
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage" :limit="limit" @pageChange="onPageChange"/>
</div>
</div>
<div class="img-action" v-if="type === 'voice' || type === 'video'">
<div class="display-b">
<div class="img-create-access" v-if="!showMedia">
<a href="javascript:;" class="img-create-access__link" @click="getMediaList(type)">从素材库中选择</a>
</div>
</div>
<div v-if="showMedia && mediaList.length > 0">
<el-table
:data="mediaList"
@row-click="onChooseMedia"
style="width: 100%">
<el-table-column
prop="name"
label="名称">
</el-table-column>
<el-table-column
prop="media_id"
label="mediaId">
</el-table-column>
<el-table-column
label="URL">
<template slot-scope="scope">
<a :href="scope.row.url" target="_blank">
<img style="width: 60px;" :src="scope.row.url"/>
</a>
</template>
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage" :limit="limit" @pageChange="onPageChange"/>
</div>
</div>
<div class="inner-emotion_editor" v-else-if="type === 'text'">
<div class="inner-edit_area">
<el-input
......@@ -107,7 +223,7 @@
showEmotion: false,
total:0,
nowPage:1,
limit: 5,
limit: 3,
id: null,
list: [],
index: -1,
......@@ -118,6 +234,7 @@
},
content: '',
imageContent: '',
newsContent: '',
type: 'text',
mediaList: [],
mediaListMock: [],
......@@ -228,6 +345,19 @@
} else {
_desc.push(this.imageContent)
}
} else if (this.type === 'news') {
if (!this.newsContent) {
this.$message({
showClose: true,
message: '请选择图文'
});
return
}
if (this.index > -1) {
_desc[this.index] = this.newsContent
} else {
_desc.push(this.newsContent)
}
}
json.desc = JSON.stringify(_desc)
if (this.id) {
......@@ -282,7 +412,11 @@
})
},
onChooseMedia(val){
this.addContent(this.type, val.url, val.media_id);
if(this.type === 'news') {
this.addContent(this.type, val.content, val.media_id);
} else {
this.addContent(this.type, val.url, val.media_id);
}
this.showMedia = false;
},
addTeacherQrcode(){
......@@ -302,7 +436,12 @@
if (mediaId) {
obj.media_id = mediaId;
}
this.imageContent = obj
if (type === 'news') {
this.newsContent = obj
} else {
this.imageContent = obj
}
}
}
}
......@@ -465,4 +604,85 @@
border: 1px dashed #666;
margin-bottom: 10px;
}
.news-media {
padding: 10px;
width: 300px;
}
.news-media img{
width: 100%;
}
.s-news img {
width: 50px;
float: right;
}
.title {
font-size: 16px;
font-weight: 400;
display: block;
line-height: 1.2;
color: #353535;
}
.digest {
padding-top: 12px;
color: #9A9A9A;
font-size: 14px;
}
.single-cover {
/*padding: 20px 15px 15px;*/
}
.muti-cover {
position: relative;
padding: 20px 15px 0 15px;
}
.bottom-title {
color: #FFFFFF;
background-color: rgba(0, 0, 0, 0.55);
position: absolute;
left: 15px;
right: 15px;
bottom: 0;
padding: 8px 12px;
}
.next-cover {
padding: 12px 15px;
position: relative;
}
.next-img {
float: right;
margin-left: 12px;
width: 60px !important;
height: 60px !important;
}
.next-title {
overflow: hidden;
font-weight: 400;
word-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
color: #353535;
}
.single-cover:hover .preview,.bottomCover:hover .preview{
display: flex;
justify-content: center;
align-items: center;
color: #fff;
}
.preview {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
text-decoration: none;
}
</style>
<style>
.clear-both:after{
content: '';
display: block;
clear: both;
}
</style>
......@@ -26,7 +26,7 @@
<div class="progress" v-if="showProgress">
<el-progress :percentage="progress" status="success"></el-progress>
</div>
<div class="media-panel-top-right">
<div class="media-panel-top-right" v-if="type !== 'news'">
<el-upload
class="upload-demo"
ref="upload"
......@@ -40,7 +40,7 @@
</el-upload>
</div>
</div>
<div v-if="mediaList.length > 0 && type === 'news'" class="d-start">
<div v-if="mediaList.length > 0 && type === 'news'" class="d-start" style="margin-bottom: 20px">
<div v-for="(item,index) in mediaList" :key="index" class="news-media">
<el-card :body-style="{ padding: '0px' }">
<div v-for="(child, childIndex) in item.content.news_item" style="position: relative">
......@@ -69,6 +69,7 @@
</el-card>
</div>
</div>
<page v-if="mediaList.length > 0 && type === 'news'" :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<div v-if="mediaList.length > 0 && type !== 'news'">
<el-table
:data="mediaList"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment