fix: 个人主页修改

This commit is contained in:
kaizheng(郑凯) 2025-02-27 13:35:50 +08:00
parent 7276ebf57d
commit e0507ca65c
7 changed files with 401 additions and 101 deletions

View File

@ -97,7 +97,7 @@
class="icon" class="icon"
src="@/assets/images/data.png" src="@/assets/images/data.png"
alt="" alt=""
@click="$router.push('/circle/data')" @click="$router.push(`/circle/data?id=${detail.id}`)"
/> />
</div> </div>
</div> </div>

View File

@ -34,7 +34,7 @@
style="width: 100%;" style="width: 100%;"
> >
<el-table-column label="序号" align="center" type="index" fixed /> <el-table-column label="序号" align="center" type="index" fixed />
<el-table-column prop="name" label="交易圈名称" width="180"> <el-table-column prop="name" label="名称" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
@ -287,7 +287,7 @@
</el-form-item> </el-form-item>
<el-form-item v-if="authority === '1'" label="链接类型"> <el-form-item v-if="authority === '1'" label="链接类型">
<el-select v-model="linkType" :disabled="isAdjust || isReadOnly"> <el-select v-model="linkType" :disabled="isAdjust || isReadOnly">
<el-option label="落地页链接" value="1" /> <!-- <el-option label="落地页链接" value="1" /> -->
<el-option label="支付页链接" value="2" /> <el-option label="支付页链接" value="2" />
</el-select> </el-select>
</el-form-item> </el-form-item>

View File

