Commit e8bc5fc7 authored by 王's avatar

期数管理bug

parent 1af2d454
...@@ -215,6 +215,7 @@ ...@@ -215,6 +215,7 @@
this.newDialog.show = true; this.newDialog.show = true;
}, },
onEdit(row){ onEdit(row){
console.log('onEdit', row);
let weekList = []; let weekList = [];
if(row.rest_week_day){ if(row.rest_week_day){
row.rest_week_day.split(',').forEach((val)=>{ row.rest_week_day.split(',').forEach((val)=>{
...@@ -234,7 +235,8 @@ ...@@ -234,7 +235,8 @@
title: row.title, title: row.title,
goods_id: row.goods_id, goods_id: row.goods_id,
rest_week_day: weekList, rest_week_day: weekList,
teacher_ids: teacherList teacher_ids: teacherList,
course_id: row.course_id
} }
this.newDialog.title = '编辑期数'; this.newDialog.title = '编辑期数';
this.newDialog.show = true; this.newDialog.show = true;
......
...@@ -263,8 +263,6 @@ ...@@ -263,8 +263,6 @@
this.form.start_num='' this.form.start_num=''
getLessonDetailApi(id,{}).then((res) => { getLessonDetailApi(id,{}).then((res) => {
this.itemOptions = res.detail[res.type] this.itemOptions = res.detail[res.type]
console.log('getLessonDetail id', id)
console.log('getLessonDetailthis.itemOptions', this.itemOptions)
}) })
}, },
getGoodsOption(){ getGoodsOption(){
...@@ -282,9 +280,8 @@ ...@@ -282,9 +280,8 @@
this.form = this.dialogObj.form; this.form = this.dialogObj.form;
this.getTeachers(); this.getTeachers();
this.getGoodsOption(); this.getGoodsOption();
console.log('this.dialogObj.form', this.dialogObj.form) if(this.dialogObj.form.course_id){
if(this.dialogObj.form.goods_id){ this.getLessonDetail(this.dialogObj.form.course_id);
this.getLessonDetail(this.dialogObj.form.goods_id);
} }
this.teacherList = this.dialogObj.form.teacher_ids; this.teacherList = this.dialogObj.form.teacher_ids;
} }
......
...@@ -32,11 +32,12 @@ ...@@ -32,11 +32,12 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="用户信息" label="用户信息"
min-width="140"
className="userInfo"
> >
<template slot-scope="scope"> <template slot-scope="scope">
id:{{scope.row.user_id}} <img class="avatar" :src="scope.row.user_avatar">
<br> {{scope.row.user_nickname}}(ID:{{scope.row.user_id}})
名称:{{scope.row.user_nickname}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -172,4 +173,17 @@ ...@@ -172,4 +173,17 @@
.refund{ .refund{
padding: 20px 0; 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> </style>
...@@ -31,9 +31,12 @@ ...@@ -31,9 +31,12 @@
<a v-else-if="scope.row.type === 'image' && scope.row.content" :href="scope.row.content" target="_blank"> <a v-else-if="scope.row.type === 'image' && scope.row.content" :href="scope.row.content" target="_blank">
<img class="shotcut" :src="scope.row.content"> <img class="shotcut" :src="scope.row.content">
</a> </a>
<div v-else-if="scope.row.variable"> <div v-else-if="scope.row.type === 'image' && scope.row.variable">
老师二维码 老师二维码
</div> </div>
<div v-else-if="scope.row.type === 'news'">
图文消息
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -148,8 +151,10 @@ ...@@ -148,8 +151,10 @@
return '文字' return '文字'
} else if(value === 'image') { } else if(value === 'image') {
return '图片' return '图片'
} else if(value === 'news'){
return '图文'
} else { } else {
return val return val
} }
}, },
contentFilter(row){ contentFilter(row){
......
...@@ -8,8 +8,11 @@ ...@@ -8,8 +8,11 @@
<div class="content"> <div class="content">
<div class="inner" v-loading="loading"> <div class="inner" v-loading="loading">
<ul class="weui-desktop-msg-sender__tabs"> <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_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 === '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> </ul>
<div class="inner-bottom"> <div class="inner-bottom">
<div class="img-action" v-if="type === 'image'"> <div class="img-action" v-if="type === 'image'">
...@@ -50,6 +53,119 @@ ...@@ -50,6 +53,119 @@
<page :total="total" v-model="nowPage" :limit="limit" @pageChange="onPageChange"/> <page :total="total" v-model="nowPage" :limit="limit" @pageChange="onPageChange"/>
</div> </div>
</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-emotion_editor" v-else-if="type === 'text'">
<div class="inner-edit_area"> <div class="inner-edit_area">
<el-input <el-input
...@@ -107,7 +223,7 @@ ...@@ -107,7 +223,7 @@
showEmotion: false, showEmotion: false,
total:0, total:0,
nowPage:1, nowPage:1,
limit: 5, limit: 3,
id: null, id: null,
list: [], list: [],
index: -1, index: -1,
...@@ -118,6 +234,7 @@ ...@@ -118,6 +234,7 @@
}, },
content: '', content: '',
imageContent: '', imageContent: '',
newsContent: '',
type: 'text', type: 'text',
mediaList: [], mediaList: [],
mediaListMock: [], mediaListMock: [],
...@@ -228,6 +345,19 @@ ...@@ -228,6 +345,19 @@
} else { } else {
_desc.push(this.imageContent) _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) json.desc = JSON.stringify(_desc)
if (this.id) { if (this.id) {
...@@ -282,7 +412,11 @@ ...@@ -282,7 +412,11 @@
}) })
}, },
onChooseMedia(val){ 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; this.showMedia = false;
}, },
addTeacherQrcode(){ addTeacherQrcode(){
...@@ -302,7 +436,12 @@ ...@@ -302,7 +436,12 @@
if (mediaId) { if (mediaId) {
obj.media_id = mediaId; obj.media_id = mediaId;
} }
this.imageContent = obj if (type === 'news') {
this.newsContent = obj
} else {
this.imageContent = obj
}
} }
} }
} }
...@@ -465,4 +604,85 @@ ...@@ -465,4 +604,85 @@
border: 1px dashed #666; border: 1px dashed #666;
margin-bottom: 10px; 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> </style>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div class="progress" v-if="showProgress"> <div class="progress" v-if="showProgress">
<el-progress :percentage="progress" status="success"></el-progress> <el-progress :percentage="progress" status="success"></el-progress>
</div> </div>
<div class="media-panel-top-right"> <div class="media-panel-top-right" v-if="type !== 'news'">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="upload" ref="upload"
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</el-upload> </el-upload>
</div> </div>
</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"> <div v-for="(item,index) in mediaList" :key="index" class="news-media">
<el-card :body-style="{ padding: '0px' }"> <el-card :body-style="{ padding: '0px' }">
<div v-for="(child, childIndex) in item.content.news_item" style="position: relative"> <div v-for="(child, childIndex) in item.content.news_item" style="position: relative">
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
</el-card> </el-card>
</div> </div>
</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'"> <div v-if="mediaList.length > 0 && type !== 'news'">
<el-table <el-table
:data="mediaList" :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