Commit be3bbbef authored by 王's avatar

bug fix

parent 01aa8dc9
This diff is collapsed.
This diff is collapsed.
...@@ -9,13 +9,15 @@ ...@@ -9,13 +9,15 @@
<el-form ref="form" :model="form" :rules="rules" > <el-form ref="form" :model="form" :rules="rules" >
<el-row> <el-row>
<el-col :span="4"><label>不上课日期</label></el-col> <el-col :span="4"><label>不上课日期</label></el-col>
<el-col :span="8"> <el-col :span="20">
<el-form-item> <el-form-item>
<el-date-picker <el-date-picker
style="width: 100%"
v-model="noLessonDate" v-model="noLessonDate"
type="date" type="dates"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:picker-options="pickerOptions1"
placeholder="选择日期"> placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -51,11 +53,16 @@ ...@@ -51,11 +53,16 @@
value:'no_lesson_date', value:'no_lesson_date',
desc:[] desc:[]
}, },
noLessonDate: '', noLessonDate: [],
rules:{ rules:{
noLessonDate:[ noLessonDate:[
{ required: true, message: '请选择日期', trigger: 'change' } { required: true, message: '请选择日期', trigger: 'change' }
] ]
},
pickerOptions1: {
disabledDate(time) {
return !(time.getTime() > Date.now());
}
} }
} }
}, },
...@@ -64,7 +71,7 @@ ...@@ -64,7 +71,7 @@
}, },
methods:{ methods:{
save(){ save(){
if(!this.noLessonDate){ if(this.noLessonDate.length === 0){
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请选择不上课时间!' message: '请选择不上课时间!'
...@@ -76,17 +83,9 @@ ...@@ -76,17 +83,9 @@
value: this.form.value value: this.form.value
} }
let _desc = this.form.desc || []; let _desc = this.form.desc || [];
let index = _desc.findIndex((val)=>{ if (this.noLessonDate.length > 0) {
return val === this.noLessonDate _desc = _desc.concat(this.noLessonDate)
}) _desc = this.dedupe(_desc)
if (index === -1){
_desc.push(this.noLessonDate);
} else {
this.$message({
type: 'error',
message: '日期不能重复添加!'
});
return;
} }
json.desc = JSON.stringify(_desc); json.desc = JSON.stringify(_desc);
...@@ -96,6 +95,7 @@ ...@@ -96,6 +95,7 @@
type: 'success', type: 'success',
message: '新增成功!' message: '新增成功!'
}); });
this.noLessonDate = _desc
this.$emit("reflash"); this.$emit("reflash");
this.show = false; this.show = false;
}) })
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
type: 'success', type: 'success',
message: '新增成功!' message: '新增成功!'
}); });
this.noLessonDate = _desc
this.$emit("reflash"); this.$emit("reflash");
this.show = false; this.show = false;
}) })
...@@ -118,7 +119,11 @@ ...@@ -118,7 +119,11 @@
} }
this.title = this.dialogObj.title; this.title = this.dialogObj.title;
this.form.desc = this.dialogObj.desc; this.form.desc = this.dialogObj.desc;
this.loading = false this.noLessonDate = this.form.desc;
this.loading = false
},
dedupe(array){
return Array.from(new Set(array));
} }
}, },
watch:{ watch:{
......
...@@ -67,7 +67,12 @@ ...@@ -67,7 +67,12 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="18"> <el-col :span="6">
<el-form-item label="收件人手机号">
<el-input v-model="searchFrom.receive_mobile"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="购买时间"> <el-form-item label="购买时间">
<el-date-picker <el-date-picker
v-model="searchFrom.payTime" v-model="searchFrom.payTime"
...@@ -190,7 +195,7 @@ ...@@ -190,7 +195,7 @@
import detailDialog from './detail' import detailDialog from './detail'
import AddressArray from '../framework/address-picker/addr' import AddressArray from '../framework/address-picker/addr'
import {INVITETYPE,ORDERSTATUS,BUYTYPE,BUYTYPEOPTION,ORDERSTATUSOPTION,INVITETYPEOPTION} from "../../util/wordbook"; import {INVITETYPE,ORDERSTATUS,BUYTYPE,BUYTYPEOPTION,ORDERSTATUSOPTION,INVITETYPEOPTION} from "../../util/wordbook";
import CommonJs from '../../util/common'; import {dateFmt} from '../../util/common';
export default { export default {
name: 'index', name: 'index',
...@@ -284,10 +289,13 @@ ...@@ -284,10 +289,13 @@
if (this.searchFrom.out_trade_no) { if (this.searchFrom.out_trade_no) {
json.out_trade_no = this.searchFrom.out_trade_no json.out_trade_no = this.searchFrom.out_trade_no
} }
if (this.searchFrom.receive_mobile) {
json.receive_mobile = this.searchFrom.receive_mobile
}
if(this.searchFrom.payTime && this.searchFrom.payTime.length > 0){ if(this.searchFrom.payTime && this.searchFrom.payTime.length > 0){
console.log('this.searchFrom.payTime') console.log('this.searchFrom.payTime')
json.pay_start_at = CommonJs.dateFmt(this.searchFrom.payTime[0],"yyyy-MM-dd hh:mm:ss") json.pay_start_at = dateFmt(this.searchFrom.payTime[0],"yyyy-MM-dd hh:mm:ss")
json.pay_end_at = CommonJs.dateFmt(this.searchFrom.payTime[1],"yyyy-MM-dd hh:mm:ss") json.pay_end_at = dateFmt(this.searchFrom.payTime[1],"yyyy-MM-dd hh:mm:ss")
} }
getOrderListApi(json).then((res)=>{ getOrderListApi(json).then((res)=>{
this.tableData = res.list this.tableData = res.list
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<label>分类</label> <label>标签</label>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="20">
<el-form-item> <el-form-item>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4" :offset="8">
<el-form-item> <el-form-item>
<el-button type="success" plain size="small" @click="onAdd" v-if="!$store.state.readonly"> <el-button type="success" plain size="small" @click="onAdd" v-if="!$store.state.readonly">
添加单品 添加单品
......
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<label>二维码:</label> <label>二维码:</label>
<img class="avatar" :src="detail.qr"/> <a :href="detail.qr">
<img class="avatar" :src="detail.qr"/>
</a>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -50,26 +52,45 @@ ...@@ -50,26 +52,45 @@
label="创建时间"> label="创建时间">
</el-table-column> </el-table-column>
</el-table> </el-table>
<page :total="total" :limit="limit" @pageChange="onPageChange"/>
</div> </div>
</template> </template>
<script> <script>
import {getTeacherDetailApi} from "../../service/api"; import {getTeacherDetailApi} from "../../service/api";
import {TEACHERTYPE} from "../../util/wordbook"; import {TEACHERTYPE} from "../../util/wordbook";
import page from '../framework/page'
export default { export default {
name: "index", name: "index",
components:{
page
},
data(){ data(){
return { return {
list:[], list:[],
id: '', id: '',
detail: {} detail: {},
total: 0,
limit: 10,
nowPage: 1
} }
}, },
methods:{ methods:{
onPageChange(val){
this.nowPage = val
this.getTeacherDetail()
},
getTeacherDetail(){ getTeacherDetail(){
let id = this.id; let id = this.id;
getTeacherDetailApi(id).then((res)=>{ let json = {
this.list = res.class_list || []; limit: this.limit,
page: this.nowPage
}
getTeacherDetailApi(id, json).then((res)=>{
if (res.class_list) {
this.list = res.class_list.list || [];
this.total = res.class_list.total;
}
this.detail = res; this.detail = res;
}) })
} }
...@@ -91,7 +112,7 @@ import {TEACHERTYPE} from "../../util/wordbook"; ...@@ -91,7 +112,7 @@ import {TEACHERTYPE} from "../../util/wordbook";
padding: 20px 0; padding: 20px 0;
} }
.avatar { .avatar {
width: 60px; width: 80px;
} }
.header { .header {
padding: 0 20px; padding: 0 20px;
......
...@@ -63,18 +63,11 @@ ...@@ -63,18 +63,11 @@
label="最后登录时间"> label="最后登录时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" label="操作">
width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" plain type="warning" v-if="!$store.state.readonly" @click="bindTeacher(scope.row)"> <el-button size="mini" plain type="primary" @click="goToDetail(scope.row.user_id)">
绑定老师
</el-button>
<el-button size="mini" plain type="primary" @click="detail(scope.row)">
查看详情 查看详情
</el-button> </el-button>
<el-button size="mini" plain type="primary" @click="goToOrder(scope.row.user_id)">
购买记录
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -165,8 +158,8 @@ ...@@ -165,8 +158,8 @@
teacher_id: data.teacher_id teacher_id: data.teacher_id
} }
}, },
goToOrder(id){ goToDetail(id){
this.$router.push('/userOrder/'+ id); this.$router.push('/userDetail/'+ id);
} }
} }
} }
......
<template>
<el-dialog
:title="dialogObj.title"
:visible.sync="dialogObj.show"
>
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="老师">
<el-select v-model="form.teacher_id" placeholder="请选择">
<el-option
v-for="(data,index) in teacherList"
:key="index"
:label="data.name"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogObj.show = false">取 消</el-button>
<el-button type="primary" @click="onSave">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {getTeacherListApi,addRelatedTeacherApi} from "../../service/api";
export default {
props:[
'dialogObj'
],
data(){
return{
form:{
id: '',
teacher_id:'',
},
teacherList:[],
}
},
methods:{
initPage(){
getTeacherListApi().then(res=>{
this.teacherList = res.list
});
this.form = {
id: this.dialogObj.id,
teacher_id: this.dialogObj.teacher_id ? this.dialogObj.teacher_id : ''
};
},
onSave(){
let json = {
teacher_id: this.form.teacher_id ? this.form.teacher_id : 0
};
addRelatedTeacherApi(this.form.id, json).then(res => {
this.$message({
type: 'success',
message: '绑定成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
})
}
},
watch:{
'dialogObj'(value){
this.initPage()
}
}
}
</script>
<style scoped>
</style>
<template> <template>
<div class="user"> <div class="user">
<div class="header">
<div class="clear-both" style="margin-top: 20px" v-if="detail">
<el-button size="mini" plain type="success" v-if="!$store.state.readonly" @click="bindTeacher" style="float: right">
绑定老师
</el-button>
</div>
<el-row>
<el-col :span="6">
<label>昵称:</label>
<a :href="detail.qr">
<img class="avatar" :src="detail.avatar"/>
</a>
{{detail.nickname}}
</el-col>
<el-col :span="6">
<label>手机号:</label> {{detail.mobile}}
</el-col>
<el-col :span="6">
<label>生日:</label>{{detail.birthday}}
</el-col>
<el-col :span="6">
<label>等级:</label>{{detail.level}}
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<label>老师ID:</label>{{detail.teacher_id}}
</el-col>
<el-col :span="6">
<label>邀请类型:</label>{{detail.invite_type | inviteType}}
</el-col>
<el-col :span="6">
<label>邀请人ID:</label>{{detail.invite_user_id}}
</el-col>
<el-col :span="6">
<label>邀请码:</label>{{detail.invite_code}}
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<label>注册时间:</label>{{detail.created_at}}
</el-col>
<el-col :span="6">
<label>最后登录:</label>{{detail.last_login_at}}
</el-col>
</el-row>
</div>
<div class="b-title">期数列表</div>
<el-table
:data="periodList"
style="width: 100%">
<el-table-column
prop="id"
label="ID">
</el-table-column>
<el-table-column
prop="periods_title"
label="期数名称">
</el-table-column>
<el-table-column
label="开课权限">
<template slot-scope="scope">
{{scope.row.is_view_course === 1 ? '开' : '关'}}
</template>
</el-table-column>
<el-table-column
label="老师">
<template slot-scope="scope">
<img class="avatar" :src="scope.row.teacher_qr"> {{scope.row.teacher_name}}
</template>
</el-table-column>
<el-table-column
prop="join_num"
label="加入人数">
</el-table-column>
<el-table-column
prop="max_join_num"
label="最大加入人数">
</el-table-column>
<el-table-column
prop="start_at"
label="开课时间">
</el-table-column>
<el-table-column
prop="created_at"
label="创建时间">
</el-table-column>
</el-table>
<div class="b-title">订单列表</div>
<el-table <el-table
:data="userList" :data="userList"
style="width: 100%"> style="width: 100%">
...@@ -66,14 +155,16 @@ ...@@ -66,14 +155,16 @@
label="创建时间"> label="创建时间">
</el-table-column> </el-table-column>
</el-table> </el-table>
<page :total="total" v-model="nowPage"/> <page :total="total" :limit="limit" @pageChange="onPageChange"/>
<teacher-dialog :dialogObj="dialogObj" @reflash="getDetail"></teacher-dialog>
</div> </div>
</template> </template>
<script> <script>
import {getOrderListApi} from "../../service/api"; import {getOrderListApi,getUserDetailApi} from "../../service/api";
import page from '../framework/page' import page from '../framework/page'
import {INVITETYPE,ORDERSTATUS,BUYTYPE} from "../../util/wordbook"; import {INVITETYPE,ORDERSTATUS,BUYTYPE} from "../../util/wordbook";
import teacherDialog from './dialog'
export default { export default {
name: "index", name: "index",
data(){ data(){
...@@ -81,25 +172,60 @@ ...@@ -81,25 +172,60 @@
userList:[], userList:[],
total:0, total:0,
nowPage:1, nowPage:1,
id: '' limit: 3,
id: '',
detail: {},
periodList: [],
dialogObj:{
show:false,
title:'绑定老师',
id:0,
teacher_id: 0
}
} }
}, },
components:{ components:{
page page,
teacherDialog
}, },
mounted(){ mounted(){
this.id = this.$route.params.id; this.id = this.$route.params.id;
this.getDetail()
this.getUser() this.getUser()
}, },
methods:{ methods:{
onPageChange(val){
this.nowPage = val;
this.getUser();
},
getUser(){ getUser(){
let json = { let json = {
user_id: this.id user_id: this.id,
limit: this.limit,
page: this.nowPage
} }
getOrderListApi(json).then(res=>{ getOrderListApi(json).then(res=>{
this.userList = res.list; this.userList = res.list;
this.total = res.total this.total = res.total
}) })
},
getDetail(){
if(!this.id) return;
getUserDetailApi(this.id).then(res=>{
this.detail = res
if (res.periods_list) {
this.periodList = res.periods_list
}
})
},
bindTeacher(){
let data = this.detail
this.dialogObj = {
show:true,
title:'绑定老师',
id:data.user_id,
teacher_id: data.teacher_id
}
} }
}, },
filters:{ filters:{
...@@ -129,13 +255,51 @@ ...@@ -129,13 +255,51 @@
@import "../../util/public"; @import "../../util/public";
.avatar { .avatar {
width: 50px; width: 50px;
border-radius: 50%;
} }
.user{ .user{
height: 100%; height: 100%;
overflow: auto; overflow: auto;
padding: 20px 0; /*padding: 20px 0;*/
.btn-content{ .btn-content{
text-align: center; text-align: center;
} }
} }
.header {
padding: 0 20px;
margin-bottom: 20px;
}
.header {
.el-row {
display: flex;
justify-content: flex-start;
align-items: center;
color: #666;
font-size: 16px;
margin: 25px 0;
label{
margin-right: 10px;
}
}
.avatar {
margin-right: 10px;
}
}
.el-col{
/*height: 50px;*/
display: flex;
justify-content: flex-start;
align-items: center;
img{
width: 50px;
border-radius: 100px;
}
label{
color: #5982e6;
}
}
.b-title {
padding: 20px;
color: #666;
}
</style> </style>
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
}, },
addContent(type, content, mediaId) { addContent(type, content, mediaId) {
let _form = this.form; let _form = this.form;
let _desc = JSON.parse(_form.desc); let _desc = _form.desc ? JSON.parse(_form.desc) : [];
let obj = {}; let obj = {};
if (content) { if (content) {
obj = { obj = {
......
...@@ -4,9 +4,14 @@ ...@@ -4,9 +4,14 @@
<span class="title">自动回复</span> <span class="title">自动回复</span>
<el-button type="success" plain style="float: right" @click="add" v-if="!$store.state.readonly">添加回复</el-button> <el-button type="success" plain style="float: right" @click="add" v-if="!$store.state.readonly">添加回复</el-button>
</div> </div>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="新用户" name="focus_reply_new"></el-tab-pane>
<el-tab-pane label="无课用户" name="focus_reply_no_course"></el-tab-pane>
<el-tab-pane label="有课用户" name="focus_reply_course"></el-tab-pane>
</el-tabs>
<el-table <el-table
:data="list" :data="list"
style="width: 100%" style="width: 100%;"
max-height="800"> max-height="800">
<el-table-column <el-table-column
fixed fixed
...@@ -68,7 +73,7 @@ ...@@ -68,7 +73,7 @@
<script> <script>
import dialogCom from './focusReplyDialog' import dialogCom from './focusReplyDialog'
import {updateConfigApi,saveConfigApi,getMediaListApi,getConfigListApi} from "../../service/api"; import {updateConfigApi,saveConfigApi,getConfigListApi} from "../../service/api";
import page from '../framework/page' import page from '../framework/page'
export default { export default {
name: "focusReply", name: "focusReply",
...@@ -77,11 +82,13 @@ ...@@ -77,11 +82,13 @@
loading:false, loading:false,
total:0, total:0,
nowPage:1, nowPage:1,
limit: 10,
activeName: 'focus_reply_new',
id: null, id: null,
list: [], list: [],
form:{ form:{
key:'focus_reply', key:'focus_reply_new',
value:'focus_reply', value:'focus_reply_new',
desc:'' desc:''
}, },
content: '', content: '',
...@@ -150,6 +157,18 @@ ...@@ -150,6 +157,18 @@
} }
}, },
methods:{ methods:{
handleClick(tab) {
console.log(tab.name);
this.form = {
key:tab.name,
value:tab.name,
desc:''
}
this.nowPage = 1;
this.getList();
this.id='';
},
save(){ save(){
let json = this.form let json = this.form
let _desc = []; let _desc = [];
...@@ -192,31 +211,6 @@ ...@@ -192,31 +211,6 @@
}) })
} }
}, },
getMediaList(type){
let json = {
type: type,
page: this.nowPage
};
this.loading = true;
getMediaListApi(json).then(res=>{
this.loading = false;
this.type = type;
this.total = res.total_count;
if (res.item.length === 0 ) {
this.$message({
showClose: true,
message: '暂无数据'
});
this.showMedia = false;
} else {
this.showMedia = true;
this.mediaList = res.item;
}
}).catch(() => {
this.loading = false;
this.showMedia = false;
})
},
onChooseMedia(val){ onChooseMedia(val){
this.addContent(this.type, val.url, val.media_id); this.addContent(this.type, val.url, val.media_id);
this.showMedia = false; this.showMedia = false;
...@@ -235,22 +229,13 @@ ...@@ -235,22 +229,13 @@
this.imageContent = obj this.imageContent = obj
}, },
getList(){ getList(){
getConfigListApi({key: 'focus_reply'}).then(res => { getConfigListApi({key: this.form.key}).then(res => {
if (res.list.length > 0) { if (res.list.length > 0) {
this.id = res.list[0].id; this.id = res.list[0].id;
console.log('res.list[0].desc', res.list[0].desc)
let _desc = JSON.parse(res.list[0].desc); let _desc = JSON.parse(res.list[0].desc);
this.list = _desc || []; this.list = _desc || [];
// this.type = _desc[0].type; } else {
// if (this.type === 'text') { this.list = []
// this.content = _desc[0].content
// } else if (this.type === 'image') {
// this.imageContent = {
// type: 'image',
// content: _desc[0].content,
// media_id: _desc[0].media_id
// }
// }
} }
}) })
}, },
...@@ -259,7 +244,9 @@ ...@@ -259,7 +244,9 @@
show: true, show: true,
id: this.id ? this.id : null, id: this.id ? this.id : null,
index: -1, index: -1,
list: this.list list: this.list,
key: this.form.key,
value: this.form.value
} }
}, },
editRow(index, row){ editRow(index, row){
...@@ -267,15 +254,17 @@ ...@@ -267,15 +254,17 @@
show: true, show: true,
id: this.id, id: this.id,
index: index, index: index,
list: this.list list: this.list,
key: this.form.key,
value: this.form.value
} }
}, },
deleteRow(index , list){ deleteRow(index , list){
let desc = list; let desc = list;
desc.splice(index,1); desc.splice(index,1);
let json = { let json = {
key: 'focus_reply', key: this.form.key,
value: 'focus_reply' value: this.form.value
} }
json.desc = JSON.stringify(desc) json.desc = JSON.stringify(desc)
this.$confirm('此操作将删除该文件, 是否继续?', '提示', { this.$confirm('此操作将删除该文件, 是否继续?', '提示', {
...@@ -304,8 +293,8 @@ ...@@ -304,8 +293,8 @@
this.list[second] = _first; this.list[second] = _first;
let desc = this.list; let desc = this.list;
let json = { let json = {
key: 'focus_reply', key: this.form.key,
value: 'focus_reply' value: this.form.value
} }
json.desc = JSON.stringify(desc) json.desc = JSON.stringify(desc)
updateConfigApi(this.id,json).then(res=>{ updateConfigApi(this.id,json).then(res=>{
...@@ -316,8 +305,8 @@ ...@@ -316,8 +305,8 @@
this.getList(); this.getList();
}) })
}, },
changeShow(){ changeShow(val){
this.dialogObj.show = false; this.dialogObj.show = val;
} }
} }
} }
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
<el-dialog <el-dialog
title="自动回复" title="自动回复"
center center
:visible.sync="show" :visible.sync="dialogObj.show"
:close="close"
width="800px"> width="800px">
<div class="focus-reply"> <div class="focus-reply">
<div class="content"> <div class="content">
...@@ -85,8 +84,8 @@ ...@@ -85,8 +84,8 @@
list: [], list: [],
index: -1, index: -1,
form:{ form:{
key:'focus_reply', key:'',
value:'focus_reply', value:'',
desc:'' desc:''
}, },
content: '', content: '',
...@@ -131,10 +130,11 @@ ...@@ -131,10 +130,11 @@
}, },
methods:{ methods:{
initDialog(){ initDialog(){
this.show = this.dialogObj.show;
if (this.dialogObj.id) { if (this.dialogObj.id) {
this.id = this.dialogObj.id; this.id = this.dialogObj.id;
} }
this.form.key=this.dialogObj.key;
this.form.value=this.dialogObj.value;
this.index = this.dialogObj.index this.index = this.dialogObj.index
this.list = this.dialogObj.list || [] this.list = this.dialogObj.list || []
if (this.index === -1) { if (this.index === -1) {
...@@ -172,15 +172,12 @@ ...@@ -172,15 +172,12 @@
type : this.type, type : this.type,
content: this.content content: this.content
}; };
console.log('index', this.index)
if (this.index > -1) { if (this.index > -1) {
_desc[this.index] = obj _desc[this.index] = obj
} else { } else {
_desc.push(obj) _desc.push(obj)
} }
console.log('save contennt _desc', _desc);
} else if (this.type === 'image') { } else if (this.type === 'image') {
console.log('image');
if (!this.imageContent) { if (!this.imageContent) {
this.$message({ this.$message({
showClose: true, showClose: true,
...@@ -194,7 +191,6 @@ ...@@ -194,7 +191,6 @@
_desc.push(this.imageContent) _desc.push(this.imageContent)
} }
} }
console.log('save contennt _desc', _desc);
json.desc = JSON.stringify(_desc) json.desc = JSON.stringify(_desc)
if (this.id) { if (this.id) {
updateConfigApi(this.id,json).then(res=>{ updateConfigApi(this.id,json).then(res=>{
...@@ -260,7 +256,7 @@ ...@@ -260,7 +256,7 @@
this.imageContent = obj this.imageContent = obj
}, },
getList(){ getList(){
getConfigListApi({key: 'focus_reply'}).then(res => { getConfigListApi({key: this.form.key}).then(res => {
if (res.total > 0) { if (res.total > 0) {
this.id = res.list[0].id; this.id = res.list[0].id;
let _desc = JSON.parse(res.list[0].desc); let _desc = JSON.parse(res.list[0].desc);
...@@ -275,7 +271,6 @@ ...@@ -275,7 +271,6 @@
media_id: _desc[0].media_id media_id: _desc[0].media_id
} }
} }
console.log('this.type', _desc)
} }
}) })
}, },
......
...@@ -19,9 +19,9 @@ const router =new Router({ ...@@ -19,9 +19,9 @@ const router =new Router({
component: e=>require(['@/components/main'],e), component: e=>require(['@/components/main'],e),
}, },
{ {
path: '/userOrder/:id', path: '/userDetail/:id',
name:'userOrder', name:'userDetail',
component: e=>require(['@/components/userOrder'],e), component: e=>require(['@/components/userDetail'],e),
}, },
{ {
path: '/teacher/:id', path: '/teacher/:id',
......
...@@ -60,8 +60,8 @@ export const getTeacherListApi = function (json) { ...@@ -60,8 +60,8 @@ export const getTeacherListApi = function (json) {
}; };
//获取教师详情 //获取教师详情
const getTeacherDetailUrl = `${_baseUrl}api/admin/teacher/info`; const getTeacherDetailUrl = `${_baseUrl}api/admin/teacher/info`;
export const getTeacherDetailApi = function (id) { export const getTeacherDetailApi = function (id, json) {
return Vue.prototype.$fetch(`${getTeacherDetailUrl}/${id}`) return Vue.prototype.$fetch(`${getTeacherDetailUrl}/${id}`, json)
}; };
//添加教师 //添加教师
const addTeacherUrl = `${_baseUrl}api/admin/teacher/add`; const addTeacherUrl = `${_baseUrl}api/admin/teacher/add`;
...@@ -470,7 +470,7 @@ export const addBoxTypeApi = function (json) { ...@@ -470,7 +470,7 @@ export const addBoxTypeApi = function (json) {
// 用户关联老师 // 用户关联老师
const addRelatedTeacherUrl = `${_baseUrl}api/admin/student/bind/`; const addRelatedTeacherUrl = `${_baseUrl}api/admin/student/bind/`;
export const addRelatedTeacherApi = function (id,json) { export const addRelatedTeacherApi = function (id,json) {
return Vue.prototype.$put(`${addRelatedTeacherUrl}/${id}`,json) return Vue.prototype.$put(`${addRelatedTeacherUrl}${id}`,json)
}; };
// 操作日志 // 操作日志
const getAdminLogListUrl = `${_baseUrl}api/admin/user/log`; const getAdminLogListUrl = `${_baseUrl}api/admin/user/log`;
......
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