@ -0,0 +1,278 @@
<template>
<div>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="圈子名称">
<el-input v-model="formInline.name" placeholder="圈子名称" />
</el-form-item>
<el-form-item label="显示状态">
<el-select v-model="formInline.isDisplay" placeholder="显示状态">
<el-option label="全部" value="" />
<el-option label="显示" :value="1" />
<el-option label="隐藏" :value="2" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData" style="width: 100%">
<el-table-column type="index" label="序号" />
<el-table-column prop="name" label="圈子名称" width="180" />
<el-table-column prop="coverImage" label="封面图" width="100">
<template #default="scope">
<el-popover placement="right" :width="400" trigger="hover">
<img :src="scope.row.coverImage" width="375" height="300" />
<template #reference>
<img
:src="scope.row.coverImage"
style="max-height: 60px; max-width: 60px"
/>
</template>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="createUserName" label="创建人" width="180" />
<el-table-column prop="createTime" label="创建时间" width="180" />
<el-table-column prop="auditTime" label="审核时间" width="180" />
<el-table-column prop="riskLevel" label="风险等级" width="100">
<template slot-scope="scope">
{{ riskLevelList[scope.row.riskLevel] }}
</template>
</el-table-column>
<el-table-column label="观看限制" width="100">
<template slot-scope="scope">
{{ scope.row.authorityId ? "权限判断" : "无限制" }}
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
{{ statusList[scope.row.status] }}
</template>
</el-table-column>
<el-table-column prop="reason" label="备注" width="180" />
<el-table-column prop="isRecommend" label="权重" />
<el-table-column label="显示状态">
<template slot-scope="scope">
{{ scope.row.isDisplay === 1 ? "显示" : "隐藏" }}
</template>
</el-table-column>
<el-table-column
v-if="!isYx"
prop="name"
label="操作"
fixed="right"
align="center"
width="300"
>
<template slot-scope="scope">
<!-- <el-button
v-if="!scope.row.isRecommend"
type="text"
@click="recommend(scope.row)"
>设置权重</el-button
>
<el-button
v-if="scope.row.isRecommend"
type="text"
@click="editWeight(scope.row)"
>取消权重</el-button
> -->
<el-button
v-if="scope.row.isDisplay === 1"
type="text"
@click="control(scope.row, 1)"
>隐藏</el-button
>
<el-button
v-if="scope.row.isDisplay !== 1"
type="text"
@click="control(scope.row, 2)"
>显示</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
class="pagination"
background
layout="total,prev, pager, next"
:current-page="current"
:total="total"
@current-change="pageChange"
/>
<el-dialog
:visible.sync="dialogWeight"
:close-on-click-modal="false"
title="推荐"
append-to-body
>
<el-form>
<el-form-item label="课程权重:">
<el-input-number
v-model="form.isRecommend"
:min="1"
:max="100"
label="请输入权重"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" @click="editWeight()"
>提交</el-button
>
<el-button size="mini" @click="cancelWeight()">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { setMainPageParam } from "@/api/course.js";
import { getCircleList } from "@/api/circle.js";
export default {
name: "CourseTab",
props: {
isYx: {
type: Boolean,
default: false
}
},
data() {
return {
formInline: {
name: "",
isDisplay: ""
},
current: 1,
tableData: [],
total: 0,
riskLevelList: {
0: "低风险",
1: "低风险",
2: "中低风险",
3: "中风险",
4: "中高风险",
5: "高风险"
},
statusList: {
1: "待提交",
2: "待审核",
3: "已上架",
4: "已驳回",
5: "已下架",
6: "已删除"
},
loading: false,
advisorId: null,
dialogWeight: false,
form: {
id: null,
isRecommend: null
}
};
},
methods: {
onSubmit() {
this.current = 1;
this.getList(this.advisorId);
},
pageChange(e) {
this.current = e;
this.getList(this.advisorId);
},
async getList(id) {
if (!id) return;
this.advisorId = id;
this.loading = true;
const ret = await getCircleList(
Object.assign(
{
current: this.current,
size: 10,
status: 3,
userType: 3,
advisorId: this.advisorId
},
this.formInline
)
);
if (ret.code === 0) {
this.tableData = ret.data.list;
console.log("this.tableData", this.tableData);
this.total = ret.data.total;
this.loading = false;
}
},
//
async recommend(item) {
// 1
this.form.id = JSON.parse(JSON.stringify(item.id));
this.dialogWeight = true;
},
//
async control(item, type) {
this.$confirm(`您确定${type === 1 ? "隐藏" : "显示"}?`, {
confirmButtonText: "提交",
cancelButtonText: "取消",
type: "warning"
})
.then(async () => {
const data = {
id: item.id,
isDisplay: type === 1 ? 2 : 1
};
const res = await setMainPageParam(data);
if (res.code === 0) {
this.$message.success("操作成功");
this.getList(this.advisorId);
}
})
.catch(() => {});
},
async editWeight(val) {
if (val) {
this.form.id = val.id;
this.form.isRecommend = 0;
this.$confirm(`您确定取消推荐?`, {
confirmButtonText: "提交",
cancelButtonText: "取消",
type: "warning"
})
.then(async () => {
const data = {
id: this.form.id,
isRecommend: 0
};
const res = await setMainPageParam(data);
if (res.code === 0) {
this.$message.success("操作成功");
this.getList(this.advisorId);
}
})
.catch(() => {});
} else {
const data = { ...this.form };
const res = await setMainPageParam(data);
if (res.code === 0) {
this.$message.success("操作成功");
this.cancelWeight();
this.getList(this.advisorId);
}
}
},
cancelWeight() {
this.form = {
id: null,
isRecommend: null
};
this.dialogWeight = false;
}
}
};
</script>
<style scoped lang="scss">
.pagination {
display: flex;
justify-content: flex-end;
margin-top: 20px;
}
</style>

View File

