VIP
This commit is contained in:
@@ -762,16 +762,16 @@
|
|||||||
if (!userVips || userVips.length === 0) return '';
|
if (!userVips || userVips.length === 0) return '';
|
||||||
|
|
||||||
const vipMap = {
|
const vipMap = {
|
||||||
4: '中医',
|
4: '中医VIP',
|
||||||
5: '针灸',
|
5: '针灸VIP',
|
||||||
6: '肿瘤',
|
6: '肿瘤VIP',
|
||||||
7: '国学',
|
7: '国学VIP',
|
||||||
8: '心理学'
|
8: '心理学VIP'
|
||||||
};
|
};
|
||||||
|
|
||||||
const vipTypes = userVips.map(vip => vip.type);
|
const vipTypes = userVips.map(vip => vip.type);
|
||||||
const isMedicalVip = vipTypes.some(type => [4, 5, 6].includes(type));
|
const isMedicalVip = [4, 5, 6].every(type => vipTypes.includes(type));
|
||||||
const isPsychologyVip = vipTypes.some(type => [7, 8].includes(type));
|
const isPsychologyVip = [7,8].every(type => vipTypes.includes(type));
|
||||||
|
|
||||||
// 特殊情况:医学 + 心理学
|
// 特殊情况:医学 + 心理学
|
||||||
if (isMedicalVip && isPsychologyVip) {
|
if (isMedicalVip && isPsychologyVip) {
|
||||||
|
|||||||
@@ -9,6 +9,21 @@
|
|||||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable>
|
<el-input v-model="dataForm.key" placeholder="参数名" clearable>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</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>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
@click="
|
@click="
|
||||||
@@ -434,16 +449,16 @@ export default {
|
|||||||
if (!userVips || userVips.length === 0) return '';
|
if (!userVips || userVips.length === 0) return '';
|
||||||
|
|
||||||
const vipMap = {
|
const vipMap = {
|
||||||
4: '中医',
|
4: '中医VIP',
|
||||||
5: '针灸',
|
5: '针灸VIP',
|
||||||
6: '肿瘤',
|
6: '肿瘤VIP',
|
||||||
7: '国学',
|
7: '国学VIP',
|
||||||
8: '心理学'
|
8: '心理学VIP'
|
||||||
};
|
};
|
||||||
|
|
||||||
const vipTypes = userVips.map(vip => vip.type);
|
const vipTypes = userVips.map(vip => vip.type);
|
||||||
const isMedicalVip = vipTypes.some(type => [4, 5, 6].includes(type));
|
const isMedicalVip = [4, 5, 6].every(type => vipTypes.includes(type));
|
||||||
const isPsychologyVip = vipTypes.some(type => [7, 8].includes(type));
|
const isPsychologyVip = [7,8].every(type => vipTypes.includes(type));
|
||||||
|
|
||||||
// 特殊情况:医学 + 心理学
|
// 特殊情况:医学 + 心理学
|
||||||
if (isMedicalVip && isPsychologyVip) {
|
if (isMedicalVip && isPsychologyVip) {
|
||||||
@@ -516,7 +531,8 @@ export default {
|
|||||||
data: this.$http.adornData({
|
data: this.$http.adornData({
|
||||||
page: this.pageIndex,
|
page: this.pageIndex,
|
||||||
limit: this.pageSize,
|
limit: this.pageSize,
|
||||||
key: this.dataForm.key
|
key: this.dataForm.key,
|
||||||
|
vipType: this.dataForm.vipType
|
||||||
})
|
})
|
||||||
// params: this.$http.adornParams({
|
// params: this.$http.adornParams({
|
||||||
// 'page': 1,
|
// 'page': 1,
|
||||||
|
|||||||
@@ -12,9 +12,17 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="dataForm.type" placeholder="请选择类型">
|
<el-select v-model="dataForm.type" placeholder="请选择类型">
|
||||||
<el-option label="超v" value=1></el-option>
|
<el-option label="医学SVIP" value=1></el-option>
|
||||||
<el-option label="吴门医述v(原简易超v)" value=2></el-option>
|
<el-option label="国学与心理学SVIP" value=2></el-option>
|
||||||
<el-option label="众秒之门vip" value=3></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=7></el-option>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -70,6 +78,14 @@
|
|||||||
label="邮箱">
|
label="邮箱">
|
||||||
<template slot-scope="scope">{{scope.row.user.email}}</template>
|
<template slot-scope="scope">{{scope.row.user.email}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="email"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="120"
|
||||||
|
label="天医币">
|
||||||
|
<template slot-scope="scope">{{scope.row.user.peanutCoin}}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="type"
|
prop="type"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
@@ -77,10 +93,13 @@
|
|||||||
width="120"
|
width="120"
|
||||||
label="类型">
|
label="类型">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.type==1">超v</span>
|
<span v-if="!scope.row.user.userVips||scope.row.user.userVips.length==0">-</span>
|
||||||
<span v-if="scope.row.type==2">吴门医述v(原简易超v)</span>
|
|
||||||
<span v-if="scope.row.type==3">众秒之门vip</span>
|
<span v-else v-html="computedVipType(scope.row.user.userVips)">
|
||||||
</template>
|
<!-- <img style="width: 25px;height: 25px;" src="../../../assets/img/vip.png" alt=""> -->
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="state"
|
prop="state"
|
||||||
@@ -108,7 +127,7 @@
|
|||||||
label="结束时间">
|
label="结束时间">
|
||||||
<template slot-scope="scope">{{scope.row.endTime}}</template>
|
<template slot-scope="scope">{{scope.row.endTime}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<!-- <el-table-column
|
||||||
fixed="right"
|
fixed="right"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
align="center"
|
align="center"
|
||||||
@@ -136,7 +155,7 @@
|
|||||||
<el-button slot="reference" size="small">办理金额</el-button>
|
<el-button slot="reference" size="small">办理金额</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@@ -170,6 +189,43 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
computedVipType(userVips) {
|
||||||
|
if (!userVips || userVips.length === 0) return '';
|
||||||
|
|
||||||
|
const vipMap = {
|
||||||
|
4: '中医VIP',
|
||||||
|
5: '针灸VIP',
|
||||||
|
6: '肿瘤VIP',
|
||||||
|
7: '国学VIP',
|
||||||
|
8: '心理学VIP'
|
||||||
|
};
|
||||||
|
|
||||||
|
const vipTypes = userVips.map(vip => vip.type);
|
||||||
|
const isMedicalVip = [4, 5, 6].every(type => vipTypes.includes(type));
|
||||||
|
const isPsychologyVip = [7,8].every(type => vipTypes.includes(type));
|
||||||
|
|
||||||
|
// 特殊情况:医学 + 心理学
|
||||||
|
if (isMedicalVip && isPsychologyVip) {
|
||||||
|
return `<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><br/>
|
||||||
|
<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>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只有医学VIP
|
||||||
|
if (isMedicalVip) {
|
||||||
|
return `<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">医学超级VIP</el-tag>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只有心理学VIP
|
||||||
|
if (isPsychologyVip) {
|
||||||
|
return `<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">国学与心理学超级VIP</el-tag>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// **普通情况**:单独展示所有 `type` 对应的内容
|
||||||
|
return vipTypes
|
||||||
|
.filter(type => vipMap[type]) // 过滤出有对应名称的类型
|
||||||
|
.map(type => `<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>`)
|
||||||
|
.join(' ');
|
||||||
|
},
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
getDataList () {
|
getDataList () {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
|
|||||||
Reference in New Issue
Block a user