合并代码
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Various Dev Server settings
|
// Various Dev Server settings
|
||||||
host: '192.168.110.160', // can be overwritten by process.env.HOST
|
host: '192.168.110.157', // can be overwritten by process.env.HOST
|
||||||
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||||
autoOpenBrowser: true,
|
autoOpenBrowser: true,
|
||||||
errorOverlay: true,
|
errorOverlay: true,
|
||||||
|
|||||||
BIN
src/assets/img/email.png
Normal file
BIN
src/assets/img/email.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/assets/img/tel.png
Normal file
BIN
src/assets/img/tel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -66,6 +66,8 @@ const mainRoutes = {
|
|||||||
{ 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 } },
|
{ path: '/userCourse', component: _import('modules/user/userCourse'), name: 'userCourse', meta: { title: '用户课程列表', isTab: true } },
|
||||||
|
{ path: '/userCertificate', component: _import('modules/user/userCertificate'), name: 'userCertificate', meta: { title: '用户证书列表', isTab: true } },
|
||||||
|
{ path: '/userPoints', component: _import('modules/user/userPoints'), name: 'userPoints', meta: { title: '用户湖分列表', isTab: true } },
|
||||||
{ path: '/workOrder', component: _import('modules/workOrderLIst'), name: 'workOrder', meta: { title: '工单列表', isTab: true } },
|
{ path: '/workOrder', component: _import('modules/workOrderLIst'), name: 'workOrder', meta: { title: '工单列表', isTab: true } },
|
||||||
// { path: '/miniClassList', component: _import('modules/miniClass/miniClassList'), name: 'miniClass', meta: { title: '班级列表', isTab: true } },
|
// { path: '/miniClassList', component: _import('modules/miniClass/miniClassList'), name: 'miniClass', meta: { title: '班级列表', isTab: true } },
|
||||||
// { path: '/miniClassList8', component: _import('modules/miniClass/miniClassList8'), name: 'miniClassList8', meta: { title: 'miniClassList8', isTab: true } },
|
// { path: '/miniClassList8', component: _import('modules/miniClass/miniClassList8'), name: 'miniClassList8', meta: { title: 'miniClassList8', isTab: true } },
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<!-- @selection-change="handleSelectionChange" -->
|
<!-- @selection-change="handleSelectionChange" -->
|
||||||
<el-table
|
<el-table
|
||||||
ref="table"
|
ref="table"
|
||||||
height="100%"
|
:height="`${isShowPagination?'calc(100% - 50px)':'100%'}`"
|
||||||
:data="associatedGoodsList"
|
:data="associatedGoodsList"
|
||||||
:row-key="getRowKeys"
|
:row-key="getRowKeys"
|
||||||
border
|
border
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column v-if="!disableOperate"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="操作"
|
label="操作"
|
||||||
@@ -89,7 +89,10 @@
|
|||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<slot name="operation" :row="scope.row"></slot>
|
<slot name="operation" :row="scope.row"></slot>
|
||||||
<el-button type="text" v-if="urlList.editCourse" @click="editCourse(scope.row)"
|
<el-button
|
||||||
|
type="text"
|
||||||
|
v-if="urlList.editCourse"
|
||||||
|
@click="editCourse(scope.row)"
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -102,8 +105,24 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<el-pagination style="margin-top: 10px;"
|
||||||
|
v-if="isShowPagination"
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="current"
|
||||||
|
:page-sizes="[50, 100, 200]"
|
||||||
|
:page-size="limit"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog title="提示" :visible.sync="editVisible" width="40%" style="font-size:12px">
|
<el-dialog
|
||||||
|
title="提示"
|
||||||
|
:visible.sync="editVisible"
|
||||||
|
width="40%"
|
||||||
|
style="font-size:12px"
|
||||||
|
>
|
||||||
<div style="width:100%">
|
<div style="width:100%">
|
||||||
<div style="margin-bottom:15px">
|
<div style="margin-bottom:15px">
|
||||||
<span style="font-weight:bold"
|
<span style="font-weight:bold"
|
||||||
@@ -116,7 +135,7 @@
|
|||||||
placeholder="请输入标签排序"
|
placeholder="请输入标签排序"
|
||||||
style="width: 50%"
|
style="width: 50%"
|
||||||
v-model="editForm.sort"
|
v-model="editForm.sort"
|
||||||
:min="0"
|
:min="0"
|
||||||
>
|
>
|
||||||
</el-input-number> </el-form-item
|
</el-input-number> </el-form-item
|
||||||
><el-form-item label="课程等级:">
|
><el-form-item label="课程等级:">
|
||||||
@@ -156,8 +175,11 @@ export default {
|
|||||||
"currentType",
|
"currentType",
|
||||||
"isNoSearch",
|
"isNoSearch",
|
||||||
"isNoPaging",
|
"isNoPaging",
|
||||||
|
"disableOperate",
|
||||||
|
"isShowPagination",
|
||||||
"axiosType",
|
"axiosType",
|
||||||
"otherInfo"
|
"otherInfo",
|
||||||
|
"CustomEdit"
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -173,6 +195,9 @@ export default {
|
|||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
totalPage: 0,
|
totalPage: 0,
|
||||||
|
current: 1,
|
||||||
|
limit: 50,
|
||||||
|
total: 0,
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
dataListSelections: [],
|
dataListSelections: [],
|
||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
@@ -206,9 +231,19 @@ export default {
|
|||||||
// await this.getGoodsTypeList();
|
// await this.getGoodsTypeList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
editHandleClose(){
|
handleSizeChange(val) {
|
||||||
this.editForm = {}
|
this.limit = val;
|
||||||
this.editVisible = false
|
this.getAssociatedGoodsList({ ...this.dataForm });
|
||||||
|
console.log(`每页 ${val} 条`);
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.current = val;
|
||||||
|
this.getAssociatedGoodsList({ ...this.dataForm });
|
||||||
|
console.log(`当前页: ${val}`);
|
||||||
|
},
|
||||||
|
editHandleClose() {
|
||||||
|
this.editForm = {};
|
||||||
|
this.editVisible = false;
|
||||||
},
|
},
|
||||||
submitEdit() {
|
submitEdit() {
|
||||||
this.$http({
|
this.$http({
|
||||||
@@ -217,19 +252,23 @@ export default {
|
|||||||
data: this.$http.adornData(this.editForm)
|
data: this.$http.adornData(this.editForm)
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
this.$message.success("操作成功!");
|
this.$message.success("操作成功!");
|
||||||
this.editHandleClose()
|
this.editHandleClose();
|
||||||
this.getAssociatedGoodsList()
|
this.getAssociatedGoodsList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editCourse(row) {
|
editCourse(row) {
|
||||||
console.log("row", row);
|
console.log("row", row);
|
||||||
|
if (this.CustomEdit) {
|
||||||
|
this.$emit("edit", row);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.editVisible = true;
|
this.editVisible = true;
|
||||||
this.editForm = {
|
this.editForm = {
|
||||||
title: row.title,
|
title: row.title,
|
||||||
id: row.bindId,
|
id: row.bindId,
|
||||||
sort:row.toSociologySort,
|
sort: row.toSociologySort,
|
||||||
level:row.level,
|
level: row.level,
|
||||||
selective:row.selective
|
selective: row.selective
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
shopDelete(row) {
|
shopDelete(row) {
|
||||||
@@ -293,7 +332,6 @@ export default {
|
|||||||
|
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
async getDataList(bookMarketId) {
|
async getDataList(bookMarketId) {
|
||||||
|
|
||||||
this.bookMarketId = bookMarketId;
|
this.bookMarketId = bookMarketId;
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.getDataList = [];
|
this.getDataList = [];
|
||||||
@@ -338,8 +376,39 @@ export default {
|
|||||||
var form = { ...this.defaultForm, ...this.dataForm };
|
var form = { ...this.defaultForm, ...this.dataForm };
|
||||||
|
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
|
if (this.otherInfo.httpType == "raw" && this.isShowPagination) {
|
||||||
|
this.$http
|
||||||
|
.request({
|
||||||
|
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
|
||||||
|
method: "POST",
|
||||||
|
data: { current: this.current, limit: this.limit, ...form },
|
||||||
|
header: {
|
||||||
|
//默认 无 说明:请求头
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(async ({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
console.log("data at line 359:", data);
|
||||||
|
if (this.otherInfo.resultValueName) {
|
||||||
|
this.associatedGoodsList = [
|
||||||
|
...data[this.otherInfo.resultValueName].records
|
||||||
|
];
|
||||||
|
this.total = data.certificateList.total;
|
||||||
|
console.log("this.total at line 392:", this.total);
|
||||||
|
this.$forceUpdate();
|
||||||
|
} else {
|
||||||
|
this.associatedGoodsList = [...data.result.records];
|
||||||
|
this.total = data[result].total;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.otherInfo.httpType == "raw" && this.otherInfo.isNoPaging) {
|
this.dataListLoading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (
|
||||||
|
this.otherInfo.httpType == "raw" &&
|
||||||
|
this.otherInfo.isNoPaging
|
||||||
|
) {
|
||||||
this.$http
|
this.$http
|
||||||
.request({
|
.request({
|
||||||
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
|
url: this.$http.adornUrl(`${this.urlList.hasBindProductList}`),
|
||||||
@@ -352,7 +421,14 @@ export default {
|
|||||||
})
|
})
|
||||||
.then(async ({ data }) => {
|
.then(async ({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.associatedGoodsList = [...data.result.records];
|
console.log("data at line 359:", data);
|
||||||
|
if (this.otherInfo.resultValueName) {
|
||||||
|
this.associatedGoodsList = [
|
||||||
|
...data[this.otherInfo.resultValueName].records
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
this.associatedGoodsList = [...data.result.records];
|
||||||
|
}
|
||||||
|
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
}
|
}
|
||||||
@@ -371,7 +447,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(async ({ data }) => {
|
.then(async ({ data }) => {
|
||||||
console.log('data at line 373:', data)
|
console.log("data at line 373:", data);
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.associatedGoodsList = [
|
this.associatedGoodsList = [
|
||||||
...data[this.otherInfo.httpDataValueName]
|
...data[this.otherInfo.httpDataValueName]
|
||||||
@@ -501,7 +577,7 @@ li {
|
|||||||
height: calc(100% - 50px);
|
height: calc(100% - 50px);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
// margin-left: -10px;
|
// margin-left: -10px;
|
||||||
padding-bottom: 20px;
|
// padding-bottom: 20px;
|
||||||
// margin-top: 20px;
|
// margin-top: 20px;
|
||||||
.shop_box_item {
|
.shop_box_item {
|
||||||
width: 23.7%;
|
width: 23.7%;
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
|
||||||
<slot name="tableItem"></slot>
|
<slot name="tableItem"></slot>
|
||||||
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
@@ -70,11 +72,12 @@
|
|||||||
width="80"
|
width="80"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
|
||||||
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleCurrentChange(scope.row)"
|
@click="handleCurrentChange(scope.row)"
|
||||||
size="mini"
|
size="mini"
|
||||||
>绑定</el-button
|
>{{CustomOperationText?CustomOperationText:'绑定'}}</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -120,6 +123,7 @@ export default {
|
|||||||
"title",
|
"title",
|
||||||
"isNoModal",
|
"isNoModal",
|
||||||
"urlList",
|
"urlList",
|
||||||
|
"CustomOperationText",
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
397
src/views/components/preview-image.vue
Normal file
397
src/views/components/preview-image.vue
Normal file
@@ -0,0 +1,397 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="imgbox">
|
||||||
|
<div
|
||||||
|
class="preview-img"
|
||||||
|
:class="boxClass"
|
||||||
|
v-if="
|
||||||
|
Imageslist == 3 ||
|
||||||
|
Imageslist == 5 ||
|
||||||
|
Imageslist == 7 ||
|
||||||
|
Imageslist == 8 ||
|
||||||
|
Imageslist >= 9
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="img-box"
|
||||||
|
v-for="(item, index) in imgArr"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<div v-for="(_item, _index) in item" :key="_index">
|
||||||
|
<div class="box-image" v-if="_index <= 3">
|
||||||
|
<el-image
|
||||||
|
ref="preview"
|
||||||
|
fit="cover"
|
||||||
|
:preview-src-list="previewImages"
|
||||||
|
:src="_item"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="box-image-shade"
|
||||||
|
@click="imglistclick()"
|
||||||
|
v-if="item.length > 4 && _index == 3"
|
||||||
|
>
|
||||||
|
<div class="shade-more">
|
||||||
|
<i class="el-icon-d-arrow-right"></i>
|
||||||
|
<i
|
||||||
|
class="arrow"
|
||||||
|
custom-style="margin-left:-16px;"
|
||||||
|
></i>
|
||||||
|
</div>
|
||||||
|
<div>{{ Imageslist }}张</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div :class="boxClass" class="preview-img" v-else>
|
||||||
|
<div
|
||||||
|
v-if="
|
||||||
|
Imageslist != 3 ||
|
||||||
|
Imageslist != 5 ||
|
||||||
|
Imageslist != 7 ||
|
||||||
|
Imageslist != 8 ||
|
||||||
|
Imageslist <= 9
|
||||||
|
"
|
||||||
|
class="box-image"
|
||||||
|
v-for="(item, index) in imgArr"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<el-image fit="contain" :src="item" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
previewData: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
// observer: function (newVal, oldVal) {
|
||||||
|
// console.log("newVal, oldVal", newVal, oldVal);
|
||||||
|
// const previewImages = [];
|
||||||
|
// newVal.map((item) => {
|
||||||
|
// previewImages.push(item);
|
||||||
|
// });
|
||||||
|
// this.setData({
|
||||||
|
// previewImages,
|
||||||
|
// });
|
||||||
|
// this.formatImageList(newVal);
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
previewData: function (newVal, oldVal) {
|
||||||
|
console.log("newVal, oldVal", newVal, oldVal);
|
||||||
|
const previewImages = [];
|
||||||
|
newVal.map((item) => {
|
||||||
|
previewImages.push(item);
|
||||||
|
});
|
||||||
|
this.previewImages = previewImages;
|
||||||
|
|
||||||
|
this.formatImageList(previewImages);
|
||||||
|
console.log("222222", newVal.length);
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.Imageslist = newVal.length;
|
||||||
|
});
|
||||||
|
// this.formatImageList(newVal);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
previewImages: [],
|
||||||
|
imgArr: [],
|
||||||
|
boxClass: "one",
|
||||||
|
Imageslist: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
imglistclick() {
|
||||||
|
|
||||||
|
console.log("图片", this.$refs.preview[8]);
|
||||||
|
this.$refs.preview[8].clickHandler();
|
||||||
|
},
|
||||||
|
formatImageList(imageArr) {
|
||||||
|
// console.log("imageArr---", imageArr);
|
||||||
|
console.log("长度:", imageArr.length);
|
||||||
|
|
||||||
|
const arrLength = imageArr.length;
|
||||||
|
if (arrLength == 1) {
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: imageArr,
|
||||||
|
// boxClass: "one",
|
||||||
|
// });
|
||||||
|
this.imgArr = imageArr;
|
||||||
|
this.boxClass = "one";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrLength == 2) {
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: imageArr,
|
||||||
|
// boxClass: "two",
|
||||||
|
// });
|
||||||
|
this.imgArr = imageArr;
|
||||||
|
this.boxClass = "two";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrLength == 3) {
|
||||||
|
const firstArr = [...imageArr.splice(0, 1)];
|
||||||
|
const threeArr = [[...firstArr], [...imageArr]];
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: threeArr,
|
||||||
|
// boxClass: "three",
|
||||||
|
// });
|
||||||
|
this.imgArr = threeArr;
|
||||||
|
this.boxClass = "three";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrLength == 4) {
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: imageArr,
|
||||||
|
// boxClass: "four",
|
||||||
|
// });
|
||||||
|
this.imgArr = imageArr;
|
||||||
|
this.boxClass = "four";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrLength == 5) {
|
||||||
|
const firstArr = [...imageArr.splice(0, 1)];
|
||||||
|
const fiveArr = [[...firstArr], [...imageArr]];
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: fiveArr,
|
||||||
|
// boxClass: "five",
|
||||||
|
// });
|
||||||
|
this.imgArr = fiveArr;
|
||||||
|
this.boxClass = "five";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrLength == 6) {
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: imageArr,
|
||||||
|
// boxClass: "six",
|
||||||
|
// });
|
||||||
|
this.imgArr = imageArr;
|
||||||
|
this.boxClass = "six";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrLength == 7) {
|
||||||
|
const firstArr = [...imageArr.splice(0, 1)];
|
||||||
|
const secondArr = [...imageArr.splice(0, 4)];
|
||||||
|
const sevenArr = [[...firstArr], [...secondArr], [...imageArr]];
|
||||||
|
console.log("sevenArr", sevenArr);
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: sevenArr,
|
||||||
|
// boxClass: "seven",
|
||||||
|
// });
|
||||||
|
this.imgArr = sevenArr;
|
||||||
|
this.boxClass = "seven";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrLength == 8) {
|
||||||
|
const firstArr = [...imageArr.splice(0, 1)];
|
||||||
|
const secondArr = [...imageArr.splice(0, 4)];
|
||||||
|
const eightArr = [[...firstArr], [...secondArr], [...imageArr]];
|
||||||
|
console.log("eightArr", eightArr);
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: eightArr,
|
||||||
|
// boxClass: "eight",
|
||||||
|
// });
|
||||||
|
this.imgArr = eightArr;
|
||||||
|
this.boxClass = "eight";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrLength >= 9) {
|
||||||
|
const firstArr = [...imageArr.splice(0, 1)];
|
||||||
|
const secondArr = [...imageArr.splice(0, 4)];
|
||||||
|
const nineArr = [[...firstArr], [...secondArr], [...imageArr]];
|
||||||
|
console.log("nineArr", nineArr);
|
||||||
|
// this.setData({
|
||||||
|
// imgArr: nineArr,
|
||||||
|
// boxClass: "nine",
|
||||||
|
// });
|
||||||
|
this.imgArr = nineArr;
|
||||||
|
this.boxClass = "nine";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.spanimg {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.imgbox {
|
||||||
|
width: 675px;
|
||||||
|
|
||||||
|
padding-bottom: 50px;
|
||||||
|
// background: red;
|
||||||
|
}
|
||||||
|
.preview-img {
|
||||||
|
padding: 16px 5px 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-image {
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 315px;
|
||||||
|
height: 315px;
|
||||||
|
border-radius: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-image .el-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
// width: 100px;
|
||||||
|
// height: 100px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.two {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.two .box-image + .box-image {
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.three,
|
||||||
|
.five,
|
||||||
|
.seven,
|
||||||
|
.eight,
|
||||||
|
.nine {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.three .img-box + .img-box {
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.three .img-box + .img-box .box-image {
|
||||||
|
width: 154px;
|
||||||
|
height: 153px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.four {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.four .box-image {
|
||||||
|
width: 205px;
|
||||||
|
height: 205px;
|
||||||
|
margin-right: 14px;
|
||||||
|
margin-top: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.five .img-box + .img-box {
|
||||||
|
margin-left: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.five .img-box + .img-box .box-image {
|
||||||
|
width: 153px;
|
||||||
|
height: 153px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.six {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.six .box-image {
|
||||||
|
width: 205px;
|
||||||
|
height: 205px;
|
||||||
|
margin-top: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seven,
|
||||||
|
.eight,
|
||||||
|
.nine {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seven .img-box:nth-child(2),
|
||||||
|
.eight .img-box:nth-child(2),
|
||||||
|
.nine .img-box:nth-child(2) {
|
||||||
|
margin-left: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 315px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seven .img-box:nth-child(2) .box-image,
|
||||||
|
.eight .img-box:nth-child(2) .box-image,
|
||||||
|
.nine .img-box:nth-child(2) .box-image {
|
||||||
|
width: 153px;
|
||||||
|
height: 153px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seven .img-box:nth-child(3) {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seven .img-box:nth-child(3) .box-image + .box-image {
|
||||||
|
margin-left: 12px;
|
||||||
|
margin-top: 14px;
|
||||||
|
width: 315px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eight .img-box:nth-child(3),
|
||||||
|
.nine .img-box:nth-child(3) {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eight .img-box:nth-child(3) .box-image {
|
||||||
|
width: 206px;
|
||||||
|
height: 206px;
|
||||||
|
margin-top: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nine .img-box:nth-child(3) .box-image {
|
||||||
|
width: 152px;
|
||||||
|
height: 152px;
|
||||||
|
margin-top: 12px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-image-shade {
|
||||||
|
width: 152px;
|
||||||
|
height: 152px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.55);
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #ffffff;
|
||||||
|
line-height: 42px;
|
||||||
|
padding-top: 36px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
574
src/views/modules/certificate/addCertificate.vue
Normal file
574
src/views/modules/certificate/addCertificate.vue
Normal file
@@ -0,0 +1,574 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config">
|
||||||
|
<el-dialog
|
||||||
|
:title="`${isEdit ? '编辑' : '新增'}证书`"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
width="600px"
|
||||||
|
>
|
||||||
|
<div v-if="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
:rules="dataRule"
|
||||||
|
:model="addCertificateForm"
|
||||||
|
ref="addCertificateForm"
|
||||||
|
label-width="110px"
|
||||||
|
>
|
||||||
|
<!-- <div style="background-color: #f0f0f0;padding:0 10px;box-sizing: border-box;color: #000;">
|
||||||
|
<p>绑定用户</p>
|
||||||
|
</div> -->
|
||||||
|
<template v-if="pageType == 'label'">
|
||||||
|
<el-form-item label="手机号/邮箱:" prop="userKey" class="form_item">
|
||||||
|
<div style="display: flex;align-items: center;">
|
||||||
|
<el-autocomplete
|
||||||
|
v-if="!isEdit"
|
||||||
|
style="width: 400px;"
|
||||||
|
v-model="addCertificateForm.userKey"
|
||||||
|
:fetch-suggestions="loadAll"
|
||||||
|
placeholder="请输入手机号/邮箱"
|
||||||
|
@select="handleSelect"
|
||||||
|
>
|
||||||
|
<template #default="{ item }">
|
||||||
|
<div class="custom-item">
|
||||||
|
<span>{{ item.tel ? item.tel : item.email }}</span>
|
||||||
|
<span
|
||||||
|
style="color: gray; margin-left: 10px;"
|
||||||
|
v-if="item.name"
|
||||||
|
>({{ item.name }})</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-autocomplete>
|
||||||
|
<span v-if="isEdit">{{ addCertificateForm.userKey }}</span>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="用户姓名:"
|
||||||
|
style="width: 400px;"
|
||||||
|
v-if="addCertificateForm.userId"
|
||||||
|
prop="user"
|
||||||
|
class="form_item"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<!-- <span
|
||||||
|
style="width: 110px;display: inline-block;text-align: right;"
|
||||||
|
>用户姓名:</span
|
||||||
|
> -->
|
||||||
|
{{
|
||||||
|
addCertificateForm.userName
|
||||||
|
? addCertificateForm.userName
|
||||||
|
: "-"
|
||||||
|
}}
|
||||||
|
</div></el-form-item
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
<template v-if="pageType == 'user'">
|
||||||
|
<el-form-item label="手机号/邮箱:" prop="user" class="form_item">
|
||||||
|
<div style="display: flex;align-items: center;">
|
||||||
|
{{ addCertificateForm.userKey }}
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="用户姓名:"
|
||||||
|
style="width: 400px;"
|
||||||
|
prop="user"
|
||||||
|
class="form_item"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
{{
|
||||||
|
addCertificateForm.userName
|
||||||
|
? addCertificateForm.userName
|
||||||
|
: "-"
|
||||||
|
}}
|
||||||
|
</div></el-form-item
|
||||||
|
>
|
||||||
|
<el-form-item label="证书分类" prop="user" class="form_item">
|
||||||
|
<div>
|
||||||
|
<el-cascader
|
||||||
|
:disabled="isEdit"
|
||||||
|
style="width: 400px;"
|
||||||
|
:show-all-levels="false"
|
||||||
|
v-model="addCertificateForm.labelId"
|
||||||
|
:props="{
|
||||||
|
value: 'id',
|
||||||
|
label: 'title'
|
||||||
|
}"
|
||||||
|
:options="cateOptions"
|
||||||
|
placeholder="证书分类"
|
||||||
|
@change="handleChange"
|
||||||
|
></el-cascader></div
|
||||||
|
></el-form-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class="flexbox width100"
|
||||||
|
style="display: flex;align-items: center;"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-form-item label="课程名:" prop="courseId">
|
||||||
|
<el-select
|
||||||
|
v-if="!isEdit"
|
||||||
|
v-model="addCertificateForm.courseId"
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
placeholder="请输入课程名"
|
||||||
|
:remote-method="remoteMethod"
|
||||||
|
style="width: 400px;"
|
||||||
|
@change="selectChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.title"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<span v-if="isEdit">{{ addCertificateForm.courseName }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="
|
||||||
|
addCertificateForm.cate && addCertificateForm.cate.length > 0
|
||||||
|
"
|
||||||
|
style="margin-left:20px"
|
||||||
|
>
|
||||||
|
<el-form-item
|
||||||
|
label="请选择开通的分部:"
|
||||||
|
label-width="150px"
|
||||||
|
prop="catalogueId"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-checkbox-group v-model="linshiids">
|
||||||
|
<el-checkbox
|
||||||
|
:label="item.id"
|
||||||
|
v-for="(item, index) in addCertificateForm.cate"
|
||||||
|
:key="index"
|
||||||
|
>{{ item.title }}</el-checkbox
|
||||||
|
>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</div>
|
||||||
|
<!-- <div v-for="(item, index) in addCertificateForm.cate" style=""
|
||||||
|
:key="index">
|
||||||
|
<el-radio
|
||||||
|
v-model="addCertificateForm.catalogueId"
|
||||||
|
:label="item.id"
|
||||||
|
>{{ item.title }}</el-radio
|
||||||
|
>
|
||||||
|
</div> -->
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <el-form-item label="课程名称:" prop="course" class="form_item">
|
||||||
|
<el-button plain type="primary" @click="selectCourse('addCertificateForm')"
|
||||||
|
size="mini">选择</el-button>
|
||||||
|
<span style="margin-left: 20px"></span>
|
||||||
|
<br/>
|
||||||
|
<div v-if="addCertificateForm.courseId" style="font-weight: bold;margin-top: 20px;display: flex;align-items: center;justify-content: space-between;"><p><img v-if="addCertificateForm.courseImg" :src="addCertificateForm.courseImg" alt=""style="width: 30px;height: 40px;margin-right: 20px;">{{ addCertificateForm.courseName }}</p><span @click="clearCourse" style="color: red;cursor: pointer;"><i class="el-icon-delete" style="margin-right: 4px;"></i> 删除</span></div>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<el-form-item label="证书编号" prop="certificateNo" class="form_item">
|
||||||
|
<el-input
|
||||||
|
v-model="addCertificateForm.certificateNo"
|
||||||
|
placeholder="请输入证书编号"
|
||||||
|
style="width: 400px;"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label="上传证书"
|
||||||
|
prop="title"
|
||||||
|
class="form_item"
|
||||||
|
v-if="dialogVisible"
|
||||||
|
>
|
||||||
|
<el-upload
|
||||||
|
action="https://api.nuttyreading.com/oss/fileoss"
|
||||||
|
list-type="picture-card"
|
||||||
|
accept="image/png, image/jpeg"
|
||||||
|
:file-list="fileList"
|
||||||
|
:on-success="onSuccessImg"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:on-progress="onProgress"
|
||||||
|
>
|
||||||
|
<i slot="default" class="el-icon-plus"></i>
|
||||||
|
<div slot="file" slot-scope="{ file }">
|
||||||
|
<img
|
||||||
|
class="el-upload-list__item-thumbnail"
|
||||||
|
:src="file.url"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<span class="el-upload-list__item-actions">
|
||||||
|
<!-- <span
|
||||||
|
class="el-upload-list__item-preview"
|
||||||
|
@click="handlePictureCardPreview(file)"
|
||||||
|
>
|
||||||
|
<i class="el-icon-zoom-in"></i>
|
||||||
|
</span> -->
|
||||||
|
<span
|
||||||
|
v-if="!disabled"
|
||||||
|
class="el-upload-list__item-delete"
|
||||||
|
@click="handleDownload(file)"
|
||||||
|
>
|
||||||
|
<i class="el-icon-download"></i>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="!disabled"
|
||||||
|
class="el-upload-list__item-delete"
|
||||||
|
@click="handleRemove(file)"
|
||||||
|
>
|
||||||
|
<i class="el-icon-delete"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<!-- 上传中的加载动画 -->
|
||||||
|
<div v-if="file.uploading" class="loading-spinner">
|
||||||
|
<i class="el-icon-loading"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<!-- <div class="flexBox" style="width:100%;justify-content: space-between;">
|
||||||
|
<div class="" style="display:flex">
|
||||||
|
|
||||||
|
<div
|
||||||
|
style="display:flex; align-items:center; width:100%;justify-content:center">
|
||||||
|
<div style="margin-right:15px">封面图</div>
|
||||||
|
<div>
|
||||||
|
<el-upload class="avatar-uploader" :action="baseUrl + '/oss/fileoss'"
|
||||||
|
:show-file-list="false" :on-success="handlePicSuccess">
|
||||||
|
<img v-if="fimages" :src="fimages" class="avatar" />
|
||||||
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
|
</el-upload>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div v-if="fimages != ''">
|
||||||
|
<el-tag class="delImgBtn" @click="delImg()"
|
||||||
|
type="danger">清空图片</el-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div> -->
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="handleSubmit('addCertificateForm')">
|
||||||
|
确 定</el-button
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { quillEditor } from "vue-quill-editor";
|
||||||
|
import global from "../../common/common.vue"; //引入共用组间
|
||||||
|
import debounce from "lodash/debounce"; //导入lodash中的debounce
|
||||||
|
import AddOrUpdate from "@/views/components/commonBookTags/bookTagsForm.vue";
|
||||||
|
import commonShop from "@/views/components/commonBookTags/shopproduct.vue";
|
||||||
|
import commonShopTable from "@/views/components/commonBookTags/shopproductTable.vue";
|
||||||
|
import commonTree from "@/views/components/commonBookTags/tags.vue";
|
||||||
|
|
||||||
|
import "quill/dist/quill.core.css";
|
||||||
|
import "quill/dist/quill.snow.css";
|
||||||
|
import "quill/dist/quill.bubble.css";
|
||||||
|
const toolbarOptions = [
|
||||||
|
["bold", "italic", "underline", "strike"], // 加粗,斜体,下划线,删除线
|
||||||
|
["blockquote", "code-block"], //引用,代码块
|
||||||
|
[{ header: 1 }, { header: 2 }], // 几级标题
|
||||||
|
[{ list: "ordered" }, { list: "bullet" }], // 有序列表,无序列表
|
||||||
|
[{ script: "sub" }, { script: "super" }], // 下角标,上角标
|
||||||
|
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||||
|
[{ direction: "rtl" }], // 文字输入方向
|
||||||
|
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||||
|
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||||
|
[{ color: [] }, { background: [] }], // 颜色选择
|
||||||
|
[
|
||||||
|
{
|
||||||
|
font: [
|
||||||
|
"SimSun",
|
||||||
|
"SimHei",
|
||||||
|
"Microsoft-YaHei",
|
||||||
|
"KaiTi",
|
||||||
|
"FangSong",
|
||||||
|
"Arial"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
], // 字体
|
||||||
|
[{ align: [] }], // 居中
|
||||||
|
["clean"], // 清除样式,
|
||||||
|
["link", "image"] // 上传图片、上传视频
|
||||||
|
];
|
||||||
|
// import dialogComponent from './seckillprodrelation'
|
||||||
|
export default {
|
||||||
|
props: ["data", "pageType", "dataInfo",'labelId'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dataRule: {
|
||||||
|
userKey: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入手机号/邮箱",
|
||||||
|
// trigger: "change",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
certificateNo: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入证书编号",
|
||||||
|
// trigger: "change",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
},
|
||||||
|
isUploading: false, // 上传过程中是否显示加载动画
|
||||||
|
isEdit: false, // 上传过程中是否显示加载动画
|
||||||
|
dialogImageUrl: "",
|
||||||
|
dialogVisibleImg: false,
|
||||||
|
disabled: false,
|
||||||
|
restaurants: [],
|
||||||
|
fileList: [],
|
||||||
|
options: [],
|
||||||
|
cateOptions: [],
|
||||||
|
state: "",
|
||||||
|
timeout: null,
|
||||||
|
addCertificateForm: {},
|
||||||
|
baseUrl: global.baseUrl,
|
||||||
|
isEdit: false,
|
||||||
|
checkAll: false,
|
||||||
|
isIndeterminate: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
urlList: {},
|
||||||
|
activeName: "first",
|
||||||
|
addForm: {},
|
||||||
|
audioFileList: [],
|
||||||
|
isFresh: false,
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
commonShop,
|
||||||
|
commonTree,
|
||||||
|
commonShopTable,
|
||||||
|
quillEditor
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
filterText(val) {
|
||||||
|
this.$refs.tree.filter(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.isEdit = false;
|
||||||
|
// this.getDataList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
remoteMethod(query) {
|
||||||
|
console.log(query, "query", this.addCertificateForm.key);
|
||||||
|
// return false
|
||||||
|
if (this.addCertificateForm.key !== "") {
|
||||||
|
let data = {
|
||||||
|
title: query //关键字
|
||||||
|
};
|
||||||
|
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;
|
||||||
|
if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
this.totalLaoding = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCateList() {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl(
|
||||||
|
"/master/userCertificate/userCertificateLabelList"
|
||||||
|
),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.cateOptions = data.labelList;
|
||||||
|
} else {
|
||||||
|
this.cateOptions = [];
|
||||||
|
}
|
||||||
|
this.totalLaoding = false;
|
||||||
|
if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadAll(queryString, cb) {
|
||||||
|
this.addCertificateForm.userId='';
|
||||||
|
this.addCertificateForm.userName='';
|
||||||
|
if (queryString == "") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.$http({
|
||||||
|
// url: this.$http.adornUrl('/book/user/list'),
|
||||||
|
url: this.$http.adornUrl("/book/user/getUserList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
page: 1,
|
||||||
|
limit: 9999,
|
||||||
|
key: queryString
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
var arr = data.user.records;
|
||||||
|
console.log("arr at line 467:", arr);
|
||||||
|
cb(arr);
|
||||||
|
} else {
|
||||||
|
cb([]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
createStateFilter(queryString) {
|
||||||
|
return state => {
|
||||||
|
return (
|
||||||
|
state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
||||||
|
);
|
||||||
|
};
|
||||||
|
},
|
||||||
|
handleSelect(item) {
|
||||||
|
console.log(item);
|
||||||
|
this.addCertificateForm.userKey = item.tel ? item.tel : item.email;
|
||||||
|
this.addCertificateForm.userName = item.name;
|
||||||
|
this.addCertificateForm.userId = item.id;
|
||||||
|
},
|
||||||
|
init(type, data) {
|
||||||
|
this.getCateList();
|
||||||
|
console.log("data at line 372:", data);
|
||||||
|
this.addCertificateForm = {};
|
||||||
|
this.fileList = [];
|
||||||
|
this.isEdit = type == "edit" ? true : false;
|
||||||
|
|
||||||
|
if (data) {
|
||||||
|
this.addCertificateForm = {
|
||||||
|
...data
|
||||||
|
};
|
||||||
|
this.remoteMethod(this.addCertificateForm.courseName);
|
||||||
|
if (this.addCertificateForm.images) {
|
||||||
|
console.log('this.addCertificateForm.images at line 447:', this.addCertificateForm.images)
|
||||||
|
this.fileList = this.addCertificateForm.images
|
||||||
|
.split(",")
|
||||||
|
.map((image, i) => ({
|
||||||
|
uid: i, // 假设 id 是唯一标识符
|
||||||
|
name: i, // 文件名
|
||||||
|
status: "done", // 状态
|
||||||
|
url: image // 文件 URL
|
||||||
|
}));
|
||||||
|
console.log("this.fileList at line 308:", this.fileList);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.addCertificateForm = {};
|
||||||
|
}
|
||||||
|
if (this.pageType == "label") {
|
||||||
|
if (data.userId) {
|
||||||
|
// this.addCertificateForm.userKey = data.tel ? data.tel : data.email;
|
||||||
|
// this.addCertificateForm.userName = data.name;
|
||||||
|
// this.addCertificateForm.userId = data.id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.addCertificateForm.userKey = this.dataInfo.tel
|
||||||
|
? this.dataInfo.tel
|
||||||
|
: this.dataInfo.email;
|
||||||
|
this.addCertificateForm.userName = this.dataInfo.name;
|
||||||
|
this.addCertificateForm.userId = this.dataInfo.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
handleSubmit: debounce(async function() {
|
||||||
|
// this.addCertificateForm
|
||||||
|
console.log('this.addCertificateForm at line 479:', this.addCertificateForm)
|
||||||
|
this.$refs["addCertificateForm"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if(!this.addCertificateForm.userId&&this.pageType=='label'){
|
||||||
|
this.$message.error("请选择用户");
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
var data={ }
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl(this.isEdit?'/master/userCertificate/editCertificate':"/master/userCertificate/addCertificate"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(this.isEdit?{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
certificateNo: this.addCertificateForm.certificateNo,
|
||||||
|
certificateUrl: this.fileList.map(item => item.url).join(","),
|
||||||
|
|
||||||
|
id: this.addCertificateForm.id
|
||||||
|
}:{
|
||||||
|
userId: this.addCertificateForm.userId,
|
||||||
|
labelId: this.pageType=='label'?this.labelId:this.addCertificateForm.labelId[this.addCertificateForm.labelId.length-1],
|
||||||
|
certificateNo: this.addCertificateForm.certificateNo,
|
||||||
|
certificateUrl: this.fileList.map(item => item.url).join(","),
|
||||||
|
courseId: this.addCertificateForm.courseId
|
||||||
|
})})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$emit("refresh");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 200),
|
||||||
|
|
||||||
|
onSuccessImg(response, file, fileList) {
|
||||||
|
// 上传成功后,直接将返回的 URL 放到 file 对象中
|
||||||
|
file.uploading = false;
|
||||||
|
file.url = response.url; // 假设返回的数据包含文件的 url 地址
|
||||||
|
this.fileList = fileList; // 更新 fileList
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeUpload(file) {
|
||||||
|
// 在文件上传之前,设置文件的上传状态
|
||||||
|
file.uploading = true;
|
||||||
|
},
|
||||||
|
onProgress(event, file, fileList) {
|
||||||
|
// 进度更新时,文件状态可以继续保持上传中
|
||||||
|
file.uploading = true;
|
||||||
|
},
|
||||||
|
handleRemove(file) {
|
||||||
|
this.fileList = this.fileList.filter(f => f.uid !== file.uid); // 删除文件
|
||||||
|
},
|
||||||
|
handleDownload(file) {
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = file.url;
|
||||||
|
link.download = file.name;
|
||||||
|
link.click();
|
||||||
|
},
|
||||||
|
selectChange(val) {
|
||||||
|
console.log("options", this.options);
|
||||||
|
// this.getCate(val)
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
// 图片预览逻辑
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped></style>
|
||||||
1557
src/views/modules/certificate/cateList.vue
Normal file
1557
src/views/modules/certificate/cateList.vue
Normal file
File diff suppressed because it is too large
Load Diff
412
src/views/modules/user/addPoints.vue
Normal file
412
src/views/modules/user/addPoints.vue
Normal file
@@ -0,0 +1,412 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config">
|
||||||
|
<el-dialog
|
||||||
|
:title="`${isEdit ? '编辑' : '充值'}湖分`"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="600px"
|
||||||
|
>
|
||||||
|
<div v-if="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
:model="addPointsForm"
|
||||||
|
ref="addPointsForm"
|
||||||
|
label-width="110px"
|
||||||
|
:rules="dataRule"
|
||||||
|
>
|
||||||
|
<!-- <div style="background-color: #f0f0f0;padding:0 10px;box-sizing: border-box;color: #000;">
|
||||||
|
<p>绑定用户</p>
|
||||||
|
</div> -->
|
||||||
|
<el-form-item label="用户:" prop="user" class="form_item">
|
||||||
|
<div style="display: flex;align-items: center;">
|
||||||
|
{{ dataInfo.tel ? dataInfo.tel : dataInfo.email }}
|
||||||
|
<span v-if="dataInfo.name">( {{ dataInfo.name }})</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="湖分分类" prop="type" class="form_item">
|
||||||
|
<div>
|
||||||
|
<el-select
|
||||||
|
:show-all-levels="false"
|
||||||
|
v-model="addPointsForm.type"
|
||||||
|
:options="cateOptions"
|
||||||
|
placeholder="请选择湖分分类"
|
||||||
|
@change="handleChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in cateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option
|
||||||
|
></el-select></div
|
||||||
|
></el-form-item>
|
||||||
|
<el-form-item label="充值湖分" prop="score">
|
||||||
|
<el-input-number
|
||||||
|
:min="0"
|
||||||
|
v-model="addPointsForm.score"
|
||||||
|
placeholder="请输入湖分"
|
||||||
|
>
|
||||||
|
</el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="充值明细">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
rows="5"
|
||||||
|
v-model="addPointsForm.detail"
|
||||||
|
placeholder="操作说明"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-select v-model="dataForm.expire" placeholder="证书分类"
|
||||||
|
@change="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();">
|
||||||
|
<el-option
|
||||||
|
v-for="item in statusOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select> -->
|
||||||
|
<!-- </el-form-item> -->
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="handleSubmit('addPointsForm')">
|
||||||
|
确 定</el-button
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { quillEditor } from "vue-quill-editor";
|
||||||
|
import global from "../../common/common.vue"; //引入共用组间
|
||||||
|
import debounce from "lodash/debounce"; //导入lodash中的debounce
|
||||||
|
import AddOrUpdate from "@/views/components/commonBookTags/bookTagsForm.vue";
|
||||||
|
import commonShop from "@/views/components/commonBookTags/shopproduct.vue";
|
||||||
|
import commonShopTable from "@/views/components/commonBookTags/shopproductTable.vue";
|
||||||
|
import commonTree from "@/views/components/commonBookTags/tags.vue";
|
||||||
|
|
||||||
|
import "quill/dist/quill.core.css";
|
||||||
|
import "quill/dist/quill.snow.css";
|
||||||
|
import "quill/dist/quill.bubble.css";
|
||||||
|
const toolbarOptions = [
|
||||||
|
["bold", "italic", "underline", "strike"], // 加粗,斜体,下划线,删除线
|
||||||
|
["blockquote", "code-block"], //引用,代码块
|
||||||
|
[{ header: 1 }, { header: 2 }], // 几级标题
|
||||||
|
[{ list: "ordered" }, { list: "bullet" }], // 有序列表,无序列表
|
||||||
|
[{ script: "sub" }, { script: "super" }], // 下角标,上角标
|
||||||
|
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||||
|
[{ direction: "rtl" }], // 文字输入方向
|
||||||
|
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||||
|
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||||
|
[{ color: [] }, { background: [] }], // 颜色选择
|
||||||
|
[
|
||||||
|
{
|
||||||
|
font: [
|
||||||
|
"SimSun",
|
||||||
|
"SimHei",
|
||||||
|
"Microsoft-YaHei",
|
||||||
|
"KaiTi",
|
||||||
|
"FangSong",
|
||||||
|
"Arial"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
], // 字体
|
||||||
|
[{ align: [] }], // 居中
|
||||||
|
["clean"], // 清除样式,
|
||||||
|
["link", "image"] // 上传图片、上传视频
|
||||||
|
];
|
||||||
|
// import dialogComponent from './seckillprodrelation'
|
||||||
|
export default {
|
||||||
|
props: ["data", "pageType", "dataInfo"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selectLabelId: "",
|
||||||
|
isUploading: false, // 上传过程中是否显示加载动画
|
||||||
|
isUploading: false, // 上传过程中是否显示加载动画
|
||||||
|
isEdit: false, // 上传过程中是否显示加载动画
|
||||||
|
dialogImageUrl: "",
|
||||||
|
dialogVisibleImg: false,
|
||||||
|
disabled: false,
|
||||||
|
restaurants: [],
|
||||||
|
fileList: [],
|
||||||
|
options: [],
|
||||||
|
cateOptions: [],
|
||||||
|
state: "",
|
||||||
|
timeout: null,
|
||||||
|
addPointsForm: {},
|
||||||
|
baseUrl: global.baseUrl,
|
||||||
|
isEdit: false,
|
||||||
|
checkAll: false,
|
||||||
|
isIndeterminate: true,
|
||||||
|
dialogVisible: false,
|
||||||
|
urlList: {},
|
||||||
|
activeName: "first",
|
||||||
|
addForm: {},
|
||||||
|
audioFileList: [],
|
||||||
|
isFresh: false,
|
||||||
|
dataRule: {
|
||||||
|
type: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择湖分分类"
|
||||||
|
// trigger: "change",
|
||||||
|
}
|
||||||
|
],
|
||||||
|
score: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入湖分"
|
||||||
|
// trigger: "change",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
commonShop,
|
||||||
|
commonTree,
|
||||||
|
commonShopTable,
|
||||||
|
quillEditor
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
filterText(val) {
|
||||||
|
this.$refs.tree.filter(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.isEdit = false;
|
||||||
|
// this.getDataList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
remoteMethod(query) {
|
||||||
|
console.log(query, "query", this.addPointsForm.key);
|
||||||
|
// return false
|
||||||
|
if (this.addPointsForm.key !== "") {
|
||||||
|
let data = {
|
||||||
|
title: query //关键字
|
||||||
|
};
|
||||||
|
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;
|
||||||
|
if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
this.totalLaoding = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleChange() {},
|
||||||
|
getCateList() {
|
||||||
|
// this.$http({
|
||||||
|
// url: this.$http.adornUrl(
|
||||||
|
// "/master/userCertificate/userCertificateLabelList"
|
||||||
|
// ),
|
||||||
|
// method: "post",
|
||||||
|
// data: this.$http.adornData({})
|
||||||
|
// }).then(({ data }) => {
|
||||||
|
// if (data && data.code === 0) {
|
||||||
|
// this.cateOptions = data.labelList;
|
||||||
|
// } else {
|
||||||
|
// this.cateOptions = [];
|
||||||
|
// }
|
||||||
|
// this.totalLaoding = false;
|
||||||
|
// if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
// });
|
||||||
|
this.cateOptions = [
|
||||||
|
{
|
||||||
|
value: "01",
|
||||||
|
label: "在线教学"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "03",
|
||||||
|
label: "学术期刊"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "05",
|
||||||
|
label: "太湖讲堂"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "07",
|
||||||
|
label: "创作技术"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "11",
|
||||||
|
label: "注册邀请"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "13",
|
||||||
|
label: "课程邀请"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
},
|
||||||
|
loadAll(queryString, cb) {
|
||||||
|
if (queryString == "") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.$http({
|
||||||
|
// url: this.$http.adornUrl('/book/user/list'),
|
||||||
|
url: this.$http.adornUrl("/book/user/getUserList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
page: 1,
|
||||||
|
limit: 9999,
|
||||||
|
key: queryString
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
var arr = data.user.records;
|
||||||
|
console.log("arr at line 467:", arr);
|
||||||
|
cb(arr);
|
||||||
|
} else {
|
||||||
|
cb([]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
createStateFilter(queryString) {
|
||||||
|
return state => {
|
||||||
|
return (
|
||||||
|
state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
||||||
|
);
|
||||||
|
};
|
||||||
|
},
|
||||||
|
handleSelect(item) {
|
||||||
|
console.log(item);
|
||||||
|
this.addPointsForm.userKey = item.tel ? item.tel : item.email;
|
||||||
|
this.addPointsForm.userName = item.name;
|
||||||
|
this.addPointsForm.userId = item.id;
|
||||||
|
},
|
||||||
|
init(type, data) {
|
||||||
|
this.getCateList();
|
||||||
|
console.log("data at line 372:", data);
|
||||||
|
this.addPointsForm = {};
|
||||||
|
this.fileList = [];
|
||||||
|
this.isEdit = type == "edit" ? true : false;
|
||||||
|
|
||||||
|
if (data) {
|
||||||
|
this.addPointsForm = {
|
||||||
|
// courseId: data.id,
|
||||||
|
// courseName: data.title,
|
||||||
|
// courseImg: data.image,
|
||||||
|
// images: data.image
|
||||||
|
// userId: data.userId
|
||||||
|
};
|
||||||
|
this.remoteMethod(this.addPointsForm.courseName);
|
||||||
|
if (this.addPointsForm.images) {
|
||||||
|
this.fileList = this.addPointsForm.images
|
||||||
|
.split(",")
|
||||||
|
.map((image, i) => ({
|
||||||
|
uid: i, // 假设 id 是唯一标识符
|
||||||
|
name: i, // 文件名
|
||||||
|
status: "done", // 状态
|
||||||
|
url: image // 文件 URL
|
||||||
|
}));
|
||||||
|
console.log("this.fileList at line 308:", this.fileList);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.addPointsForm = {};
|
||||||
|
}
|
||||||
|
if (this.pageType == "label") {
|
||||||
|
if (data.userId) {
|
||||||
|
this.addPointsForm.userKey = data.tel ? data.tel : data.email;
|
||||||
|
this.addPointsForm.userName = data.name;
|
||||||
|
this.addPointsForm.userId = data.id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.addPointsForm.userKey = this.dataInfo.tel
|
||||||
|
? this.dataInfo.tel
|
||||||
|
: this.dataInfo.email;
|
||||||
|
this.addPointsForm.userName = this.dataInfo.name;
|
||||||
|
this.addPointsForm.userId = this.dataInfo.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
handleSubmit: debounce(async function() {
|
||||||
|
this.$refs["addPointsForm"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl(
|
||||||
|
"/master/userContribution/saveUserContribution"
|
||||||
|
),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
userId: this.dataInfo.id,
|
||||||
|
score: this.addPointsForm.score,
|
||||||
|
detail: this.addPointsForm.detail
|
||||||
|
? this.addPointsForm.detail
|
||||||
|
: "",
|
||||||
|
type: this.addPointsForm.type
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$emit("refresh");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 200),
|
||||||
|
|
||||||
|
onSuccessImg(response, file, fileList) {
|
||||||
|
// 上传成功后,直接将返回的 URL 放到 file 对象中
|
||||||
|
file.uploading = false;
|
||||||
|
file.url = response.url; // 假设返回的数据包含文件的 url 地址
|
||||||
|
this.fileList = fileList; // 更新 fileList
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeUpload(file) {
|
||||||
|
// 在文件上传之前,设置文件的上传状态
|
||||||
|
file.uploading = true;
|
||||||
|
},
|
||||||
|
onProgress(event, file, fileList) {
|
||||||
|
// 进度更新时,文件状态可以继续保持上传中
|
||||||
|
file.uploading = true;
|
||||||
|
},
|
||||||
|
handleRemove(file) {
|
||||||
|
this.fileList = this.fileList.filter(f => f.uid !== file.uid); // 删除文件
|
||||||
|
},
|
||||||
|
handleDownload(file) {
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = file.url;
|
||||||
|
link.download = file.name;
|
||||||
|
link.click();
|
||||||
|
},
|
||||||
|
selectChange(val) {
|
||||||
|
console.log("options", this.options);
|
||||||
|
// this.getCate(val)
|
||||||
|
},
|
||||||
|
handlePictureCardPreview(file) {
|
||||||
|
// 图片预览逻辑
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -6,29 +6,33 @@
|
|||||||
@keyup.enter.native="getDataList()"
|
@keyup.enter.native="getDataList()"
|
||||||
>
|
>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable>
|
<el-input v-model="dataForm.key" placeholder="参数名" clearable size="small">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="dataForm.vipType" placeholder="请选择类型" clearable>
|
<el-select size="small"
|
||||||
<el-option label="医学SVIP" value=1></el-option>
|
v-model="dataForm.vipType"
|
||||||
<el-option label="国学与心理学SVIP" value=2></el-option>
|
placeholder="请选择类型"
|
||||||
<el-option label="中医VIP" value=4></el-option>
|
clearable
|
||||||
<el-option label="针灸VIP" value=5></el-option>
|
>
|
||||||
<el-option label="肿瘤VIP" value=6></el-option>
|
<el-option label="医学SVIP" value="1"></el-option>
|
||||||
<el-option label="国学VIP" value=7></el-option>
|
<el-option label="国学与心理学SVIP" value="2"></el-option>
|
||||||
<el-option label="心理学VIP" value=8></el-option>
|
<el-option label="中医VIP" value="4"></el-option>
|
||||||
|
<el-option label="针灸VIP" value="5"></el-option>
|
||||||
|
<el-option label="肿瘤VIP" value="6"></el-option>
|
||||||
|
<el-option label="国学VIP" value="7"></el-option>
|
||||||
|
<el-option label="心理学VIP" value="8"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button size="small"
|
||||||
@click="
|
@click="
|
||||||
pageIndex = 1;
|
pageIndex = 1;
|
||||||
getDataList();
|
getDataList();
|
||||||
"
|
"
|
||||||
>查询</el-button
|
>查询</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button size="small"
|
||||||
v-if="isAuth('book:user:save')"
|
v-if="isAuth('book:user:save')"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="addOrUpdateHandle()"
|
@click="addOrUpdateHandle()"
|
||||||
@@ -37,7 +41,7 @@
|
|||||||
<!-- <el-button type="primary" @click="addOrUpdateHandle()"
|
<!-- <el-button type="primary" @click="addOrUpdateHandle()"
|
||||||
>合并账号</el-button
|
>合并账号</el-button
|
||||||
> -->
|
> -->
|
||||||
<el-button type="primary" @click="addOpenCourse()"
|
<el-button type="primary" size="small" @click="addOpenCourse()"
|
||||||
>批量开通课程</el-button
|
>批量开通课程</el-button
|
||||||
>
|
>
|
||||||
<!-- <el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()"
|
<!-- <el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()"
|
||||||
@@ -58,37 +62,113 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
width="100"
|
||||||
prop="id"
|
prop="id"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="用户ID"
|
label="用户信息"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<el-image
|
||||||
|
v-if="scope.row.avatar && scope.row.avatar != ''"
|
||||||
|
style="width: 30px; height: 30px;cursor: pointer;"
|
||||||
|
:src="scope.row.avatar "
|
||||||
|
:preview-src-list="[scope.row.avatar]"
|
||||||
|
>
|
||||||
|
</el-image>
|
||||||
|
|
||||||
|
<img
|
||||||
|
v-else
|
||||||
|
src="../../../../static/img/morenAvavter.png"
|
||||||
|
width="30"
|
||||||
|
height="30"
|
||||||
|
class="tableImg"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style="line-height: 20px;">
|
||||||
|
<span>ID:{{ scope.row.id }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
min-width="100"
|
||||||
prop="nickname"
|
prop="nickname"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="姓名"
|
label="昵称 ( 姓名 )"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{
|
<div
|
||||||
scope.row.nickname ? scope.row.nickname : "暂无用户名"
|
style="font-size: 13px;"
|
||||||
}}</span
|
v-if="!scope.row.nickname && !scope.row.name"
|
||||||
>
|
>
|
||||||
<br/>
|
<span style="color: #999;">
|
||||||
|
未设置
|
||||||
<span v-if="!scope.row.userVips||scope.row.userVips.length==0">-</span>
|
</span>
|
||||||
|
</div>
|
||||||
<span v-else v-html="computedVipType(scope.row.userVips)">
|
<div
|
||||||
<!-- <img style="width: 25px;height: 25px;" src="../../../assets/img/vip.png" alt=""> -->
|
style="font-size: 13px;"
|
||||||
|
v-else-if="scope.row.nickname == scope.row.name"
|
||||||
</span>
|
>
|
||||||
<!-- <span v-if="scope.row.vip == 0">普通用户</span>
|
<span style="color: #999;">
|
||||||
<span v-else-if="scope.row.vip == 2">(吴门医述VIP)</span>
|
未设置
|
||||||
<span v-else-if="scope.row.vip == 1">(超级VIP)</span>
|
</span>
|
||||||
<span v-else-if="scope.row.vip == 3">(众妙之门VIP)</span> -->
|
</div>
|
||||||
|
<div style="font-size: 13px;" v-else>
|
||||||
|
<span v-if="scope.row.nickname">{{ scope.row.nickname }}</span>
|
||||||
|
<span v-else style="color: #999;">
|
||||||
|
未设置
|
||||||
|
</span>
|
||||||
|
<br />
|
||||||
|
<span style="color: #999;">(</span>
|
||||||
|
<span v-if="scope.row.name">{{ scope.row.name }}</span>
|
||||||
|
<span v-else style="color: #999;">
|
||||||
|
未设置
|
||||||
|
</span>
|
||||||
|
<span style="color: #999;">)</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
min-width="140"
|
||||||
|
prop="nickname"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="会员信息"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="!scope.row.userVips || scope.row.userVips.length == 0"
|
||||||
|
>-</span
|
||||||
|
>
|
||||||
|
|
||||||
|
<span v-else v-html="computedVipType(scope.row.userVips)"> </span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
min-width="170"
|
||||||
|
prop="tel"
|
||||||
|
header-align="center"
|
||||||
|
align="left"
|
||||||
|
label="联系方式"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div style="font-size: 14px;padding-left: 4px;">
|
||||||
|
<div>
|
||||||
|
<img
|
||||||
|
src="../../../assets/img/tel.png"
|
||||||
|
width="15"
|
||||||
|
height="15"
|
||||||
|
/>:{{ scope.row.tel ? scope.row.tel : "-" }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<img src="../../../assets/img/email.png" width="15" height="15" />
|
||||||
|
:{{ scope.row.email ? scope.row.email : "-" }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</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="性别">
|
||||||
@@ -96,62 +176,144 @@
|
|||||||
<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="头像"
|
|
||||||
>
|
|
||||||
<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-else
|
|
||||||
src="../../../../static/img/morenAvavter.png"
|
|
||||||
width="50"
|
|
||||||
height="50"
|
|
||||||
class="tableImg"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="nickname"
|
|
||||||
header-align="center"
|
|
||||||
align="center"
|
|
||||||
label="昵称"
|
|
||||||
>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="tel"
|
|
||||||
header-align="center"
|
|
||||||
align="center"
|
|
||||||
label="电话"
|
|
||||||
>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
prop="email"
|
|
||||||
header-align="center"
|
|
||||||
align="center"
|
|
||||||
label="邮箱"
|
|
||||||
>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="peanutCoin"
|
prop="peanutCoin"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="天医币"
|
label="天医币"
|
||||||
>
|
min-width="80"
|
||||||
|
><template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<router-link
|
||||||
|
:to="{
|
||||||
|
path: 'user-point-memery',
|
||||||
|
query: {
|
||||||
|
tel: scope.row.tel,
|
||||||
|
id: scope.row.id,
|
||||||
|
userName: scope.row.nickname
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
style="text-decoration: underline;font-weight: bold;color: #ff9b1a;"
|
||||||
|
>
|
||||||
|
{{ scope.row.peanutCoin }}
|
||||||
|
</span>
|
||||||
|
</router-link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
style="color: #ff9b1a;padding: 0;position: absolute;top: 4px;right: 0px;font-weight: 500;"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="ck(scope.row)"
|
||||||
|
>
|
||||||
|
【充/扣】
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="peanutCoin"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
min-width="80"
|
||||||
|
label="湖分"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div><router-link
|
||||||
|
:to="{ path: '/userPoints', query: { id: scope.row.id } }"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
style="text-decoration: underline;font-weight: bold;color: #16aa68;"
|
||||||
|
>
|
||||||
|
{{ scope.row.contributionScore }}
|
||||||
|
</span>
|
||||||
|
</router-link></div>
|
||||||
|
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
style="color: #16aa68;padding: 0;position: absolute;top: 4px;right: 0px;"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="handleRecharge(scope.row)"
|
||||||
|
>
|
||||||
|
【充值】
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="peanutCoin"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
min-width="80"
|
||||||
|
label="课程管理"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<!-- <el-button style="background-color: #467cfd;color: #fff;" type="text" size="small"> -->
|
||||||
|
<router-link
|
||||||
|
:to="{
|
||||||
|
path: '/userCourse',
|
||||||
|
query: { id: scope.row.id }
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-button type="text" size="small" style="color: #467cfd;border: 1px solid #467cfdcc;padding: 4px;">
|
||||||
|
课程列表
|
||||||
|
</el-button>
|
||||||
|
</router-link>
|
||||||
|
<!-- </el-button> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="peanutCoin"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
min-width="80"
|
||||||
|
label="证书管理"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<!-- <el-button style="color: #365089;" type="text" size="small"> -->
|
||||||
|
<router-link
|
||||||
|
:to="{
|
||||||
|
path: '/userCertificate',
|
||||||
|
query: { id: scope.row.id }
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-button type="text" size="small" style="color: #365089; border: 1px solid #365089cc;padding: 4px;">
|
||||||
|
证书列表
|
||||||
|
</el-button>
|
||||||
|
</router-link>
|
||||||
|
<!-- </el-button> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="peanutCoin"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
min-width="90"
|
||||||
|
label="优惠券管理"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
style="color: #d9904e;border: 1px solid #d9904ecc;padding: 4px;"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="
|
||||||
|
thisUserID = scope.row.id;
|
||||||
|
youVisible = true;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
优惠券列表
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
fixed="right"
|
fixed="right"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
width="150"
|
min-width="130"
|
||||||
label="操作"
|
label="操作"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -160,14 +322,18 @@
|
|||||||
size="small"
|
size="small"
|
||||||
@click="addOrUpdateHandle(scope.row.id)"
|
@click="addOrUpdateHandle(scope.row.id)"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
><span style="margin-left: 4px;">|</span>
|
||||||
|
<el-button type="text" size="small" @click="resetPassword(scope.row)"
|
||||||
|
>修改密码</el-button
|
||||||
|
><span style="margin-left: 4px;">|</span>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
|
style="color: red;"
|
||||||
size="small"
|
size="small"
|
||||||
@click="deleteHandle(scope.row.id)"
|
@click="deleteHandle(scope.row.id)"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
<el-dropdown>
|
<!-- <el-dropdown>
|
||||||
<span
|
<span
|
||||||
class="el-dropdown-link"
|
class="el-dropdown-link"
|
||||||
style="font-size:12px; color:#17B3A3; cursor: pointer;"
|
style="font-size:12px; color:#17B3A3; cursor: pointer;"
|
||||||
@@ -224,15 +390,37 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</router-link>
|
</router-link>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<!-- <el-dropdown-item>
|
<el-dropdown-item>
|
||||||
|
<router-link
|
||||||
|
:to="{ path: '/userPoints', query: { id: scope.row.id } }"
|
||||||
|
>
|
||||||
|
<el-button type="text" size="small">
|
||||||
|
湖分管理
|
||||||
|
</el-button>
|
||||||
|
</router-link>
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item>
|
||||||
|
<router-link
|
||||||
|
:to="{
|
||||||
|
path: '/userCertificate',
|
||||||
|
query: { id: scope.row.id }
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-button type="text" size="small">
|
||||||
|
证书管理
|
||||||
|
</el-button>
|
||||||
|
</router-link>
|
||||||
|
</el-dropdown-item>
|
||||||
|
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-dropdown-item>
|
||||||
<el-button type="text" size="small" @click="openVip(scope.row)">
|
<el-button type="text" size="small" @click="openVip(scope.row)">
|
||||||
开通VIP
|
开通VIP
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-dropdown-item> -->
|
</el-dropdown-item> -->
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -251,8 +439,7 @@
|
|||||||
@refreshDataList="getDataList"
|
@refreshDataList="getDataList"
|
||||||
></add-or-update>
|
></add-or-update>
|
||||||
<!-- 开通VIP -->
|
<!-- 开通VIP -->
|
||||||
<open-vip v-if="openVipVisible" ref="openVip">
|
<open-vip v-if="openVipVisible" ref="openVip"> </open-vip>
|
||||||
</open-vip>
|
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="充/扣天医币"
|
title="充/扣天医币"
|
||||||
@@ -325,13 +512,20 @@
|
|||||||
:userId="thisUserID"
|
:userId="thisUserID"
|
||||||
@close="closeCoupon"
|
@close="closeCoupon"
|
||||||
></userCouponList>
|
></userCouponList>
|
||||||
|
<addCertificate
|
||||||
|
@refresh="getDataList()"
|
||||||
|
ref="addCertificate"
|
||||||
|
pageType="user"
|
||||||
|
:dataInfo="currentuserInfo"
|
||||||
|
></addCertificate>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import userCouponList from "../coupon/userCouponList";
|
import userCouponList from "../coupon/userCouponList";
|
||||||
import OpenVip from "./user-open-vip"
|
import OpenVip from "./user-open-vip";
|
||||||
import AddOrUpdate from "./user-add-or-update";
|
import AddOrUpdate from "./user-add-or-update";
|
||||||
|
import addCertificate from "./addPoints.vue";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -376,15 +570,17 @@ export default {
|
|||||||
addOrUpdateVisible: false,
|
addOrUpdateVisible: false,
|
||||||
youVisible: false,
|
youVisible: false,
|
||||||
youForm: {},
|
youForm: {},
|
||||||
|
currentuserInfo: {},
|
||||||
courperList: [],
|
courperList: [],
|
||||||
courperHistList: [],
|
courperHistList: [],
|
||||||
//开通vip
|
//开通vip
|
||||||
openVipVisible: false,
|
openVipVisible: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
userCouponList,
|
userCouponList,
|
||||||
|
addCertificate,
|
||||||
OpenVip
|
OpenVip
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
@@ -392,32 +588,34 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//批量开通课程
|
//批量开通课程
|
||||||
addOpenCourse(){
|
addOpenCourse() {
|
||||||
this.$router.push('/user-add-course');
|
this.$router.push("/user-add-course");
|
||||||
},
|
},
|
||||||
//开通vip
|
//开通vip
|
||||||
openVip(row){
|
openVip(row) {
|
||||||
this.openVipVisible = true;
|
this.openVipVisible = true;
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(() => {
|
||||||
this.$refs.openVip.init(row);
|
this.$refs.openVip.init(row);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
computedVipType(userVips) {
|
computedVipType(userVips) {
|
||||||
if (!userVips || userVips.length === 0) return '';
|
if (!userVips || userVips.length === 0) return "";
|
||||||
|
|
||||||
const vipMap = {
|
const vipMap = {
|
||||||
4: '中医VIP',
|
4: "中医VIP",
|
||||||
5: '针灸VIP',
|
5: "针灸VIP",
|
||||||
6: '肿瘤VIP',
|
6: "肿瘤VIP",
|
||||||
7: '国学VIP',
|
7: "国学VIP",
|
||||||
8: '心理学VIP'
|
8: "心理学VIP"
|
||||||
};
|
};
|
||||||
|
|
||||||
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
||||||
let vipTypes = [];
|
let vipTypes = [];
|
||||||
if (typeof userVips === 'number') {
|
if (typeof userVips === "number") {
|
||||||
vipTypes = String(userVips).split('').map(Number); // 数字转为数组
|
vipTypes = String(userVips)
|
||||||
|
.split("")
|
||||||
|
.map(Number); // 数字转为数组
|
||||||
} else {
|
} else {
|
||||||
vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type
|
vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type
|
||||||
}
|
}
|
||||||
@@ -431,25 +629,37 @@ export default {
|
|||||||
|
|
||||||
// 1. 医学SVIP(只显示一次)
|
// 1. 医学SVIP(只显示一次)
|
||||||
if (hasMedicalSVip) {
|
if (hasMedicalSVip) {
|
||||||
tags.push(`<el-tag size="mini" type="warning" style="font-weight: bold; background-image: linear-gradient(90deg, #ff1f00 0%, #fa9f93 100%); color: #fff; padding: 2px; border-radius: 2px; font-size: 10px;" effect="dark">医学SVIP</el-tag>`);
|
tags.push(
|
||||||
|
`<el-tag size="mini" type="warning" style="font-weight: bold; background-image: linear-gradient(90deg, #ff1f00 0%, #fa9f93 100%); color: #fff; padding: 2px; border-radius: 2px; font-size: 11px;" effect="dark">医学SVIP</el-tag>`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. 心理学SVIP(只显示一次)
|
// 2. 心理学SVIP(只显示一次)
|
||||||
if (hasPsychologySVip) {
|
if (hasPsychologySVip) {
|
||||||
tags.push(`<el-tag size="mini" type="warning" style="font-weight: bold; background-image: linear-gradient(90deg, #67c23a 0%, #e1f3d8 100%); color: #fff; padding: 2px; border-radius: 2px; font-size: 10px;" effect="dark">心理学SVIP</el-tag>`);
|
tags.push(
|
||||||
|
`<el-tag size="mini" type="warning" style="font-weight: bold; background-image: linear-gradient(90deg, #67c23a 0%, #e1f3d8 100%); color: #fff; padding: 2px; border-radius: 2px; font-size: 11px;" effect="dark">心理学SVIP</el-tag>`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 普通VIP标签(确保不重复显示SVIP相关的类型)
|
// 3. 普通VIP标签(确保不重复显示SVIP相关的类型)
|
||||||
vipTypes
|
vipTypes
|
||||||
.filter(type => vipMap[type] && !(
|
.filter(
|
||||||
(hasMedicalSVip && [4, 5, 6].includes(type)) || // 医学SVIP已显示,排除 4、5、6
|
type =>
|
||||||
(hasPsychologySVip && [7, 8].includes(type)) // 心理学SVIP已显示,排除 7、8
|
vipMap[type] &&
|
||||||
))
|
!(
|
||||||
|
(
|
||||||
|
(hasMedicalSVip && [4, 5, 6].includes(type)) || // 医学SVIP已显示,排除 4、5、6
|
||||||
|
(hasPsychologySVip && [7, 8].includes(type))
|
||||||
|
) // 心理学SVIP已显示,排除 7、8
|
||||||
|
)
|
||||||
|
)
|
||||||
.forEach(type => {
|
.forEach(type => {
|
||||||
tags.push(`<el-tag size="mini" type="info" style="font-weight: bold; color: #fff; padding: 2px; border-radius: 2px; font-size: 10px; background: #409EFF;" effect="dark">${vipMap[type]}</el-tag>`);
|
tags.push(
|
||||||
|
`<el-tag size="mini" type="info" style="font-weight: bold; color: #fff; padding: 2px; border-radius: 2px; font-size: 11px; background: #409EFF;" effect="dark">${vipMap[type]}</el-tag>`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return tags.join(' ');
|
return tags.join(" ");
|
||||||
},
|
},
|
||||||
|
|
||||||
getVipMoney(data) {
|
getVipMoney(data) {
|
||||||
@@ -461,20 +671,20 @@ export default {
|
|||||||
})
|
})
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
var list=[]
|
var list = [];
|
||||||
console.log("data at line 436:", data.list);
|
console.log("data at line 436:", data.list);
|
||||||
for(let i in data.list){
|
for (let i in data.list) {
|
||||||
if (data.list[i].length > 0) {
|
if (data.list[i].length > 0) {
|
||||||
list.push([...data.list[i]]);
|
list.push([...data.list[i]]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.vipList=list.flat(Infinity)
|
this.vipList = list.flat(Infinity);
|
||||||
|
|
||||||
console.log("this.vipList at line 440:", this.vipList);
|
console.log("this.vipList at line 440:", this.vipList);
|
||||||
}else{
|
} else {
|
||||||
this.$message.error(data.msg);
|
this.$message.error(data.msg);
|
||||||
this.vipList=[]
|
this.vipList = [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -617,6 +827,12 @@ export default {
|
|||||||
this.pointForm = e;
|
this.pointForm = e;
|
||||||
this.adc = true;
|
this.adc = true;
|
||||||
},
|
},
|
||||||
|
handleRecharge(val) {
|
||||||
|
this.currentuserInfo = val;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addCertificate.init("add", {});
|
||||||
|
});
|
||||||
|
},
|
||||||
huaSheng(point) {
|
huaSheng(point) {
|
||||||
// console.log(this.pointForm.pointAmount, point)
|
// console.log(this.pointForm.pointAmount, point)
|
||||||
if (this.pointForm.pointAmount > point && this.pointForm.pointType == 1) {
|
if (this.pointForm.pointAmount > point && this.pointForm.pointType == 1) {
|
||||||
@@ -703,3 +919,13 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
/deep/ .mod-config .el-table .el-table__cell {
|
||||||
|
padding: 4px 0 !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
/deep/ .mod-config .el-table .cell, .el-table th div {
|
||||||
|
padding: 0 !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
729
src/views/modules/user/userCertificate.vue
Normal file
729
src/views/modules/user/userCertificate.vue
Normal file
@@ -0,0 +1,729 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config">
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:model="dataForm"
|
||||||
|
@keyup.enter.native="getDataList()"
|
||||||
|
>
|
||||||
|
<el-form-item label="">
|
||||||
|
<el-form-item
|
||||||
|
label="证书分类"
|
||||||
|
|
||||||
|
prop="user"
|
||||||
|
class="form_item"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-cascader size="small"
|
||||||
|
:show-all-levels="false"
|
||||||
|
v-model="Certificate"
|
||||||
|
:props="{
|
||||||
|
value: 'id',
|
||||||
|
label: 'title'
|
||||||
|
}"
|
||||||
|
:options="cateOptions"
|
||||||
|
placeholder="证书分类"
|
||||||
|
@change="handleChange"
|
||||||
|
></el-cascader></div
|
||||||
|
></el-form-item>
|
||||||
|
<el-form-item label="证书名称">
|
||||||
|
<el-input size="small"
|
||||||
|
v-model="dataForm.title"
|
||||||
|
placeholder="请输入证书名称"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="">
|
||||||
|
<el-input v-model="dataForm.userInfo" placeholder="用户手机/邮箱/姓名" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<!-- <el-select v-model="dataForm.expire" placeholder="证书分类"
|
||||||
|
@change="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();">
|
||||||
|
<el-option
|
||||||
|
v-for="item in statusOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
@click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();
|
||||||
|
"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
<el-button size="small"
|
||||||
|
@click="
|
||||||
|
dataForm = {};
|
||||||
|
Certificate=[]
|
||||||
|
|
||||||
|
"
|
||||||
|
>重置</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="showAddD" type="primary" size="small">开通证书</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="float:right">
|
||||||
|
<div v-if="user.id" class="flexbox userInfo" style="margin-bottom: 0;">
|
||||||
|
<div>用户信息:{{ user.name }}{{user.tel?user.tel:user.email }}</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
|
||||||
|
label="证书编号"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
prop="certificateNo"
|
||||||
|
>
|
||||||
|
<!-- <template slot-scope="scope">
|
||||||
|
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||||
|
</template> -->
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="证书名称"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<!-- <el-table-column
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="课程图"
|
||||||
|
width="140"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img
|
||||||
|
v-if="scope.row.image != ''"
|
||||||
|
:src="scope.row.image"
|
||||||
|
width="25"
|
||||||
|
height="35"
|
||||||
|
class="tableImg"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="证书"
|
||||||
|
width="160"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope" v-if="scope.row.certificateUrl != ''">
|
||||||
|
<!-- <el-image
|
||||||
|
ref="preview"
|
||||||
|
fit="cover"
|
||||||
|
:preview-src-list="previewImages"
|
||||||
|
:src="item"
|
||||||
|
v-for="(item,index) in scope.row.certificateUrl.split(',')"
|
||||||
|
/> -->
|
||||||
|
<el-image
|
||||||
|
:key="index"
|
||||||
|
v-for="(item, index) in scope.row.certificateUrl.split(',')"
|
||||||
|
style="width: 50px; height: 60px;margin-right: 4px;cursor: pointer;"
|
||||||
|
:src="item"
|
||||||
|
:preview-src-list="scope.row.certificateUrl.split(',')"
|
||||||
|
>
|
||||||
|
</el-image>
|
||||||
|
|
||||||
|
<!-- <img style="margin-right: 5px;"
|
||||||
|
v-for="(item,index) in scope.row.certificateUrl.split(',')"
|
||||||
|
:src="item"
|
||||||
|
width="30"
|
||||||
|
height="40"
|
||||||
|
class="tableImg"
|
||||||
|
/> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="createTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="160"
|
||||||
|
label="创建日期"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
fixed="right"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="160"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
|
||||||
|
type="primary"
|
||||||
|
@click="delay(scope.row)"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button type="danger" @click="dataFormDelete(scope.row)" plain size="mini"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
@size-change="sizeChangeHandle"
|
||||||
|
@current-change="currentChangeHandle"
|
||||||
|
:current-page="pageIndex"
|
||||||
|
:page-sizes="[50, 100, 200]"
|
||||||
|
: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
|
||||||
|
style="width:100%"
|
||||||
|
: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 width100">
|
||||||
|
<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>
|
||||||
|
<!-- {{youForm.cate}} -->
|
||||||
|
<div
|
||||||
|
v-if="youForm.cate && youForm.cate.length > 0"
|
||||||
|
style="margin-left:20px"
|
||||||
|
>
|
||||||
|
<el-form-item
|
||||||
|
label="请选择开通的分部:"
|
||||||
|
label-width="150px"
|
||||||
|
prop="catalogueId"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-checkbox-group v-model="linshiids">
|
||||||
|
<el-checkbox
|
||||||
|
:label="item.id"
|
||||||
|
v-for="(item, index) in youForm.cate"
|
||||||
|
:key="index"
|
||||||
|
>{{ item.title }}</el-checkbox
|
||||||
|
>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</div>
|
||||||
|
<!-- <div v-for="(item, index) in youForm.cate" style=""
|
||||||
|
: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"
|
||||||
|
style="width:400px"
|
||||||
|
>
|
||||||
|
<el-input v-model="youForm.days" placeholder="请选择开通时长"
|
||||||
|
><template slot="append">天</template></el-input
|
||||||
|
>
|
||||||
|
<!-- <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-item label="开通原因:" prop="come" style="width: 400px">
|
||||||
|
<el-input
|
||||||
|
v-model="youForm.come"
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</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>
|
||||||
|
<addCertificate
|
||||||
|
ref="addCertificate"
|
||||||
|
:data="addCertificateForm"
|
||||||
|
pageType="user"
|
||||||
|
:dataInfo="user"
|
||||||
|
@refresh="getDataList"
|
||||||
|
></addCertificate>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import debounce from "lodash/debounce"; //导入lodash中的debounce
|
||||||
|
import addCertificate from "@/views/modules/certificate/addCertificate.vue";
|
||||||
|
// import AddOrUpdate from './user-add-or-update'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
cateOptions: [],
|
||||||
|
Certificate: [],
|
||||||
|
dataForm: {
|
||||||
|
key: "",
|
||||||
|
expire: "",
|
||||||
|
userInfo: ""
|
||||||
|
},
|
||||||
|
statusOptions: [
|
||||||
|
{
|
||||||
|
value: "0",
|
||||||
|
label: "有效"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "-1",
|
||||||
|
label: "已过期"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
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: "30天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "60",
|
||||||
|
label: "60天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "90",
|
||||||
|
label: "90天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "120",
|
||||||
|
label: "120天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "150",
|
||||||
|
label: "150天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "180",
|
||||||
|
label: "180天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "365",
|
||||||
|
label: "365天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "730",
|
||||||
|
label: "730天"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dataList: [],
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
total: 0,
|
||||||
|
totalLaoding: false,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
|
||||||
|
youVisible: false,
|
||||||
|
linshiids: [],
|
||||||
|
|
||||||
|
youForm: {
|
||||||
|
courseId: null,
|
||||||
|
cate: [],
|
||||||
|
catalogueId: "",
|
||||||
|
days: "",
|
||||||
|
come: "" //管理员开通(原因)
|
||||||
|
},
|
||||||
|
linshilist: [
|
||||||
|
{
|
||||||
|
title: "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "2"
|
||||||
|
},
|
||||||
|
{ title: "3" }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
addCertificate
|
||||||
|
// AddOrUpdate
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.userId = this.$route.query.id;
|
||||||
|
console.log(this.$route.query);
|
||||||
|
console.log(this.userId, "onsole.log(this.$route.query)");
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.userId = this.$route.query.id;
|
||||||
|
this.init();
|
||||||
|
// this.getDataList()
|
||||||
|
// this.getcourpeList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
dataFormDelete: debounce(async function(row, deleteType) {
|
||||||
|
console.log("row at line 515:", row);
|
||||||
|
this.$confirm(
|
||||||
|
`确定要删除${deleteType != "all" ? "该" : "所有"}证书嘛?`,
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(async () => {
|
||||||
|
// var lableIds = row[0].bookLabelId;
|
||||||
|
var productIds = row.id;
|
||||||
|
|
||||||
|
await this.$http
|
||||||
|
.request({
|
||||||
|
url: this.$http.adornUrl(`/master/userCertificate/delCertificate`),
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
id: productIds
|
||||||
|
// marketId: this.addForm.id
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
//默认 无 说明:请求头
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(async ({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// this.$refs.commonShop.selectShopArr = [];
|
||||||
|
this.getDataList()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}, 200),
|
||||||
|
getCateList() {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl(
|
||||||
|
"/master/userCertificate/userCertificateLabelList"
|
||||||
|
),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.cateOptions = data.labelList;
|
||||||
|
} else {
|
||||||
|
this.cateOptions = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delay(val) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addCertificate.init("edit", {
|
||||||
|
certificateNo:val.certificateNo,
|
||||||
|
id:val.id,
|
||||||
|
userId:val.userId,
|
||||||
|
userKey:val.user.tel||val.user.email,
|
||||||
|
userName:val.user.name,
|
||||||
|
courseId:val.courseId,
|
||||||
|
courseName:val.title,
|
||||||
|
labelId:val.labelId,
|
||||||
|
images:val.certificateUrl,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delaySubmit(data) {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userCourseBuy/delayUserCourseBuy"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data && data.code == 0) {
|
||||||
|
this.$message.success("操作成功!");
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.$message.error("操作失败!");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.$message.error(err.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
submit() {
|
||||||
|
console.log(this.youForm, "youForm");
|
||||||
|
this.youForm.catalogueId = this.linshiids.join(",");
|
||||||
|
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/userCourseBuy/insertUserCourseBuy"
|
||||||
|
),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
this.$message.success("开课成功!");
|
||||||
|
this.getDataList();
|
||||||
|
this.dialogClose();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.log("表单提交报错");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dialogClose() {
|
||||||
|
this.youVisible = false;
|
||||||
|
this.linshiids = [];
|
||||||
|
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("options", this.options);
|
||||||
|
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;
|
||||||
|
if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
this.totalLaoding = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showAddD() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addCertificate.init("add", {});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.getCateList();
|
||||||
|
// 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) return this.$message.error(data.msg);
|
||||||
|
|
||||||
|
this.user = data.user;
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.$http({
|
||||||
|
// url: this.$http.adornUrl('/book/user/list'),
|
||||||
|
url: this.$http.adornUrl("/master/userCertificate/userCertificateList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
current: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
|
||||||
|
userId: this.userId, //用户id
|
||||||
|
title: this.dataForm.title, //课程名
|
||||||
|
labelId: this.Certificate[this.Certificate.length-1] //课程名
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
console.log(data, "data");
|
||||||
|
this.dataList = data.certificateList.records;
|
||||||
|
this.totalPage = data.certificateList.pages;
|
||||||
|
this.total = data.certificateList.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.linshiids = [];
|
||||||
|
|
||||||
|
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 = [];
|
||||||
|
this.linshiids = [];
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.log("数据报错");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
/deep/ .width100 .el-input__inner {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.flexbox {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.userInfo {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.userInfo * {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
@keyup.enter.native="getDataList()"
|
@keyup.enter.native="getDataList()"
|
||||||
>
|
>
|
||||||
<el-form-item label="">
|
<el-form-item label="">
|
||||||
<el-input v-model="dataForm.key" placeholder="请输入课程名" clearable>
|
<el-input v-model="dataForm.key" placeholder="请输入课程名" size="small" clearable>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="">
|
<!-- <el-form-item label="">
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="">
|
<el-form-item label="">
|
||||||
<el-select v-model="dataForm.expire" placeholder="课程状态"
|
<el-select v-model="dataForm.expire" placeholder="课程状态" size="small"
|
||||||
@change="
|
@change="
|
||||||
pageIndex = 1;
|
pageIndex = 1;
|
||||||
getDataList();">
|
getDataList();">
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item >
|
<el-form-item >
|
||||||
<el-button
|
<el-button size="small"
|
||||||
@click="
|
@click="
|
||||||
pageIndex = 1;
|
pageIndex = 1;
|
||||||
getDataList();
|
getDataList();
|
||||||
@@ -37,17 +37,17 @@
|
|||||||
>
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="showAddD" type="primary">开通课程</el-button>
|
<el-button @click="showAddD" type="primary" size="small">开通课程</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="float:right">
|
<el-form-item style="float:right">
|
||||||
<div v-if="user.id" class="flexbox userInfo">
|
<div v-if="user.id" class="flexbox userInfo" style="margin-bottom: 0;">
|
||||||
<div>用户信息:{{ user.name }}{{ user.tel }}</div>
|
<div>用户信息:{{ user.name }}{{ user.tel }}</div>
|
||||||
<div>
|
<!-- <div>
|
||||||
<span v-if="user.vip == 0">(普通用户)</span>
|
<span v-if="user.vip == 0">(普通用户)</span>
|
||||||
<span v-else-if="user.vip == 2">(吴门医述VIP)</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 == 1">(超级VIP)</span>
|
||||||
<span v-else-if="user.vip == 3">(众妙之门VIP)</span>
|
<span v-else-if="user.vip == 3">(众妙之门VIP)</span>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
686
src/views/modules/user/userPoints.vue
Normal file
686
src/views/modules/user/userPoints.vue
Normal file
@@ -0,0 +1,686 @@
|
|||||||
|
<template>
|
||||||
|
<div class="mod-config">
|
||||||
|
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:model="dataForm"
|
||||||
|
@keyup.enter.native="getDataList()"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="">
|
||||||
|
<el-form-item
|
||||||
|
label="湖分分类"
|
||||||
|
|
||||||
|
prop="user"
|
||||||
|
class="form_item"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-select size="small"
|
||||||
|
clearable
|
||||||
|
:show-all-levels="false"
|
||||||
|
v-model="selectLabelId"
|
||||||
|
:options="cateOptions"
|
||||||
|
placeholder="湖分分类"
|
||||||
|
@change="handleChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in cateOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option
|
||||||
|
></el-select></div
|
||||||
|
></el-form-item>
|
||||||
|
<!-- <el-form-item label="证书名称">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.title"
|
||||||
|
placeholder="请输入证书名称"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="">
|
||||||
|
<el-input v-model="dataForm.userInfo" placeholder="用户手机/邮箱/姓名" clearable>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<!-- <el-select v-model="dataForm.expire" placeholder="证书分类"
|
||||||
|
@change="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();">
|
||||||
|
<el-option
|
||||||
|
v-for="item in statusOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button size="small"
|
||||||
|
@click="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();
|
||||||
|
"
|
||||||
|
>查询</el-button
|
||||||
|
>
|
||||||
|
<!-- <el-button
|
||||||
|
@click="
|
||||||
|
dataForm = {};
|
||||||
|
selectLabelId=[]
|
||||||
|
|
||||||
|
"
|
||||||
|
>重置</el-button
|
||||||
|
> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="showAddD" type="primary" size="small">充值</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="float:right">
|
||||||
|
<div v-if="user.id" class="flexbox userInfo" style="margin-bottom: 0;">
|
||||||
|
<div>
|
||||||
|
用户信息:{{ user.name }}{{ user.tel ? user.tel : user.email }}
|
||||||
|
</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>
|
||||||
|
<!-- <div style="color: rgb(22, 170, 104);font-weight: bold;text-align: right;">总湖分:{{ user.jf }}</div> -->
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
width="100"
|
||||||
|
align="center"
|
||||||
|
prop="certificateNo"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="140"
|
||||||
|
label="湖分类型"
|
||||||
|
><template slot-scope="scope">
|
||||||
|
<span>{{ getPointsType(scope.row.type) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="score" width="140"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="湖分"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="detail"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="描述"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<!-- <el-table-column
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="课程图"
|
||||||
|
width="140"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img
|
||||||
|
v-if="scope.row.image != ''"
|
||||||
|
:src="scope.row.image"
|
||||||
|
width="25"
|
||||||
|
height="35"
|
||||||
|
class="tableImg"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
prop="createTime"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="180"
|
||||||
|
label="创建日期"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
fixed="right"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="100"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
|
||||||
|
<el-button type="danger" @click="dataFormDelete(scope.row)" plain size="mini"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
@size-change="sizeChangeHandle"
|
||||||
|
@current-change="currentChangeHandle"
|
||||||
|
:current-page="pageIndex"
|
||||||
|
:page-sizes="[50, 100, 200]"
|
||||||
|
: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
|
||||||
|
style="width:100%"
|
||||||
|
: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>
|
||||||
|
|
||||||
|
<el-form-item label="充值原因:" prop="come" style="width: 400px">
|
||||||
|
<el-input
|
||||||
|
v-model="youForm.come"
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
></el-input>
|
||||||
|
</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>
|
||||||
|
<addCertificate
|
||||||
|
@refresh="
|
||||||
|
pageIndex = 1;
|
||||||
|
getDataList();
|
||||||
|
"
|
||||||
|
ref="addCertificate"
|
||||||
|
:data="addCertificateForm"
|
||||||
|
pageType="user"
|
||||||
|
:dataInfo="user"
|
||||||
|
></addCertificate>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import debounce from "lodash/debounce"; //导入lodash中的debounce
|
||||||
|
import addCertificate from "./addPoints.vue";
|
||||||
|
// import AddOrUpdate from './user-add-or-update'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
cateOptions: [],
|
||||||
|
selectLabelId: "",
|
||||||
|
dataForm: {
|
||||||
|
key: "",
|
||||||
|
expire: "",
|
||||||
|
userInfo: ""
|
||||||
|
},
|
||||||
|
statusOptions: [
|
||||||
|
{
|
||||||
|
value: "0",
|
||||||
|
label: "有效"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "-1",
|
||||||
|
label: "已过期"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
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: "30天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "60",
|
||||||
|
label: "60天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "90",
|
||||||
|
label: "90天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "120",
|
||||||
|
label: "120天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "150",
|
||||||
|
label: "150天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "180",
|
||||||
|
label: "180天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "365",
|
||||||
|
label: "365天"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "730",
|
||||||
|
label: "730天"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dataList: [],
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
total: 0,
|
||||||
|
totalLaoding: false,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
|
||||||
|
youVisible: false,
|
||||||
|
linshiids: [],
|
||||||
|
|
||||||
|
youForm: {
|
||||||
|
courseId: null,
|
||||||
|
cate: [],
|
||||||
|
catalogueId: "",
|
||||||
|
days: "",
|
||||||
|
come: "" //管理员开通(原因)
|
||||||
|
},
|
||||||
|
linshilist: [
|
||||||
|
{
|
||||||
|
title: "1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "2"
|
||||||
|
},
|
||||||
|
{ title: "3" }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
addCertificate
|
||||||
|
// AddOrUpdate
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.userId = this.$route.query.id;
|
||||||
|
console.log(this.$route.query);
|
||||||
|
console.log(this.userId, "onsole.log(this.$route.query)");
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
activated() {
|
||||||
|
this.userId = this.$route.query.id;
|
||||||
|
this.init();
|
||||||
|
// this.getDataList()
|
||||||
|
// this.getcourpeList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getPointsType(type) {
|
||||||
|
var str = "";
|
||||||
|
//在线教学 01 学术期刊 03 太湖讲堂 05 创作技术 07 注册邀请 11 课程邀请 13
|
||||||
|
switch (type) {
|
||||||
|
case "01":
|
||||||
|
return "在线教学";
|
||||||
|
|
||||||
|
case "03":
|
||||||
|
return "学术期刊";
|
||||||
|
|
||||||
|
case "05":
|
||||||
|
return "太湖讲堂";
|
||||||
|
|
||||||
|
case "07":
|
||||||
|
return "创作技术";
|
||||||
|
|
||||||
|
case "11":
|
||||||
|
return "注册邀请";
|
||||||
|
|
||||||
|
case "13":
|
||||||
|
return "课程邀请";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataFormDelete: debounce(async function(row, deleteType) {
|
||||||
|
console.log("row at line 515:", row);
|
||||||
|
this.$confirm(
|
||||||
|
`确定要删除${deleteType != "all" ? "该" : "所有"}湖分嘛?`,
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(async () => {
|
||||||
|
// var lableIds = row[0].bookLabelId;
|
||||||
|
var productIds = row.id;
|
||||||
|
|
||||||
|
await this.$http
|
||||||
|
.request({
|
||||||
|
url: this.$http.adornUrl(`/master/userContribution/delUserContribution`),
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
id: productIds
|
||||||
|
// marketId: this.addForm.id
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
//默认 无 说明:请求头
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(async ({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// this.$refs.commonShop.selectShopArr = [];
|
||||||
|
this.getDataList()
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}, 200),
|
||||||
|
getCateList() {
|
||||||
|
// this.$http({
|
||||||
|
// url: this.$http.adornUrl(
|
||||||
|
// "/master/userCertificate/userCertificateLabelList"
|
||||||
|
// ),
|
||||||
|
// method: "post",
|
||||||
|
// data: this.$http.adornData({})
|
||||||
|
// }).then(({ data }) => {
|
||||||
|
// if (data && data.code === 0) {
|
||||||
|
this.cateOptions = [
|
||||||
|
{
|
||||||
|
value: "01",
|
||||||
|
label: "在线教学"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "03",
|
||||||
|
label: "学术期刊"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "05",
|
||||||
|
label: "太湖讲堂"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "07",
|
||||||
|
label: "创作技术"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "11",
|
||||||
|
label: "注册邀请"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "13",
|
||||||
|
label: "课程邀请"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
// } else {
|
||||||
|
// this.cateOptions = [];
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
delay(val) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addCertificate.init("edit", { val });
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delaySubmit(data) {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userCourseBuy/delayUserCourseBuy"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data && data.code == 0) {
|
||||||
|
this.$message.success("操作成功!");
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.$message.error("操作失败!");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.$message.error(err.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
submit() {
|
||||||
|
console.log(this.youForm, "youForm");
|
||||||
|
this.youForm.catalogueId = this.linshiids.join(",");
|
||||||
|
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/userCourseBuy/insertUserCourseBuy"
|
||||||
|
),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
})
|
||||||
|
.then(({ data }) => {
|
||||||
|
if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
this.$message.success("开课成功!");
|
||||||
|
this.getDataList();
|
||||||
|
this.dialogClose();
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.log("表单提交报错");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
dialogClose() {
|
||||||
|
this.youVisible = false;
|
||||||
|
this.linshiids = [];
|
||||||
|
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("options", this.options);
|
||||||
|
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;
|
||||||
|
if (data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.options = [];
|
||||||
|
this.totalLaoding = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showAddD() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addCertificate.init("add", {});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
init() {
|
||||||
|
this.getCateList();
|
||||||
|
// 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) return this.$message.error(data.msg);
|
||||||
|
|
||||||
|
this.user = data.user;
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
this.$http({
|
||||||
|
// url: this.$http.adornUrl('/book/user/list'),
|
||||||
|
url: this.$http.adornUrl("/master/userContribution/listByPage"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
current: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
userId: this.userId, //用户id
|
||||||
|
userName: "",
|
||||||
|
// "userId": "",
|
||||||
|
tel: "",
|
||||||
|
email: "",
|
||||||
|
type: this.selectLabelId //课程名
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code !== 0) return this.$message.error(data.msg);
|
||||||
|
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.linshiids = [];
|
||||||
|
|
||||||
|
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 = [];
|
||||||
|
this.linshiids = [];
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.log("数据报错");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
/deep/ .width100 .el-input__inner {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.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'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||||
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://192.168.110.110:9200/pb'; //本地
|
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.110:9200/pb'; //本地
|
||||||
|
|
||||||
// cdn地址 = 域名 + 版本号
|
// cdn地址 = 域名 + 版本号
|
||||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||||
|
|||||||
Reference in New Issue
Block a user