Commit 385617c9 authored by chenfenglei's avatar chenfenglei

云集优化

parent 949ad765
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级名称"> <el-form-item label="班级名称">
<el-input v-model="form.className" style="width:220px"></el-input> <el-input v-model="form.class_name" style="width:220px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="最大学员"> <el-form-item label="最大学员">
<el-input-number v-model="form.max_join_num"></el-input-number> <el-input-number v-model="form.max_join_num"></el-input-number>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
form:{ form:{
teacher_id:'', teacher_id:'',
max_join_num:'', max_join_num:'',
className:"" class_name:""
}, },
teacherList:[], teacherList:[],
exitTeacherList: [], exitTeacherList: [],
...@@ -70,35 +70,13 @@ ...@@ -70,35 +70,13 @@
return newArray return newArray
}, },
getTeacher(){ getTeacher(){
this.exitTeacherList = this.dialogObj.teacherList.length > 0 ? this.dialogObj.teacherList : [];
getTeacherListApi({limit:100}).then(res=>{ getTeacherListApi({limit:100}).then(res=>{
if (this.exitTeacherList.length > 0) {
this.teacherList = this.findDifferentArray(res.list, this.exitTeacherList);
if (this.form.teacher_id){
let _index = this.teacherList.findIndex((ts)=>{
return ts.id == this.form.teacher_id
})
if (_index === -1) {
let obj = res.list.find((item)=>{ return item.id == this.form.teacher_id})
this.teacherList.push(obj)
}
}
} else {
this.teacherList = res.list this.teacherList = res.list
}
}); });
}, },
getTeacherByPeriods(){ getTeacherByPeriods(){
getPeriodsTeacherApi(this.periods.id).then(res1=>{
this.exitTeacherList = res1
getTeacherListApi().then(res=>{ getTeacherListApi().then(res=>{
if (this.exitTeacherList.length > 0) {
this.teacherList = this.findDifferentArray(res.list, this.exitTeacherList)
} else {
this.teacherList = res.list this.teacherList = res.list
}
});
}) })
}, },
initPage(){ initPage(){
...@@ -119,7 +97,7 @@ ...@@ -119,7 +97,7 @@
this.form = { this.form = {
teacher_id: parseInt(res.teacher_id), teacher_id: parseInt(res.teacher_id),
max_join_num:res.max_join_num, max_join_num:res.max_join_num,
className:res.class_name class_name:res.class_name
}; };
this.getTeacher(); this.getTeacher();
}) })
...@@ -141,6 +119,10 @@ ...@@ -141,6 +119,10 @@
}); });
}, },
onSave(){ onSave(){
this.form.max_join_num=String(this.form.max_join_num);
this.form.teacher_id=String(this.form.teacher_id);
console.log(this.form);
switch (this.dialogObj.type) { switch (this.dialogObj.type) {
case 0: case 0:
let id = this.dialogObj.periodsId ? this.dialogObj.periodsId : this.periods.id; let id = this.dialogObj.periodsId ? this.dialogObj.periodsId : this.periods.id;
...@@ -181,7 +163,7 @@ ...@@ -181,7 +163,7 @@
let filterVal=val.filter(function(item,i){ let filterVal=val.filter(function(item,i){
return item.id == id return item.id == id
}); });
this.form.className=filterVal[0].name+"一班"; this.form.class_name=filterVal[0].name+"一班";
} }
}, },
watch:{ watch:{
......
...@@ -129,6 +129,12 @@ ...@@ -129,6 +129,12 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</template> </template>
</el-table-column>
<el-table-column
label="班级名称">
<template slot-scope="scope">
{{scope.row.class_name}}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="teacher_name" prop="teacher_name"
...@@ -140,12 +146,7 @@ ...@@ -140,12 +146,7 @@
{{scope.row.type | classTypeFilter}} {{scope.row.type | classTypeFilter}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="班级名称">
<template slot-scope="scope">
{{scope.row.class_name}}
</template>
</el-table-column>
<el-table-column <el-table-column
prop="max_join_num" prop="max_join_num"
label="最大人数"> label="最大人数">
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
<el-tabs v-model="activeName" type="card" style="line-height:1"> <el-tabs v-model="activeName" type="card" style="line-height:1">
<el-tab-pane label="商品名称" name="first"> <el-tab-pane label="商品名称" name="first">
<el-form ref="searchFrom" :model="searchFrom" label-width="90px" inline> <el-form ref="searchFrom" :model="searchFrom" label-width="90px" inline>
<el-form-item label="描述">
<el-input v-model="searchFrom.desc"></el-input>
</el-form-item>
<el-form-item label="商品名称"> <el-form-item label="商品名称">
<el-select v-model="searchFrom.value" placeholder="请选择"> <el-select v-model="searchFrom.value" placeholder="请选择">
<el-option <el-option
...@@ -21,7 +18,8 @@ ...@@ -21,7 +18,8 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<div class="search-btn-block"> <div class="search-btn-block">
<el-button type="primary" plain @click="getUser(searchFrom)">配置</el-button> <el-button type="primary" plain @click="getUser(searchFrom)">确定</el-button>
<el-button type="primary" plain @click="getLink1()">复制链接</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -29,9 +27,6 @@ ...@@ -29,9 +27,6 @@
<el-tab-pane label="期数名称" name="second"> <el-tab-pane label="期数名称" name="second">
<el-form label-width="90px" inline :model="searchFrom2"> <el-form label-width="90px" inline :model="searchFrom2">
<el-form-item label="描述">
<el-input v-model="searchFrom2.desc"></el-input>
</el-form-item>
<el-form-item label="期数名称"> <el-form-item label="期数名称">
<el-cascader <el-cascader
:options="periodsList" :options="periodsList"
...@@ -44,7 +39,8 @@ ...@@ -44,7 +39,8 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<div class="search-btn-block"> <div class="search-btn-block">
<el-button type="primary" plain @click="getUser(searchFrom2)">配置</el-button> <el-button type="primary" plain @click="getUser(searchFrom2)">确定</el-button>
<el-button type="primary" plain @click="getLink2()">复制链接</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -53,7 +49,7 @@ ...@@ -53,7 +49,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {getConfigListApi,getGoodsListApi,getPeriodsApi,putConfigApi,getDefaultPeriodsApi} from "../../service/api"; import {getConfigListApi,getGoodsListApi,getPeriodsApi,putConfigApi,getDefaultPeriodsApi,getLinkApi} from "../../service/api";
import {GOODSTYPE} from '../../util/wordbook'; import {GOODSTYPE} from '../../util/wordbook';
export default { export default {
name:"entrance", name:"entrance",
...@@ -116,6 +112,8 @@ ...@@ -116,6 +112,8 @@
page: 1 page: 1
} }
getPeriodsApi(json1).then(res=>{ getPeriodsApi(json1).then(res=>{
console.log(res.list)
this.periodsList = res.list; this.periodsList = res.list;
}); });
}, },
...@@ -129,7 +127,8 @@ ...@@ -129,7 +127,8 @@
}) })
}, },
getUser(data){ getUser(data){
if(data.value!="" && data.desc!=""){ console.log(data)
if(data.value!=""){
this.$confirm('此操作将设置系统指定配置为商品?', '提示', { this.$confirm('此操作将设置系统指定配置为商品?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -140,7 +139,7 @@ ...@@ -140,7 +139,7 @@
} }
json.value=data.value; json.value=data.value;
json.key=data.key; json.key=data.key;
json.desc=data.desc; json.desc="2";
putConfigApi(json).then(res=>{ putConfigApi(json).then(res=>{
this.$message({ this.$message({
type: 'success', type: 'success',
...@@ -180,14 +179,45 @@ ...@@ -180,14 +179,45 @@
this.periodsList = res.list; this.periodsList = res.list;
}); });
}, },
getLink1(){
let json={
}
json.url="https://wechat.changchangenglish.com/api/client/login?goods_id=1%26redirect_url=https://wechat.changchangenglish.com"
getLinkApi(json).then(res => {
this.copyUrl(res.url);
});
},
getLink2(){
let json={
}
json.url="https://wechat.changchangenglish.com/api/client/login?goods_id=1%26redirect_url=https://wechat.changchangenglish.com"
getLinkApi(json).then(res => {
this.copyUrl(res.url);
});
},
copyUrl(data) {
let url = data;
let oInput = document.createElement("input");
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
this.$message({
message: "已成功复制到剪切板",
type: "success"
});
oInput.remove();
}
}, },
watch:{ watch:{
'entranceObj.show':function(a){ 'entranceObj.show':function(a){
if(a){ if(a){
this.initPage1();
this.initPage() this.initPage()
this.getPeriodsList(); this.getPeriodsList();
this.getGoodsList(); this.getGoodsList();
this.initPage1();
} }
} }
} }
......
...@@ -55,7 +55,12 @@ ...@@ -55,7 +55,12 @@
prop="nickname" prop="nickname"
label="购买人"> label="购买人">
<template slot-scope="scope"> <template slot-scope="scope">
<img class="avatar" :src="scope.row.avatar"/> {{scope.row.nickname}}<br>(ID:{{scope.row.user_id}}) <div v-if='scope.row.user_id==0? false:true'>
<img class="avatar" :src="scope.row.avatar"/> {{scope.row.nickname}}<br>(ID:{{scope.row.user_id}})
</div>
<div v-else>
用户暂未够课
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
......
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