提交
This commit is contained in:
@@ -3,10 +3,12 @@
|
||||
<el-dialog
|
||||
:title="`${isEdit ? '编辑' : '新增'}证书`"
|
||||
:visible.sync="dialogVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="600px"
|
||||
>
|
||||
<div>
|
||||
<div v-if="dialogVisible">
|
||||
<el-form
|
||||
:rules="dataRule"
|
||||
:model="addCertificateForm"
|
||||
ref="addCertificateForm"
|
||||
label-width="110px"
|
||||
@@ -15,13 +17,14 @@
|
||||
<p>绑定用户</p>
|
||||
</div> -->
|
||||
<template v-if="pageType == 'label'">
|
||||
<el-form-item label="手机号/邮箱:" prop="user" class="form_item">
|
||||
<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="请输入用户信息"
|
||||
placeholder="请输入手机号/邮箱"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
@@ -35,6 +38,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
<span v-if="isEdit">{{ addCertificateForm.userKey }}</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
@@ -77,21 +81,16 @@
|
||||
}}
|
||||
</div></el-form-item
|
||||
>
|
||||
<el-form-item
|
||||
label="证书分类"
|
||||
|
||||
prop="user"
|
||||
class="form_item"
|
||||
>
|
||||
<el-form-item label="证书分类" prop="user" class="form_item">
|
||||
<div>
|
||||
<el-cascader style="width: 400px;"
|
||||
:show-all-levels="false"
|
||||
|
||||
v-model="value"
|
||||
<el-cascader
|
||||
:disabled="isEdit"
|
||||
style="width: 400px;"
|
||||
:show-all-levels="false"
|
||||
v-model="addCertificateForm.labelId"
|
||||
:props="{
|
||||
value: 'id',
|
||||
label: 'title',
|
||||
|
||||
label: 'title'
|
||||
}"
|
||||
:options="cateOptions"
|
||||
placeholder="证书分类"
|
||||
@@ -107,6 +106,7 @@
|
||||
<div>
|
||||
<el-form-item label="课程名:" prop="courseId">
|
||||
<el-select
|
||||
v-if="!isEdit"
|
||||
v-model="addCertificateForm.courseId"
|
||||
filterable
|
||||
remote
|
||||
@@ -124,6 +124,7 @@
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span v-if="isEdit">{{ addCertificateForm.courseName }}</span>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
@@ -167,8 +168,9 @@
|
||||
<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="title" class="form_item">
|
||||
<el-form-item label="证书编号" prop="certificateNo" class="form_item">
|
||||
<el-input
|
||||
v-model="addCertificateForm.certificateNo"
|
||||
placeholder="请输入证书编号"
|
||||
style="width: 400px;"
|
||||
></el-input>
|
||||
@@ -301,10 +303,26 @@ const toolbarOptions = [
|
||||
];
|
||||
// import dialogComponent from './seckillprodrelation'
|
||||
export default {
|
||||
props: ["data", "pageType", "dataInfo"],
|
||||
props: ["data", "pageType", "dataInfo",'labelId'],
|
||||
data() {
|
||||
return {
|
||||
isUploading: false, // 上传过程中是否显示加载动画
|
||||
dataRule: {
|
||||
userKey: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入手机号/邮箱",
|
||||
// trigger: "change",
|
||||
}
|
||||
],
|
||||
certificateNo: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入证书编号",
|
||||
// trigger: "change",
|
||||
}
|
||||
],
|
||||
|
||||
},
|
||||
isUploading: false, // 上传过程中是否显示加载动画
|
||||
isEdit: false, // 上传过程中是否显示加载动画
|
||||
dialogImageUrl: "",
|
||||
@@ -327,15 +345,7 @@ export default {
|
||||
addForm: {},
|
||||
audioFileList: [],
|
||||
isFresh: false,
|
||||
dataRule: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "标签名称不能为空"
|
||||
// trigger: "change",
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -383,7 +393,9 @@ export default {
|
||||
},
|
||||
getCateList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/userCertificate/userCertificateLabelList"),
|
||||
url: this.$http.adornUrl(
|
||||
"/master/userCertificate/userCertificateLabelList"
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({})
|
||||
}).then(({ data }) => {
|
||||
@@ -397,6 +409,8 @@ export default {
|
||||
});
|
||||
},
|
||||
loadAll(queryString, cb) {
|
||||
this.addCertificateForm.userId='';
|
||||
this.addCertificateForm.userName='';
|
||||
if (queryString == "") {
|
||||
return false;
|
||||
}
|
||||
@@ -434,7 +448,7 @@ export default {
|
||||
this.addCertificateForm.userId = item.id;
|
||||
},
|
||||
init(type, data) {
|
||||
this.getCateList()
|
||||
this.getCateList();
|
||||
console.log("data at line 372:", data);
|
||||
this.addCertificateForm = {};
|
||||
this.fileList = [];
|
||||
@@ -442,14 +456,11 @@ export default {
|
||||
|
||||
if (data) {
|
||||
this.addCertificateForm = {
|
||||
courseId: data.id,
|
||||
courseName: data.title,
|
||||
courseImg: data.image,
|
||||
images: data.image
|
||||
// userId: data.userId
|
||||
...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) => ({
|
||||
@@ -465,9 +476,9 @@ export default {
|
||||
}
|
||||
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;
|
||||
// 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
|
||||
@@ -479,12 +490,52 @@ export default {
|
||||
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleSubmit() {
|
||||
console.log(
|
||||
"this.fileList at line 728:",
|
||||
this.fileList.map(e => e.url)
|
||||
); // 直接取 url
|
||||
},
|
||||
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 对象中
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
|
||||
<commonTree
|
||||
source="tags"
|
||||
axiosType="raw"
|
||||
@@ -71,14 +72,14 @@
|
||||
<div class="title_box" style="margin-bottom: 10px; height: 40px">
|
||||
<div class="title">
|
||||
<span class="line"></span>证书列表
|
||||
<!-- <el-button
|
||||
<el-button
|
||||
plain
|
||||
type="primary"
|
||||
style="margin-left: 20px"
|
||||
@click="openTable('addForm')"
|
||||
size="mini"
|
||||
>新增</el-button
|
||||
> -->
|
||||
>
|
||||
|
||||
<!-- <div style="" class="button_box"> -->
|
||||
<!-- <el-button plain type="danger" @click="handleCheckAllChange(true)" size="mini">清空</el-button> -->
|
||||
@@ -102,7 +103,7 @@
|
||||
axiosType="raw"
|
||||
getAssociatedGoodsListKey="id"
|
||||
:isNoPaging="true"
|
||||
:disableOperate="true"
|
||||
|
||||
:isShowPagination="true"
|
||||
getAssociatedGoodsListValue="result"
|
||||
:tableColumnList="tableColumnList"
|
||||
@@ -295,10 +296,12 @@
|
||||
|
||||
|
||||
</el-form> -->
|
||||
<addCertificate
|
||||
<addCertificate v-if="currentNode.data&¤tNode.data.id"
|
||||
ref="addCertificate"
|
||||
:data="addCertificateForm"
|
||||
:labelId="currentNode.data.id"
|
||||
pageType="label"
|
||||
@refresh="refresh"
|
||||
></addCertificate>
|
||||
<commonShopTable
|
||||
title="课程"
|
||||
@@ -440,8 +443,8 @@ export default {
|
||||
urlList: {
|
||||
treeList: "/master/userCertificate/userCertificateLabelList",
|
||||
delete: "/master/userCertificate/delUserCertificateLabel",
|
||||
deleteShop: "/master/courseMedical/unbindCourseAndMedical",
|
||||
saveShop: "/master/courseMedical/bindCourseAndMedical",
|
||||
deleteShop: "/master/userCertificate/delCertificate",
|
||||
saveShop: "/master/userCertificate/editCertificate",
|
||||
add: "/master/userCertificate/saveUserCertificateLabel",
|
||||
edit: "/master/userCertificate/editUserCertificateLabel",
|
||||
hasBindProductList:
|
||||
@@ -570,6 +573,12 @@ export default {
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
refresh(){
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.commonShop.getAssociatedGoodsList()
|
||||
})
|
||||
|
||||
},
|
||||
getCate(id) {
|
||||
this.linshiids = [];
|
||||
|
||||
@@ -599,7 +608,17 @@ export default {
|
||||
console.log("data at line 472:", data);
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addCertificate.init("edit", data);
|
||||
this.$refs.addCertificate.init("edit", {
|
||||
certificateNo:data.certificateNo,
|
||||
id:data.id,
|
||||
userId:data.userId,
|
||||
userKey:data.user.tel||data.user.email,
|
||||
userName:data.user.name,
|
||||
courseId:data.courseId,
|
||||
courseName:data.title,
|
||||
labelId:data.labelId,
|
||||
images:data.certificateUrl,
|
||||
},);
|
||||
});
|
||||
|
||||
// this.selectChange(data.id)
|
||||
@@ -867,7 +886,7 @@ export default {
|
||||
dataFormDelete: debounce(async function(row, deleteType) {
|
||||
console.log("row at line 515:", row);
|
||||
this.$confirm(
|
||||
`确定要删除${deleteType != "all" ? "该" : "所有"}关联课程嘛?`,
|
||||
`确定要删除${deleteType != "all" ? "该" : "所有"}证书吗?`,
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
@@ -893,7 +912,7 @@ export default {
|
||||
url: this.$http.adornUrl(`${this.urlList.deleteShop}`),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: row[0].bindId
|
||||
id: productIds
|
||||
// marketId: this.addForm.id
|
||||
},
|
||||
header: {
|
||||
|
||||
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()"
|
||||
>
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable size="small">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="dataForm.vipType" placeholder="请选择类型" clearable>
|
||||
<el-option label="医学SVIP" value=1></el-option>
|
||||
<el-option label="国学与心理学SVIP" value=2></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 size="small"
|
||||
v-model="dataForm.vipType"
|
||||
placeholder="请选择类型"
|
||||
clearable
|
||||
>
|
||||
<el-option label="医学SVIP" value="1"></el-option>
|
||||
<el-option label="国学与心理学SVIP" value="2"></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-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
<el-button size="small"
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList();
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
<el-button size="small"
|
||||
v-if="isAuth('book:user:save')"
|
||||
type="primary"
|
||||
@click="addOrUpdateHandle()"
|
||||
@@ -37,7 +41,7 @@
|
||||
<!-- <el-button type="primary" @click="addOrUpdateHandle()"
|
||||
>合并账号</el-button
|
||||
> -->
|
||||
<el-button type="primary" @click="addOpenCourse()"
|
||||
<el-button type="primary" size="small" @click="addOpenCourse()"
|
||||
>批量开通课程</el-button
|
||||
>
|
||||
<!-- <el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()"
|
||||
@@ -58,37 +62,113 @@
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
width="100"
|
||||
prop="id"
|
||||
header-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
|
||||
min-width="100"
|
||||
prop="nickname"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="姓名"
|
||||
label="昵称 ( 姓名 )"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
scope.row.nickname ? scope.row.nickname : "暂无用户名"
|
||||
}}</span
|
||||
<div
|
||||
style="font-size: 13px;"
|
||||
v-if="!scope.row.nickname && !scope.row.name"
|
||||
>
|
||||
<br/>
|
||||
|
||||
<span v-if="!scope.row.userVips||scope.row.userVips.length==0">-</span>
|
||||
|
||||
<span v-else v-html="computedVipType(scope.row.userVips)">
|
||||
<!-- <img style="width: 25px;height: 25px;" src="../../../assets/img/vip.png" alt=""> -->
|
||||
|
||||
</span>
|
||||
<!-- <span v-if="scope.row.vip == 0">普通用户</span>
|
||||
<span v-else-if="scope.row.vip == 2">(吴门医述VIP)</span>
|
||||
<span v-else-if="scope.row.vip == 1">(超级VIP)</span>
|
||||
<span v-else-if="scope.row.vip == 3">(众妙之门VIP)</span> -->
|
||||
<span style="color: #999;">
|
||||
未设置
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
style="font-size: 13px;"
|
||||
v-else-if="scope.row.nickname == scope.row.name"
|
||||
>
|
||||
<span style="color: #999;">
|
||||
未设置
|
||||
</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>
|
||||
</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> -->
|
||||
<!-- <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>
|
||||
</template>
|
||||
</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
|
||||
prop="peanutCoin"
|
||||
header-align="center"
|
||||
align="center"
|
||||
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
|
||||
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
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
min-width="130"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
@@ -160,14 +322,18 @@
|
||||
size="small"
|
||||
@click="addOrUpdateHandle(scope.row.id)"
|
||||
>修改</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
|
||||
type="text"
|
||||
style="color: red;"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-dropdown>
|
||||
<!-- <el-dropdown>
|
||||
<span
|
||||
class="el-dropdown-link"
|
||||
style="font-size:12px; color:#17B3A3; cursor: pointer;"
|
||||
@@ -226,22 +392,35 @@
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<router-link
|
||||
:to="{ path: '/userCertificate', query: { id: scope.row.id } }"
|
||||
:to="{ path: '/userPoints', query: { id: scope.row.id } }"
|
||||
>
|
||||
<el-button type="text" size="small">
|
||||
用户证书管理
|
||||
湖分管理
|
||||
</el-button>
|
||||
</router-link>
|
||||
</el-dropdown-item>
|
||||
<!-- <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)">
|
||||
开通VIP
|
||||
</el-button>
|
||||
</el-dropdown-item> -->
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -260,8 +439,7 @@
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
<!-- 开通VIP -->
|
||||
<open-vip v-if="openVipVisible" ref="openVip">
|
||||
</open-vip>
|
||||
<open-vip v-if="openVipVisible" ref="openVip"> </open-vip>
|
||||
|
||||
<el-dialog
|
||||
title="充/扣天医币"
|
||||
@@ -334,13 +512,20 @@
|
||||
:userId="thisUserID"
|
||||
@close="closeCoupon"
|
||||
></userCouponList>
|
||||
<addCertificate
|
||||
@refresh="getDataList()"
|
||||
ref="addCertificate"
|
||||
pageType="user"
|
||||
:dataInfo="currentuserInfo"
|
||||
></addCertificate>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
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 addCertificate from "./addPoints.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -385,15 +570,17 @@ export default {
|
||||
addOrUpdateVisible: false,
|
||||
youVisible: false,
|
||||
youForm: {},
|
||||
currentuserInfo: {},
|
||||
courperList: [],
|
||||
courperHistList: [],
|
||||
//开通vip
|
||||
openVipVisible: false,
|
||||
openVipVisible: false
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
userCouponList,
|
||||
addCertificate,
|
||||
OpenVip
|
||||
},
|
||||
activated() {
|
||||
@@ -401,32 +588,34 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
//批量开通课程
|
||||
addOpenCourse(){
|
||||
this.$router.push('/user-add-course');
|
||||
addOpenCourse() {
|
||||
this.$router.push("/user-add-course");
|
||||
},
|
||||
//开通vip
|
||||
openVip(row){
|
||||
openVip(row) {
|
||||
this.openVipVisible = true;
|
||||
this.$nextTick(()=>{
|
||||
this.$nextTick(() => {
|
||||
this.$refs.openVip.init(row);
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
computedVipType(userVips) {
|
||||
if (!userVips || userVips.length === 0) return '';
|
||||
if (!userVips || userVips.length === 0) return "";
|
||||
|
||||
const vipMap = {
|
||||
4: '中医VIP',
|
||||
5: '针灸VIP',
|
||||
6: '肿瘤VIP',
|
||||
7: '国学VIP',
|
||||
8: '心理学VIP'
|
||||
4: "中医VIP",
|
||||
5: "针灸VIP",
|
||||
6: "肿瘤VIP",
|
||||
7: "国学VIP",
|
||||
8: "心理学VIP"
|
||||
};
|
||||
|
||||
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
||||
let vipTypes = [];
|
||||
if (typeof userVips === 'number') {
|
||||
vipTypes = String(userVips).split('').map(Number); // 数字转为数组
|
||||
if (typeof userVips === "number") {
|
||||
vipTypes = String(userVips)
|
||||
.split("")
|
||||
.map(Number); // 数字转为数组
|
||||
} else {
|
||||
vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type
|
||||
}
|
||||
@@ -440,25 +629,37 @@ export default {
|
||||
|
||||
// 1. 医学SVIP(只显示一次)
|
||||
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(只显示一次)
|
||||
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相关的类型)
|
||||
vipTypes
|
||||
.filter(type => vipMap[type] && !(
|
||||
(hasMedicalSVip && [4, 5, 6].includes(type)) || // 医学SVIP已显示,排除 4、5、6
|
||||
(hasPsychologySVip && [7, 8].includes(type)) // 心理学SVIP已显示,排除 7、8
|
||||
))
|
||||
.filter(
|
||||
type =>
|
||||
vipMap[type] &&
|
||||
!(
|
||||
(
|
||||
(hasMedicalSVip && [4, 5, 6].includes(type)) || // 医学SVIP已显示,排除 4、5、6
|
||||
(hasPsychologySVip && [7, 8].includes(type))
|
||||
) // 心理学SVIP已显示,排除 7、8
|
||||
)
|
||||
)
|
||||
.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) {
|
||||
@@ -470,20 +671,20 @@ export default {
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
var list=[]
|
||||
var 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) {
|
||||
list.push([...data.list[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
this.vipList=list.flat(Infinity)
|
||||
this.vipList = list.flat(Infinity);
|
||||
|
||||
console.log("this.vipList at line 440:", this.vipList);
|
||||
}else{
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
this.vipList=[]
|
||||
this.vipList = [];
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -626,6 +827,12 @@ export default {
|
||||
this.pointForm = e;
|
||||
this.adc = true;
|
||||
},
|
||||
handleRecharge(val) {
|
||||
this.currentuserInfo = val;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addCertificate.init("add", {});
|
||||
});
|
||||
},
|
||||
huaSheng(point) {
|
||||
// console.log(this.pointForm.pointAmount, point)
|
||||
if (this.pointForm.pointAmount > point && this.pointForm.pointType == 1) {
|
||||
@@ -712,3 +919,13 @@ export default {
|
||||
}
|
||||
};
|
||||
</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>
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
<el-form-item label="">
|
||||
<el-form-item
|
||||
label="证书分类"
|
||||
style="width: 400px;"
|
||||
|
||||
prop="user"
|
||||
class="form_item"
|
||||
>
|
||||
<div>
|
||||
<el-cascader
|
||||
<el-cascader size="small"
|
||||
:show-all-levels="false"
|
||||
v-model="Certificate"
|
||||
:props="{
|
||||
@@ -26,7 +26,7 @@
|
||||
></el-cascader></div
|
||||
></el-form-item>
|
||||
<el-form-item label="证书名称">
|
||||
<el-input
|
||||
<el-input size="small"
|
||||
v-model="dataForm.title"
|
||||
placeholder="请输入证书名称"
|
||||
clearable
|
||||
@@ -53,6 +53,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
@@ -60,7 +61,7 @@
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
<el-button size="small"
|
||||
@click="
|
||||
dataForm = {};
|
||||
Certificate=[]
|
||||
@@ -69,18 +70,18 @@
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
<el-button @click="showAddD" type="primary">开通证书</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">
|
||||
<div>用户信息:{{ user.name }}{{ user.tel }}</div>
|
||||
<div>
|
||||
<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> -->
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -166,7 +167,7 @@
|
||||
label="创建日期"
|
||||
>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
@@ -175,7 +176,7 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.expire == 0"
|
||||
|
||||
type="primary"
|
||||
@click="delay(scope.row)"
|
||||
plain
|
||||
@@ -186,7 +187,7 @@
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@@ -314,6 +315,7 @@
|
||||
:data="addCertificateForm"
|
||||
pageType="user"
|
||||
:dataInfo="user"
|
||||
@refresh="getDataList"
|
||||
></addCertificate>
|
||||
</div>
|
||||
</template>
|
||||
@@ -457,14 +459,14 @@ export default {
|
||||
)
|
||||
.then(async () => {
|
||||
// var lableIds = row[0].bookLabelId;
|
||||
var productIds = row[0].id;
|
||||
var productIds = row.id;
|
||||
|
||||
await this.$http
|
||||
.request({
|
||||
url: this.$http.adornUrl(`${this.urlList.deleteShop}`),
|
||||
url: this.$http.adornUrl(`/master/userCertificate/delCertificate`),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: row[0].bindId
|
||||
id: productIds
|
||||
// marketId: this.addForm.id
|
||||
},
|
||||
header: {
|
||||
@@ -480,9 +482,7 @@ export default {
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
// this.$refs.commonShop.selectShopArr = [];
|
||||
if (this.$refs.commonShop) {
|
||||
this.$refs.commonShop.getAssociatedGoodsList();
|
||||
}
|
||||
this.getDataList()
|
||||
});
|
||||
});
|
||||
})
|
||||
@@ -507,7 +507,17 @@ export default {
|
||||
},
|
||||
delay(val) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addCertificate.init("edit", { val });
|
||||
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) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<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-form-item>
|
||||
<!-- <el-form-item label="">
|
||||
@@ -14,7 +14,7 @@
|
||||
</el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="">
|
||||
<el-select v-model="dataForm.expire" placeholder="课程状态"
|
||||
<el-select v-model="dataForm.expire" placeholder="课程状态" size="small"
|
||||
@change="
|
||||
pageIndex = 1;
|
||||
getDataList();">
|
||||
@@ -28,7 +28,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item >
|
||||
<el-button
|
||||
<el-button size="small"
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList();
|
||||
@@ -37,17 +37,17 @@
|
||||
>
|
||||
</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 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>
|
||||
<!-- <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> -->
|
||||
</div>
|
||||
</el-form-item>
|
||||
</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>
|
||||
Reference in New Issue
Block a user