提交 VIP办理
This commit is contained in:
@@ -155,6 +155,29 @@
|
|||||||
:close="setStudentClose"
|
:close="setStudentClose"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
|
<div style="display: flex;align-items: center;">
|
||||||
|
<el-autocomplete
|
||||||
|
size="small"
|
||||||
|
style="width: 100%;"
|
||||||
|
v-model="addForm.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>
|
||||||
|
<el-button size="mini" type="primary" @click="addClass()" style="margin-left: 20px;"
|
||||||
|
>+ 添加学员</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<p>已添加的成员列表</p>
|
||||||
<el-table :data="studentList">
|
<el-table :data="studentList">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
property="student.id"
|
property="student.id"
|
||||||
@@ -174,7 +197,7 @@
|
|||||||
<el-table-column property="student.tel" label="手机号"></el-table-column>
|
<el-table-column property="student.tel" label="手机号"></el-table-column>
|
||||||
<el-table-column property="" label="操作">
|
<el-table-column property="" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="warning" @click="outClass(scope.row)"
|
<el-button size="mini" type="warning" @click="outClass(scope.row)"
|
||||||
>踢出班级</el-button
|
>踢出班级</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
@@ -194,6 +217,7 @@ import miniClass from "./miniClass.vue";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
addForm:{},
|
||||||
setStudentVisible: false,
|
setStudentVisible: false,
|
||||||
setStudentVisible: false,
|
setStudentVisible: false,
|
||||||
studentList: [], // 学员列表
|
studentList: [], // 学员列表
|
||||||
@@ -333,6 +357,70 @@ export default {
|
|||||||
}else{
|
}else{
|
||||||
this.$message.error("获取学员列表失败");
|
this.$message.error("获取学员列表失败");
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handleSelect(data) {
|
||||||
|
console.log("data at line 161:", data);
|
||||||
|
this.addForm.userKey = data.tel || data.email;
|
||||||
|
this.addForm.userId = data.id;
|
||||||
|
this.addForm.name = data.name;
|
||||||
|
this.addForm.tel = data.tel;
|
||||||
|
this.addForm.email = data.email;
|
||||||
|
},
|
||||||
|
loadAll(queryString, cb) {
|
||||||
|
this.addForm.userId = "";
|
||||||
|
this.addForm.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([]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addClass(row){
|
||||||
|
console.log('row at line 340:', this.miniClass.id,this.addForm)
|
||||||
|
if(this.addForm&&this.addForm.userId){
|
||||||
|
this.$http({
|
||||||
|
// url: this.$http.adornUrl('/book/user/list'),
|
||||||
|
url: this.$http.adornUrl("/common/class/addClassUser"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
classId: this.miniClass.id,
|
||||||
|
userId: this.addForm.userId
|
||||||
|
})
|
||||||
|
}).then(async ({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
type: "success",
|
||||||
|
message: "添加成功!"
|
||||||
|
});
|
||||||
|
var jieguo = await this.getCLassInfo(this.miniClass.id)
|
||||||
|
if(jieguo.data.code == 0){
|
||||||
|
this.studentList = jieguo.data.result.students;
|
||||||
|
this.addForm={}
|
||||||
|
}else{
|
||||||
|
this.$message.error("获取学员列表失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
this.$message.error("请输入手机号/邮箱");
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 踢出班级
|
// 踢出班级
|
||||||
async outClass(row) {
|
async outClass(row) {
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
v-else-if="scope.row.nickname == scope.row.name"
|
v-else-if="scope.row.nickname == scope.row.name"
|
||||||
>
|
>
|
||||||
<span style="color: #999;">
|
<span style="color: #999;">
|
||||||
未设置
|
{{ scope.row.nickname }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size: 13px;" v-else>
|
<div style="font-size: 13px;" v-else>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
width="80%"
|
width="1200px"
|
||||||
title="开通VIP"
|
title="开通VIP"
|
||||||
|
destroy-on-close
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:visible.sync="visible"
|
:visible.sync="visible"
|
||||||
@close="handlereset"
|
@close="handlereset"
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
</el-autocomplete>
|
</el-autocomplete>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<!-- <el-form-item
|
||||||
label="账户余额"
|
label="账户余额"
|
||||||
v-if="dataForm.userKey"
|
v-if="dataForm.userKey"
|
||||||
style="width: 50%;float: left;"
|
style="width: 50%;float: left;"
|
||||||
@@ -53,7 +54,7 @@
|
|||||||
style="font-style: normal; font-size: 16px; color: #17B3A3;"
|
style="font-style: normal; font-size: 16px; color: #17B3A3;"
|
||||||
>{{ dataForm.jf }}</em
|
>{{ dataForm.jf }}</em
|
||||||
>
|
>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-form-item label="VIP类型" prop="type" class="type_block">
|
<el-form-item label="VIP类型" prop="type" class="type_block">
|
||||||
@@ -69,7 +70,12 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="VIP年限" prop="year" class="year_block">
|
<el-form-item label="VIP年限" prop="year" class="year_block">
|
||||||
<el-radio-group v-model="dataForm.year" size="mini">
|
<div style="height: 40px;">
|
||||||
|
<el-radio-group
|
||||||
|
v-model="dataForm.year"
|
||||||
|
size="mini"
|
||||||
|
|
||||||
|
>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="(option, index) in yearList"
|
v-for="(option, index) in yearList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -78,46 +84,61 @@
|
|||||||
{{ option.label }}
|
{{ option.label }}
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<span class="qita"
|
</div >
|
||||||
>其他:<el-input v-model="dataForm.day"></el-input>  天</span
|
|
||||||
>
|
<span class="qita"> </span>
|
||||||
|
<!-- 其他:<el-input v-model="dataForm.day"></el-input>  天 -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预计费用" class="price_block">
|
<!-- <el-form-item label="预计费用" class="price_block">
|
||||||
<span style=" color: #f56c6c;">{{ dataForm.price }}元</span>
|
<span style=" color: #f56c6c;">{{ dataForm.price }}元</span>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<el-form-item label="支付方式" class="coin_block">
|
||||||
|
<div>
|
||||||
|
<el-radio-group v-model="dataForm.payType" @input="payTypeChange">
|
||||||
|
<el-radio label="微信">微信</el-radio>
|
||||||
|
<el-radio label="支付宝">支付宝</el-radio>
|
||||||
|
|
||||||
|
<el-radio label="天医币">天医币</el-radio>
|
||||||
|
<el-radio label="银行支付">银行支付</el-radio>
|
||||||
|
<el-radio label="海外支付">海外支付</el-radio>
|
||||||
|
<el-radio label="其他">其他</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="抵扣天医币" class="coin_block">
|
<el-form-item label="金额" class="coin_block">
|
||||||
<div> <el-input
|
<div>
|
||||||
style="width: 300px;"
|
<el-input
|
||||||
|
clearable
|
||||||
v-model="dataForm.value"
|
v-model="dataForm.fee"
|
||||||
placeholder="请输入需要抵扣的天医币"
|
placeholder="请输入需要金额"
|
||||||
>
|
>
|
||||||
</el-input></div>
|
</el-input>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="抵扣积分" class="coin_block">
|
<el-form-item label="抵扣积分" class="coin_block">
|
||||||
<div> <el-input
|
<div>
|
||||||
style="width: 300px;"
|
<el-input
|
||||||
|
clearable
|
||||||
v-model="dataForm.value"
|
v-model="dataForm.jf"
|
||||||
placeholder="请输入需要抵扣的天医币"
|
placeholder="请输入需要抵扣的积分"
|
||||||
>
|
>
|
||||||
</el-input></div>
|
</el-input>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="开通说明">
|
<el-form-item label="备注">
|
||||||
<el-input
|
<el-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
rows="5"
|
rows="5"
|
||||||
v-model="dataForm.remark"
|
v-model="dataForm.remark"
|
||||||
placeholder="开通说明"
|
placeholder="备注"
|
||||||
>
|
>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="handlereset">取消</el-button>
|
<el-button @click="handlereset" size="mini">取消</el-button>
|
||||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
<el-button type="primary" @click="dataFormSubmit()" size="mini" >确定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -135,12 +156,14 @@ export default {
|
|||||||
name: "",
|
name: "",
|
||||||
tel: "",
|
tel: "",
|
||||||
email: "",
|
email: "",
|
||||||
peanutCoin: "",
|
|
||||||
|
pageType: "", //vip类型
|
||||||
type: "", //vip类型
|
type: "", //vip类型
|
||||||
year: "",
|
year: "",
|
||||||
day: "",
|
|
||||||
remark: "",
|
remark: "",
|
||||||
price: "0"
|
fee: 0, //金额
|
||||||
|
jf: 0 //积分
|
||||||
},
|
},
|
||||||
peanutCoin: 0, //天医币和积分总和判断是否为0
|
peanutCoin: 0, //天医币和积分总和判断是否为0
|
||||||
dataRule: {
|
dataRule: {
|
||||||
@@ -160,12 +183,15 @@ export default {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
typeList: [
|
typeList: [
|
||||||
|
{ value: "11", label: "超v" },
|
||||||
|
{ value: "12", label: "简易超v" },
|
||||||
{ value: "1", label: "医学超v" },
|
{ value: "1", label: "医学超v" },
|
||||||
|
{ value: "2", label: "国学与心理学超v" },
|
||||||
{ value: "4", label: "中医学" },
|
{ value: "4", label: "中医学" },
|
||||||
{ value: "9", label: "中西汇通学" },
|
|
||||||
{ value: "5", label: "针灸学" },
|
{ value: "5", label: "针灸学" },
|
||||||
{ value: "6", label: "肿瘤学" },
|
{ value: "6", label: "肿瘤学" },
|
||||||
{ value: "2", label: "国学与心理学超v" },
|
|
||||||
|
{ value: "9", label: "中西汇通学" },
|
||||||
{ value: "7", label: "国学" },
|
{ value: "7", label: "国学" },
|
||||||
{ value: "8", label: "心理学" }
|
{ value: "8", label: "心理学" }
|
||||||
],
|
],
|
||||||
@@ -178,14 +204,41 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(data) {
|
init(data) {
|
||||||
|
this.dataForm = {
|
||||||
|
id: 0,
|
||||||
|
name: "",
|
||||||
|
tel: "",
|
||||||
|
email: "",
|
||||||
|
|
||||||
|
pageType: "", //vip类型
|
||||||
|
type: "", //vip类型
|
||||||
|
year: "",
|
||||||
|
|
||||||
|
remark: "",
|
||||||
|
fee: 0, //金额
|
||||||
|
jf: 0 //积分
|
||||||
|
}
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
this.dataForm.userKey = data.tel || data.email;
|
this.$http({
|
||||||
this.dataForm.userId = data.id;
|
url: this.$http.adornUrl("/master/userVip/getUserVipInfoByUserId"),
|
||||||
this.dataForm.name = data.name;
|
method: "post",
|
||||||
this.dataForm.tel = data.tel;
|
data: this.$http.adornData({
|
||||||
this.dataForm.email = data.email;
|
userId: data.id
|
||||||
this.dataForm.peanutCoin = data.peanutCoin;
|
})
|
||||||
this.dataForm.jf = data.jf;
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.dataForm = data.userVipInfo;
|
||||||
|
} else {
|
||||||
|
cb([]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// this.dataForm.userKey = data.tel || data.email;
|
||||||
|
// this.dataForm.userId = data.id;
|
||||||
|
// this.dataForm.name = data.name;
|
||||||
|
// this.dataForm.tel = data.tel;
|
||||||
|
// this.dataForm.email = data.email;
|
||||||
|
// this.dataForm.peanutCoin = data.peanutCoin;
|
||||||
|
// this.dataForm.jf = data.jf;
|
||||||
},
|
},
|
||||||
handleSelect(data) {
|
handleSelect(data) {
|
||||||
console.log("data at line 161:", data);
|
console.log("data at line 161:", data);
|
||||||
@@ -194,8 +247,6 @@ export default {
|
|||||||
this.dataForm.name = data.name;
|
this.dataForm.name = data.name;
|
||||||
this.dataForm.tel = data.tel;
|
this.dataForm.tel = data.tel;
|
||||||
this.dataForm.email = data.email;
|
this.dataForm.email = data.email;
|
||||||
this.dataForm.peanutCoin = data.peanutCoin;
|
|
||||||
this.dataForm.jf = data.jf;
|
|
||||||
},
|
},
|
||||||
loadAll(queryString, cb) {
|
loadAll(queryString, cb) {
|
||||||
this.dataForm.userId = "";
|
this.dataForm.userId = "";
|
||||||
@@ -222,9 +273,74 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
payTypeChange(e){
|
||||||
|
console.log('e at line 261:', e)
|
||||||
|
if (this.dataForm.payType == "海外支付") {
|
||||||
|
this.dataForm.fee=0;
|
||||||
|
this.dataForm.jf=0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//表单提交
|
//表单提交
|
||||||
dataFormSubmit() {},
|
dataFormSubmit() {
|
||||||
|
this.$refs["dataForm"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (!this.dataForm.userId) {
|
||||||
|
this.$message.error("请选择用户");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.dataForm.payType) {
|
||||||
|
this.$message.error("请输入支付方式");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// if (this.dataForm.jf == 0 && this.dataForm.fee == 0) {
|
||||||
|
// this.$message.error("请重新填写金额或者积分,不能都为0");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
if (this.dataForm.payType == "海外支付") {
|
||||||
|
this.dataForm.fee=0;
|
||||||
|
this.dataForm.jf=0;
|
||||||
|
}
|
||||||
|
if (this.dataForm.payType == "其他") {
|
||||||
|
if (!this.dataForm.remark) {
|
||||||
|
this.$message.error("请输入备注");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var data = {
|
||||||
|
...this.dataForm,
|
||||||
|
|
||||||
|
jf: this.dataForm.jf || 0,
|
||||||
|
fee: this.dataForm.fee || 0
|
||||||
|
};
|
||||||
|
|
||||||
|
data.adminId = 1;
|
||||||
|
console.log("...this.dataForm at line 273:", this.dataForm);
|
||||||
|
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/master/userVip/addUserVipByAdmin"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
...data
|
||||||
|
})
|
||||||
|
}).then(({ data }) => {
|
||||||
|
if (data && data.code === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("refreshDataList");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message.error(data.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
//取消
|
//取消
|
||||||
handlereset() {
|
handlereset() {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
@@ -286,7 +402,7 @@ export default {
|
|||||||
}
|
}
|
||||||
/deep/.el-radio__label {
|
/deep/.el-radio__label {
|
||||||
padding-left: 3px;
|
padding-left: 3px;
|
||||||
padding-right: 25px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -7,8 +7,26 @@
|
|||||||
>
|
>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dataForm.key"
|
v-model="dataForm.userName"
|
||||||
placeholder="参数名"
|
placeholder="用户名"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.tel"
|
||||||
|
placeholder="电话"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.email"
|
||||||
|
placeholder="邮箱"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
@@ -17,7 +35,7 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select
|
||||||
size="small"
|
size="small"
|
||||||
v-model="dataForm.vipType"
|
v-model="dataForm.type"
|
||||||
placeholder="请选择VIP类型"
|
placeholder="请选择VIP类型"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
@@ -28,17 +46,24 @@
|
|||||||
<el-option label="肿瘤VIP" value="6"></el-option>
|
<el-option label="肿瘤VIP" value="6"></el-option>
|
||||||
<el-option label="国学VIP" value="7"></el-option>
|
<el-option label="国学VIP" value="7"></el-option>
|
||||||
<el-option label="心理学VIP" value="8"></el-option>
|
<el-option label="心理学VIP" value="8"></el-option>
|
||||||
|
<el-option label="中西汇通VIP" value="9"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-date-picker
|
<el-select
|
||||||
size="small"
|
size="small"
|
||||||
type="daterange"
|
clearable
|
||||||
range-separator="至"
|
v-model="dataForm.state"
|
||||||
start-placeholder="开始日期"
|
placeholder="请选择VIP状态"
|
||||||
end-placeholder="结束日期"
|
|
||||||
>
|
>
|
||||||
</el-date-picker>
|
<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-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -84,17 +109,17 @@
|
|||||||
prop="id"
|
prop="id"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="用户ID"
|
label="用户信息"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span
|
<span
|
||||||
@click="detailHandle(scope.row)"
|
@click="detailHandle(scope.row)"
|
||||||
style="cursor: pointer;color: #006699;position: absolute;top: 0;left: 6px;font-size: 12px;"
|
style="cursor: pointer;color: #006699;position: absolute;top: 0;right: 6px;font-size: 12px;"
|
||||||
>详情</span
|
>详情</span
|
||||||
>
|
>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<el-image
|
<!-- <el-image
|
||||||
v-if="scope.row.avatar && scope.row.avatar != ''"
|
v-if="scope.row.avatar && scope.row.avatar != ''"
|
||||||
style="width: 30px; height: 30px;cursor: pointer;"
|
style="width: 30px; height: 30px;cursor: pointer;"
|
||||||
:src="scope.row.avatar"
|
:src="scope.row.avatar"
|
||||||
@@ -108,10 +133,13 @@
|
|||||||
width="30"
|
width="30"
|
||||||
height="30"
|
height="30"
|
||||||
class="tableImg"
|
class="tableImg"
|
||||||
/>
|
/> -->
|
||||||
</div>
|
</div>
|
||||||
<div style="line-height: 20px;">
|
<div style="line-height: 20px;">
|
||||||
<span>ID:{{ scope.row.id }}</span>
|
<span>{{
|
||||||
|
scope.row.name || scope.row.nickname || scope.row.id
|
||||||
|
}}</span>
|
||||||
|
<!-- <span>ID:{{ scope.row.id }}</span> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -120,62 +148,24 @@
|
|||||||
prop="nickname"
|
prop="nickname"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="用户信息"
|
label="联系方式"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div style="display: flex;align-items: center;padding-left: 10px;">
|
|
||||||
<span style="margin-right: 10px;color: #888;">昵称 ( 姓名 ):</span>
|
|
||||||
<div
|
<div
|
||||||
style="font-size: 13px;"
|
v-if="scope.row.tel"
|
||||||
v-if="!scope.row.nickname && !scope.row.name"
|
style="text-align: left;padding-left: 20px;"
|
||||||
>
|
>
|
||||||
<span style="color: #999;">
|
<img src="../../../assets/img/tel.png" width="15" height="15" />{{
|
||||||
未设置
|
scope.row.tel ? scope.row.tel : "-"
|
||||||
</span>
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
style="font-size: 13px;"
|
v-if="scope.row.email"
|
||||||
v-else-if="scope.row.nickname == scope.row.name"
|
style="text-align: left;padding-left: 20px;"
|
||||||
>
|
>
|
||||||
<span style="color: #999;">
|
<img src="../../../assets/img/email.png" width="15" height="15" />
|
||||||
未设置
|
|
||||||
</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>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="display: flex;align-items: flex-start;padding-left: 10px;margin-top: 4px;">
|
|
||||||
<span style="margin-right: 10px;display: inline-block;color: #888;">联系方式:</span>
|
|
||||||
<div style="font-size: 14px;padding-left: 4px;font-weight: bold;text-align: left;">
|
|
||||||
<div v-if="scope.row.tel">
|
|
||||||
<img
|
|
||||||
src="../../../assets/img/tel.png"
|
|
||||||
width="15"
|
|
||||||
height="15"
|
|
||||||
/>{{ scope.row.tel ? scope.row.tel : "-" }}
|
|
||||||
</div>
|
|
||||||
<div v-if="scope.row.email">
|
|
||||||
<img
|
|
||||||
src="../../../assets/img/email.png"
|
|
||||||
width="15"
|
|
||||||
height="15"
|
|
||||||
/>
|
|
||||||
{{ scope.row.email ? scope.row.email : "-" }}
|
{{ scope.row.email ? scope.row.email : "-" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -183,20 +173,25 @@
|
|||||||
prop="nickname"
|
prop="nickname"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
label="VIP信息 ( 时间 )"
|
label="VIP信息 / 摊销金额 / 时间"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<div style="text-align: left;padding-left: 20px;">
|
||||||
<span v-if="!scope.row.userVips || scope.row.userVips.length == 0"
|
<span v-if="!scope.row.userVips || scope.row.userVips.length == 0"
|
||||||
>-</span
|
>-</span
|
||||||
>
|
>
|
||||||
|
|
||||||
<span v-else v-html="computedVipType(scope.row.userVips)"> </span>
|
<span
|
||||||
<span>{{ scope.row.createTime?scope.row.createTime.split(' ')[0]:'' }}</span>
|
v-else
|
||||||
<span >{{ scope.row.endTime?scope.row.endTime.split(' ')[0]:'' }}</span>
|
v-html="computedVipType(scope.row.userVips)"
|
||||||
|
style="text-align: left;"
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
width="190"
|
width="190"
|
||||||
prop="nickname"
|
prop="nickname"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
@@ -204,9 +199,21 @@
|
|||||||
label="摊销金额"
|
label="摊销金额"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
{{ getVipPrice(scope.row) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
|
<!-- <el-table-column
|
||||||
|
width="120"
|
||||||
|
prop="nickname"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="VIP状态"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.state == 0" style="color: #67c23a;">有效</span>
|
||||||
|
<span v-else style="color: #7f7575;">失效</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
<!-- <el-table-column
|
<!-- <el-table-column
|
||||||
width="190"
|
width="190"
|
||||||
prop="nickname"
|
prop="nickname"
|
||||||
@@ -220,8 +227,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <el-table-column prop="age" header-align="center" align="center" label="年龄">
|
<!-- <el-table-column prop="age" header-align="center" align="center" label="年龄">
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<!-- <el-table-column prop="sex" header-align="center" align="center" label="性别">
|
<!-- <el-table-column prop="sex" header-align="center" align="center" label="性别">
|
||||||
@@ -244,12 +249,12 @@
|
|||||||
@click="handleDetail(scope.row.id)"
|
@click="handleDetail(scope.row.id)"
|
||||||
>管理</el-button
|
>管理</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<!-- <el-button
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
@click="addOrUpdateHandle(scope.row.id)"
|
@click="addOrUpdateHandle(scope.row.id)"
|
||||||
>操作VIP</el-button
|
>升级VIP</el-button
|
||||||
>
|
> -->
|
||||||
|
|
||||||
<!-- <el-dropdown>
|
<!-- <el-dropdown>
|
||||||
<span
|
<span
|
||||||
@@ -357,7 +362,12 @@
|
|||||||
@refreshDataList="getDataList"
|
@refreshDataList="getDataList"
|
||||||
></add-or-update>
|
></add-or-update>
|
||||||
<!-- 开通VIP -->
|
<!-- 开通VIP -->
|
||||||
<open-vip v-if="openVipVisible" ref="openVip"> </open-vip>
|
<open-vip
|
||||||
|
v-if="openVipVisible"
|
||||||
|
ref="openVip"
|
||||||
|
@refreshDataList="getDataList"
|
||||||
|
>
|
||||||
|
</open-vip>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="充/扣天医币"
|
title="充/扣天医币"
|
||||||
@@ -433,7 +443,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dataForm: {
|
dataForm: {
|
||||||
key: ""
|
state: ""
|
||||||
},
|
},
|
||||||
pointFormRules: {
|
pointFormRules: {
|
||||||
pointAmount: [
|
pointAmount: [
|
||||||
@@ -446,6 +456,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
vipList: [],
|
vipList: [],
|
||||||
|
statusOptions: [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: "有效"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: "失效"
|
||||||
|
}
|
||||||
|
],
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: 0,
|
value: 0,
|
||||||
@@ -480,19 +500,36 @@ export default {
|
|||||||
openVipVisible: false
|
openVipVisible: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {OpenVip},
|
components: { OpenVip },
|
||||||
activated() {
|
activated() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleDetail(id){
|
getVipPrice(data) {
|
||||||
|
console.log("data at line 504:", data.userVipLogs);
|
||||||
this.$router.push({
|
if (data.userVipLogs && data.userVipLogs.length > 0) {
|
||||||
|
const now = new Date(); // 当前时间
|
||||||
|
const matchedData = data.userVipLogs.filter(item => {
|
||||||
|
// 转换日期为 Date 对象,直接比较
|
||||||
|
const start = new Date(item.startTime);
|
||||||
|
const end = new Date(item.endTime);
|
||||||
|
return now >= start && now <= end; // 核心判断条件
|
||||||
|
});
|
||||||
|
console.log("matchedData at line 508:", matchedData);
|
||||||
|
if (matchedData && matchedData.length > 0) {
|
||||||
|
return matchedData[0].dayAmount;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleDetail(id) {
|
||||||
|
this.$router.push({
|
||||||
name: "vipList-vipDetail",
|
name: "vipList-vipDetail",
|
||||||
query: {
|
query: {
|
||||||
id: id
|
id: id
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
detailHandle(row) {
|
detailHandle(row) {
|
||||||
console.log("row at line 447:", row);
|
console.log("row at line 447:", row);
|
||||||
@@ -523,7 +560,8 @@ this.$router.push({
|
|||||||
5: "针灸VIP",
|
5: "针灸VIP",
|
||||||
6: "肿瘤VIP",
|
6: "肿瘤VIP",
|
||||||
7: "国学VIP",
|
7: "国学VIP",
|
||||||
8: "心理学VIP"
|
8: "心理学VIP",
|
||||||
|
9: "中西汇通VIP"
|
||||||
};
|
};
|
||||||
|
|
||||||
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
||||||
@@ -533,7 +571,7 @@ this.$router.push({
|
|||||||
.split("")
|
.split("")
|
||||||
.map(Number); // 数字转为数组
|
.map(Number); // 数字转为数组
|
||||||
} else {
|
} else {
|
||||||
vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type
|
vipTypes = userVips.map(vip => vip); // 如果是对象数组,获取每个对象的 type
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断是否同时包含 4、5、6(医学SVIP)
|
// 判断是否同时包含 4、5、6(医学SVIP)
|
||||||
@@ -542,18 +580,69 @@ this.$router.push({
|
|||||||
const hasPsychologySVip = [7, 8].every(type => vipTypes.includes(type));
|
const hasPsychologySVip = [7, 8].every(type => vipTypes.includes(type));
|
||||||
|
|
||||||
const tags = [];
|
const tags = [];
|
||||||
vipTypes.forEach(type => {
|
vipTypes.forEach(e => {
|
||||||
if (type == 4 || type == 5 || type == 6) {
|
if (e.type == 4 || e.type == 5 || e.type == 6 || e.type == 9) {
|
||||||
tags.push(
|
tags.push(
|
||||||
`<el-tag size="mini" type="info" style="font-weight: bold; color: #fff;display:inline-block;margin-bottom: 6px; padding:0 6px; border-radius: 2px; font-size: 11px; background: #409EFF;" effect="dark">${vipMap[type]}</el-tag>`
|
`<el-tag size="mini" type="info" style="text-align:center;width:76px;font-weight: bold; color: ${
|
||||||
|
e.state == 0 ? "#fff" : "#888"
|
||||||
|
};display:inline-block;margin-bottom: 6px; padding:0 6px; border-radius: 2px; font-size: 11px; background: ${
|
||||||
|
e.state == 0 ? "#409EFF" : "#f0f0f0"
|
||||||
|
};" effect="dark">${vipMap[e.type]}</el-tag>
|
||||||
|
|
||||||
|
<span style="color: #f94f04;margin-left: 20px;font-weight:700;display:inline-block;min-width:80px;text-align:center"> ${
|
||||||
|
this.getVipPrice(e) != null
|
||||||
|
? "¥" + this.getVipPrice(e)
|
||||||
|
: '<i class="el-icon-close"></i>'
|
||||||
|
}</span>
|
||||||
|
<span style="color: #888;margin-left: 20px;">有效期:${
|
||||||
|
e.startTime ? e.startTime : ""
|
||||||
|
}</span>
|
||||||
|
<span>~</span>
|
||||||
|
<span style="color: #888;">${e.endTime ? e.endTime : ""}</span>
|
||||||
|
|
||||||
|
`
|
||||||
);
|
);
|
||||||
} else if (type == 7 ) {
|
} else if (e.type == 7) {
|
||||||
tags.push(
|
tags.push(
|
||||||
`<el-tag size="mini" type="info" style="font-weight: bold; color: #fff;display:inline-block;margin-bottom: 6px; padding:0 6px; border-radius: 2px; font-size: 11px; background:#67c23a" effect="dark">${vipMap[type]}</el-tag>`
|
`<el-tag size="mini" type="info" style="text-align:center;width:76px;font-weight: bold; color: ${
|
||||||
|
e.state == 0 ? "#fff" : "#888"
|
||||||
|
};display:inline-block;margin-bottom: 6px; padding:0 6px; border-radius: 2px; font-size: 11px; background: ${
|
||||||
|
e.state == 0 ? "#67c23a" : "#f0f0f0"
|
||||||
|
}" effect="dark">${vipMap[e.type]}</el-tag>
|
||||||
|
<span style="color: #f94f04;margin-left: 20px;font-weight:700;display:inline-block;min-width:80px;text-align:center"> ${
|
||||||
|
this.getVipPrice(e) != null
|
||||||
|
? "¥" + this.getVipPrice(e)
|
||||||
|
: '<i class="el-icon-close"></i>'
|
||||||
|
}</span>
|
||||||
|
<span style="color: #888;margin-left: 20px;">有效期:${
|
||||||
|
e.startTime ? e.startTime : ""
|
||||||
|
}</span>
|
||||||
|
<span>~</span>
|
||||||
|
<span style="color: #888;">${e.endTime ? e.endTime : ""}</span>
|
||||||
|
|
||||||
|
`
|
||||||
);
|
);
|
||||||
} else if (type == 8 ) {
|
} else if (e.type == 8) {
|
||||||
tags.push(
|
tags.push(
|
||||||
`<el-tag size="mini" type="info" style="font-weight: bold; color: #fff;display:inline-block;margin-bottom: 6px; background: #00bcd4; padding:0 6px; border-radius: 2px; font-size: 11px; " effect="dark">${vipMap[type]}</el-tag>`
|
`<el-tag size="mini" type="info" style="text-align:center;width:76px;font-weight: bold; color: ${
|
||||||
|
e.state == 0 ? "#fff" : "#888"
|
||||||
|
};display:inline-block;margin-bottom: 6px; background: ${
|
||||||
|
e.state == 0 ? "#00bcd4" : "#f0f0f0"
|
||||||
|
}; padding:0 6px; border-radius: 2px; font-size: 11px; " effect="dark">${
|
||||||
|
vipMap[e.type]
|
||||||
|
}</el-tag>
|
||||||
|
<span style="color: #f94f04;margin-left: 20px;font-weight:700;display:inline-block;min-width:80px;text-align:center"> ${
|
||||||
|
this.getVipPrice(e) != null
|
||||||
|
? "¥" + this.getVipPrice(e)
|
||||||
|
: '<i class="el-icon-close"></i>'
|
||||||
|
}</span>
|
||||||
|
<span style="color: #888;margin-left: 20px;">有效期:${
|
||||||
|
e.startTime ? e.startTime : ""
|
||||||
|
}</span>
|
||||||
|
<span>~</span>
|
||||||
|
<span style="color: #888;">${e.endTime ? e.endTime : ""}</span>
|
||||||
|
|
||||||
|
`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -626,15 +715,22 @@ this.$router.push({
|
|||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
|
var data = {
|
||||||
|
current: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
userName: this.dataForm.userName,
|
||||||
|
tel: this.dataForm.tel,
|
||||||
|
email: this.dataForm.email,
|
||||||
|
type: this.dataForm.type,
|
||||||
|
state: this.dataForm.state
|
||||||
|
};
|
||||||
|
|
||||||
this.$http({
|
this.$http({
|
||||||
// url: this.$http.adornUrl('/book/user/list'),
|
// url: this.$http.adornUrl('/book/user/list'),
|
||||||
url: this.$http.adornUrl("/book/user/getUserList"),
|
url: this.$http.adornUrl("/master/userVip/getUserVipList"),
|
||||||
method: "post",
|
method: "post",
|
||||||
data: this.$http.adornData({
|
data: this.$http.adornData({
|
||||||
page: this.pageIndex,
|
...data
|
||||||
limit: this.pageSize,
|
|
||||||
key: this.dataForm.key,
|
|
||||||
vipType: this.dataForm.vipType
|
|
||||||
})
|
})
|
||||||
// params: this.$http.adornParams({
|
// params: this.$http.adornParams({
|
||||||
// 'page': 1,
|
// 'page': 1,
|
||||||
@@ -643,9 +739,9 @@ this.$router.push({
|
|||||||
// })
|
// })
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.dataList = data.user.records;
|
this.dataList = data.result.records;
|
||||||
this.totalPage = data.user.pages;
|
this.totalPage = data.result.pages;
|
||||||
this.total = data.user.total;
|
this.total = data.result.total;
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user