@ -21,12 +21,12 @@
<el-table-column prop="coverImage" label="封面图" width="100"> <el-table-column prop="coverImage" label="封面图" width="100">
<template #default="scope"> <template #default="scope">
<el-popover placement="right" :width="400" trigger="hover"> <el-popover placement="right" :width="400" trigger="hover">
<img :src="scope.row.coverImage" width="375" height="300"> <img :src="scope.row.coverImage" width="375" height="300" />
<template #reference> <template #reference>
<img <img
:src="scope.row.coverImage" :src="scope.row.coverImage"
style="max-height: 60px; max-width: 60px" style="max-height: 60px; max-width: 60px"
> />
</template> </template>
</el-popover> </el-popover>
</template> </template>
@ -59,7 +59,7 @@
<el-table-column prop="isRecommend" label="权重" /> <el-table-column prop="isRecommend" label="权重" />
<el-table-column label="显示状态"> <el-table-column label="显示状态">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.isDisplay === 1 ? '显示' : '隐藏' }} {{ scope.row.isDisplay === 1 ? "显示" : "隐藏" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -70,32 +70,34 @@
align="center" align="center"
width="300" width="300"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="!scope.row.isRecommend" v-if="!scope.row.isRecommend"
type="text" type="text"
@click="recommend(scope.row)" @click="recommend(scope.row)"
>设置权重</el-button> >设置权重</el-button
>
<el-button <el-button
v-if="scope.row.isRecommend" v-if="scope.row.isRecommend"
type="text" type="text"
@click="editWeight(scope.row)" @click="editWeight(scope.row)"
>取消权重</el-button> >取消权重</el-button
>
<el-button <el-button
v-if="scope.row.isDisplay === 1" v-if="scope.row.isDisplay === 1"
type="text" type="text"
@click="control(scope.row, 1)" @click="control(scope.row, 1)"
>隐藏</el-button> >隐藏</el-button
>
<el-button <el-button
v-if="scope.row.isDisplay !== 1" v-if="scope.row.isDisplay !== 1"
type="text" type="text"
@click="control(scope.row, 2)" @click="control(scope.row, 2)"
>显示</el-button> >显示</el-button
<el-button >
type="text" <el-button type="text" @click="editText(scope.row)"
@click="editText(scope.row)" >配置文案</el-button
>配置文案</el-button> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -124,11 +126,9 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button <el-button size="mini" type="primary" @click="editWeight()"
size="mini" >提交</el-button
type="primary" >
@click="editWeight()"
>提交</el-button>
<el-button size="mini" @click="cancelWeight()">取消</el-button> <el-button size="mini" @click="cancelWeight()">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -140,24 +140,27 @@
> >
<el-form> <el-form>
<el-form-item label="产品介绍"> <el-form-item label="产品介绍">
<el-input v-model="formText.mainPageText" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" clearable /> <el-input
v-model="formText.mainPageText"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
clearable
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button <el-button size="mini" type="primary" @click="submitText()"
size="mini" >提交</el-button
type="primary" >
@click="submitText()"
>提交</el-button>
<el-button size="mini" @click="cancelText()">取消</el-button> <el-button size="mini" @click="cancelText()">取消</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { getCourseList, setMainPageParam } from '@/api/course.js' import { getCourseList, setMainPageParam } from "@/api/course.js";
export default { export default {
name: 'CourseTab', name: "CourseTab",
props: { props: {
isYx: { isYx: {
type: Boolean, type: Boolean,
@ -167,19 +170,19 @@ export default {
data() { data() {
return { return {
formInline: { formInline: {
title: '', title: "",
isDisplay: '' isDisplay: ""
}, },
current: 1, current: 1,
tableData: [], tableData: [],
total: 0, total: 0,
riskLevelList: { riskLevelList: {
0: '低风险', 0: "低风险",
1: '低风险', 1: "低风险",
2: '中低风险', 2: "中低风险",
3: '中风险', 3: "中风险",
4: '中高风险', 4: "中高风险",
5: '高风险' 5: "高风险"
}, },
loading: false, loading: false,
advisorId: null, advisorId: null,
@ -193,89 +196,94 @@ export default {
id: null, id: null,
mainPageText: null mainPageText: null
} }
} };
}, },
methods: { methods: {
onSubmit() { onSubmit() {
this.current = 1 this.current = 1;
this.getList(this.advisorId) this.getList(this.advisorId);
}, },
pageChange(e) { pageChange(e) {
this.current = e this.current = e;
this.getList(this.advisorId) this.getList(this.advisorId);
}, },
async getList(id) { async getList(id) {
if (!id) return if (!id) return;
this.advisorId = id this.advisorId = id;
this.loading = true this.loading = true;
const ret = await getCourseList(Object.assign({ const ret = await getCourseList(
current: this.current, Object.assign(
size: 10, {
status: 3, current: this.current,
userType: 3, size: 10,
advisorId: this.advisorId status: 3,
}, this.formInline)) userType: 3,
advisorId: this.advisorId
},
this.formInline
)
);
if (ret.code === 0) { if (ret.code === 0) {
this.tableData = ret.data.list this.tableData = ret.data.list;
console.log('this.tableData', this.tableData) console.log("this.tableData", this.tableData);
this.total = ret.data.total this.total = ret.data.total;
this.loading = false this.loading = false;
} }
}, },
// //
async recommend(item) { async recommend(item) {
// 1 // 1
this.form.id = JSON.parse(JSON.stringify(item.id)) this.form.id = JSON.parse(JSON.stringify(item.id));
this.dialogWeight = true this.dialogWeight = true;
}, },
// //
async control(item, type) { async control(item, type) {
this.$confirm(`您确定${type === 1 ? '隐藏' : '显示'}?`, { this.$confirm(`您确定${type === 1 ? "隐藏" : "显示"}?`, {
confirmButtonText: '提交', confirmButtonText: "提交",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}) })
.then(async() => { .then(async () => {
const data = { const data = {
id: item.id, id: item.id,
isDisplay: type === 1 ? 2 : 1 isDisplay: type === 1 ? 2 : 1
} };
const res = await setMainPageParam(data) const res = await setMainPageParam(data);
if (res.code === 0) { if (res.code === 0) {
this.$message.success('操作成功') this.$message.success("操作成功");
this.getList(this.advisorId) this.getList(this.advisorId);
} }
}) })
.catch(() => {}) .catch(() => {});
}, },
async editWeight(val) { async editWeight(val) {
if (val) { if (val) {
this.form.id = val.id this.form.id = val.id;
this.form.isRecommend = 0 this.form.isRecommend = 0;
this.$confirm(`您确定取消推荐?`, { this.$confirm(`您确定取消推荐?`, {
confirmButtonText: '提交', confirmButtonText: "提交",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}) })
.then(async() => { .then(async () => {
const data = { const data = {
id: this.form.id, id: this.form.id,
isRecommend: 0 isRecommend: 0
} };
const res = await setMainPageParam(data) const res = await setMainPageParam(data);
if (res.code === 0) { if (res.code === 0) {
this.$message.success('操作成功') this.$message.success("操作成功");
this.getList(this.advisorId) this.getList(this.advisorId);
} }
}) })
.catch(() => {}) .catch(() => {});
} else { } else {
const data = { ...this.form } const data = { ...this.form };
const res = await setMainPageParam(data) const res = await setMainPageParam(data);
if (res.code === 0) { if (res.code === 0) {
this.$message.success('操作成功') this.$message.success("操作成功");
this.cancelWeight() this.cancelWeight();
this.getList(this.advisorId) this.getList(this.advisorId);
} }
} }
}, },
@ -283,35 +291,37 @@ export default {
this.form = { this.form = {
id: null, id: null,
isRecommend: null isRecommend: null
} };
this.dialogWeight = false this.dialogWeight = false;
}, },
editText(item) { editText(item) {
this.formText.id = JSON.parse(JSON.stringify(item.id)) this.formText.id = JSON.parse(JSON.stringify(item.id));
this.formText.mainPageText = JSON.parse(JSON.stringify(item.mainPageText)) this.formText.mainPageText = JSON.parse(
this.dialogText = true JSON.stringify(item.mainPageText)
);
this.dialogText = true;
}, },
async submitText() { async submitText() {
const data = { const data = {
id: this.formText.id, id: this.formText.id,
mainPageText: this.formText.mainPageText mainPageText: this.formText.mainPageText
} };
const res = await setMainPageParam(data) const res = await setMainPageParam(data);
if (res.code === 0) { if (res.code === 0) {
this.$message.success('操作成功') this.$message.success("操作成功");
this.dialogText = false this.dialogText = false;
this.getList(this.advisorId) this.getList(this.advisorId);
} }
}, },
cancelText() { cancelText() {
this.dialogText = false this.dialogText = false;
this.formText = { this.formText = {
id: null, id: null,
mainPageText: null mainPageText: null
} };
} }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.pagination { .pagination {

View File

@ -38,6 +38,7 @@
<ShortTab v-if="selectedButton === 35" ref="shortTab" /> <ShortTab v-if="selectedButton === 35" ref="shortTab" />
<LiveTab v-if="selectedButton === 3" ref="liveTab" /> <LiveTab v-if="selectedButton === 3" ref="liveTab" />
<CourseTab v-if="selectedButton === 32" ref="courseTab" /> <CourseTab v-if="selectedButton === 32" ref="courseTab" />
<CircleTab v-if="selectedButton === 41" ref="CircleTab" />
</div> </div>
<el-dialog <el-dialog
:visible.sync="dialogTab" :visible.sync="dialogTab"
@ -120,8 +121,9 @@ import { tgList, mainTabInfoList, mainTabInfoSave } from "@/api/adviser";
import { handleClipboard } from "@/views/liveBroadcast/manage/config"; import { handleClipboard } from "@/views/liveBroadcast/manage/config";
import { urlResize } from "@/api/videoLive"; import { urlResize } from "@/api/videoLive";
import ShortTab from "./components/ShortTab.vue"; import ShortTab from "./components/ShortTab.vue";
import CircleTab from "./components/CircleTab.vue";
export default { export default {
components: { LiveTab, CourseTab, ShortTab }, components: { LiveTab, CourseTab, ShortTab, CircleTab },
data() { data() {
return { return {
editableTabsValue: "", editableTabsValue: "",
@ -221,6 +223,8 @@ export default {
this.$refs.courseTab.getList(this.advisorId); this.$refs.courseTab.getList(this.advisorId);
} else if (this.selectedButton === 35 && this.$refs.shortTab) { } else if (this.selectedButton === 35 && this.$refs.shortTab) {
this.$refs.shortTab.queryList(this.advisorId); this.$refs.shortTab.queryList(this.advisorId);
} else if (this.selectedButton === 41 && this.$refs.CircleTab) {
this.$refs.CircleTab.getList(this.advisorId);
} }
}); });
}, },

View File

@ -22,6 +22,7 @@
<ShortTab v-if="selectedButton === 35" ref="shortTab" /> <ShortTab v-if="selectedButton === 35" ref="shortTab" />
<LiveTab v-if="selectedButton === 3" ref="liveTab" /> <LiveTab v-if="selectedButton === 3" ref="liveTab" />
<CourseTab v-if="selectedButton === 32" ref="courseTab" /> <CourseTab v-if="selectedButton === 32" ref="courseTab" />
<CircleTab v-if="selectedButton === 41" ref="CircleTab" />
</div> </div>
<el-dialog <el-dialog
:visible.sync="dialogTab" :visible.sync="dialogTab"
@ -99,12 +100,13 @@ import Sortable from "sortablejs";
import LiveTab from "./components/LiveTab.vue"; import LiveTab from "./components/LiveTab.vue";
import CourseTab from "./components/CourseTab.vue"; import CourseTab from "./components/CourseTab.vue";
import ShortTab from "./components/ShortTab.vue"; import ShortTab from "./components/ShortTab.vue";
import CircleTab from "./components/CircleTab.vue";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { mainTabInfoList, mainTabInfoSave } from "@/api/adviser"; import { mainTabInfoList, mainTabInfoSave } from "@/api/adviser";
import { handleClipboard } from "@/views/liveBroadcast/manage/config"; import { handleClipboard } from "@/views/liveBroadcast/manage/config";
import { urlResize } from "@/api/videoLive"; import { urlResize } from "@/api/videoLive";
export default { export default {
components: { LiveTab, CourseTab, ShortTab }, components: { LiveTab, CourseTab, ShortTab, CircleTab },
data() { data() {
return { return {
editableTabsValue: "", editableTabsValue: "",
@ -128,7 +130,8 @@ export default {
6: ["图文直播", "圈子", "服务圈", "财富圈"], 6: ["图文直播", "圈子", "服务圈", "财富圈"],
31: ["甄选服务", "会员"], 31: ["甄选服务", "会员"],
32: ["课程", "产品", "系列课"], 32: ["课程", "产品", "系列课"],
35: ["短视频", "视频", "作品"] 35: ["短视频", "视频", "作品"],
41: ["圈子"]
} }
}; };
}, },
@ -171,6 +174,8 @@ export default {
this.$refs.courseTab.getList(this.advisorId); this.$refs.courseTab.getList(this.advisorId);
} else if (this.selectedButton === 35 && this.$refs.shortTab) { } else if (this.selectedButton === 35 && this.$refs.shortTab) {
this.$refs.shortTab.queryList(this.advisorId); this.$refs.shortTab.queryList(this.advisorId);
} else if (this.selectedButton === 41 && this.$refs.CircleTab) {
this.$refs.CircleTab.queryList(this.advisorId);
} }
}); });
}, },

View File

@ -39,6 +39,7 @@
<ShortTab v-if="selectedButton === 35" ref="shortTab" /> <ShortTab v-if="selectedButton === 35" ref="shortTab" />
<LiveTab v-if="selectedButton === 3" ref="liveTab" :is-yx="true" /> <LiveTab v-if="selectedButton === 3" ref="liveTab" :is-yx="true" />
<CourseTab v-if="selectedButton === 32" ref="courseTab" :is-yx="true" /> <CourseTab v-if="selectedButton === 32" ref="courseTab" :is-yx="true" />
<CircleTab v-if="selectedButton === 41" ref="CircleTab" />
</div> </div>
<el-dialog <el-dialog
:visible.sync="dialogTab" :visible.sync="dialogTab"
@ -120,9 +121,9 @@ import { tgList, mainTabInfoList, mainTabInfoSave } from "@/api/adviser";
import { handleClipboard } from "@/views/liveBroadcast/manage/config"; import { handleClipboard } from "@/views/liveBroadcast/manage/config";
import ShortTab from "./components/ShortTab.vue"; import ShortTab from "./components/ShortTab.vue";
import { urlResize } from "@/api/videoLive"; import { urlResize } from "@/api/videoLive";
import { create } from "simple-drawing-board"; import CircleTab from "./components/CircleTab.vue";
export default { export default {
components: { LiveTab, CourseTab, ShortTab }, components: { LiveTab, CourseTab, ShortTab, CircleTab },
data() { data() {
return { return {
editableTabsValue: "", editableTabsValue: "",
@ -220,6 +221,8 @@ export default {
this.$refs.courseTab.getList(this.advisorId); this.$refs.courseTab.getList(this.advisorId);
} else if (this.selectedButton === 35 && this.$refs.shortTab) { } else if (this.selectedButton === 35 && this.$refs.shortTab) {
this.$refs.shortTab.queryList(this.advisorId); this.$refs.shortTab.queryList(this.advisorId);
} else if (this.selectedButton === 41 && this.$refs.CircleTab) {
this.$refs.CircleTab.queryList(this.advisorId);
} }
}); });
}, },