Compare commits
7 Commits
martekSort
...
xie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af3572fbec | ||
|
|
0ce171f1c0 | ||
|
|
a9d9780521 | ||
|
|
ead4a02b3a | ||
|
|
1cbd4deb98 | ||
|
|
59f791e491 | ||
|
|
bc64bdc971 |
@@ -64,6 +64,7 @@ const mainRoutes = {
|
|||||||
{ path: '/course-courseChapter', component: _import('modules/course/courseChapter'), name: 'course-courseChapter', meta: { title: '课程目录章节列表', isTab: true } },
|
{ path: '/course-courseChapter', component: _import('modules/course/courseChapter'), name: 'course-courseChapter', meta: { title: '课程目录章节列表', isTab: true } },
|
||||||
{ path: '/course-courseVideo', component: _import('modules/course/courseVideo'), name: 'course-courseVideo', meta: { title: '课程目录章节视频列表', isTab: true } },
|
{ path: '/course-courseVideo', component: _import('modules/course/courseVideo'), name: 'course-courseVideo', meta: { title: '课程目录章节视频列表', isTab: true } },
|
||||||
{ path: '/course-sociologyList', component: _import('modules/course/sociologyList'), name: 'course-sociologyList', meta: { title: '国学标签列表', isTab: true } },
|
{ path: '/course-sociologyList', component: _import('modules/course/sociologyList'), name: 'course-sociologyList', meta: { title: '国学标签列表', isTab: true } },
|
||||||
|
{ path: '/userCourse', component: _import('modules/user/userCourse'), name: 'userCourse', meta: { title: '用户课程列表', isTab: true } },
|
||||||
],
|
],
|
||||||
beforeEnter (to, from, next) {
|
beforeEnter (to, from, next) {
|
||||||
let token = Vue.cookie.get('token')
|
let token = Vue.cookie.get('token')
|
||||||
|
|||||||
@@ -98,16 +98,24 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
|
|
||||||
>
|
>
|
||||||
<div style="width:120px">视频/音频ID</div>
|
<div style="width:120px">视频/音频ID:</div>
|
||||||
<div style="width:300px; margin-right:10px; margin-left:10px">
|
<div style="width:250px; margin-right:10px; margin-left:10px">
|
||||||
<el-input
|
<el-input
|
||||||
style=""
|
style=""
|
||||||
v-model="item.video"
|
v-model="item.video"
|
||||||
placeholder="请输入视频/音频ID"
|
placeholder="请输入视频/音频ID"
|
||||||
></el-input>
|
></el-input>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flexbox" style="align-items:center;" >
|
||||||
|
<span style="display:inline-block; width:60px">排序:</span>
|
||||||
|
<el-input
|
||||||
|
style=""
|
||||||
|
v-model="item.sort"
|
||||||
|
placeholder="排序"
|
||||||
|
></el-input>
|
||||||
|
</div>
|
||||||
<div style="margin-right:10px; height:38px">
|
<div style="margin-right:10px; height:38px">
|
||||||
<el-form-item label="加密类型" prop="type">
|
<el-form-item label="加密类型:" prop="type" label-width="100px">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="item.type"
|
v-model="item.type"
|
||||||
filterable
|
filterable
|
||||||
@@ -240,9 +248,9 @@ export default {
|
|||||||
// ]
|
// ]
|
||||||
},
|
},
|
||||||
video_audio_url: [
|
video_audio_url: [
|
||||||
{ video: "" ,type:0,id:0}
|
{ video: "" ,type:1,id:0,sort:0}
|
||||||
],
|
],
|
||||||
obj:{ video: "" ,type:0,id:0},
|
obj:{ video: "" ,type:1,id:0,sort:0},
|
||||||
splitsTypeList: [],
|
splitsTypeList: [],
|
||||||
dataRule: {},
|
dataRule: {},
|
||||||
chapterId:null,
|
chapterId:null,
|
||||||
|
|||||||
@@ -45,6 +45,43 @@
|
|||||||
<img width="100%" :src="dataForm.image" alt="" />
|
<img width="100%" :src="dataForm.image" alt="" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<div v-if="relationProducts && relationProducts.length > 0" style="margin-bottom:20px">
|
||||||
|
<el-table
|
||||||
|
:data="relationProducts"
|
||||||
|
border
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
prop="productName"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="商品名"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="课程图"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div
|
||||||
|
v-if="scope.row.productImages"
|
||||||
|
style="width:100%;display: flex;
|
||||||
|
align-items: center;justify-content: center;"
|
||||||
|
>
|
||||||
|
<img :src="scope.row.productImages" alt="" width="40px" height="40px" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column width="100px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button plain type="danger" size="mini" @click="delPro(scope.$index)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<div style="text-align:center; margin-bottom:15px" ><el-button @click="showProTable" size="mini" type="primary">添加关联书籍</el-button></div>
|
||||||
<el-form-item label="课程介绍" prop="sort" style="margin-bottom: 140px;">
|
<el-form-item label="课程介绍" prop="sort" style="margin-bottom: 140px;">
|
||||||
<div style="height: calc(620px - 120px)">
|
<div style="height: calc(620px - 120px)">
|
||||||
<el-upload
|
<el-upload
|
||||||
@@ -140,6 +177,7 @@ export default {
|
|||||||
},
|
},
|
||||||
placeholder: "请输入正文"
|
placeholder: "请输入正文"
|
||||||
},
|
},
|
||||||
|
relationProducts :[],
|
||||||
baseUrl: global.baseUrl,
|
baseUrl: global.baseUrl,
|
||||||
visible: false,
|
visible: false,
|
||||||
bookList: [
|
bookList: [
|
||||||
@@ -228,6 +266,7 @@ export default {
|
|||||||
// relationId:0,
|
// relationId:0,
|
||||||
},
|
},
|
||||||
splitsTypeList: [],
|
splitsTypeList: [],
|
||||||
|
courseId:undefined,
|
||||||
dataRule: {
|
dataRule: {
|
||||||
// name: [
|
// name: [
|
||||||
// { required: true, message: '书名不能为空', trigger: 'blur' }
|
// { required: true, message: '书名不能为空', trigger: 'blur' }
|
||||||
@@ -286,8 +325,23 @@ export default {
|
|||||||
created() {},
|
created() {},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.restaurants = this.loadAll();
|
// this.restaurants = this.loadAll();
|
||||||
|
this.$bus.$on("linkList", (data) => {
|
||||||
|
console.log('获得列表',data)
|
||||||
|
if(data && data.length > 0){
|
||||||
|
this.relationProducts = this.relationProducts.concat(data)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
delPro(i){
|
||||||
|
console.log('i',i)
|
||||||
|
// this.$emit('delPro',i)
|
||||||
|
this.relationProducts.splice(i,1)
|
||||||
|
console.log('处理后的',this.relationProducts)
|
||||||
|
},
|
||||||
|
showProTable(){
|
||||||
|
this.$emit('showProTable',true)
|
||||||
|
},
|
||||||
contentUploadSuccess(res, file) {
|
contentUploadSuccess(res, file) {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
let quill = this.$refs.myQuillEditor.quill;
|
let quill = this.$refs.myQuillEditor.quill;
|
||||||
@@ -319,6 +373,7 @@ export default {
|
|||||||
init(row) {
|
init(row) {
|
||||||
console.log("11111", row);
|
console.log("11111", row);
|
||||||
if (row && row.id) {
|
if (row && row.id) {
|
||||||
|
this.courseId = row.id
|
||||||
this.$http
|
this.$http
|
||||||
.request({
|
.request({
|
||||||
url: this.$http.adornUrl(this.urlList.info),
|
url: this.$http.adornUrl(this.urlList.info),
|
||||||
@@ -337,7 +392,11 @@ export default {
|
|||||||
if (res && res.data.code === 0) {
|
if (res && res.data.code === 0) {
|
||||||
var data = res.data.course;
|
var data = res.data.course;
|
||||||
console.log("data at line 357:", data);
|
console.log("data at line 357:", data);
|
||||||
|
if(res.data.shopProductList && res.data.shopProductList.length > 0){
|
||||||
|
this.relationProducts = res.data.shopProductList
|
||||||
|
}else{
|
||||||
|
this.relationProducts = []
|
||||||
|
}
|
||||||
if (data.image != "" && data.image != null) {
|
if (data.image != "" && data.image != null) {
|
||||||
var img = {
|
var img = {
|
||||||
name: "",
|
name: "",
|
||||||
@@ -365,6 +424,15 @@ export default {
|
|||||||
// this.$message.error("请选择图书类型");
|
// this.$message.error("请选择图书类型");
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
let _relationProductIds = ''
|
||||||
|
if(this.relationProducts.length > 0){
|
||||||
|
let _list = [...this.relationProducts]
|
||||||
|
_list = _list.map(item => item.productId)
|
||||||
|
_relationProductIds = _list.join()
|
||||||
|
// console.log(_relationProductIds, _list,'_relationProductIds')
|
||||||
|
}
|
||||||
|
// console.log(_relationProductIds, _list,'_relationProductIds')
|
||||||
|
|
||||||
this.$refs["dataForm"].validate(valid => {
|
this.$refs["dataForm"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$http({
|
this.$http({
|
||||||
@@ -381,7 +449,8 @@ export default {
|
|||||||
title: this.dataForm.title,
|
title: this.dataForm.title,
|
||||||
sort: this.dataForm.sort,
|
sort: this.dataForm.sort,
|
||||||
image: this.dataForm.image,
|
image: this.dataForm.image,
|
||||||
content: this.dataForm.content
|
content: this.dataForm.content,
|
||||||
|
relationProductIds : _relationProductIds
|
||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
@@ -391,6 +460,8 @@ export default {
|
|||||||
duration: 1500,
|
duration: 1500,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
|
this.relationProductIds = []
|
||||||
|
this.relationProducts = []
|
||||||
this.$emit("refreshDataList");
|
this.$emit("refreshDataList");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -429,6 +500,9 @@ export default {
|
|||||||
},
|
},
|
||||||
handlereset() {
|
handlereset() {
|
||||||
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
(this.fileList = []), (this.fileListNovel = []), (this.visible = false);
|
||||||
|
this.$emit('pclose')
|
||||||
|
this.relationProducts = []
|
||||||
|
this.courseId = undefined
|
||||||
},
|
},
|
||||||
handlePreview(file) {
|
handlePreview(file) {
|
||||||
console.log(file);
|
console.log(file);
|
||||||
|
|||||||
@@ -31,6 +31,12 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="目录名称"
|
label="目录名称"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span style="font-weight:bold; font-size:16px">{{ scope.row.title }}</span><br>
|
||||||
|
<span style="color:#999">( 创建时间:{{ scope.row.createTime}} )</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="sort"
|
prop="sort"
|
||||||
|
|||||||
@@ -32,6 +32,12 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="章节名称"
|
label="章节名称"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span style="font-weight:bold; font-size:16px">{{ scope.row.title }}</span><br>
|
||||||
|
<!-- <span style="color:#999">( 创建时间:{{ scope.row.createTime}} )</span> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|||||||
@@ -69,7 +69,8 @@
|
|||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>
|
<div>
|
||||||
<span>{{ scope.row.title }}</span>
|
<span style="font-weight:bold; font-size:16px">{{ scope.row.title }}</span><br>
|
||||||
|
<span style="color:#999">( 创建时间:{{ scope.row.createTime}} )</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -338,8 +339,17 @@
|
|||||||
<add-or-update
|
<add-or-update
|
||||||
v-if="addOrUpdateVisible"
|
v-if="addOrUpdateVisible"
|
||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
|
:relationProducts = relationProducts
|
||||||
|
@pclose = "pclose"
|
||||||
|
@showProTable = "showProTable"
|
||||||
@refreshDataList="getDataList"
|
@refreshDataList="getDataList"
|
||||||
></add-or-update>
|
></add-or-update>
|
||||||
|
<commonShopTable
|
||||||
|
ref="commonShopTable"
|
||||||
|
:currentId="courseId"
|
||||||
|
currentType="courseLinkPro"
|
||||||
|
@linkList="linkList"
|
||||||
|
></commonShopTable>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="课程引用一览"
|
title="课程引用一览"
|
||||||
:visible.sync="resListVisible"
|
:visible.sync="resListVisible"
|
||||||
@@ -382,6 +392,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import commonShopTable from "./shopproductTable.vue";
|
||||||
import AddOrUpdate from "./course-add-or-update";
|
import AddOrUpdate from "./course-add-or-update";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -404,9 +415,11 @@ export default {
|
|||||||
children: []
|
children: []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
courseId:"0",
|
||||||
dataForm: {
|
dataForm: {
|
||||||
key: ""
|
key: "",
|
||||||
},
|
},
|
||||||
|
relationProducts:[],
|
||||||
query: {
|
query: {
|
||||||
type: "",
|
type: "",
|
||||||
categoryId: "",
|
categoryId: "",
|
||||||
@@ -430,7 +443,8 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate
|
AddOrUpdate,
|
||||||
|
commonShopTable
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
if (this.$route.query.upPageInde != null) {
|
if (this.$route.query.upPageInde != null) {
|
||||||
@@ -442,6 +456,32 @@ export default {
|
|||||||
this.getTreeList(this.urlList.sociologyList, 2);
|
this.getTreeList(this.urlList.sociologyList, 2);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
delPro(val){
|
||||||
|
console.log(val,this.relationProducts)
|
||||||
|
let list = this.relationProducts
|
||||||
|
|
||||||
|
|
||||||
|
this.relationProducts = list.slice(1,1)
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
pclose(){
|
||||||
|
this.relationProducts = []
|
||||||
|
this.courseId = null
|
||||||
|
console.log('关闭了 ')
|
||||||
|
},
|
||||||
|
linkList(data){
|
||||||
|
console.log('父级',data)
|
||||||
|
if(data && data.length > 0){
|
||||||
|
this.relationProducts = data
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showProTable(data){
|
||||||
|
console.log('data',data)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.commonShopTable.open();
|
||||||
|
});
|
||||||
|
},
|
||||||
closeLink() {
|
closeLink() {
|
||||||
this.resListVisible = false;
|
this.resListVisible = false;
|
||||||
this.resList = [];
|
this.resList = [];
|
||||||
@@ -492,6 +532,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
|
this.relationProducts = []
|
||||||
var data = {
|
var data = {
|
||||||
page: this.pageIndex,
|
page: this.pageIndex,
|
||||||
limit: this.pageSize,
|
limit: this.pageSize,
|
||||||
@@ -554,6 +595,8 @@ export default {
|
|||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
addOrUpdateHandle(row) {
|
addOrUpdateHandle(row) {
|
||||||
this.addOrUpdateVisible = true;
|
this.addOrUpdateVisible = true;
|
||||||
|
row ? this.courseId = row.id : ''
|
||||||
|
// this.courseId = row.id
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdate.init(row);
|
this.$refs.addOrUpdate.init(row);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -116,6 +116,7 @@
|
|||||||
:action="baseUrl + '/oss/fileoss'"
|
:action="baseUrl + '/oss/fileoss'"
|
||||||
:on-remove="audioHandleRemove"
|
:on-remove="audioHandleRemove"
|
||||||
:on-success="audioUploadSuccess"
|
:on-success="audioUploadSuccess"
|
||||||
|
:before-upload="onprogress"
|
||||||
accept=".mp3"
|
accept=".mp3"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
:file-list="audioFileList"
|
:file-list="audioFileList"
|
||||||
@@ -611,6 +612,9 @@ export default {
|
|||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onprogress(){
|
||||||
|
this.$message('上传中,请勿关闭或进行其他操作');
|
||||||
|
},
|
||||||
audioHandleRemove(file, fileList) {
|
audioHandleRemove(file, fileList) {
|
||||||
console.log(file, fileList);
|
console.log(file, fileList);
|
||||||
this.audioFileList = []
|
this.audioFileList = []
|
||||||
@@ -619,6 +623,7 @@ export default {
|
|||||||
audioUploadSuccess(res, file) {
|
audioUploadSuccess(res, file) {
|
||||||
this.audioFileList = []
|
this.audioFileList = []
|
||||||
this.audioFileList.push(file)
|
this.audioFileList.push(file)
|
||||||
|
this.$message.success('上传成功');
|
||||||
console.log(this.audioFileList,res, "上传成功");
|
console.log(this.audioFileList,res, "上传成功");
|
||||||
this.addForm.media = res.url
|
this.addForm.media = res.url
|
||||||
|
|
||||||
|
|||||||
361
src/views/modules/course/shopproductTable.vue
Normal file
361
src/views/modules/course/shopproductTable.vue
Normal file
@@ -0,0 +1,361 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-drawer title="新增关联商品" v-if="drawer" :wrapperClosable="false" :visible.sync="drawer" :before-close="handleClose" destroy-on-close
|
||||||
|
direction="rtl" size="70%">
|
||||||
|
<div class="shop_drawer_box demo-drawer__content">
|
||||||
|
<div class="addFormBox">
|
||||||
|
<el-form ref="addForm" label-width="80px" :model="dataForm">
|
||||||
|
<el-form-item label="商品名称" prop="keywords" class="form_item">
|
||||||
|
<el-input size="small" placeholder="请输入商品名称" style="width: 100%" v-model="dataForm.keywords" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品类型" prop="type" class="form_item">
|
||||||
|
<el-select size="small" v-model="dataForm.type" placeholder="请选择" style="width: 100%" clearable>
|
||||||
|
<el-option v-for="item in goodsTypeList" :key="item.dictType" :label="item.dictValue"
|
||||||
|
:value="item.dictType">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="" class="form_item" label-width="20px" style="width: 160px !important">
|
||||||
|
<el-button type="primary" plain @click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList(bookMarketId);
|
||||||
|
" size="small">查询</el-button>
|
||||||
|
<el-button @click="handleReset()" size="small" plain>重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table ref="table" height="80%" :data="dataList" :row-key="getRowKeys" border size="mini"
|
||||||
|
v-loading="dataListLoading" @selection-change="handleSelectionChange" style="width: 100%">
|
||||||
|
<!-- <el-table-column :reserve-selection="true" type="selection" header-align="center" align="center" width="50">
|
||||||
|
</el-table-column> -->
|
||||||
|
<!-- -->
|
||||||
|
<el-table-column label="商品ID" width="70" align="center" prop="productId">
|
||||||
|
<!-- <template slot-scope="scope">
|
||||||
|
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||||
|
</template> -->
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="productName" header-align="center" align="center" label="商品名称">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="price" width="120" header-align="center" align="center" sortable label="价格">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="activityPrice" width="120" header-align="center" align="center" sortable label="活动价">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="productStock" width="120" header-align="center" align="center" sortable label="库存">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column header-align="center" align="center" label="商品图" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img v-if="scope.row.productImages != ''" :src="scope.row.productImages" width="25" height="35"
|
||||||
|
class="tableImg" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="productStock" width="120" header-align="center" align="center" sortable label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" plain size="mini" @click="addLink(scope.row, scope.$index)">添加</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
|
||||||
|
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper">
|
||||||
|
</el-pagination>
|
||||||
|
|
||||||
|
<!-- <div class="demo-drawer__footer">
|
||||||
|
<div style="float: right; margin-top: 20px">
|
||||||
|
<el-button @click="close" size="small">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit" :loading="loading" size="small">{{ loading ? "提交中 ..." : "确 定"
|
||||||
|
}}</el-button>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
|
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @showchooseBookf = "showchooseBookf"></add-or-update>
|
||||||
|
<choose-book v-if="chooseBookVisible" :bookIds = bookIds ref="chooseBook" :chooseBookVisible = chooseBookVisible @closeBookf = "closeBookf"></choose-book> -->
|
||||||
|
</div>
|
||||||
|
</el-drawer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import chooseBook from './chooseBook.vue'
|
||||||
|
// import AddOrUpdate from './shopproduct-add-or-update'
|
||||||
|
export default {
|
||||||
|
props: ["currentType", "currentId"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
timer: null,
|
||||||
|
drawer: false,
|
||||||
|
loading: false,
|
||||||
|
multipleSelectionAll: [], // 所有选中的数据包含跨页数据
|
||||||
|
multipleSelection: [], // 当前页选中的数据
|
||||||
|
idKey: "productId", // 标识列表数据中每一行的唯一键的名称(需要按自己的数据改一下)
|
||||||
|
dataForm: {
|
||||||
|
type:'00'
|
||||||
|
},
|
||||||
|
bookMarketId: null,
|
||||||
|
dataList: [],
|
||||||
|
publishStatus: false,
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
chooseBookVisible: false,
|
||||||
|
bookIds: [],
|
||||||
|
goodsTypeList: [],
|
||||||
|
linkList:[]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// AddOrUpdate,
|
||||||
|
// chooseBook
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addLink(row,i){
|
||||||
|
// 添加商品绑定
|
||||||
|
this.linkList.push(row)
|
||||||
|
console.log('linkList',this.linkList)
|
||||||
|
this.dataList.splice(i,1)
|
||||||
|
// this.getDataList()
|
||||||
|
},
|
||||||
|
handleReset() {
|
||||||
|
this.dataForm = {
|
||||||
|
type:'00'
|
||||||
|
};
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
// var ids = this.multipleSelection.map((e) => e.productId).toString(",");
|
||||||
|
// this.$emit("submit", ids);
|
||||||
|
// console.log(
|
||||||
|
// "🚀 ~ submit ~ this.multipleSelection:",
|
||||||
|
// this.multipleSelection
|
||||||
|
// );
|
||||||
|
// this.drawer = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// 获取商品类型
|
||||||
|
getGoodsTypeList() {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/sysdictdata/selectByType/goodsType"),
|
||||||
|
method: "get",
|
||||||
|
}).then(({ data }) => {
|
||||||
|
// console.log(data.dataList)
|
||||||
|
this.goodsTypeList = data.dataList;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleClose(done) {
|
||||||
|
|
||||||
|
this.$bus.$emit("linkList", this.linkList );
|
||||||
|
this.linkList = []
|
||||||
|
// this.$emit("linkList", this.linkList)
|
||||||
|
done();
|
||||||
|
},
|
||||||
|
async open() {
|
||||||
|
this.drawer = true;
|
||||||
|
this.dataForm = {
|
||||||
|
type:'00'
|
||||||
|
};
|
||||||
|
this.pageIndex = 1;
|
||||||
|
await this.getGoodsTypeList();
|
||||||
|
await this.getDataList();
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.drawer = false;
|
||||||
|
|
||||||
|
},
|
||||||
|
getRowKeys(row) {
|
||||||
|
return row.productId;
|
||||||
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
console.log("🚀 ~ handleSelectionChange ~ val:", val);
|
||||||
|
// table组件选中事件,记得加上@selection-change="handleSelectionChange"
|
||||||
|
this.multipleSelection = val;
|
||||||
|
// this.changePageCoreRecordData();
|
||||||
|
},
|
||||||
|
|
||||||
|
closeBookf() {
|
||||||
|
this.chooseBookVisible = false;
|
||||||
|
},
|
||||||
|
showchooseBookf(e) {
|
||||||
|
// 显示图书列表
|
||||||
|
this.chooseBookVisible = true;
|
||||||
|
// console.log(this.bookIds,'this.bookIds')
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.chooseBook.getBookList()
|
||||||
|
// this.bookIds = e.bookIds
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
async getDataList() {
|
||||||
|
var form = {
|
||||||
|
...this.dataForm,
|
||||||
|
keywords:this.dataForm.keywords ? this.dataForm.keywords : '',
|
||||||
|
page: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
id: this.currentId
|
||||||
|
// productId: "",
|
||||||
|
};
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.clear();
|
||||||
|
// let _url = "/master/shopProduct/listByPage"
|
||||||
|
|
||||||
|
// await this.$http({
|
||||||
|
// url: this.$http.adornUrl(_url),
|
||||||
|
// method: "post",
|
||||||
|
// data: {
|
||||||
|
// "current": form.page,
|
||||||
|
// "limit": form.limit,
|
||||||
|
// "productName": form.keywords,
|
||||||
|
// "goodsType": form.type
|
||||||
|
// },
|
||||||
|
// header: {
|
||||||
|
// //默认 无 说明:请求头
|
||||||
|
// "Content-Type": "application/json"
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
await this.$http({
|
||||||
|
url: this.$http.adornUrl(`/master/course/getProductListForCourse`),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
"page": form.page,
|
||||||
|
"limit": form.limit,
|
||||||
|
"productName": form.keywords,
|
||||||
|
"goodsType": form.type,
|
||||||
|
"courseId": form.id
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.dataList = data.shopProductListhopProducts.records;
|
||||||
|
this.totalPage = data.shopProductListhopProducts.total;
|
||||||
|
} else {
|
||||||
|
this.dataList = [];
|
||||||
|
this.totalPage = 0;
|
||||||
|
}
|
||||||
|
this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
clear() {
|
||||||
|
// this.$refs.table.clearSelection();
|
||||||
|
this.multipleSelection = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
// 每页数
|
||||||
|
sizeChangeHandle(val) {
|
||||||
|
// this.changePageCoreRecordData();
|
||||||
|
this.pageSize = val;
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 当前页
|
||||||
|
currentChangeHandle(val) {
|
||||||
|
// 改变页的时候调用一次
|
||||||
|
// this.changePageCoreRecordData();
|
||||||
|
this.pageIndex = val;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 多选
|
||||||
|
selectionChangeHandle(val) {
|
||||||
|
this.dataListSelections = val;
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addOrUpdateHandle(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteHandle(id) {
|
||||||
|
var ids = id
|
||||||
|
? [id]
|
||||||
|
: this.dataListSelections.map((item) => {
|
||||||
|
return item.productId;
|
||||||
|
});
|
||||||
|
this.$confirm(
|
||||||
|
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/shopproduct/delete"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(ids, false),
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
SwitchChange(event) {
|
||||||
|
/*点击时他会自动把你绑定的值变更,直接去请求数据就可以了*/
|
||||||
|
var parms = {
|
||||||
|
publishStatus: event.publishStatus,
|
||||||
|
productId: event.productId,
|
||||||
|
};
|
||||||
|
// console.log(parms)
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/book/shopproduct/update"),
|
||||||
|
method: "post",
|
||||||
|
data: parms,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: "成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.getDataList();
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.loading = false;
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
console.log(event);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.shop_drawer_box {
|
||||||
|
padding: 20px !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addFormBox {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
// overflow: hidden;
|
||||||
|
.form_item {
|
||||||
|
width: 33%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.el-drawer__header {
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -13,10 +13,10 @@
|
|||||||
:disabled="dataListSelections.length <= 0">批量删除</el-button> -->
|
:disabled="dataListSelections.length <= 0">批量删除</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
|
<el-table :data="dataList" border v-loading="dataListLoading"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<el-table-column type="selection" header-align="center" align="center" width="50">
|
<!-- <el-table-column type="selection" header-align="center" align="center" width="50">
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<!-- <el-table-column label="序号" width="70" align="center">
|
<!-- <el-table-column label="序号" width="70" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||||
@@ -29,14 +29,21 @@
|
|||||||
label="用户ID">
|
label="用户ID">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name" header-align="center" align="center" label="姓名">
|
<el-table-column prop="name" header-align="center" align="center" label="姓名">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{scope.row.name ? scope.row.name : '暂无用户名'}}</span>-
|
||||||
|
<span v-if="scope.row.vip == 0">普通用户</span>
|
||||||
|
<span v-else-if="scope.row.vip == 2">(吴门医述VIP)</span>
|
||||||
|
<span v-else-if="scope.row.vip == 1">(超级VIP)</span>
|
||||||
|
<span v-else-if="scope.row.vip == 3">(众妙之门VIP)</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column prop="age" header-align="center" align="center" label="年龄">
|
<!-- <el-table-column prop="age" header-align="center" align="center" label="年龄">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column prop="sex" header-align="center" align="center" label="性别">
|
<!-- <el-table-column prop="sex" header-align="center" align="center" label="性别">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.sex == 0">女</span><span v-if="scope.row.sex == 1">男</span><span v-if="scope.row.sex == 2">保密</span>
|
<span v-if="scope.row.sex == 0">女</span><span v-if="scope.row.sex == 1">男</span><span v-if="scope.row.sex == 2">保密</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column prop="avatar" header-align="center" align="center" label="头像">
|
<el-table-column prop="avatar" header-align="center" align="center" label="头像">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<img v-if="scope.row.avatar && scope.row.avatar != ''" :src="scope.row.avatar" width="50" height="50" class="tableImg" />
|
<img v-if="scope.row.avatar && scope.row.avatar != ''" :src="scope.row.avatar" width="50" height="50" class="tableImg" />
|
||||||
@@ -76,10 +83,10 @@
|
|||||||
align="center"
|
align="center"
|
||||||
label="阅读时间">
|
label="阅读时间">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column prop="lastLoginTime" header-align="center" align="center" label="最后登录时间">
|
<!-- <el-table-column prop="lastLoginTime" header-align="center" align="center" label="最后登录时间">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间">
|
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间">
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<!-- <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间">
|
<!-- <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<!-- <el-table-column
|
<!-- <el-table-column
|
||||||
@@ -105,6 +112,13 @@
|
|||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item><el-button type="text" size="small" @click="youhui(scope.row)">优惠券列表</el-button></el-dropdown-item>
|
<el-dropdown-item><el-button type="text" size="small" @click="youhui(scope.row)">优惠券列表</el-button></el-dropdown-item>
|
||||||
<el-dropdown-item><el-button type="text" size="small" @click="resetPassword(scope.row)">修改密码</el-button></el-dropdown-item>
|
<el-dropdown-item><el-button type="text" size="small" @click="resetPassword(scope.row)">修改密码</el-button></el-dropdown-item>
|
||||||
|
<el-dropdown-item>
|
||||||
|
<router-link :to="{ path: '/userCourse', query: {id:scope.row.id} }">
|
||||||
|
<el-button type="text" size="small">
|
||||||
|
用户课程管理
|
||||||
|
</el-button>
|
||||||
|
</router-link>
|
||||||
|
</el-dropdown-item>
|
||||||
<!-- <el-dropdown-item divided>蚵仔煎</el-dropdown-item> -->
|
<!-- <el-dropdown-item divided>蚵仔煎</el-dropdown-item> -->
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@@ -232,6 +246,10 @@
|
|||||||
this.getcourpeList()
|
this.getcourpeList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 用户课程
|
||||||
|
userCourse(val){
|
||||||
|
|
||||||
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
|
|||||||
453
src/views/modules/user/userCourse.vue
Normal file
453
src/views/modules/user/userCourse.vue
Normal file
@@ -0,0 +1,453 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config">
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:model="dataForm"
|
||||||
|
@keyup.enter.native="getDataList()"
|
||||||
|
>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="showAddD" type="primary">开通课程</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="dataForm.key" placeholder="请输入课程名" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item >
|
||||||
|
<el-button
|
||||||
|
@click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();
|
||||||
|
"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="float:right">
|
||||||
|
<div v-if="user.id" class="flexbox userInfo">
|
||||||
|
<div>用户信息:{{ user.name }}{{ user.tel }}</div>
|
||||||
|
<div>
|
||||||
|
<span v-if="user.vip == 0">(普通用户)</span>
|
||||||
|
<span v-else-if="user.vip == 2">(吴门医述VIP)</span>
|
||||||
|
<span v-else-if="user.vip == 1">(超级VIP)</span>
|
||||||
|
<span v-else-if="user.vip == 3">(众妙之门VIP)</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="课程名"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="catalogueName"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="分部"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="startTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="开通时间"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="endTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="到期时间"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column
|
||||||
|
fixed="right"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="150"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope"> </template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
@size-change="sizeChangeHandle"
|
||||||
|
@current-change="currentChangeHandle"
|
||||||
|
:current-page="pageIndex"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
:total="total"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
title="开通课程"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:visible.sync="youVisible"
|
||||||
|
append-to-body
|
||||||
|
width="60%"
|
||||||
|
@close="dialogClose"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
:model="youForm"
|
||||||
|
label-width="100px"
|
||||||
|
ref="youForm"
|
||||||
|
:rules="youFormRule"
|
||||||
|
>
|
||||||
|
<el-form-item label="用户">
|
||||||
|
{{ user.tel }} <span v-if="user.name != ''">{{ user.name }}</span>
|
||||||
|
<span v-if="user.vip == 0">普通用户</span>
|
||||||
|
<span v-else-if="user.vip == 2">(吴门医述VIP)</span>
|
||||||
|
<span v-else-if="user.vip == 1">(超级VIP)</span>
|
||||||
|
<span v-else-if="user.vip == 3">(众妙之门VIP)</span>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="flexbox">
|
||||||
|
<div>
|
||||||
|
<el-form-item label="课程名:" prop="courseId">
|
||||||
|
<el-select
|
||||||
|
v-model="youForm.courseId"
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
placeholder="请输入课程名并选择您要添加的课程"
|
||||||
|
:remote-method="remoteMethod"
|
||||||
|
:loading="totalLaoding"
|
||||||
|
@change="selectChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.title"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-input v-model="youForm.key" placeholder="" clearable></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
<div v-if="youForm.cate.length > 0" style="margin-left:20px">
|
||||||
|
<el-form-item
|
||||||
|
label="请选择开通的分部:"
|
||||||
|
label-width="150px"
|
||||||
|
prop="catalogueId"
|
||||||
|
>
|
||||||
|
<div v-for="(item, index) in youForm.cate"
|
||||||
|
:key="index">
|
||||||
|
<el-radio
|
||||||
|
v-model="youForm.catalogueId"
|
||||||
|
:label="item.id"
|
||||||
|
>{{ item.title }}</el-radio
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-form-item label="开通时长:" v-if="youForm.courseId" prop="days">
|
||||||
|
<el-select v-model="youForm.days" placeholder="请选择开通时长">
|
||||||
|
<el-option
|
||||||
|
v-for="item in timeOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogClose">取消</el-button>
|
||||||
|
<el-button @click="submit" type="primary">确认开通</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import AddOrUpdate from './user-add-or-update'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dataForm: {
|
||||||
|
key: ""
|
||||||
|
},
|
||||||
|
userId: this.$route.query.id,
|
||||||
|
user: {},
|
||||||
|
pointFormRules: {
|
||||||
|
pointAmount: [
|
||||||
|
{ required: true, message: "请输入金额", trigger: "blur" }
|
||||||
|
],
|
||||||
|
pointType: {
|
||||||
|
required: true,
|
||||||
|
message: "请选择操作类型",
|
||||||
|
trigger: "blur"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
youFormRule: {
|
||||||
|
catalogueId: [
|
||||||
|
{ required: true, message: "请选择开通的分部", trigger: "blur" }
|
||||||
|
],
|
||||||
|
days: [{ required: true, message: "请选择开通时长", trigger: "blur" }]
|
||||||
|
},
|
||||||
|
options: [],
|
||||||
|
timeOptions: [
|
||||||
|
// 开通时长
|
||||||
|
{
|
||||||
|
value: "30",
|
||||||
|
label: "一个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "60",
|
||||||
|
label: "两个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "90",
|
||||||
|
label: "三个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "120",
|
||||||
|
label: "四个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "150",
|
||||||
|
label: "五个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "180",
|
||||||
|
label: "六个月"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "365",
|
||||||
|
label: "一年"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "730",
|
||||||
|
label: "两年"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dataList: [],
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
total: 0,
|
||||||
|
totalLaoding: false,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
|
||||||
|
youVisible: false,
|
||||||
|
|
||||||
|
youForm: {
|
||||||
|
courseId: null,
|
||||||
|
cate: [],
|
||||||
|
catalogueId: null,
|
||||||
|
days: ""
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// AddOrUpdate
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
console.log(this.$route.query);
|
||||||
|
console.log(this.userId, "onsole.log(this.$route.query)");
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
// this.getDataList()
|
||||||
|
// this.getcourpeList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submit() {
|
||||||
|
console.log(this.youForm, "youForm");
|
||||||
|
this.$refs['youForm'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
let data = {
|
||||||
|
userId:this.userId,
|
||||||
|
...this.youForm
|
||||||
|
}
|
||||||
|
delete data.cate
|
||||||
|
console.log('data',data)
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userManage/addUserCourseBuy"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
this.$message.success('开课成功!')
|
||||||
|
this.getDataList()
|
||||||
|
this.dialogClose()
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.log("表单提交报错");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dialogClose() {
|
||||||
|
this.youVisible = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.youForm.cate = [];
|
||||||
|
this.options = [];
|
||||||
|
this.$refs["youForm"].resetFields();
|
||||||
|
console.log(this.youForm, "youForm");
|
||||||
|
});
|
||||||
|
console.log(this.youForm, "youForm");
|
||||||
|
},
|
||||||
|
selectChange(val) {
|
||||||
|
// console.log('val',val)
|
||||||
|
console.log("options", this.options);
|
||||||
|
// const _obj = this.options.find(item => item.id == val);
|
||||||
|
// this.youForm.cate = _obj.courseCatalogueEntityList;
|
||||||
|
// console.log(this.youForm.cate, "this.youForm.cate");
|
||||||
|
this.getCate(val)
|
||||||
|
},
|
||||||
|
remoteMethod(query) {
|
||||||
|
console.log(query, "query", this.youForm.key);
|
||||||
|
// return false
|
||||||
|
if (this.youForm.key !== "") {
|
||||||
|
let data = {
|
||||||
|
// page: this.pageIndex,
|
||||||
|
// limit: this.pageSize,
|
||||||
|
title: query, //关键字
|
||||||
|
// medicalId: "",
|
||||||
|
// sociologyId: "",
|
||||||
|
// type: 0
|
||||||
|
};
|
||||||
|
this.totalLaoding = true;
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userManage/courseAndChildrenList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.options = data.list;
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
}
|
||||||
|
this.totalLaoding = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
this.totalLaoding = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showAddD() {
|
||||||
|
this.youVisible = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
init() {
|
||||||
|
if (!this.userId) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.init();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl(`/book/user/info/${this.userId}`),
|
||||||
|
method: "get",
|
||||||
|
params: this.$http.adornParams()
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.user = data.user;
|
||||||
|
this.getDataList();
|
||||||
|
// if (data.user.avatar && data.user.avatar != "") {
|
||||||
|
// var img = {
|
||||||
|
// name: '',
|
||||||
|
// url: data.user.avatar
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.$http({
|
||||||
|
// url: this.$http.adornUrl('/book/user/list'),
|
||||||
|
url: this.$http.adornUrl("/master/userManage/getUserCourseList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
userId: this.userId,
|
||||||
|
page: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
title: this.dataForm.key
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
console.log(data,'data')
|
||||||
|
this.dataList = data.result.records;
|
||||||
|
this.totalPage = data.result.pages;
|
||||||
|
this.total = data.result.total;
|
||||||
|
this.dataListLoading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 每页数
|
||||||
|
sizeChangeHandle(val) {
|
||||||
|
this.pageSize = val;
|
||||||
|
this.pageIndex = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 当前页
|
||||||
|
currentChangeHandle(val) {
|
||||||
|
this.pageIndex = val;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// // 多选
|
||||||
|
// selectionChangeHandle(val) {
|
||||||
|
// this.dataListSelections = val
|
||||||
|
// },
|
||||||
|
// 新增 / 修改
|
||||||
|
closeDia() {
|
||||||
|
this.adc = false;
|
||||||
|
this.$refs.pointForm.resetFields();
|
||||||
|
// this.pointForm.pointType == 0
|
||||||
|
},
|
||||||
|
getCate(id) {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userManage/catalogueListByCourse"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
"courseId": id
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
console.log('data','data++++++++++++++++++++')
|
||||||
|
this.youForm.cate = data.list
|
||||||
|
// this.youForm.cate
|
||||||
|
}else{
|
||||||
|
this.youForm.cate = []
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
console.log('数据报错')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.flexbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.userInfo {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.userInfo * {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
window.SITE_CONFIG = {};
|
window.SITE_CONFIG = {};
|
||||||
|
|
||||||
// api接口请求地址
|
// api接口请求地址
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';//张川川
|
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb';//张川川
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
||||||
window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境11
|
// window.SITE_CONFIG['baseUrl'] = 'https://testapi.nuttyreading.com'; // 线上测试环境11
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';//磊哥
|
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb';//磊哥
|
||||||
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
// window.SITE_CONFIG['baseUrl'] = 'http://59.110.212.44:9200/pb';
|
||||||
|
|||||||
Reference in New Issue
Block a user