fix: 调试

This commit is contained in:
kaizheng(郑凯) 2025-02-12 21:40:09 +08:00
parent 74dcb70174
commit 7ddc0e978c
34 changed files with 8418 additions and 609 deletions

View File

@ -2,6 +2,6 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'https://eladmin.vip'
VUE_APP_BASE_API = ''
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'wss://eladmin.vip'
VUE_APP_WS_API = ''

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
.DS_Store
node_modules/
dist/
build/
demo/
npm-debug.log*
yarn-debug.log*

View File

@ -37,6 +37,7 @@
"@stomp/stompjs": "^6.1.2",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^1.0.2",
"amfe-flexible": "^2.2.1",
"axios": "1.7.4",
"babel-eslint": "^8.2.2",
"clipboard": "2.0.4",
@ -61,6 +62,7 @@
"qrcodejs2": "^0.0.2",
"qs": "^6.10.1",
"screenfull": "4.2.0",
"simple-drawing-board": "^3.1.3",
"sortablejs": "1.8.4",
"vod-js-sdk-v6": "^1.7.1-beta.1",
"vue": "^2.6.14",
@ -74,8 +76,7 @@
"vuex": "3.1.0",
"wangeditor": "^4.7.11",
"webpack": "^4.47.0",
"xlsx": "^0.18.5",
"amfe-flexible": "^2.2.1"
"xlsx": "^0.18.5"
},
"devDependencies": {
"@babel/parser": "^7.7.4",
@ -111,7 +112,8 @@
"svgo": "1.2.0",
"tasksfile": "^5.1.1",
"vue-template-compiler": "2.7.15",
"vue2-editor": "^2.10.3"
"vue2-editor": "^2.10.3",
"zip-webpack-plugin": "^4.0.3"
},
"engines": {
"node": ">=8.9",

19
src/api/pop.js Normal file
View File

@ -0,0 +1,19 @@
import { get, post } from '@/utils/request'
// 查询升级弹窗详情
export const queryPopContent = (params) => get('/admin/upgradePop/queryPopContent', params)
// 升级弹窗内容更新
export const updateContent = (params) => post('/admin/upgradePop/updateContent', params)
// 查询保证金支付开关状态true打开 false关闭
export const queryMarginPaymentStatus = (params) => get('/admin/crm/queryMarginPaymentStatus', params)
// 更改保证金支付开关状态
export const updateMarginPaymentStatus = (params) => get('/admin/crm/updateMarginPaymentStatus', params)
// 更改保证金支付开关状态
export const querySignTime = (params) => get('/admin/crm/querySignTime', params)
// 设置保证金-佣金支付签约时间
export const setSignTime = (params) => post('/admin/crm/setSignTime', params)

View File

@ -208,20 +208,20 @@ export function addCommentBlack(data) {
});
}
// 解除用户禁言
export function removeCommentBlack(params) {
export function removeCommentBlack(data) {
return request({
url: "/admin/comment/removeCommentBlack",
method: "get",
params
method: "post",
data
});
}
// 中台查询禁言列表
export function queryCommentBlackList(params) {
export function queryCommentBlackList(data) {
return request({
url: "/admin/comment/queryCommentBlackList",
method: "get",
params
method: "post",
data
});
}

View File

@ -105,35 +105,35 @@ export const constantRouterMap = [
{
path: "/circle",
component: Layout,
hidden: false,
hidden: true,
name: "圈子管理",
children: [
// {
// path: "indexYy",
// component: () => import("@/views/circle/list/indexYy"),
// name: "圈子列表(运营)",
// meta: { title: "圈子列表(运营)" }
// },
// {
// path: "indexTg",
// component: () => import("@/views/circle/list/indexTg"),
// name: "圈子列表(投顾)",
// meta: { title: "圈子列表(投顾)" }
// },
// {
// path: "indexYx",
// component: () => import("@/views/circle/list/indexYx"),
// name: "圈子列表(营销)",
// meta: { title: "圈子列表(营销)" }
// },
// {
// path: "indexZj",
// component: () => import("@/views/circle/list/indexZj"),
// name: "圈子列表(助教)",
// meta: { title: "圈子列表(助教)" }
// },
{
path: "indexYy",
component: () => import("@/views/circle/list/indexYy"),
name: "圈子列表(运营)",
meta: { title: "圈子列表(运营)" }
},
{
path: "indexTg",
component: () => import("@/views/circle/list/indexTg"),
name: "圈子列表(投顾)",
meta: { title: "圈子列表(投顾)" }
},
{
path: "indexYx",
component: () => import("@/views/circle/list/indexYx"),
name: "圈子列表(营销)",
meta: { title: "圈子列表(营销)" }
},
{
path: "indexZj",
component: () => import("@/views/circle/list/indexZj"),
name: "圈子列表(助教)",
meta: { title: "圈子列表(助教)" }
},
{
path: "detail/:id",
path: "detail",
component: () => import("@/views/circle/detail/index"),
name: "圈子详情",
meta: { title: "圈子详情" }

View File

@ -0,0 +1,83 @@
<template>
<!-- 禁言弹窗 -->
<el-dialog
title="禁言"
:visible.sync="dialogFormVisible"
:modal-append-to-body="false"
>
<el-form :model="formProhibition">
<el-form-item label="请选择禁言时效">
<el-radio-group v-model="formProhibition.type">
<el-radio :label="0">次日解禁</el-radio>
<el-radio :label="1">一个月后解禁</el-radio>
<el-radio :label="2">永久禁言</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelProhibition()"> </el-button>
<el-button type="primary" @click="submitProhibition()"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
queryCommentBlackList,
addCommentBlack,
removeCommentBlack
} from "@/api/videoLive";
export default {
props: {
productId: {
type: Number
},
productType: {
type: Number
},
scope: {
type: Number
}
},
data() {
return {
formProhibition: {
userName: "",
phone: "",
type: 0,
content: "无"
},
dialogFormVisible: false
};
},
methods: {
submitProhibition() {
if (![0, 1, 2].includes(this.formProhibition.type)) return;
const data = {
productId: this.productId,
productType: this.productType,
type: this.formProhibition.type,
userName: this.formProhibition.userName,
userPhone: this.formProhibition.phone,
scope: this.scope,
content: this.formProhibition.content
};
addCommentBlack(data).then(res => {
if (res.code === 0) {
this.$message({
message: "禁言成功",
showClose: false,
type: "success"
});
this.$emit("callback", this.formProhibition.phone);
this.formProhibition = {
userName: "",
phone: "",
type: 0
};
this.dialogFormVisible = false;
}
});
}
}
};
</script>

View File

@ -2,10 +2,10 @@
<div class="message-send">
<div class="msg-content">
<el-input
type="textarea"
v-model="content"
type="textarea"
rows="5"
placeholder="文本输入区"
:placeholder="placeholder"
/>
<el-upload
class="avatar-uploader"
@ -15,19 +15,21 @@
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
<img v-if="imageUrl" :src="imageUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon" />
</el-upload>
</div>
<div class="msg-opt">
<el-checkbox v-model="isRecommend" :false-label="2" :true-label="1"
>设为精选</el-checkbox
>
<el-checkbox
v-model="isRecommend"
:false-label="2"
:true-label="1"
>设为精选</el-checkbox>
<el-dropdown
split-button
type="primary"
@click="sendAdvisorMessage(1)"
:disabled="!content"
@click="sendAdvisorMessage(1)"
>
发送并推送
<!-- <el-dropdown-menu slot="dropdown">
@ -39,8 +41,7 @@
type="primary"
:disabled="!imageUrl"
@click="sendAdvisorMessage(2)"
>发送图片</el-button
>
>发送图片</el-button>
</div>
</div>
</template>
@ -57,6 +58,10 @@ export default {
},
replyId: {
type: Number
},
privateUserInfo: {
type: Object,
default: () => {}
}
},
data() {
@ -70,6 +75,13 @@ export default {
isRecommend: 2
};
},
computed: {
placeholder() {
return this.interactiveType === 1
? "请输入您想发送的互动内容"
: "请输入您想发送的私聊内容";
}
},
methods: {
handleAvatarSuccess(res, file) {
this.imageUrl = res.data.url;
@ -88,13 +100,15 @@ export default {
return true;
},
async sendAdvisorMessage(contentType) {
let ret = await sendAdvisorMessage({
const ret = await sendAdvisorMessage({
content: contentType === 1 ? this.content : this.imageUrl,
groupId: this.groupId,
isRecommend: this.isRecommend,
interactiveType: this.interactiveType,
replyId: this.replyId,
contentType
contentType,
toUserId: this.privateUserInfo.privateUserId,
toUserName: this.privateUserInfo.privateUserName
});
if (ret && ret.code === 0) {
this.$message({

View File

@ -1,9 +1,9 @@
<template>
<div class="news-list-wrap">
<ul
v-infinite-scroll="getMessageList"
class="news-list"
infinite-scroll-disabled="disabled"
v-infinite-scroll="getMessageList"
infinite-scroll-immediate="false"
>
<li v-for="(item, index) in list" :key="item.id">
@ -11,9 +11,9 @@
<img
v-if="item.userType === 1"
:src="item.advisor ? item.advisor.avatar : defaultAvatar.teacher"
/>
<img v-else-if="item.userType === 3" :src="defaultAvatar.assistant" />
<img v-else-if="item.userType === 2" :src="defaultAvatar.student" />
>
<img v-else-if="item.userType === 3" :src="defaultAvatar.assistant">
<img v-else-if="item.userType === 2" :src="defaultAvatar.student">
<div class="news-info">
<div class="news-info-top">
<div class="news-user">
@ -21,31 +21,28 @@
<label
v-if="[1, 3].includes(item.userType)"
:class="[item.userType === 1 ? 'blue' : 'orange']"
>{{ item.userType === 1 ? "老师" : "助教" }}</label
>
>{{ item.userType === 1 ? "老师" : "助教" }}</label>
<span><i>1</i>/4</span>
<span>已读</span>
</div>
<div class="news-opt">
<el-link type="success" @click="setMessageRecommend(item)">{{
<el-link
v-if="type !== 5"
type="success"
@click="setMessageRecommend(item)"
>{{
item.isRecommend === 1 ? "取消精选" : "设为精选"
}}</el-link>
<el-link
v-if="item.userType === 2 && type !== 5"
type="success"
v-if="item.userType === 2"
@click="setReplyMsg(item)"
>引用</el-link
>
>引用</el-link>
<el-link
v-if="item.userType === 2 && item.status === 1"
type="success"
v-if="item.userType === 2 && item.isOpen === 1"
>取消审核</el-link
>
<el-link
type="success"
v-else-if="item.userType === 2 && item.isOpen === 2"
>通过审核</el-link
>
@click="updateMessageStatus(item)"
>通过审核</el-link>
</div>
</div>
<p>{{ item.createTime }}</p>
@ -53,18 +50,18 @@
</div>
<div class="new-content">
<p v-if="item.contentType === 1">{{ item.content }}</p>
<img v-else :src="item.content" alt="" />
<img v-else :src="item.content" alt="">
</div>
</li>
</ul>
<p class="load-tip" v-if="loading">加载中...</p>
<p class="load-tip" v-if="!hasNext">没有更多了...</p>
<p class="load-tip" v-else-if="!loading && hasNext">下拉加载更多...</p>
<p v-if="loading" class="load-tip">加载中...</p>
<p v-if="!hasNext" class="load-tip">没有更多了...</p>
<p v-else-if="!loading && hasNext" class="load-tip">下拉加载更多...</p>
</div>
</template>
<script>
import { getMessageList } from "@/api/circle.js";
import { setMessageRecommend } from "@/api/circle";
import { setMessageRecommend, updateMessageStatus } from "@/api/circle";
export default {
props: {
groupId: {
@ -75,11 +72,16 @@ export default {
type: Number
},
newMsg: {
//
type: Object
},
userId: {
// id
type: Number
type: Number | String
},
privateNewMsg: {
//
type: Object
}
},
data() {
@ -109,18 +111,24 @@ export default {
this.type === 1 ||
(this.type === 2 && msg.userType === 1) ||
(this.type === 4 && msg.isRecommend === 1)
)
this.list.unshift(msg);
) { this.list.unshift(msg); }
},
privateNewMsg(msg) {
if (
msg.userType !== 2 ||
(msg.userType === 2 && this.privateNewMsg.privateUserId === this.userId)
) { this.list.unshift(msg); }
},
userId(value) {
if (value) {
this.searchMsg("");
}
}
},
created() {
this.searchMsg("");
},
methods: {
async getMessageList() {
debugger;
this.loading = true;
let ret = await getMessageList({
const ret = await getMessageList({
groupId: this.groupId,
keyword: this.keyword,
lastId:
@ -150,7 +158,7 @@ export default {
this.$emit("setReplyMsg", item);
},
async setMessageRecommend(item) {
let ret = await setMessageRecommend({
const ret = await setMessageRecommend({
isRecommend: item.isRecommend === 1 ? 2 : 1,
messageId: item.id
});
@ -161,6 +169,20 @@ export default {
});
item.isRecommend = item.isRecommend === 1 ? 2 : 1;
}
},
async updateMessageStatus(item) {
const ret = await updateMessageStatus({
id: item.id,
status: item.status === 1 ? 2 : 1
});
if (ret && ret.code === 0) {
this.$message({
message: "操作成功",
showClose: false,
type: "success"
});
item.status = item.status === 1 ? 2 : 1;
}
}
}
};

View File

@ -2,14 +2,22 @@
<div class="privat-chat">
<div class="header">
<div class="left">
<el-button size="mini" type="primary" @click="closePrivateChat"
>返回群聊</el-button
>
<el-button
size="mini"
type="primary"
@click="closePrivateChat"
>返回群聊</el-button>
<h5>{{ userInfo.userName }}</h5>
</div>
<div>私聊中</div>
</div>
<newsList :type="5" :groupId="groupId" :userId="userInfo.userId" />
<newsList
:type="5"
:group-id="groupId"
:user-id="userInfo.privateUserId"
:private-new-msg="privateNewMsg"
@setReplyMsg="setReplyMsg"
/>
</div>
</template>
<script>
@ -23,11 +31,17 @@ export default {
userInfo: {
type: Object,
default: () => {}
},
privateNewMsg: {
type: Object
}
},
methods: {
closePrivateChat() {
this.$emit("closePrivateChat");
},
setReplyMsg(item) {
this.$emit("setReplyMsg", item);
}
}
};

View File

@ -1,40 +1,57 @@
<template>
<div>
<div class="list-wrap">
<div class="search">
<el-input size="mini" placeholder="" />
<el-button type="primary" size="mini">搜索</el-button>
<el-input
v-model.trim="keyword"
size="mini"
placeholder="请输入用户昵称"
/>
<el-button type="primary" size="mini" @click="searchMsg">搜索</el-button>
</div>
<ul>
<li
@click="toPrivateChat(item)"
v-for="(item, index) in list"
v-for="item in filterList"
:key="item.id"
@click="toPrivateChat(item)"
>
<div class="left">
<div class="portrait">
<el-badge is-dot class="item"
><img :src="defaultAvatar.student" alt=""
/></el-badge>
<!-- <el-badge is-dot class="item"
><img :src="defaultAvatar.student" alt="" />
</el-badge> -->
<img :src="defaultAvatar.student" alt="">
</div>
<div class="user-info">
<p>{{ item.userName }}</p>
<p>
{{ item.userType !== 2 ? item.privateUserName : item.userName }}
</p>
<p v-if="item.contentType === 1">{{ item.content }}</p>
<p v-if="item.contentType === 2">[图片]</p>
</div>
</div>
<div class="time">
{{ item.createTime }}
{{ item.createTime | timefilter }}
</div>
</li>
</ul>
<p v-if="!loading" class="load-tip">没有更多了...</p>
</div>
</template>
<script>
import { getPrivateChatList } from "@/api/circle.js";
import dayjs from "dayjs";
export default {
filters: {
timefilter(date) {
return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
}
},
props: {
groupId: {
type: Number
},
privateNewMsg: {
type: Object
}
},
data() {
@ -44,38 +61,78 @@ export default {
student: require("@/assets/images/defaultAvatar/student.png"),
assistant: require("@/assets/images/defaultAvatar/assistant.png")
},
list: []
userIdsMsgObj: {}, // idkey
filterList: [],
list: [],
keyword: "",
loading: false
};
},
watch: {
groupId() {
this.keyword = "";
this.getPrivateChatList();
},
privateNewMsg(msg) {
if (this.userIdsMsgObj[msg.privateUserId]) {
Object.assign(this.userIdsMsgObj[msg.privateUserId], msg);
this.$set(msg, "newMsgTip", true);
} else {
this.list.unshift(msg);
this.$set(msg, "newMsgTip", true);
}
this.list = this.list.sort((x, y) => {
return (
new Date(y.createTime).getTime() - new Date(x.createTime).getTime()
);
});
this.filterList = this.list;
}
},
methods: {
toPrivateChat() {
toPrivateChat(item) {
this.$emit("toPrivateChat", item);
},
async getPrivateChatList() {
this.loading = true;
let ret = await getPrivateChatList({
const ret = await getPrivateChatList({
id: this.groupId
}).catch(() => {
this.loading = false;
});
if (ret && ret.code === 0) {
this.list = ret.data;
this.list = ret.data.sort((x, y) => {
return (
new Date(y.createTime).getTime() - new Date(x.createTime).getTime()
);
});
this.list.forEach(item => {
this.userIdsMsgObj[item.privateUserId] = item;
});
this.filterList = this.list;
}
this.loading = false;
},
searchMsg() {
this.list = [];
this.getMessageList();
if (this.keyword) {
this.filterList = this.list.filter(item => {
const userName =
item.userType !== 2 ? item.privateUserName : item.userName;
return userName.includes(this.keyword);
});
} else {
this.filterList = this.list;
}
}
}
};
</script>
<style lang="scss" scoped>
.list-wrap {
height: 600px;
overflow-y: scroll;
background: #fff;
}
.search {
display: flex;
margin-bottom: 10px;
@ -90,8 +147,6 @@ ul {
background: #fff;
list-style: none;
padding: 10px;
min-height: 500px;
overflow-y: scroll;
li {
display: flex;
border-bottom: 1px dashed #999;
@ -121,7 +176,7 @@ ul {
text-overflow: ellipsis;
}
p:nth-child(1) {
margin-bottom: 4px;
margin-bottom: 6px;
}
}
.time {
@ -130,4 +185,8 @@ ul {
}
}
}
.load-tip {
text-align: center;
line-height: 50px;
}
</style>

View File

@ -1,10 +1,14 @@
<template>
<div>
<div class="list-wrap">
<div class="search">
<el-input size="mini" placeholder="" />
<el-button type="primary" size="mini">搜索</el-button>
<el-input v-model="userName" size="mini" placeholder="请输入用户昵称" />
<el-button type="primary" size="mini" @click="searchMsg">搜索</el-button>
</div>
<dl>
<dl
v-infinite-scroll="getList"
infinite-scroll-disabled="disabled"
infinite-scroll-immediate="false"
>
<dt>
<div>头像</div>
<div>uid</div>
@ -12,49 +16,41 @@
<div>到期时间</div>
<div>操作</div>
</dt>
<dd>
<div><img src="" alt="" /></div>
<dd v-for="(item, index) in list" :key="item.id">
<div><img src="" alt=""></div>
<div>
<p>1234</p>
<p>小可爱</p>
<!-- <p>{{ item.phone }}</p> -->
<p>{{ item.userName }}</p>
</div>
<div>
<p>2012-12-22</p>
<p>数据缺失</p>
</div>
<div>
<p>2012-12-22</p>
<p>数据缺失</p>
</div>
<div>
<div>
<el-button type="text">私聊</el-button>
<el-link type="success" :underline="false">私聊</el-link>
</div>
<div>
<el-button type="text">禁言</el-button>
</div>
</div>
</dd>
<dd>
<div><img src="" alt="" /></div>
<div>
<p>1234</p>
<p>小可爱</p>
</div>
<div>
<p>2012-12-22</p>
</div>
<div>
<p>2012-12-22</p>
</div>
<div>
<div>
<el-button type="text">私聊</el-button>
</div>
<div>
<el-button type="text">禁言</el-button>
<el-link
v-if="type === 1"
type="success"
:underline="false"
>根据用户的禁言状态来显示禁言还是取消禁言</el-link>
<el-link
v-else-if="type === 2"
type="success"
:underline="false"
@click="setCommentBlack(2, item)"
>取消禁言</el-link>
</div>
</div>
</dd>
</dl>
<p v-if="loading" class="load-tip">加载中...</p>
<p v-if="!hasNext" class="load-tip">没有更多了...</p>
<p v-else-if="!loading && hasNext" class="load-tip">下拉加载更多...</p>
</div>
</template>
<script>
@ -64,26 +60,47 @@ import {
removeCommentBlack
} from "@/api/videoLive";
export default {
props: {
groupId: {
type: Number
},
type: {
type: Number,
default: 1 // 1 2
}
},
data() {
return {
loading: true,
hasNext: true,
userName: "",
list: []
};
},
watch: {
groupId() {
this.userName = "";
this.searchMsg();
}
},
methods: {
setCommentBlack() {
this.$confirm(`您确定${item.isForbid === 2 ? "禁言" : "取消禁言"}?`, {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
if (item.isForbid === 2) {
addCommentBlack(data).then(res => {
if (res.code === 0) {
this.$message({
message: "禁言成功",
showClose: false,
type: "success"
});
}
});
} else {
removeCommentBlack({ phone: item.userId }).then(res => {
setCommentBlack(type, item) {
if (type === 1) {
//
} else {
//
this.$confirm(`您确定取消禁言?`, {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
debugger;
removeCommentBlack({
userPhone: item.phone,
productId: item.productId,
productType: 41 // 41
}).then(res => {
if (res.code === 0) {
this.$message({
message: "取消禁言成功",
@ -92,20 +109,46 @@ export default {
});
}
});
}
})
.catch(() => {});
})
.catch(() => {});
}
},
async getCommentBlackList() {
let ret = await CommentBlackList({
size: 10,
current: 1
});
async getList() {
if (this.type === 2) {
this.loading = true;
const ret = await queryCommentBlackList({
size: 10,
current: 1,
productId: this.groupId,
userName: this.userName,
productType: 41,
userType: 3 // 访 1: 2:() 3:
}).catch(() => {
this.loading = false;
});
if (ret && ret.code === 0) {
this.list = ret.data.list;
this.hasNext = ret.data.hasNext;
}
this.loading = false;
}
},
searchMsg() {
this.list = [];
this.getList();
},
toPrivateChat(item) {
this.$emit("toPrivateChat", item);
}
}
};
</script>
<style lang="scss" scoped>
.list-wrap {
height: 600px;
overflow-y: scroll;
background: #fff;
}
.search {
display: flex;
margin-bottom: 10px;
@ -117,11 +160,8 @@ dl {
list-style: none;
margin: 0;
padding: 0;
background: #fff;
list-style: none;
padding: 10px;
min-height: 500px;
overflow-y: scroll;
dt {
padding: 10px 0;
}
@ -135,24 +175,33 @@ dl {
border-bottom: 1px dashed #999;
& > div {
display: flex;
flex-direction: column;
// flex-direction: column;
justify-content: center;
padding: 6px 0;
align-items: center;
}
& > div:nth-child(1) {
width: 60px;
}
& > div:nth-child(2) {
width: 100px;
flex: 1;
text-align: center;
}
& > div:nth-child(3) {
width: 100px;
text-align: center;
}
& > div:nth-child(4) {
width: 100px;
text-align: center;
}
& > div:nth-child(5) {
flex: 1;
display: block;
width: 60px;
text-align: right;
& > div {
text-align: right;
}
}
p {
font-size: 14px;
@ -169,4 +218,8 @@ dl {
}
}
}
.load-tip {
text-align: center;
line-height: 50px;
}
</style>

View File

@ -1,19 +1,19 @@
<template>
<div>
<div class="search">
<el-input size="mini" v-model="keyword" placeholder="" />
<el-input v-model="keyword" size="mini" placeholder="请输入用户昵称" />
<el-button type="primary" size="mini" @click="searchMsg">搜索</el-button>
</div>
<div class="news-list-wrap">
<ul
v-infinite-scroll="getMessageList"
class="news-list"
infinite-scroll-disabled="disabled"
v-infinite-scroll="getMessageList"
infinite-scroll-immediate="false"
>
<li v-for="(item, index) in list" :key="index">
<div class="new-header">
<img :src="defaultAvatar.student" />
<img :src="defaultAvatar.student">
<div class="news-info">
<div class="news-info-top">
<div class="news-user">
@ -21,44 +21,62 @@
<label
v-if="[1, 3].includes(item.userType)"
:class="[item.userType === 1 ? 'blue' : 'orange']"
>{{ item.userType === 1 ? "老师" : "助教" }}</label
>
>{{ item.userType === 1 ? "老师" : "助教" }}</label>
<span><i>1</i>/4</span>
<span>已读</span>
</div>
<div class="news-opt">
<div class="flex">
<el-link type="success" @click="setReplyMsg(item)"
>引用</el-link
>
<el-link type="success">取消审核</el-link>
</div>
<div class="flex">
<el-link type="success" @click="toPrivateChat(item)"
>私聊</el-link
>
<el-link type="success">取消禁言</el-link>
</div>
</div>
</div>
<p>{{ item.createTime }}</p>
</div>
<div class="news-opt">
<div class="flex">
<el-link
type="success"
@click="setReplyMsg(item)"
>引用</el-link>
<el-link
v-if="item.userType === 2 && item.status === 1"
type="success"
@click="updateMessageStatus(item)"
>通过审核</el-link>
</div>
<div class="flex">
<el-link
type="success"
@click="toPrivateChat(item)"
>私聊</el-link>
<el-link type="success" @click="prohibition(item)">{{
item.isForbidden === 1 ? "取消禁言" : "禁言"
}}</el-link>
</div>
</div>
</div>
<div class="new-content">
<p v-if="item.contentType === 1">{{ item.content }}</p>
<img v-else :src="item.content" alt="" />
<img v-else :src="item.content" alt="">
</div>
</li>
</ul>
<p class="load-tip" v-if="loading">加载中...</p>
<p class="load-tip" v-if="!hasNext">没有更多了...</p>
<p class="load-tip" v-else-if="!loading && hasNext">下拉加载更多...</p>
<p v-if="loading" class="load-tip">加载中...</p>
<p v-if="!hasNext" class="load-tip">没有更多了...</p>
<p v-else-if="!loading && hasNext" class="load-tip">下拉加载更多...</p>
</div>
<forbidSpeak
ref="forbidSpeakRef"
:product-type="41"
:product-id="groupId"
:scope="2"
@callback="callback"
/>
</div>
</template>
<script>
import { getMessageList } from "@/api/circle.js";
import { removeCommentBlack } from "@/api/videoLive";
import { getMessageList, updateMessageStatus } from "@/api/circle.js";
import forbidSpeak from "./forbidSpeak.vue";
export default {
components: { forbidSpeak },
props: {
groupId: {
type: Number
@ -77,7 +95,10 @@ export default {
teacher: require("@/assets/images/defaultAvatar/teacher.png"),
student: require("@/assets/images/defaultAvatar/student.png"),
assistant: require("@/assets/images/defaultAvatar/assistant.png")
}
},
msgIdsObj: {}, // idkey
msgUserIdsObj: {}, // userIdkey
optUserObj: {}
};
},
computed: {
@ -87,16 +108,26 @@ export default {
},
watch: {
groupId() {
this.keyword = "";
this.list = [];
this.getMessageList();
},
newMsg(msg) {
if (msg.userType === 2) this.list.unshift(msg);
if (msg.userType === 2) {
this.list.unshift(msg);
this.msgIdsObj[msg.id] = msg;
if (this.msgUserIdsObj[msg.userId]) {
this.msgUserIdsObj[msg.userId].push(msg);
} else {
this.msgUserIdsObj[msg.userId] = [msg];
}
}
}
},
methods: {
async getMessageList() {
this.loading = true;
let ret = await getMessageList({
const ret = await getMessageList({
groupId: this.groupId,
keyword: this.keyword,
lastId:
@ -110,11 +141,21 @@ export default {
});
if (ret && ret.code === 0) {
this.list = this.list.concat(ret.data.list);
this.list.forEach(msg => {
this.msgIdsObj[msg.id] = msg;
if (this.msgUserIdsObj[msg.userId]) {
this.msgUserIdsObj[msg.userId].push(msg);
} else {
this.msgUserIdsObj[msg.userId] = [msg];
}
});
this.hasNext = ret.data.hasNext;
}
this.loading = false;
},
searchMsg() {
this.msgIdsObj = {}; // idkey
this.msgUserIdsObj = {}; // userIdkey
this.list = [];
this.getMessageList();
},
@ -123,6 +164,59 @@ export default {
},
toPrivateChat(item) {
this.$emit("toPrivateChat", item);
},
prohibition(item) {
if (item.isForbidden === 1) {
this.$confirm(`您确定取消禁言?`, {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
removeCommentBlack({
userPhone: item.userId,
productId: this.groupId,
productType: 41
}).then(res => {
if (res.code === 0) {
this.$message({
message: "取消禁言成功",
showClose: false,
type: "success"
});
this.msgUserIdsObj[item.userId].forEach(item => {
item.isForbidden = 2;
});
}
});
})
.catch(() => {});
} else {
const forbidSpeakRef = this.$refs.forbidSpeakRef;
forbidSpeakRef.dialogFormVisible = true;
forbidSpeakRef.formProhibition.userName = item.userName;
forbidSpeakRef.formProhibition.phone = item.userId;
forbidSpeakRef.formProhibition.content = item.content;
}
},
callback(userId) {
this.msgUserIdsObj[userId].forEach(item => {
item.isForbidden = 1;
});
},
async updateMessageStatus(item) {
const ret = await updateMessageStatus({
id: item.id,
status: item.status === 1 ? 2 : 1
});
if (ret && ret.code === 0) {
this.$message({
message: "操作成功",
showClose: false,
type: "success"
});
item.status = item.status === 1 ? 2 : 1;
}
}
}
};
@ -185,19 +279,21 @@ export default {
margin: 0 10px;
}
}
.news-opt {
display: flex;
.flex {
display: flex;
flex-direction: column;
margin-left: 5px;
}
}
p {
margin: 0;
color: #999;
}
}
.news-opt {
display: flex;
.flex {
display: flex;
flex-direction: column;
margin-left: 5px;
align-items: center;
justify-content: space-between;
}
}
}
.new-content {
p {

View File

@ -4,10 +4,10 @@
<h3>圈子消息</h3>
<el-form :inline="true" size="mini" class="my-form">
<el-form-item>
<el-input :value="detail.advisor.deptName" disabled></el-input>
<el-input :value="detail.advisor.deptName" disabled />
</el-form-item>
<el-form-item>
<el-input :value="detail.advisor.showName" disabled></el-input>
<el-input :value="detail.advisor.showName" disabled />
</el-form-item>
<el-form-item>
<el-select
@ -18,33 +18,28 @@
placeholder="请输入关键词"
:remote-method="getCircleList"
>
<el-option
:key="detail.id"
:label="detail.name"
:value="detail.id"
disabled
>
</el-option>
<el-option
v-for="item in circleOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
:disabled="item.id === detail.id"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :disabled="changeGroupId === detail.id"
>切换</el-button
>
<el-button
type="primary"
:disabled="changeGroupId === detail.id"
@click="changeCircle"
>切换</el-button>
</el-form-item>
</el-form>
</div>
<div class="circle-main">
<div class="circle-main-header">
<div class="circle-info">
<img :src="detail.coverImage" alt="" />
<img :src="detail.coverImage" alt="">
<div>
<h4>{{ detail.name }}</h4>
<p>{{ detail.remark }}</p>
@ -59,8 +54,7 @@
:active-value="1"
:inactive-value="2"
@change="changeSwitch(1)"
>
</el-switch>
/>
</div>
<div class="set-item">
<label>先审后发</label>
@ -69,8 +63,7 @@
:active-value="1"
:inactive-value="2"
@change="changeSwitch(2)"
>
</el-switch>
/>
</div>
</div>
<div class="set-item-wrap">
@ -81,8 +74,7 @@
:active-value="2"
:inactive-value="1"
@change="changeSwitch(3)"
>
</el-switch>
/>
</div>
<div class="set-item">
<label>隐藏圈子人数</label>
@ -91,32 +83,31 @@
:active-value="2"
:inactive-value="1"
@change="changeSwitch(4)"
>
</el-switch>
/>
</div>
</div>
<img
class="icon"
@click="setNotice"
src="@/assets/images/trumpet.png"
alt=""
/>
@click="setNotice"
>
<img
class="icon"
src="@/assets/images/data.png"
alt=""
@click="$router.push('/circle/data')"
/>
>
</div>
</div>
<div class="circle-content">
<div class="circle-interact" v-if="chatType === 1">
<div v-show="chatType === 1" class="circle-interact">
<div class="circle-interact-header">
<ul class="tabs">
<li
:class="[msgType === item.id ? 'active' : '']"
v-for="(item, index) in msgTabs"
:key="item.id"
:class="[msgType === item.id ? 'active' : '']"
@click="msgType = item.id"
>
{{ item.name }}
@ -133,19 +124,21 @@
</div>
<newsList
v-for="(item, index) in msgTabs"
:ref="`newsListRef${item.id}`"
:groupId="detail.id"
:type="item.id"
v-show="msgType === item.id"
:ref="`newsListRef${item.id}`"
:group-id="detail.id"
:type="item.id"
:new-msg="newMsg"
@setReplyMsg="setReplyMsg"
:newMsg="newMsg"
/>
</div>
<privateChat
:userInfo="privateUserInfo"
:groupId="detail.id"
v-else
@closePrivateChat="() => (chatType = 1)"
v-show="chatType === 2"
:user-info="privateUserInfo"
:private-new-msg="privateNewMsg"
:group-id="detail.id"
@closePrivateChat="closePrivateChat"
@setReplyMsg="setReplyMsg"
/>
<div class="circle-user">
<ul class="tabs">
@ -176,38 +169,47 @@
</ul>
<userLnteractList
v-show="userTabIndex === 0"
:groupId="detail.id"
:newMsg="newMsg"
:group-id="detail.id"
:new-msg="newMsg"
@setReplyMsg="setReplyMsg"
@toPrivateChat="toPrivateChat"
/>
<userList v-if="userTabIndex === 1" type="1" />
<userList
v-show="userTabIndex === 1"
:key="1"
:group-id="detail.id"
:type="1"
@toPrivateChat="toPrivateChat"
/>
<privateList
v-show="userTabIndex === 2"
:groupId="detail.id"
:group-id="detail.id"
:private-new-msg="privateNewMsg"
@toPrivateChat="toPrivateChat"
/>
<userList
v-if="userTabIndex === 4"
@toPrivateChat="toPrivateChat"
type="2"
v-show="userTabIndex === 3"
:key="2"
:group-id="detail.id"
:type="2"
/>
</div>
</div>
</div>
<div class="quote" v-if="replyMsg.id">
<div v-if="replyMsg.id" class="quote">
<div class="quote-content">
<label>用户{{ replyMsg.userName }}</label>
<p v-if="replyMsg.contentType === 1">{{ replyMsg.content }}</p>
<p v-else-if="replyMsg.contentType === 2">[图片]</p>
</div>
<i class="el-icon-close"></i>
<i class="el-icon-close" />
</div>
<messageSend
v-if="detail.status === 3"
:replyId="replyMsg.id"
:interactiveType="chatType"
:groupId="detail.id"
:reply-id="replyMsg.id"
:interactive-type="chatType"
:private-user-info="privateUserInfo"
:group-id="detail.id"
@sendCallBack="setReplyMsg"
/>
</div>
@ -239,6 +241,7 @@ export default {
messageSend,
privateChat
},
mixins: [webSocketConnect],
data() {
return {
changeGroupId: "",
@ -256,10 +259,11 @@ export default {
circleOptions: [],
msgKeyWord: "",
replyMsg: {}, //
newMsg: {}
newMsg: {},
privateUserInfo: {}, //
privateNewMsg: {} //
};
},
mixins: [webSocketConnect],
computed: {
...mapGetters(["user"])
},
@ -277,9 +281,7 @@ export default {
userType: this.user.user.userType
});
if (ret && ret.code === 0) {
this.circleOptions = ret.data.list.filter(
item => item.id !== this.detail.id
);
this.circleOptions = ret.data.list;
}
},
setNotice() {
@ -287,10 +289,11 @@ export default {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputType: "textarea",
inputPlaceholder: "请输入公告内容500字以内"
inputPlaceholder: "请输入公告内容500字以内",
inputValue: this.detail.notice
})
.then(async ({ value }) => {
let ret = await setNotice({
.then(async({ value }) => {
const ret = await setNotice({
id: this.detail.id,
notice: value
});
@ -309,12 +312,19 @@ export default {
});
},
toPrivateChat(userInfo) {
this.privateUserInfo = userInfo;
this.privateUserInfo = Object.assign({
privateUserId: userInfo.userId,
privateUserName: userInfo.userName
});
this.chatType = 2;
},
closePrivateChat() {
this.chatType = 1;
this.privateUserInfo = {};
},
async getCircleDetail() {
console.log(this.$route);
let ret = await getCircleDetail({ id: this.$route.params.id });
const ret = await getCircleDetail({ id: this.$route.query.id });
if (ret && ret.code === 0) {
this.detail = ret.data;
this.changeGroupId = this.detail.id;
@ -344,7 +354,7 @@ export default {
fn: setShowMemberCount
}
};
let ret = await option[type].fn({
const ret = await option[type].fn({
groupId: this.detail.id,
status: this.detail[option[type].key]
});
@ -356,7 +366,6 @@ export default {
},
handleGroupChatTopic(msg) {
console.log("handleGroupChatTopic", msg);
debugger;
const body = JSON.parse(msg.body);
if ([1].includes(body.type)) {
// 1
@ -364,10 +373,22 @@ export default {
}
},
handlePrivateChatTopic(msg) {
debugger;
console.log("handlePrivateChatTopic", msg);
const body = JSON.parse(msg.body);
if ([1].includes(body.type)) {
// 1
this.privateNewMsg = JSON.parse(msg.body).data;
}
},
setReplyMsg(msg) {
debugger;
this.replyMsg = msg;
},
changeCircle() {
this.$router.replace(`/circle/detail?id=${this.changeGroupId}`);
this.msgKeyWord = "";
this.getCircleDetail();
}
}
};

View File

@ -14,17 +14,19 @@
style="width: 200px;margin-right: 10px"
clearable
>
<el-option :value="1" label="待提交"></el-option>
<el-option :value="2" label="待审核"></el-option>
<el-option :value="3" label="已上架"></el-option>
<el-option :value="4" label="已驳回"></el-option>
<el-option :value="5" label="已下架"></el-option>
<el-option v-if="yunyin" :value="6" label="已删除"></el-option>
<el-option :value="1" label="待提交" />
<el-option :value="2" label="待审核" />
<el-option :value="3" label="已上架" />
<el-option :value="4" label="已驳回" />
<el-option :value="5" label="已下架" />
<el-option v-if="yunyin" :value="6" label="已删除" />
</el-select>
<el-button type="primary" @click="getLists(1)">查询</el-button>
<el-button v-if="zhujiao || tougu" type="success" @click="addTag()"
>新增圈子</el-button
>
<el-button
v-if="zhujiao || tougu"
type="success"
@click="addTag()"
>新增圈子</el-button>
</div>
<el-table
@ -48,22 +50,19 @@
<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" />
<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>
<el-table-column prop="createTime" label="创建时间" width="180">
</el-table-column>
<el-table-column prop="auditTime" label="审核时间" width="180">
</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] }}
@ -79,8 +78,7 @@
{{ statusList[scope.row.status] }}
</template>
</el-table-column>
<el-table-column prop="reason" label="备注" width="180">
</el-table-column>
<el-table-column prop="reason" label="备注" width="180" />
<el-table-column label="操作" fixed="right" align="center" width="250">
<template slot-scope="scope">
<el-button
@ -88,15 +86,13 @@
type="text"
size="mini"
@click="addTag(scope.row, 2)"
>审核</el-button
>
>审核</el-button>
<el-button
v-if="tougu || yunyin || zhujiao || yinxiao"
type="text"
size="mini"
@click="addTag(scope.row, 1)"
>查看</el-button
>
>查看</el-button>
<el-button
v-if="
(tougu || zhujiao || yunyin) &&
@ -106,50 +102,43 @@
type="text"
size="mini"
@click="addTag(scope.row, 0)"
>修改</el-button
>
>修改</el-button>
<el-button
v-if="(tougu || zhujiao) && scope.row.status === 1"
type="text"
size="mini"
@click="update(scope.row, 101)"
>申请上架</el-button
>
>申请上架</el-button>
<el-button
v-if="(tougu || zhujiao) && scope.row.status === 2"
type="text"
size="mini"
@click="update(scope.row, 102)"
>撤回</el-button
>
>撤回</el-button>
<!-- <el-button v-if="yinxiao" type="text" size="mini" @click="update(scope.row)">数据</el-button> -->
<el-button
v-if="(tougu || yinxiao || zhujiao) && scope.row.status === 3"
type="text"
size="mini"
@click="copyUrl($event, scope.row)"
>复制圈子链接</el-button
>
>复制圈子链接</el-button>
<el-button
v-if="yunyin && scope.row.status === 5"
type="text"
size="mini"
@click="update(scope.row, 105)"
>上架</el-button
>
>上架</el-button>
<el-button
v-if="yunyin && scope.row.status === 3"
type="text"
size="mini"
@click="update(scope.row, 106)"
>下架</el-button
>
>下架</el-button>
<el-button
v-if="yunyin && [5].includes(scope.row.status)"
type="text"
@click="update(scope.row, 107)"
>删除</el-button
>
>删除</el-button>
</template>
</el-table-column>
</el-table>
@ -163,7 +152,7 @@
append-to-body
width="700px"
>
<el-form label-width="80px" ref="ruleForm" :model="form" :rules="rules">
<el-form ref="ruleForm" label-width="80px" :model="form" :rules="rules">
<el-form-item label="圈子名称" prop="name">
<el-input
v-model="form.name"
@ -202,7 +191,7 @@
form.advisorId = item.id;
}
"
></adviser-select>
/>
</div>
</el-form-item>
<el-form-item label="适用人群" prop="applicableUser">
@ -231,9 +220,9 @@
</el-form-item>
<el-form-item label="详情">
<vue-editor
:disabled="isAdjust || isReadOnly"
v-model="form.detail"
useCustomImageHandler
:disabled="isAdjust || isReadOnly"
use-custom-image-handler
@image-added="handleImageAdded"
/>
</el-form-item>
@ -253,8 +242,8 @@
v-if="form.coverImage"
:src="form.coverImage"
class="avatar"
/>
<el-button size="mini" v-else type="primary">上传图片</el-button>
>
<el-button v-else size="mini" type="primary">上传图片</el-button>
</el-upload>
</el-form-item>
<el-form-item label="私聊状态">
@ -285,8 +274,8 @@
</el-form-item>
<el-form-item v-if="authority === '1'" label="链接类型">
<el-select v-model="linkType" :disabled="isAdjust || isReadOnly">
<el-option label="落地页链接" value="1"></el-option>
<el-option label="支付页链接" value="2"></el-option>
<el-option label="落地页链接" value="1" />
<el-option label="支付页链接" value="2" />
</el-select>
</el-form-item>
<el-form-item
@ -313,8 +302,8 @@
<el-col :span="12">
<el-form-item label="价格" prop="originalPrice">
<el-input-number
:min="0"
v-model="form.originalPrice"
:min="0"
:disabled="isAdjust || isReadOnly"
/>
</el-form-item>
@ -322,9 +311,9 @@
<el-col :span="12">
<el-form-item label="活动价" prop="activityPrice">
<el-input-number
v-model="form.activityPrice"
min="0"
:max="form.originalPrice"
v-model="form.activityPrice"
:disabled="isAdjust || isReadOnly"
/>
</el-form-item>
@ -342,14 +331,13 @@
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
/>
</el-select>
</el-form-item>
<el-form-item v-if="isAdjust" label="审核结果">
<el-radio-group v-model="adjustForm.event">
<el-radio :label="103">通过</el-radio>
<br />
<br>
<el-radio :label="104">驳回</el-radio>
<el-input
v-model="adjustForm.reason"
@ -357,7 +345,7 @@
size="mini"
placeholder="驳回理由(必填)"
style="display: inline-block;width: 180px;"
></el-input>
/>
</el-radio-group>
</el-form-item>
</el-form>
@ -368,8 +356,7 @@
:loading="editLoading"
type="primary"
@click="submit()"
>确认</el-button
>
>确认</el-button>
</div>
</el-dialog>
</div>
@ -405,6 +392,7 @@ import { RISK_LEVEL } from "@/utils/options.js";
import { fileUpload } from "@/api/upload";
export default {
name: "Column",
components: { AdviserSelect, PageSelect },
props: {
zhujiao: {
@ -431,7 +419,6 @@ export default {
type: Number
}
},
name: "column",
data() {
return {
dialog: false,
@ -540,7 +527,7 @@ export default {
},
methods: {
async getDeptList(keyword) {
let ret = await getDepts({ keyword });
const ret = await getDepts({ keyword });
if (ret && ret.code === 0) {
this.deptList = ret.data;
}
@ -688,7 +675,7 @@ export default {
});
},
async detail(row) {
this.$router.push("/circle/detail/" + row.id);
this.$router.push(`/circle/detail?id=${row.id}`);
},
//
async update(item, event) {
@ -706,7 +693,7 @@ export default {
cancelButtonText: "取消",
type: "warning"
})
.then(async () => {
.then(async() => {
const params = {
id: item.id,
event,
@ -728,7 +715,7 @@ export default {
},
async copyUrl(event, item) {
const currentTarget = event.currentTarget;
let url = item.authorityId
const url = item.authorityId
? `/circle?id=${item.id}&saleUserId=${this.user.user.id}`
: `/circle/interact?id=${item.id}&saleUserId=${this.user.user.id}`;
const ret = await urlResize({
@ -793,7 +780,7 @@ export default {
var formData = new FormData();
formData.append("file", file);
let ret = await fileUpload(formData);
const ret = await fileUpload(formData);
if (ret && ret.code === 0) {
const url = ret.data.url; // Get url from response
Editor.insertEmbed(cursorLocation, "image", url);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,139 @@
<template>
<div style="display: inline-block">
<el-dialog
:visible.sync="dialog"
:close-on-click-modal="false"
title="协议详情"
append-to-body
width="500px"
@close="cancel"
>
<div class="portfolio-verify">
<div
v-for="(item, key) in data"
:key="key"
class="contractList"
style="margin:30px 0px 0px 20px"
>
<el-link
type="primary"
:href="item.linkAddr"
target="_blank"
>{{ item.contractName }}</el-link>
<!-- <div>{{ '《' + item.fileName + '》' + getStatus(item.status) }}</div> -->
</div>
</div>
<el-button
style="margin:30px 0px 0px 380px"
@click="dialog = false"
>取消</el-button>
</el-dialog>
</div>
</template>
<script>
import { updateStatus } from '@/utils/portfolio'
import { mapGetters } from 'vuex'
// import { queryContractList } from '@/api/order'
export default {
data() {
return {
error: null,
loading: false,
dialog: false,
form: {
applyReason: '',
cancelAmount: null
},
data: [],
status: 0
}
},
created() {},
computed: {
...mapGetters(['user'])
},
methods: {
updateStatus,
getError() {
// this.$message.error(this.error)
// this.$message({
// message: this.error,
// type:'error',
// customClass:'message',
// duration: 1500
// });
},
cancel() {
this.resetForm()
},
resetForm() {
// console.log('clear')
this.error = null
this.status = 0
this.form = {
applyReason: '',
cancelAmount: null
}
this.data = []
this.dialog = false
// this.$parent.getOrderList()
},
getStatus(val) {
switch (val) {
case 1:
return '(待签署)'
case 2:
return '(签署中)'
case 3:
return '(已完成)'
case 4:
return '(已过期)'
case 5:
return '(已解约)'
case 6:
return '(已拒签)'
default:
return ''
}
}
},
watch: {
error: {
handler(newName) {
if (newName) {
this.getError()
}
},
deep: true
}
}
}
</script>
<style scoped lang="scss">
.portfolio-verify {
margin: 15px;
padding: 0px;
width: calc(100% - 100px);
height: 100%;
}
.portfolio-form {
height: 100%;
width: 100%;
}
.portfolio-no{
width: 100%;
height: 20px;
line-height: 20px;
font-size: 20px;
text-align: center;
}
</style>
<style>
.el-message{
z-index: 5000 !important;
}
</style>

View File

@ -0,0 +1,650 @@
<template>
<div class="app-container">
<el-table
v-loading="loading"
border
:data="tableData"
size="small"
style="width: 100%"
>
<el-table-column
type="index"
label="序号"
fixed="left"
align="center"
/>
<el-table-column
prop="orderId"
:show-overflow-tooltip="true"
fixed="left"
label="订单编号(商户订单号)"
width="140"
align="center"
/>
<el-table-column
prop="iPlat"
label="渠道"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.iPlat | getChannel }}</span>
</template>
</el-table-column>
<el-table-column
prop="payId"
:show-overflow-tooltip="true"
label="订单号"
align="center"
width="140"
/>
<el-table-column
prop="custName"
label="客户姓名"
align="center"
/>
<el-table-column
prop="custOrgName"
label="客户营业部"
align="center"
/>
<el-table-column
prop="fundAccount"
label="资金账号(用户标识)"
align="center"
width="130"
>
<template slot-scope="scope">
<span>{{ scope.row.fundAccount == scope.row.mobile ? '--' : scope.row.fundAccount }}</span>
</template>
</el-table-column>
<el-table-column
prop="mobile"
label="手机号"
align="center"
width="110"
/>
<el-table-column
prop="custRiskLevel"
:show-overflow-tooltip="true"
label="客户风测等级"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.custRiskLevel | getCustomRiskLevel }}</span>
</template>
</el-table-column>
<el-table-column
prop="productName"
:show-overflow-tooltip="true"
label="产品名称"
align="center"
/>
<el-table-column
prop="productType"
:show-overflow-tooltip="true"
label="产品类型"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.productType | getProductType }}</span>
</template>
</el-table-column>
<!-- 风险等级 -->
<el-table-column
prop="productRiskLevel"
:show-overflow-tooltip="true"
label="产品风险等级"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.productRiskLevel | getRiskLevel }}</span>
</template>
</el-table-column>
<el-table-column
label="投顾账号"
align="center"
prop="tgAccount"
/>
<el-table-column
label="投顾名称"
align="center"
prop="tgName"
/>
<el-table-column
label="投顾营业部"
align="center"
prop="tgOrgName"
/>
<el-table-column
prop="payType"
:show-overflow-tooltip="true"
label="支付方式"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.payType | getPayType }}</span>
</template>
</el-table-column>
<el-table-column
prop="productPrice"
label="产品定价"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13">{{ scope.row.commissionRate }}</span>
<span v-else>{{ (scope.row.productPrice / 100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column
label="优惠券ID"
align="center"
prop="couponId"
/>
<el-table-column
label="优惠券名称"
align="center"
prop="couponName"
/>
<el-table-column
label="优惠金额/天数"
align="center"
prop="couponValue"
/>
<el-table-column
prop="payTotal"
label="支付金额"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13">--</span>
<span v-else>{{ (scope.row.payTotal / 100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column
prop="cancelAmount"
label="退款金额"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.orderStatus===100">{{ (scope.row.cancelAmount / 100).toFixed(2) }}</span>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column
prop="orderStatus"
:show-overflow-tooltip="true"
label="订单状态"
align="center"
min-width="85"
>
<template slot-scope="scope">
<span>{{ scope.row.orderStatus | getOrderStatus(scope.row.payType) }}</span>
</template>
</el-table-column>
<!-- <el-table-column
prop="supportStatus"
label="信用账号提拥状态"
align="center"
>
<template slot-scope="scope">
{{ scope.row.payType === 13 ? scope.row.supportStatus : '' | getCommissionStatus }}
</template>
</el-table-column>
<el-table-column
prop="conquerStatus"
label="信用账号降拥状态"
align="center"
>
<template slot-scope="scope">
{{ scope.row.payType === 13 && scope.row.orderStatus === 100 ? scope.row.conquerStatus : '' | getCommissionStatus }}
</template>
</el-table-column> -->
<el-table-column
prop="refundStatus"
:show-overflow-tooltip="true"
label="退款状态"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13">--</span>
<span v-else>{{ scope.row.refundStatus | getRefundStatus(scope.row.payType) }}</span>
</template>
</el-table-column>
<!-- <el-table-column
prop="refundStatus"
:show-overflow-tooltip="true"
label="解约状态"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13">{{ getRefundStatus(scope.row.refundStatus, 13) }}</span>
<span v-else>--</span>
</template>
</el-table-column> -->
<el-table-column
prop="isRenew"
:show-overflow-tooltip="true"
label="是否续订"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.isRenew === 1 ? '续订' : '新订' }}</span>
</template>
</el-table-column>
<el-table-column
label="下单时间"
align="center"
prop="createTime"
width="90"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="支付时间"
align="center"
prop="payTime"
width="90"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="生效时间"
align="center"
prop="moduleStart"
width="90"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.moduleStart) }}</span>
</template>
</el-table-column>
<el-table-column
label="到期时间"
align="center"
prop="moduleEnd"
width="90"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.moduleEnd) }}</span>
</template>
</el-table-column>
<el-table-column
label="申请退款时间"
align="center"
prop="applyRefundTime"
width="90"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13 || !scope.row.applyRefundTime">--</span>
<span v-else>{{ parseTime(scope.row.applyRefundTime) }}</span>
</template>
</el-table-column>
<el-table-column
label="退款成功时间"
align="center"
prop="approveRefundTime"
width="90"
>
<template slot-scope="scope">
<span v-if="scope.row.orderStatus === 100 && scope.row.approveRefundTime">{{ parseTime(scope.row.approveRefundTime) }}</span>
<span v-else>--</span>
</template>
</el-table-column>
<!-- <el-table-column
label="申请解约时间"
align="center"
prop="applyRefundTime"
width="90"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13 && scope.row.applyRefundTime">{{ parseTime(scope.row.applyRefundTime) }}</span>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column
label="解约成功时间"
align="center"
prop="approveRefundTime"
width="90"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13 && scope.row.approveRefundTime">{{ parseTime(scope.row.approveRefundTime) }}</span>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column
prop="applyReason"
:show-overflow-tooltip="true"
label="解约理由"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13 && scope.row.applyReason">{{ scope.row.applyReason }}</span>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column
prop="agreementNo"
:show-overflow-tooltip="true"
label="天威协议编号"
align="center"
>
</el-table-column> -->
<el-table-column
prop="valid"
:show-overflow-tooltip="true"
label="权限状态"
align="center"
>
<template slot-scope="scope">
<span>{{ scope.row.valid === 1 ? '有效' : '无效' }}</span>
</template>
</el-table-column>
<el-table-column
prop="applyReason"
:show-overflow-tooltip="true"
label="退款理由"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.payType === 13 || !scope.row.applyReason">--</span>
<span v-else>{{ scope.row.applyReason }}</span>
</template>
</el-table-column>
<el-table-column
prop="examineReason"
:show-overflow-tooltip="true"
label="退款审核说明"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.refundStatus === 210">{{ scope.row.examineReason }}</span>
<span v-else>--</span>
</template>
</el-table-column>
<!-- <el-table-column
prop="tyReason"
:show-overflow-tooltip="true"
label="签约审核理由"
align="center"
>
</el-table-column>
<el-table-column
prop="referNo"
:show-overflow-tooltip="true"
label="推荐人编号"
align="center"
>
</el-table-column>
<el-table-column
prop="referName"
:show-overflow-tooltip="true"
label="推荐人姓名"
align="center"
>
</el-table-column> -->
<el-table-column
prop="ascriptionId"
:show-overflow-tooltip="true"
label="归属关系ID"
align="center"
/>
<el-table-column
prop="ascriptionMobile"
:show-overflow-tooltip="true"
label="归属关系手机号"
align="center"
/>
<el-table-column
prop="productSponsorId"
:show-overflow-tooltip="true"
label="产品推荐人ID"
align="center"
/>
<el-table-column
prop="productSponsorMobile"
:show-overflow-tooltip="true"
label="产品推荐人手机号"
align="center"
/>
<el-table-column
label="操作"
align="center"
width="80"
fixed="right"
>
<template slot-scope="scope">
<el-button
v-show="scope.row.refundStatus === 180 && scope.row.orderStatus === 95"
type="text"
size="mini"
class="inline-btn"
@click="reviewed(scope.row)"
>{{ scope.row.payType === 13 ? '解约' : '退款' }}审核</el-button>
<el-button
v-show="[220].includes(scope.row.orderStatus) && scope.row.payType !== 14 && scope.row.payType !== 13"
type="text"
size="mini"
class="inline-btn"
style="margin-left: 0px;"
@click="refund(scope.row)"
>直接退款</el-button>
<el-button
v-show="[95, 220].includes(scope.row.orderStatus) && scope.row.payType === 13"
type="text"
size="mini"
class="inline-btn"
style="margin-left: 0px;"
@click="refund(scope.row)"
>直接解约</el-button>
<!-- <el-button
v-show="[170].includes(scope.row.orderStatus)"
type="text"
size="mini"
class="inline-btn"
style="margin-left: 0px;"
@click="signing(scope.row)"
>签约审核</el-button> -->
</template>
</el-table-column>
<!-- v-show="scope.row.orderStatus === 220 && scope.row.valid === 1" -->
<el-table-column
prop="title"
fixed="right"
:show-overflow-tooltip="true"
label="签约协议"
align="center"
>
<template slot-scope="scope">
<el-button
type="text"
size="mini"
class="inline-btn"
@click="agreement(scope.row)"
>协议详情</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="current"
:page-size="size"
:total="total"
:page-sizes="[10, 20, 30, 40, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
@size-change="sizeChange"
@current-change="pageChange"
/>
<refundApplication ref="refund" />
<refundLication ref="directRefund" />
<agreementDetails ref="details" />
</div>
</template>
<script>
import { queryUnderOrderList, queryOrderList, queryContractList } from '@/api/order.js'
import { parseTime } from '@/utils/index'
import refundApplication from './refundApplication.vue'
import agreementDetails from './agreementDetails.vue'
import refundLication from './refundLication.vue'
export default {
components: {
refundApplication,
agreementDetails,
refundLication
},
props: {},
data() {
return {
loading: false,
tableData: [],
orderIds: [],
current: 1,
size: 10,
total: 0
}
},
computed: {},
watch: {},
created() {
this.queryUnderOrderListFn()
},
mounted() {},
methods: {
parseTime,
async queryUnderOrderListFn() {
this.loading = true
const res = await queryUnderOrderList()
if (res.code !== 0) return this.$message.error(res.message)
if (res.data && res.data.length > 0) {
this.orderIds = res.data
this.getOrderList()
}
this.loading = false
},
//
async getOrderList() {
const params = {}
params.offset = (this.current - 1) * this.size
params.size = this.size
params.orderIds = this.orderIds
const res = await queryOrderList(params)
if (res.code === 0) {
this.tableData = res.data.list
this.total = res.data.total
} else {
this.$message.error(res.message)
}
// console.log(params)
},
sizeChange(val) {
this.current = 1
this.size = val
this.getOrderList()
},
pageChange(val) {
this.current = val
this.getOrderList()
},
getRiskLevel(row) {
switch (row) {
case 1:
return 'C1保守型'
case 2:
return 'C2谨慎型'
case 3:
return 'C3稳健型'
case 4:
return 'C4积极型'
case 5:
return 'C5激进型'
default:
break
}
},
// 退
reviewed(row) {
// console.log(row)
// this.$confirm('退?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
const _this = this.$refs.refund
_this.id = row.orderId
_this.createTime = row.createTime
_this.form.applyReason = row.applyReason
_this.form.cancelAmount = row.cancelAmount
_this.data = row
_this.dialog = true
// }).catch(() => {
// this.$message({
// type: 'info',
// message: ''
// })
// })
},
// vip退
refund(row) {
const _this = this.$refs.directRefund
_this.id = row.orderId
_this.createTime = row.createTime
_this.data = row
_this.dialog = true
},
// ()
async agreement(row) {
const _this = this.$refs.details
const params = {}
params.agreementNo = row.agreementNo
// params.sdOrderId = row.sdOrderId
if (row.agreementNo.indexOf('-') !== -1) {
return this.$message.error('该历史订单没有找到原合同')
}
const data = await queryContractList(params)
if (data.code === 0) {
// _this.createTime = row.createTime
// data.data.map((v, k) => {
// v.status = k + 1
// })
// console.log(data.data)
if (!data.data.length) {
return this.$message.error('暂无协议!')
}
_this.data = data.data
_this.dialog = true
// if (!data.data[0].htid) {
// return this.$message.error('')
// } else {
// _this.dialog = true
// }
// if (row.sdOrderId) {
// if (data.data.length === row.agreementNo.split(',').length) {
// _this.dialog = true
// } else {
// this.$message.error('')
// }
// } else {
// if (data.data.length === 3) {
// _this.dialog = true
// } else {
// this.$message.error('')
// }
// }
} else {
_this.error = data.message
this.$message.error(data.message)
}
}
}
}
</script>
<style scoped lang="scss">
.el-pagination {
display: flex;
justify-content: flex-end;
margin-top: 20px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,217 @@
<template>
<div style="display: inline-block">
<el-dialog
:visible.sync="dialog"
:close-on-click-modal="false"
:title="data.payType === 13 ? '解约审核' : '退款审核'"
append-to-body
width="650px"
@close="cancel"
>
<div class="portfolio-verify">
<el-form ref="form" :model="form" label-width="80px" class="portfolio-form">
<el-form-item v-if="data.payType !== 13" label="订单金额">
<span>{{ (data.payTotal / 100).toFixed(2) }}</span>
<span></span>
</el-form-item>
<el-form-item v-if="data.payType !== 13" label="退订金额">
<!-- <span> {{ (form.cancelAmount / 100).toFixed(2) }}</span> -->
<el-input-number
v-model="form.cancelAmount"
:disabled="status === 1 || !marginOrderStatus"
:precision="2"
:step="0.01"
size="small"
:max="data.payTotal / 100"
:min="0.00"
/>
<span></span>
</el-form-item>
<el-form-item v-if="data.payType !== 13" label="退款理由">
<el-input v-model="form.applyReason" disabled size="small" type="textarea" :rows="5" maxlength="100" show-word-limit />
</el-form-item>
<el-form-item label="审核结果" prop="reason">
<el-radio-group v-model="status" style="width: 178px">
<el-radio :label="200"> 通过 </el-radio><br>
<el-radio :label="210">
驳回
<el-input
v-model="examineReason"
type="text"
:rows="2"
:maxlength="200"
placeholder="通过/驳回理由(必填)"
style="margin-left: 20px"
size="small"
/>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="save()">提交</el-button>
<el-button size="small" @click="dialog = false">取消</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
import { updateStatus } from '@/utils/portfolio'
import { mapGetters } from 'vuex'
import { refundOrder, queryMarginOrderStatus } from '@/api/order'
export default {
data() {
return {
id: null,
loading: false,
dialog: false,
price: null,
createTime: null,
form: {
applyReason: '',
cancelAmount: null
},
data: {},
examineReason: '',
status: 0,
marginOrderStatus: true // 退
}
},
created() {
},
computed: {
...mapGetters(['user'])
},
methods: {
updateStatus,
async save() {
if (!this.status) {
return this.$message.error('请选择审核结果')
}
// if (this.status === 210 && !this.examineReason) {
// return this.$message.error('')
// }
const params = {}
params.orderId = this.id
params.refundStatus = this.status
// if (this.status === 210) {
// params.examineReason = this.examineReason
// } else {
// params.examineReason = ''
// }
if (!this.examineReason) {
return this.$message.error('请输入通过/驳回理由')
}
params.examineReason = this.examineReason
params.cancelAmount = parseFloat((this.form.cancelAmount * 100).toFixed(2))
const data = await refundOrder(params)
if (data.code === 0) {
this.$message.success('操作成功')
this.resetForm()
this.dialog = false
} else {
this.$message.error(data.message)
}
console.log(data)
},
async queryMarginOrderStatus() {
const { code, data } = await queryMarginOrderStatus({ orderId: this.id })
if (code === 0) {
this.marginOrderStatus = data
}
},
cancel() {
this.resetForm()
},
resetForm() {
// console.log('clear')
this.id = null
this.price = null
this.createTime = null
this.examineReason = ''
this.status = 0
this.form = {
applyReason: '',
cancelAmount: null
}
this.data = {}
this.marginOrderStatus = true
this.dialog = false
this.$parent.getOrderList()
},
getPeriod(period) {
// switch (period) {
// case 0:
// return ','
// case 7:
// return ''
// case 14:
// return ''
// case 16:
// return ''
// case 19:
// return ''
// case 20:
// return ''
// case 99:
// return ','
// default:
// break
// }
switch (period) {
// case 0:
// return ','
case 1:
return '周'
case 2:
return '月'
case 3:
return '季度'
case 4:
return '半年'
case 5:
return '年'
case 0:
return '收费永久,单篇收费'
default:
break
}
}
},
watch: {
dialog: {
handler(newName) {
if (newName && this.data.payType === 14) this.queryMarginOrderStatus()
// if (newName) {
// const timeNow = new Date().getTime()
// const times = new Date(this.createTime).getTime()
// if (timeNow - times <= 604800000) {
// this.status = 1
// this.form.cancelAmount = this.data.payTotal
// }
// console.log(this.status)
// // console.log(times)
// }
},
deep: true
}
}
}
</script>
<style scoped lang="scss">
.portfolio-verify {
margin: 15px;
padding: 0px;
width: calc(100% - 100px);
height: 100%;
.portfolio-form {
height: 100%;
width: 100%;
}
}
</style>

View File

@ -0,0 +1,225 @@
<template>
<div style="display: inline-block">
<el-dialog
:visible.sync="dialog"
:close-on-click-modal="false"
:title="data.payType === 13 ? '直接解约' : '直接退款'"
append-to-body
width="650px"
@close="cancel"
>
<div class="portfolio-verify">
<el-form
ref="form"
:model="form"
label-width="80px"
class="portfolio-form"
>
<el-form-item v-if="data.payType !== 13" label="订单金额">
<span> {{ (data.payTotal / 100).toFixed(2) + '元' }}</span>
</el-form-item>
<el-form-item v-if="data.payType !== 13" label="退订金额">
<!-- <el-input
v-model="form.cancelAmount"
size="small"
maxlength="20"
show-word-limit
/> -->
<el-input-number
v-model="form.cancelAmount"
:precision="2"
:step="0.01"
size="small"
:max="data.payTotal / 100"
/>
<span></span>
</el-form-item>
<el-form-item :label="data.payType === 13 ? '解约理由' : '退款理由'">
<el-input
v-model="form.applyReason"
size="small"
type="textarea"
:rows="5"
maxlength="100"
show-word-limit
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="small"
:loading="loading"
@click="save()"
>提交</el-button>
<el-button
size="small"
@click="dialog = false"
>取消</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
import { updateStatus } from '@/utils/portfolio'
import { mapGetters } from 'vuex'
import { refundOrder } from '@/api/order'
export default {
data() {
return {
id: null,
loading: false,
dialog: false,
price: null,
createTime: null,
form: {
applyReason: '',
cancelAmount: null
},
data: {},
status: 0
}
},
created() {
},
computed: {
...mapGetters(['user'])
},
methods: {
updateStatus,
async save() {
if (!this.form.applyReason.trim()) {
return this.$message.error(`请输入${this.data.payType === 13 ? '解约' : '退款'}理由`)
}
if (this.data.payType === 13) {
const params = {}
params.orderId = this.id
params.applyReason = this.form.applyReason
params.cancelAmount = 0
params.refundStatus = 200
const data = await refundOrder(params)
if (data.code === 0) {
this.$message.success('申请成功')
this.dialog = false
} else {
this.$message.error(data.message)
}
} else {
this.$confirm('提交退款后,退款金额将会退回到客户账户,是否要进行退款操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
this.loading = true
const params = {}
params.orderId = this.id
params.cancelAmount = parseFloat((this.form.cancelAmount * 100).toFixed(2))
params.applyReason = this.form.applyReason
params.refundStatus = 200
const data = await refundOrder(params)
if (data.code === 0) {
this.$message.success('申请成功')
this.dialog = false
} else {
this.$message.error(data.message)
}
this.loading = false
}).catch((e) => {
console.log(e)
this.loading = false
})
}
},
cancel() {
this.resetForm()
},
resetForm() {
// console.log('clear')
this.id = null
this.price = null
this.createTime = null
this.status = 0
this.form = {
applyReason: '',
cancelAmount: null
}
this.data = {}
this.dialog = false
this.$parent.getOrderList()
},
getPeriod(period) {
// switch (period) {
// case 0:
// return ','
// case 7:
// return ''
// case 14:
// return ''
// case 16:
// return ''
// case 19:
// return ''
// case 20:
// return ''
// case 99:
// return ','
// default:
// break
// }
switch (period) {
// case 0:
// return ','
case 1:
return '周'
case 2:
return '月'
case 3:
return '季度'
case 4:
return '半年'
case 5:
return '年'
case 0:
return '收费永久,单篇收费'
default:
break
}
}
},
watch: {
dialog: {
handler(newName) {
if (newName) {
// const timeNow = new Date().getTime()
// const times = new Date(this.createTime).getTime()
// if (timeNow - times <= 604800000) {
// this.status = 1
// this.form.cancelAmount = this.data.payTotal
// }
// console.log(this.status)
this.form.cancelAmount = this.data.payTotal
// console.log(times)
}
},
deep: true
}
}
}
</script>
<style scoped lang="scss">
.portfolio-verify {
margin: 15px;
padding: 0px;
width: calc(100% - 100px);
height: 100%;
.portfolio-form {
height: 100%;
width: 100%;
}
}
</style>

View File

@ -0,0 +1,161 @@
<template>
<div class="signingReview">
<el-dialog
:visible.sync="dialog"
:close-on-click-modal="false"
title="签约审核"
append-to-body
width="450px"
@close="cancel"
>
<div class="review-verify">
<el-radio-group
v-model="status"
style="width: 178px;margin-bottom: 20px;"
>
<el-radio :label="0">通过</el-radio>
<el-radio :label="1">驳回 </el-radio>
</el-radio-group>
<!-- :disabled="status === 1 ? false : true" -->
<el-input
v-model="examineReason"
class="review-reason"
type="textarea"
:rows="6"
:maxlength="200"
:autosize="{ minRows: 6, maxRows: 12 }"
placeholder="请输入理由"
size="small"
show-word-limit
resize="none"
/>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialog = false"> </el-button>
<el-button type="primary" size="small" @click="save()"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { updateStatus } from "@/utils/portfolio";
import { mapGetters } from "vuex";
import { auditTyOrder } from "@/api/order";
export default {
data() {
return {
id: null,
dialog: false,
createTime: null,
data: {},
examineReason: "",
status: null
};
},
computed: {
...mapGetters(["user"])
},
watch: {
dialog: {
handler(newName) {
newName;
},
deep: true
}
},
methods: {
updateStatus,
async save() {
if (!this.status && this.status !== 0) {
return this.$message.error("请选择审核结果");
}
if (!this.examineReason.trim()) {
return this.$message.error("请输入理由");
}
const params = {};
params.orderId = this.id;
params.status = this.status;
params.reason = this.examineReason;
// if (this.status === 1) {
// params.reason = this.examineReason
// } else {
// params.reason = ''
// }
// if (params) {
// console.log(params)
// return
// }
const data = await auditTyOrder(params);
if (data.code === 0) {
this.$message.success("操作成功");
// this.resetForm()
this.dialog = false;
} else {
this.$message.error(data.message);
}
console.log(data);
},
cancel() {
this.resetForm();
},
resetForm() {
// console.log('clear')
this.id = null;
this.createTime = null;
this.examineReason = "";
this.status = null;
this.data = {};
this.dialog = false;
this.$parent.getOrderList();
},
getPeriod(period) {
// switch (period) {
// case 0:
// return ','
// case 7:
// return ''
// case 14:
// return ''
// case 16:
// return ''
// case 19:
// return ''
// case 20:
// return ''
// case 99:
// return ','
// default:
// break
// }
switch (period) {
case 1:
return "周";
case 2:
return "月";
case 3:
return "季度";
case 4:
return "半年";
case 5:
return "年";
case 0:
return "收费永久,单篇收费";
default:
break;
}
}
}
};
</script>
<style lang="scss" scoped>
.signingReview {
display: inline-block;
.review-verify {
.review-reason {
width: 100%;
}
}
}
</style>

View File

@ -0,0 +1,127 @@
<template>
<div style="display: inline-block">
<el-dialog
:visible.sync="dialog"
:close-on-click-modal="false"
title="协议详情"
append-to-body
width="500px"
@close="cancel"
>
<div class="portfolio-verify">
<div
v-for="(item, key) in data"
:key="key"
class="contractList"
style="margin:30px 0px 0px 20px"
>
<el-link
type="primary"
:href="item.linkAddr"
target="_blank"
>{{ item.contractName }}</el-link>
<!-- <div v-else>{{ '' + item.fileName + '' + getStatus(item.status) }}</div> -->
</div>
</div>
<el-button
style="margin:30px 0px 0px 380px"
@click="dialog = false"
>取消</el-button>
</el-dialog>
</div>
</template>
<script>
import { updateStatus } from '@/utils/portfolio'
import { mapGetters } from 'vuex'
// import { queryContractList } from '@/api/order'
export default {
data() {
return {
error: null,
loading: false,
dialog: false,
form: {
applyReason: '',
cancelAmount: null
},
data: [],
status: 0
}
},
created() {},
computed: {
...mapGetters(['user'])
},
methods: {
updateStatus,
getError() {
// this.$message.error(this.error)
},
cancel() {
this.resetForm()
},
resetForm() {
// console.log('clear')
this.error = null
this.status = 0
this.form = {
applyReason: '',
cancelAmount: null
}
this.data = []
this.dialog = false
// this.$parent.getOrderList()
},
getStatus(val) {
switch (val) {
case 1:
return '(待签署)'
case 2:
return '(签署中)'
case 3:
return '(已完成)'
case 4:
return '(已过期)'
case 5:
return '(已解约)'
case 6:
return '(已拒签)'
default:
return ''
}
}
},
watch: {
error: {
handler(newName) {
if (newName) {
this.getError()
}
},
deep: true
}
}
}
</script>
<style scoped lang="scss">
.portfolio-verify {
margin: 15px;
padding: 0px;
width: calc(100% - 100px);
height: 100%;
.portfolio-form {
height: 100%;
width: 100%;
}
}
.portfolio-no{
width: 100%;
height: 20px;
line-height: 20px;
font-size: 20px;
text-align: center;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,198 @@
<template>
<div style="display: inline-block">
<el-dialog
:visible.sync="dialog"
:close-on-click-modal="false"
:title="data.payType === 13 ? '申请解约' : '申请退款'"
append-to-body
width="650px"
@close="cancel"
>
<div class="portfolio-verify">
<el-form
ref="form"
:model="form"
label-width="80px"
class="portfolio-form"
>
<el-form-item label="订单金额">
<span> {{ (data.payTotal / 100).toFixed(2) + '元' }}</span>
</el-form-item>
<el-form-item label="退订金额">
<!-- <el-input
v-model="form.cancelAmount"
size="small"
maxlength="20"
show-word-limit
/> -->
<el-input-number
v-model="form.cancelAmount"
:disabled="status === 1"
:precision="2"
:step="0.01"
size="small"
:max="data.payTotal / 100"
:min="0"
/>
<span></span>
</el-form-item>
<el-form-item label="退款理由">
<el-input
v-model="form.applyReason"
size="small"
type="textarea"
:rows="5"
maxlength="100"
show-word-limit
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="small"
@click="save()"
>提交</el-button>
<el-button
size="small"
@click="dialog = false"
>取消</el-button>
</el-form-item>
</el-form>
</div>
</el-dialog>
</div>
</template>
<script>
import { updateStatus } from '@/utils/portfolio'
import { mapGetters } from 'vuex'
import { refundOrder } from '@/api/order'
export default {
data() {
return {
id: null,
loading: false,
dialog: false,
price: null,
createTime: null,
form: {
applyReason: '',
cancelAmount: null
},
data: {},
status: 0
}
},
created() {
},
computed: {
...mapGetters(['user'])
},
methods: {
updateStatus,
async save() {
if (!this.form.applyReason.trim()) {
return this.$message.error('请输入退款理由')
}
const params = {}
params.orderId = this.id
params.cancelAmount = this.form.cancelAmount * 100
params.applyReason = this.form.applyReason
params.refundStatus = 180
const data = await refundOrder(params)
if (data.code === 0) {
this.$message.success('申请成功')
this.dialog = false
} else {
this.$message.error(data.message)
}
console.log(data)
},
cancel() {
this.resetForm()
},
resetForm() {
// console.log('clear')
this.id = null
this.price = null
this.createTime = null
this.status = 0
this.form = {
applyReason: '',
cancelAmount: null
}
this.data = {}
this.dialog = false
this.$parent.getOrderList()
},
getPeriod(period) {
// switch (period) {
// case 0:
// return ','
// case 7:
// return ''
// case 14:
// return ''
// case 16:
// return ''
// case 19:
// return ''
// case 20:
// return ''
// case 99:
// return ','
// default:
// break
// }
switch (period) {
case 1:
return '周'
case 2:
return '月'
case 3:
return '季度'
case 4:
return '半年'
case 5:
return '年'
case 0:
return '收费永久,单篇收费'
default:
break
}
}
},
watch: {
dialog: {
handler(newName) {
if (newName) {
const timeNow = new Date().getTime()
const times = new Date(this.createTime).getTime()
if (timeNow - times <= 604800000) {
this.status = 1
this.form.cancelAmount = this.data.payTotal
}
console.log(this.status)
// console.log(times)
}
},
deep: true
}
}
}
</script>
<style scoped lang="scss">
.portfolio-verify {
margin: 15px;
padding: 0px;
width: calc(100% - 100px);
height: 100%;
.portfolio-form {
height: 100%;
width: 100%;
}
}
</style>

View File

@ -0,0 +1,544 @@
<template>
<div class="app-container">
<div class="head-container">
<el-row :gutter="20">
<el-col :span="24">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入订单编号"
clearable
style="width: 200px"
/>
</el-form-item>
<el-form-item label="" prop="productName">
<el-input
v-model="queryParams.productName"
placeholder="请输入推荐人姓名"
clearable
style="width: 200px"
/>
</el-form-item>
<el-form-item label="" prop="platform">
<el-select
v-model="queryParams.platform"
placeholder="是否是直播带货订单"
clearable
:fit-input-width="true"
style="width: 150px"
>
<el-option label="是" :value="1" />
<el-option label="否" :value="2" />
</el-select>
</el-form-item>
<el-form-item label="" prop="customAccount" label-width="110px">
<el-input
v-model="queryParams.customAccount"
placeholder="请输入带货产品名称"
clearable
style="width: 200px"
/>
</el-form-item>
<el-form-item label="时间筛选:" prop="timeType" class="datepicker">
<el-select
v-model="queryParams.timeType"
placeholder="时间筛选"
clearable
class="selectbox"
:fit-input-width="true"
style="width: 150px"
>
<el-option label="下单时间" :value="1" />
<el-option label="支付时间 " :value="2" />
<el-option label="生效时间" :value="3" />
<el-option label="到期时间 " :value="4" />
<el-option label="申请退款时间" :value="5" />
<el-option label="退款成功时间" :value="6" />
</el-select>
</el-form-item>
<el-form-item label="" prop="" class="datepicker">
<el-date-picker
v-model="dateVale"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
size="small"
/>
</el-form-item>
<el-form-item style="margin-left: 10px">
<el-button
size="mini"
type="primary"
icon="el-icon-search"
@click="handleSearch(1)"
>查询</el-button>
<el-button
size="mini"
icon="el-icon-refresh-right"
@click="handleReset('queryFormRef')"
>重置</el-button>
<el-button
size="mini"
type="primary"
:loading="downloadLoading"
@click="toExport"
>导出</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" style="width: 100%">
<el-table-column
align="center"
type="index"
width="60"
label="序号"
fixed="left"
/>
<el-table-column
prop="orderId"
label="订单编号"
fixed="left"
width="180px"
/>
<el-table-column
prop="customCode"
label="订单来源渠道"
fixed="left"
width="120px"
/>
<el-table-column
prop="customMobile"
label="微信/支付宝订单号"
width="120px"
/>
<el-table-column prop="customAccount" label="客户姓名" width="110px" />
<el-table-column prop="customName" label="客户营业部" width="130px" />
<el-table-column prop="productType" label="资金账号" width="110px" />
<el-table-column
prop="productId"
:label="settingToC ? '客户账号' : '客户手机号'"
width="100px"
/>
<el-table-column prop="productName" label="客户风测等级" width="100px" />
<el-table-column prop="categoryName" label="产品名称" width="110px" />
<el-table-column prop="moduleStart" label=" 产品类型" width="180px" />
<el-table-column prop="moduleEnd" label="产品风险等级" width="180px" />
<el-table-column prop="payType" label="创建者" width="100px" />
<el-table-column prop="payId" label="所属分公司" width="260px" />
<el-table-column prop="payTime" label="所属营业部" width="180px" />
<el-table-column prop="totalPrice" label="是否是直播带货订单">
<template #default="scope">
{{ (scope.row.totalPrice / 100).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="payPrice" label="带货直播名称" width="100px">
<template #default="scope">
{{ (scope.row.payPrice / 100).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="rate" label="支付方式" width="100px">
<template #default="scope">
{{ scope.row.rate ? `${scope.row.rate * 1000}` : "-" }}
</template>
</el-table-column>
<el-table-column prop="couponId" label="服务时长" width="180px" />
<el-table-column label="扣款方式" width="180px">
<template #default="scope">
<span>{{ coupon_type_map[scope.row.couponType] || "" }}</span>
</template>
</el-table-column>
<el-table-column label="产品定价" width="180px">
<template #default="scope" />
</el-table-column>
<el-table-column prop="couponId" label="订单金额" width="180px">
<template #default="scope" />
</el-table-column>
<el-table-column prop="isRenewal" label="实际支付金额" width="110px">
<template #default="scope" />
</el-table-column>
<el-table-column
prop="customRiskLevel"
label="是否使用优惠券"
width="110px"
>
<template #default="scope" />
</el-table-column>
<el-table-column prop="productRiskLevel" label="优惠券名称" width="110px">
<template #default="scope" />
</el-table-column>
<el-table-column prop="productPeriod" label="订单状态" width="100px">
<template #default="scope" />
</el-table-column>
<el-table-column prop="refereeName" label="是否续订" width="100px" />
<el-table-column prop="platform" label="推荐人姓名" width="110px" />
<el-table-column prop="categoryId" label="推荐人工号" width="100px" />
<el-table-column prop="channel" label="下单时间" width="90px" />
<el-table-column prop="campaign" label="支付时间" width="110px" />
<el-table-column prop="status" label="生效时间" width="100px">
<template #default="scope" />
</el-table-column>
<el-table-column prop="orderTime" label="到期时间" width="180px" />
<el-table-column prop="updateTime" label="权限状态" width="180px" />
<el-table-column prop="refundApply" label="退款金额" width="100px" />
<el-table-column prop="refundAmount" label="申请退款时间" width="110px">
<template #default="scope" />
</el-table-column>
<el-table-column prop="refundReason" label="退款成功时间" width="100px" />
<el-table-column
prop="refundApplyTime"
label="退款审核时间"
width="180px"
/>
<el-table-column prop="operator" label="退款理由" width="110px" />
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="queryParams.current"
:page-size="queryParams.size"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import { mapGetters, mapState } from "vuex";
import dayjs from "dayjs";
import {
queryOrderList,
toRefundApplyCheck,
toRefundApply,
toRefundForce,
unSubscribe
} from "@/api/order";
import {
PAY_TYPE_WORDS,
RENEWAL_MAP,
RISK_LEVELS,
CHANNEL_MAP,
FREE_ORDER_CAMPAIGN_MAP,
PAY_STATUS_WORDS,
PAY_STATUS_WORDS_TY,
PAY_CYCLE,
COUPON_TYPE_MAP
} from "@/utils/options";
export default {
name: "",
data() {
const checkAmount = (rule, value, callback) => {
if (value === "") {
callback(new Error("请输入退款金额"));
} else if (value > this.refundParams.amount / 100 || value < 0) {
callback(
new Error(`请输入大于0小于${this.refundParams.amount / 100}的数字`)
);
} else {
callback();
}
};
return {
total: 1,
loading: false,
data: [],
pay_type_words: PAY_TYPE_WORDS,
renewal_map: RENEWAL_MAP,
risk_levels: RISK_LEVELS,
channel_map: CHANNEL_MAP,
free_order_campaign_map: FREE_ORDER_CAMPAIGN_MAP,
pay_status_words: PAY_STATUS_WORDS,
pay_status_words_ty: PAY_STATUS_WORDS_TY,
pay_cycle: PAY_CYCLE,
coupon_type_map: COUPON_TYPE_MAP,
queryParams: {
productName: "",
categoryId: undefined,
channel: undefined,
current: 1,
customAccount: "",
customRiskLevel: undefined,
endTime: "2023-03-08 17:20:24",
isRenewal: undefined,
matching: undefined,
moduleStatus: undefined,
orderId: "",
payType: undefined,
platform: undefined,
productPeriod: undefined,
productType: undefined,
refereeId: "",
size: 10,
startTime: "2021-03-08 17:20:24",
status: undefined,
timeType: undefined
},
dateVale: "",
refundDialog: {
title: "",
visible: false
},
checkRefundDialog: {
title: "",
visible: false
},
checkRefundParams: {
orderId: "", // ID
refundAmount: 0, // 退
checkStatus: "", // 0 1 2
checkReason: "" //
},
refundParams: {
orderId: "", // ID
amount: 0, //
refundAmount: 0, // 退
refundReason: "" // 退
},
refundRules: {
refundAmount: [
{
validator: checkAmount,
type: "number",
min: 0,
required: true,
trigger: "change"
}
]
},
checkRefundRules: {
checkStatus: [
{
required: true,
message: "请选择审核状态",
trigger: "change"
}
]
}
};
},
computed: {
...mapGetters(["user"]),
...mapState({
settingToC: state => state.settings.settingToC
})
},
watch: {},
created() {
this.dateVale = [
dayjs()
.subtract(1, "months")
.format("YYYY-MM-DD"),
dayjs().format("YYYY-MM-DD")
];
},
mounted() {
this.queryOrderList();
},
methods: {
//
queryOrderList() {
this.loading = true;
// this.$set(
// this.queryParams,
// 'startTime',
// moment(this.queryParams.startTime).format('YYYY-MM-DD HH:mm:ss')
// )
// const isEndTime = new Date(this.queryParams.endTime)
// isEndTime.setHours(23)
// isEndTime.setMinutes(59)
// isEndTime.setSeconds(59)
// this.$set(
// this.queryParams,
// 'endTime',
// moment(isEndTime).format('YYYY-MM-DD HH:mm:ss')
// )
this.queryParams.startTime = dayjs(this.dateVale[0]).format(
"YYYY-MM-DD 00:00:00"
);
this.queryParams.endTime = dayjs(this.dateVale[1]).format(
"YYYY-MM-DD 23:59:59"
);
queryOrderList(this.queryParams).then(data => {
this.data = data.data.list;
this.total = data.data.total;
this.loading = false;
});
},
handleSearch(current) {
this.$set(
this.queryParams,
"current",
current || this.queryParams.current
);
this.queryOrderList();
},
handleReset(formName) {
this.$refs[formName].resetFields();
this.queryOrderList();
},
submitRefundForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
this.toRefundApplyMethod();
} else {
console.log("error submit!!");
return false;
}
});
},
resetRefundForm(formName) {
this.$refs[formName].resetFields();
this.$set(this.refundDialog, "visible", false);
},
resetCheckRefundForm(formName) {
this.$refs[formName].resetFields();
this.$set(this.checkRefundDialog, "visible", false);
},
// 退
submitCheckRefundForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
this.toRefundApplyCheckMethod();
} else {
console.log("error submit!!");
return false;
}
});
},
async toRefundApplyCheckMethod() {
const { code } = await toRefundApplyCheck(this.checkRefundParams);
if (code === 0) {
this.$message({
message: "审核退款成功",
type: "success"
});
this.resetCheckRefundForm("checkRefundFormRef");
this.queryOrderList();
} else {
this.$message({
message: "审核退款失败",
type: "error"
});
}
},
// 退
async toRefundApplyMethod() {
const params = {
orderId: this.refundParams.orderId,
refundAmount: this.refundParams.refundAmount * 100,
refundReason: this.refundParams.refundReason
};
if (this.refundDialog.title === "申请退款") {
const { code } = await toRefundApply(params);
if (code === 0) {
this.$message({
message: "申请退款成功",
type: "success"
});
this.resetRefundForm("refundFormRef");
this.queryOrderList();
} else {
this.$message({
message: "申请退款失败",
type: "error"
});
}
} else if (this.refundDialog.title === "强制退款") {
const { code } = await toRefundForce(params);
if (code === 0) {
this.$message({
message: "强制退款成功",
type: "success"
});
this.resetRefundForm("refundFormRef");
this.queryOrderList();
} else {
this.$message({
message: "强制退款失败",
type: "error"
});
}
}
},
// 退
showEdit(row, title) {
this.$set(this.refundDialog, "title", title);
this.$set(this.refundDialog, "visible", true);
this.$set(this.refundParams, "orderId", row.orderId);
this.$set(this.refundParams, "amount", row.payPrice);
},
//
showCheck(row, title) {
this.$set(this.checkRefundDialog, "title", title);
this.$set(this.checkRefundDialog, "visible", true);
this.$set(this.checkRefundParams, "orderId", row.orderId);
this.$set(this.checkRefundParams, "refundAmount", row.refundAmount);
},
handleCurrentChange(val) {
this.$set(this.queryParams, "current", val || 1);
this.queryOrderList();
},
handleSizeChange(val) {
this.$set(this.queryParams, "size", val);
this.$set(this.queryParams, "current", 1);
this.queryOrderList();
},
async unSubscribeFn(val) {
const ret = await unSubscribe({ orderId: val });
if (ret.code === 0) {
this.$message({
message: "解约成功!",
type: "success"
});
this.queryOrderList();
} else {
this.$message({
message: "解约失败!",
type: "error"
});
}
}
}
};
</script>
<style scoped lang="scss">
.compress {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.el-pagination {
display: flex;
justify-content: flex-end;
margin-top: 20px;
}
::v-deep.el-input__suffix {
margin-right: 3px;
}
.head-down {
display: flex;
align-items: baseline;
}
</style>

View File

@ -0,0 +1,434 @@
<template>
<div class="app-container">
<div class="head-container">
<span style="margin-right:10px;">时间筛选 : </span>
<el-date-picker
v-model="date"
:picker-options="pickerOptions"
class="filter-item"
end-placeholder="结束日期"
range-separator="至"
size="small"
start-placeholder="开始日期"
style="padding-right: 10px"
type="daterange"
value-format="yyyy-MM-dd"
@blur="datePickerBlur"
@change="datePickerChange"
/>
<!-- icon="el-icon-search" -->
<el-button
class="filter-item"
size="mini"
style="margin-left: 10px"
type="primary"
@click="toQuery()"
>查询
</el-button>
<el-button
:loading="downloadLoading"
class="filter-item"
size="mini"
type="warning"
@click="download"
>导出
</el-button>
</div>
<!-- 头部信息 -->
<div class="table-container">
<span>总交易单数: {{ topData.orders }} </span>
<span>订单总金额(): {{ (topData.totalPrices / 100).toFixed(2) }}</span>
<span>手续费总金额(): {{ (topData.totalFees / 100).toFixed(2) }}</span>
<span>实收总金额(): {{ (topData.payTotals / 100).toFixed(2) }}</span>
<span>申请退款总金额():
{{ (topData.applyRefundAmounts / 100).toFixed(2) }}</span>
<span>退款总金额(): {{ (topData.refundAmounts / 100).toFixed(2) }}</span>
</div>
<!--表格渲染-->
<el-table
v-loading="loading"
:data="data"
border
size="small"
style="width: 100%"
>
<el-table-column align="center" fixed="left" label="序号" type="index" />
<el-table-column align="center" label="交易时间" prop="days" width="90" />
<el-table-column
:show-overflow-tooltip="true"
align="center"
label="总交易单数"
prop="orders"
/>
<el-table-column align="center" label="订单总金额(元)" prop="totalPrices">
<template slot-scope="scope">
<span>{{ (scope.row.totalPrices / 100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="手续费总金额(元)" prop="totalFees">
<template slot-scope="scope">
<span>{{ (scope.row.totalFees / 100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="实收总金额(元)" prop="payTotals">
<template slot-scope="scope">
<span>{{ (scope.row.payTotals / 100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column
align="center"
label="申请退款总金额(元)"
prop="applyRefundAmounts"
>
<template slot-scope="scope">
<span>{{ (scope.row.applyRefundAmounts / 100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column
align="center"
label="退款总金额(元)"
prop="refundAmounts"
>
<template slot-scope="scope">
<span>{{ (scope.row.refundAmounts / 100).toFixed(2) }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:current-page="page"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { parseTime } from "@/utils/index";
import keyBy from "lodash/keyBy";
import { queryOrderSummary } from "@/api/order";
import dayjs from "dayjs";
// import { DAY_TYPE } from '@/utils/options'
//
const space = 6;
//
let _minDate = "";
export default {
// name: "",
name: "",
components: {},
data() {
return {
// ()
pickerOptions: {
//
disabledDate: time => {
//
if (_minDate) {
//
const min = dayjs(_minDate).subtract(space, "month");
//
const max = dayjs(_minDate).add(space, "month");
return (
//
dayjs(time).isBefore(min) || dayjs(max).isBefore(time)
);
} else {
return false;
}
},
//
onPick({ minDate }) {
_minDate = minDate;
}
},
total: 1,
page: 1,
size: 10,
loading: false,
date: [],
topData: {
orders: 0,
totalPrices: 0,
totalFees: 0,
payTotals: 0,
applyRefundAmounts: 0,
refundAmounts: 0
},
downloadLoading: false,
data: [],
deriveData: [],
delLoading: false
};
},
computed: {
...mapGetters(["user"])
},
mounted() {
this.getOrderList();
},
methods: {
parseTime,
getSubString(value) {
return value.length > 15 ? value.substring(0, 15) + "..." : value;
},
//
async getOrderList() {
this.loading = true;
const params = {};
params.current = this.page;
params.size = this.size;
params.type = 1;
if (this.date.length > 0) {
params.startTime = this.date[0];
params.endTime = this.date[1];
} else {
params.startTime = dayjs()
.subtract(1, "month")
.format("YYYY-MM-DD");
params.endTime = dayjs().format("YYYY-MM-DD");
}
const data = await queryOrderSummary(params);
if (data.code === 0) {
this.loading = false;
this.data = data.data.list;
this.total = data.data.total;
this.getTop();
} else {
this.loading = false;
this.$message.error(data.message);
}
// console.log(params)
},
//
async getTop() {
const params = {};
params.current = 1;
params.size = 1;
params.type = 2;
if (this.date.length > 0) {
params.startTime = this.date[0];
params.endTime = this.date[1];
} else {
params.startTime = dayjs()
.subtract(1, "month")
.format("YYYY-MM-DD");
params.endTime = dayjs().format("YYYY-MM-DD");
}
const data = await queryOrderSummary(params);
if (data.code === 0) {
if (data.data.list.length > 0) {
this.topData = data.data.list[0];
} else {
this.topData = {
orders: 0,
totalPrices: 0,
totalFees: 0,
payTotals: 0,
applyRefundAmounts: 0,
refundAmounts: 0
};
}
} else {
this.$message.error(data.message);
}
// console.log(this.topData)
},
//
getTime(date) {
const y = date.substring(0, 4);
const m = date.substring(4, 6);
const d = date.substring(6);
return y + "-" + m + "-" + d;
},
async toQuery() {
this.page = 1;
if (this.date === null) {
this.date = [];
}
this.getOrderList();
},
//
sizeChange(e) {
this.page = 1;
this.size = e;
this.getOrderList();
},
pageChange(e) {
this.page = e;
this.getOrderList();
},
// 退
getProductType(status) {
const statusObj = keyBy(this.productTypeList, "key")[status];
return statusObj ? statusObj.value : "";
},
getRefundStatus(row) {
switch (row) {
case 180:
return "申请退款";
case 200:
return "退款审核通过";
case 210:
return "退款失败";
case 220:
return "已退款";
default:
break;
}
},
isNumber(val) {
//
var regPos = /^\d+(\.\d+)?$/;
//
var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;
if (regPos.test(val) || regNeg.test(val)) {
return true;
} else {
return false;
}
},
//
async download() {
if (this.date === null) {
this.date = [];
}
const params = {};
params.current = 1;
params.size = 1000000;
params.type = 1;
if (this.date.length > 0) {
params.startTime = this.date[0];
params.endTime = this.date[1];
} else {
params.startTime = dayjs()
.subtract(1, "month")
.format("YYYY-MM-DD");
params.endTime = dayjs().format("YYYY-MM-DD");
}
const data = await queryOrderSummary(params);
if (data.code === 0) {
this.deriveData = data.data.list;
}
// return
this.downloadLoading = true;
console.log(this.deriveData);
import("@/utils/export2Excel").then(excel => {
const tHeader = [
"交易时间",
"总交易单数",
"订单总金额(元)",
"手续费总金额(元)",
"实收总金额(元)",
"申请退款总金额(元)",
"退款总金额(元)"
];
const filterVal = [
"days",
"orders",
"totalPrices",
"totalFees",
"payTotals",
"applyRefundAmounts",
"refundAmounts"
];
const data = this.formatJson(filterVal, this.deriveData);
excel.export_json_to_excel({
header: tHeader,
data,
filename: "订单汇总"
});
this.downloadLoading = false;
});
},
//
formatJson(filterVal, jsonData) {
return jsonData.map(v =>
filterVal.map(j => {
if (
j === "totalPrices" ||
j === "totalFees" ||
j === "payTotals" ||
j === "applyRefundAmounts" ||
j === "refundAmounts"
) {
return (v[j] / 100).toFixed(2);
} else {
return v[j];
}
})
);
},
//
getRisk(riskLevel) {
switch (riskLevel) {
case 0:
return "低风险";
case 1:
return "低风险";
case 2:
return "中低风险";
case 3:
return "中风险";
case 4:
return "中高风险";
case 5:
return "高风险";
}
},
//
datePickerChange() {
// null ()
if (!this.date) {
_minDate = "";
return;
}
},
//
datePickerBlur() {
// null0 ()
if (this.date && this.date.length === 0) {
_minDate = "";
}
}
}
};
</script>
<style lang="scss" scoped>
.app-container {
min-width: 1000px;
}
.head-container {
display: flex;
align-items: baseline;
}
.compress {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.el-pagination {
display: flex;
justify-content: flex-end;
margin-top: 20px;
}
.table-container {
height: 60px;
display: flex;
justify-content: space-between;
align-items: center;
}
::v-deep .el-input__suffix {
margin-right: 3px;
}
</style>

View File

@ -0,0 +1,322 @@
<template>
<div>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="课程名称">
<el-input v-model="formInline.title" 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="contentCount" 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="180">
<template slot-scope="scope">
{{ riskLevelList[scope.row.riskLevel] }}
</template>
</el-table-column>
<el-table-column prop="" label="收费类型" width="120">
<template slot-scope="scope">
{{ scope.row.authorityId ? "收费" : "免费" }}
</template>
</el-table-column>
<el-table-column prop="" label="收费价格" width="120">
<template slot-scope="scope">
{{
scope.row.authorityId
? scope.row.activityPrice
? scope.row.activityPrice
: scope.row.originalPrice
: "--"
}}
</template>
</el-table-column>
<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>
<el-button
type="text"
@click="editText(scope.row)"
>配置文案</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>
<el-dialog
:visible.sync="dialogText"
:close-on-click-modal="false"
title="配置文案"
append-to-body
>
<el-form>
<el-form-item label="产品介绍">
<el-input v-model="formText.mainPageText" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" clearable />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
size="mini"
type="primary"
@click="submitText()"
>提交</el-button>
<el-button size="mini" @click="cancelText()">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getCourseList, setMainPageParam } from '@/api/course.js'
export default {
name: 'CourseTab',
props: {
isYx: {
type: Boolean,
default: false
}
},
data() {
return {
formInline: {
title: '',
isDisplay: ''
},
current: 1,
tableData: [],
total: 0,
riskLevelList: {
0: '低风险',
1: '低风险',
2: '中低风险',
3: '中风险',
4: '中高风险',
5: '高风险'
},
loading: false,
advisorId: null,
dialogWeight: false,
dialogText: false,
form: {
id: null,
isRecommend: null
},
formText: {
id: null,
mainPageText: 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 getCourseList(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
},
editText(item) {
this.formText.id = JSON.parse(JSON.stringify(item.id))
this.formText.mainPageText = JSON.parse(JSON.stringify(item.mainPageText))
this.dialogText = true
},
async submitText() {
const data = {
id: this.formText.id,
mainPageText: this.formText.mainPageText
}
const res = await setMainPageParam(data)
if (res.code === 0) {
this.$message.success('操作成功')
this.dialogText = false
this.getList(this.advisorId)
}
},
cancelText() {
this.dialogText = false
this.formText = {
id: null,
mainPageText: null
}
}
}
}
</script>
<style scoped lang="scss">
.pagination {
display: flex;
justify-content: flex-end;
margin-top: 20px;
}
</style>

View File

@ -0,0 +1,248 @@
<template>
<div>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="视频名称">
<el-input v-model="formInline.title" 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 v-loading="loading" :data="tableData" style="width: 100%">
<el-table-column type="index" label="序号" />
<el-table-column prop="title" label="视频名称" width="200" />
<el-table-column prop="imgUrl" label="封面" width="100">
<template #default="scope">
<el-popover placement="right" :width="400" trigger="hover">
<img :src="scope.row.imgUrl" width="375" height="300">
<template #reference>
<img :src="scope.row.imgUrl" style="max-height: 60px; max-width: 60px">
</template>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="name" label="风险等级" width="120">
<template slot-scope="scope">
{{ riskLevelList[scope.row.riskLevel] }}
</template>
</el-table-column>
<el-table-column prop="columnCount" label="展示形式" width="120">
<template slot-scope="scope">
{{ playStyleList[scope.row.playStyle] }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="120" />
<el-table-column prop="name" label="直播状态" width="180">
<template slot-scope="scope">
{{ scope.row.playType === 1 ? liveLabel[scope.row.liveStatus] : '--' }}
</template>
</el-table-column>
<el-table-column prop="videoTime" label="直播/视频时长" width="120">
<template slot-scope="scope">
{{ scope.row.duration ? timeFormatTwo(scope.row.duration) : scope.row.duration }}
</template>
</el-table-column>
<el-table-column prop="favorUserCount" label="点赞数" width="120" />
<el-table-column prop="readCount" label="播放数" width="120" />
<el-table-column prop="joinUserCount" label="互动数" width="120" />
<el-table-column prop="cartVOList" label="视频是否带货" width="120">
<template slot-scope="scope">
{{ scope.row.cartVOList.length > 0 ? '是' : '否' }}
</template>
</el-table-column>
<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="400">
<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 {
getInfoList,
setMainPageParam
} from '@/api/videoLive'
import { timeFormat, timeFormatTwo } from '@/utils/index'
export default {
name: 'LiveTab',
props: {
isYx: {
type: Boolean,
default: false
}
},
data() {
return {
formInline: {
title: '',
isDisplay: ''
},
current: 1,
tableData: [],
total: 0,
liveLabel: ['', '直播中', '未开始', '暂停中', '已结束'],
riskLevelList: {
1: '低风险',
2: '中低风险',
3: '中风险',
4: '中高风险',
5: '高风险'
},
playStyleList: {
1: '竖屏',
2: '横屏'
},
dialogWeight: false,
form: {
id: null,
isRecommend: null
},
advisorId: '',
loading: false
}
},
mounted() {
},
methods: {
timeFormat,
timeFormatTwo,
onSubmit() {
this.current = 1
this.getList(this.advisorId)
},
pageChange(e) {
this.current = e
this.getList(this.advisorId)
},
async getList(advisorId) {
this.loading = true
this.advisorId = advisorId
const ret = await getInfoList(Object.assign({
current: this.current,
size: 10,
userType: 2, // 1 2 3 4
status: 3,
advisorId: 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
} else {
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

@ -0,0 +1,246 @@
<template>
<div>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="视频名称">
<el-input v-model="formInline.title" 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 label="序号" type="index" fixed width="50" />
<el-table-column prop="title" label="视频名称" width="200" />
<el-table-column prop="imgUrl" label="封面">
<template #default="scope">
<el-popover placement="right" :width="400" trigger="hover">
<img :src="scope.row.imgUrl" width="375" height="300">
<template #reference>
<img
:src="scope.row.imgUrl"
style="max-height: 60px; max-width: 60px"
>
</template>
</el-popover>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="150" />
<el-table-column prop="favorCount" label="点赞数" />
<el-table-column
prop="watchCount"
label="播放量"
width="100"
/>
<el-table-column prop="commentCount" label="互动数" />
<el-table-column prop="status" label="状态">
<template #default="scope">
{{ statusObj[scope.row.status] }}
</template>
</el-table-column>
<el-table-column prop="riskLevel" label="风险等级">
<template #default="scope">
{{ riskLevelObj[scope.row.riskLevel] }}
</template>
</el-table-column>
<el-table-column prop="isCart" label="视频是否带货" width="120">
<template #default="scope">
{{ scope.row.isCart === 1 ? "是" : "否" }}
</template>
</el-table-column>
<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
prop="name"
label="操作"
fixed="right"
width="200"
align="center"
>
<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
:total="total"
:current-page="formInline.current"
:page-size="formInline.size"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<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 { mapGetters } from "vuex";
import { queryShortVideoList, setMainPageParam } from "@/api/shortVideo";
export default {
props: {
type: {
type: String,
default: ""
}
},
computed: {
...mapGetters(["user"])
},
data() {
return {
statusObj: {
1: "待提交",
2: "待审核",
3: "已上架",
4: "已驳回",
5: "已下架"
},
riskLevelObj: {
1: "低风险",
2: "中低风险",
3: "中风险",
4: "中高风险",
5: "高风险"
},
statusOptions: [
//
{ label: "待提交", value: 1 },
{ label: "待审核", value: 2 },
{ label: "已上架", value: 3 },
{ label: "已驳回", value: 4 },
{ label: "已下架", value: 5 }
],
formInline: {
advisorId: '',
title: "",
status: 3,
current: 1,
size: 10,
userType: 2,
isDisplay: ''
},
tableData: [],
total: 0,
dialogWeight: false,
form: {
id: null,
isRecommend: null
}
};
},
methods: {
onSubmit() {
this.current = 1
this.queryList()
},
handleSizeChange(val) {
this.formInline.size = val;
this.formInline.current = val;
this.queryList();
},
handleCurrentChange(val) {
this.formInline.current = val || 1;
this.queryList();
},
async queryList(advisorId) {
this.formInline.advisorId = advisorId || this.formInline.advisorId
try {
const { code, data } = await queryShortVideoList(this.formInline);
if (code === 0) {
this.tableData = data.list;
this.total = data.total;
}
} catch (error) {
console.log(error);
}
},
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.queryList()
}
})
.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.queryList()
}
})
.catch(() => { })
} else {
const data = { ...this.form }
const res = await setMainPageParam(data)
if (res.code === 0) {
this.$message.success('操作成功')
this.cancelWeight()
this.queryList()
}
}
},
cancelWeight() {
this.form = {
id: null,
isRecommend: null
}
this.dialogWeight = false
}
}
};
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,367 @@
<template>
<div class="centent app-container">
<div class="menu-container">
<el-tabs
v-model="editableTabsValue"
type="card"
@tab-click="selectedTab()"
>
<el-tab-pane
v-for="(item, index) in tgList"
:key="item.name"
:label="item.name"
:name="item.name"
>
{{ item.content }}
</el-tab-pane>
</el-tabs>
</div>
<div class="button-box">
<div>
<el-button
v-for="(item, index) in buttonText"
:class="{ selected: selectedButton === item.productType }"
plain
@click="selected(item.productType)"
>{{ item.showName }}</el-button>
<el-button
class="custom-button selected"
type="primary"
@click="copyUrl($event)"
>复制投顾主页链接</el-button>
</div>
</div>
<div class="content-box">
<ShortTab v-if="selectedButton === 35" ref="shortTab" />
<LiveTab v-if="selectedButton === 3" ref="liveTab" />
<CourseTab v-if="selectedButton === 32" ref="courseTab" />
</div>
<el-dialog
:visible.sync="dialogTab"
:close-on-click-modal="false"
title="自定义tab"
append-to-body
>
<div ref="contentContainer" class="dialog-content">
<div
v-for="(item, index) in buttonTextEdit"
:key="item.productType"
class="dialog-content-item"
draggable="true"
>
<div class="dialog-content-item-left">{{ item.showName }}</div>
<div class="dialog-content-item-right">
<el-switch
v-model="item.status"
:active-value="1"
:inactive-value="2"
/>
<i
class="el-icon-edit-outline"
style="font-size: 24px;margin-left: 10px;cursor: pointer;"
@click="openEditTab(item)"
/>
<i
class="el-icon-set-up"
style="font-size: 24px;margin-left: 10px;cursor: pointer;"
/>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button
size="mini"
type="primary"
@click="editTab()"
>提交</el-button>
<el-button size="mini" @click="cancelTab()">取消</el-button>
</div>
</el-dialog>
<!-- 修改名称 -->
<el-dialog
:visible.sync="editDialog"
:close-on-click-modal="false"
:title="titleList[editItem.productType]"
append-to-body
>
<el-form>
<el-form-item>
<el-input v-model="editItem.showName" label="请输入名称" />
</el-form-item>
<el-form-item>
系统推荐名称
</el-form-item>
<el-form-item>
<el-button
v-for="(item, index) in buttonTextEditList[editItem.productType]"
:key="index"
@click="editItem.showName = JSON.parse(JSON.stringify(item))"
>{{ item }}</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
size="mini"
type="primary"
@click="submitEditDialog()"
>提交</el-button>
<el-button size="mini" @click="cancelEditDialog()">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Sortable from "sortablejs";
import LiveTab from "./components/LiveTab.vue";
import CourseTab from "./components/CourseTab.vue";
import { mapGetters } from "vuex";
import { tgList, mainTabInfoList, mainTabInfoSave } from "@/api/adviser";
import { handleClipboard } from "@/views/liveBroadcast/manage/config";
import { urlResize } from "@/api/videoLive";
import ShortTab from "./components/ShortTab.vue";
export default {
components: { LiveTab, CourseTab, ShortTab },
data() {
return {
editableTabsValue: "",
selectedButton: null,
buttonText: [],
tgList: [],
advisorId: null,
dialogTab: false,
sortable: null,
buttonTextEdit: [],
editDialog: false,
editItem: {},
titleList: {
3: "修改直播tab名称",
6: "修改图文tab名称",
31: "修改甄选服务tab名称",
32: "修改课程tab名称",
35: "修改短视频tab名称"
},
buttonTextEditList: {
3: ["视频直播", "直播课", "直播"],
6: ["图文直播", "圈子", "服务圈", "财富圈"],
31: ["甄选服务", "会员"],
32: ["课程", "产品", "系列课"],
35: ["短视频", "视频", "作品"]
}
};
},
mounted() {
this.getTgList();
},
computed: {
...mapGetters(["user"])
},
watch: {
editableTabsValue(value) {
if (value === "0" && value === null) return;
this.$nextTick(() => {
if (this.selectedButton === 3 && this.$refs.liveTab) {
const selectTg = this.tgList.find(item => item.name === value);
this.advisorId = selectTg.id;
this.$refs.liveTab.getList(this.advisorId);
} else if (this.selectedButton === 32 && this.$refs.courseTab) {
const selectTg = this.tgList.find(item => item.name === value);
this.advisorId = selectTg.id;
this.$refs.courseTab.getList(this.advisorId);
}
});
},
selectedButton(value) {
if (value) {
this.$nextTick(() => {
if (this.selectedButton === 3 && this.$refs.liveTab) {
const selectTg = this.tgList.find(
item => item.name === this.editableTabsValue
);
this.advisorId = selectTg.id;
this.$refs.liveTab.getList(this.advisorId);
} else if (this.selectedButton === 32 && this.$refs.courseTab) {
const selectTg = this.tgList.find(
item => item.name === this.editableTabsValue
);
this.advisorId = selectTg.id;
this.$refs.courseTab.getList(this.advisorId);
}
});
}
},
advisorId(value) {
if (value) {
this.getMainTabInfoList();
}
}
},
methods: {
initSortable() {
this.sortable = Sortable.create(this.$refs.contentContainer, {
animation: 150, //
ghostClass: "ghost", //
onEnd: ({ newIndex, oldIndex }) => {
this.updateOrder(newIndex, oldIndex);
}
});
},
updateOrder(newIndex, oldIndex) {
if (newIndex !== oldIndex) {
const movedItem = this.buttonTextEdit.splice(oldIndex, 1)[0];
this.buttonTextEdit.splice(newIndex, 0, movedItem);
}
},
selected(productType) {
this.selectedButton = productType;
this.$nextTick(() => {
if (this.selectedButton === 3 && this.$refs.liveTab) {
this.$refs.liveTab.getList(this.advisorId);
} else if (this.selectedButton === 32 && this.$refs.courseTab) {
this.$refs.courseTab.getList(this.advisorId);
} else if (this.selectedButton === 35 && this.$refs.shortTab) {
this.$refs.shortTab.queryList(this.advisorId);
}
});
},
async getTgList(name) {
const ret = await tgList({
current: 1,
name,
showName: "",
size: 100000,
staffNo: "",
status: 3,
deptId: this.user.user.deptId
});
if (ret.code === 0) {
this.tgList = ret.data.list;
this.advisorId = this.tgList[0].id;
this.editableTabsValue = this.tgList[0].name;
// tab
}
},
selectedTab() {
const selectTg = this.tgList.find(
item => item.name === this.editableTabsValue
);
this.advisorId = selectTg.id;
},
//
customDialog() {
this.dialogTab = true;
this.$nextTick(() => {
this.initSortable();
});
},
async getMainTabInfoList() {
const data = {
id: this.advisorId
};
const res = await mainTabInfoList(data);
if (res.code === 0) {
this.buttonText = res.data;
this.buttonText.sort((a, b) => a.sort - b.sort);
this.buttonTextEdit = JSON.parse(JSON.stringify(this.buttonText));
this.selectedButton = this.buttonText[0].productType;
this.selected(this.selectedButton);
}
},
async editTab() {
this.buttonTextEdit.forEach((item, index) => {
item.sort = index + 1;
});
const data = {
advisorId: this.advisorId,
tabList: this.buttonTextEdit
};
const res = await mainTabInfoSave(data);
if (res.code === 0) {
this.$message.success("修改成功");
this.dialogTab = false;
this.getMainTabInfoList();
}
},
cancelTab() {
this.buttonTextEdit = JSON.parse(JSON.stringify(this.buttonText));
this.dialogTab = false;
},
//
openEditTab(item) {
this.editItem = JSON.parse(JSON.stringify(item));
this.editDialog = true;
},
//
cancelEditDialog() {
this.editItem = {};
this.editDialog = false;
},
//
submitEditDialog() {
if (!this.editItem.showName) return this.$message.error("请输入名称");
// productType
const index = this.buttonTextEdit.findIndex(
item => item.productType === this.editItem.productType
);
if (index !== -1) {
this.buttonTextEdit[index].showName = JSON.parse(
JSON.stringify(this.editItem.showName)
);
}
this.editDialog = false;
},
async copyUrl(event) {
const currentTarget = event.currentTarget;
const ret = await urlResize({
url: `/tg?id=${this.advisorId}`
});
if (ret.code === 0) {
handleClipboard(ret.data, event, currentTarget);
}
}
}
};
</script>
<style scoped lang="scss">
.centent {
padding: 20px;
.menu-container {
padding: 0 10px;
}
.button-box {
padding: 20px 0;
display: inline-flex;
.custom-button {
margin-left: 40px;
}
.selected {
background-color: #409eff !important;
color: #ffffff !important;
}
}
.content-box {
margin-top: 20px;
}
}
.dialog-content-item {
display: flex;
flex-direction: row;
padding: 20px;
margin-bottom: 10px;
border-radius: 4px;
background-color: #c0c4cc;
justify-content: space-between;
align-items: center;
.dialog-content-item-left {
font-size: 18px;
}
.dialog-content-item-right {
display: flex;
flex-direction: row;
align-items: center;
}
}
</style>

View File

@ -0,0 +1,367 @@
<template>
<div class="centent app-container">
<div class="menu-container">
<el-tabs
v-model="editableTabsValue"
type="card"
@tab-click="selectedTab()"
>
<el-tab-pane
v-for="(item, index) in tgList"
:key="item.name"
:label="item.name"
:name="item.name"
>
{{ item.content }}
</el-tab-pane>
</el-tabs>
</div>
<div class="button-box">
<div>
<el-button
v-for="(item, index) in buttonText"
:class="{ selected: selectedButton === item.productType }"
plain
@click="selected(item.productType)"
>{{ item.showName }}</el-button>
<el-button
class="custom-button selected"
type="primary"
@click="copyUrl($event)"
>复制投顾主页链接</el-button>
</div>
</div>
<div class="content-box">
<ShortTab v-if="selectedButton === 35" ref="shortTab" />
<LiveTab v-if="selectedButton === 3" ref="liveTab" />
<CourseTab v-if="selectedButton === 32" ref="courseTab" />
</div>
<el-dialog
:visible.sync="dialogTab"
:close-on-click-modal="false"
title="自定义tab"
append-to-body
>
<div ref="contentContainer" class="dialog-content">
<div
v-for="(item, index) in buttonTextEdit"
:key="item.productType"
class="dialog-content-item"
draggable="true"
>
<div class="dialog-content-item-left">{{ item.showName }}</div>
<div class="dialog-content-item-right">
<el-switch
v-model="item.status"
:active-value="1"
:inactive-value="2"
/>
<i
class="el-icon-edit-outline"
style="font-size: 24px;margin-left: 10px;cursor: pointer;"
@click="openEditTab(item)"
/>
<i
class="el-icon-set-up"
style="font-size: 24px;margin-left: 10px;cursor: pointer;"
/>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button
size="mini"
type="primary"
@click="editTab()"
>提交</el-button>
<el-button size="mini" @click="cancelTab()">取消</el-button>
</div>
</el-dialog>
<!-- 修改名称 -->
<el-dialog
:visible.sync="editDialog"
:close-on-click-modal="false"
:title="titleList[editItem.productType]"
append-to-body
>
<el-form>
<el-form-item>
<el-input v-model="editItem.showName" label="请输入名称" />
</el-form-item>
<el-form-item>
系统推荐名称
</el-form-item>
<el-form-item>
<el-button
v-for="(item, index) in buttonTextEditList[editItem.productType]"
:key="index"
@click="editItem.showName = JSON.parse(JSON.stringify(item))"
>{{ item }}</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
size="mini"
type="primary"
@click="submitEditDialog()"
>提交</el-button>
<el-button size="mini" @click="cancelEditDialog()">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Sortable from "sortablejs";
import LiveTab from "./components/LiveTab.vue";
import CourseTab from "./components/CourseTab.vue";
import ShortTab from "./components/ShortTab.vue";
import { mapGetters } from "vuex";
import { tgList, mainTabInfoList, mainTabInfoSave } from "@/api/adviser";
import { handleClipboard } from "@/views/liveBroadcast/manage/config";
import { urlResize } from "@/api/videoLive";
export default {
components: { LiveTab, CourseTab, ShortTab },
data() {
return {
editableTabsValue: "",
selectedButton: null,
buttonText: [],
tgList: [],
advisorId: null,
dialogTab: false,
sortable: null,
buttonTextEdit: [],
editDialog: false,
editItem: {},
titleList: {
3: "修改直播tab名称",
6: "修改图文tab名称",
31: "修改甄选服务tab名称",
32: "修改课程tab名称",
35: "修改短视频tab名称"
},
buttonTextEditList: {
3: ["视频直播", "直播课", "直播"],
6: ["图文直播", "圈子", "服务圈", "财富圈"],
31: ["甄选服务", "会员"],
32: ["课程", "产品", "系列课"],
35: ["短视频", "视频", "作品"]
}
};
},
mounted() {
// this.getTgList()
this.advisorId = this.user.advisorInfo.id;
this.editableTabsValue = this.user.advisorInfo.name;
},
computed: {
...mapGetters(["user"])
},
watch: {
// editableTabsValue(value) {
// if(value === '0' && value === null) return
// this.$nextTick(()=>{
// if(this.selectedButton === 3 && this.$refs.liveTab){
// this.$refs.liveTab.getList(value)
// }else if(this.selectedButton === 32 && this.$refs.courseTab){
// const selectTg = this.tgList.find(item => item.name === value);
// this.advisorId = selectTg.id
// this.$refs.courseTab.getList(this.advisorId)
// }
// })
// },
// selectedButton(value){
// if(value){
// this.$nextTick(()=>{
// if(this.selectedButton === 3 && this.$refs.liveTab){
// this.$refs.liveTab.getList(this.editableTabsValue)
// }else if(this.selectedButton === 32 && this.$refs.courseTab){
// const selectTg = this.tgList.find(item => item.name === this.editableTabsValue);
// this.advisorId = selectTg.id
// this.$refs.courseTab.getList(this.advisorId)
// }
// })
// }
// },
advisorId(value) {
if (value) {
this.getMainTabInfoList();
}
}
},
methods: {
initSortable() {
this.sortable = Sortable.create(this.$refs.contentContainer, {
animation: 150, //
ghostClass: "ghost", //
onEnd: ({ newIndex, oldIndex }) => {
this.updateOrder(newIndex, oldIndex);
}
});
},
updateOrder(newIndex, oldIndex) {
if (newIndex !== oldIndex) {
const movedItem = this.buttonTextEdit.splice(oldIndex, 1)[0];
this.buttonTextEdit.splice(newIndex, 0, movedItem);
}
},
selected(productType) {
this.selectedButton = productType;
this.$nextTick(() => {
if (this.selectedButton === 3 && this.$refs.liveTab) {
this.$refs.liveTab.getList(this.advisorId);
} else if (this.selectedButton === 32 && this.$refs.courseTab) {
this.$refs.courseTab.getList(this.advisorId);
} else if (this.selectedButton === 35 && this.$refs.shortTab) {
this.$refs.shortTab.queryList(this.advisorId);
}
});
},
async getTgList() {
const ret = await tgList({
current: 1,
name: this.user.user.name,
showName: "",
size: 100000,
staffNo: "",
status: 3,
deptId: this.user.user.deptId
});
if (ret.code === 0) {
this.tgList = ret.data.list;
if (this.tgList.lenght > 0) {
this.advisorId = this.tgList[0].id;
this.editableTabsValue = this.tgList[0].name;
}
// tab
}
},
selectedTab() {
const selectTg = this.tgList.find(
item => item.name === this.editableTabsValue
);
this.advisorId = selectTg.id;
},
//
customDialog() {
this.dialogTab = true;
this.$nextTick(() => {
this.initSortable();
});
},
async getMainTabInfoList() {
const data = {
id: this.advisorId
};
const res = await mainTabInfoList(data);
if (res.code === 0) {
this.buttonText = res.data;
this.buttonText.sort((a, b) => a.sort - b.sort);
this.buttonTextEdit = JSON.parse(JSON.stringify(this.buttonText));
this.selectedButton = this.buttonText[0].productType;
this.selected(this.selectedButton);
}
},
async editTab() {
this.buttonTextEdit.forEach((item, index) => {
item.sort = index + 1;
});
const data = {
advisorId: this.advisorId,
tabList: this.buttonTextEdit
};
const res = await mainTabInfoSave(data);
if (res.code === 0) {
this.$message.success("修改成功");
this.dialogTab = false;
this.getMainTabInfoList();
}
},
cancelTab() {
this.buttonTextEdit = JSON.parse(JSON.stringify(this.buttonText));
this.dialogTab = false;
},
//
openEditTab(item) {
this.editItem = JSON.parse(JSON.stringify(item));
this.editDialog = true;
},
//
cancelEditDialog() {
this.editItem = {};
this.editDialog = false;
},
//
submitEditDialog() {
if (!this.editItem.showName) return this.$message.error("请输入名称");
// productType
const index = this.buttonTextEdit.findIndex(
item => item.productType === this.editItem.productType
);
if (index !== -1) {
this.buttonTextEdit[index].showName = JSON.parse(
JSON.stringify(this.editItem.showName)
);
}
this.editDialog = false;
},
async copyUrl(event) {
const currentTarget = event.currentTarget;
const ret = await urlResize({
url: `/tg?id=${this.user.advisorInfo.id}`
});
if (ret.code === 0) {
handleClipboard(ret.data, event, currentTarget);
}
}
}
};
</script>
<style scoped lang="scss">
.centent {
padding: 20px;
.menu-container {
padding: 0 10px;
}
.button-box {
padding: 20px 0;
display: inline-flex;
.custom-button {
margin-left: 40px;
}
.selected {
background-color: #409eff !important;
color: #ffffff !important;
}
}
.content-box {
margin-top: 20px;
}
}
.dialog-content-item {
display: flex;
flex-direction: row;
padding: 20px;
margin-bottom: 10px;
border-radius: 4px;
background-color: #c0c4cc;
justify-content: space-between;
align-items: center;
.dialog-content-item-left {
font-size: 18px;
}
.dialog-content-item-right {
display: flex;
flex-direction: row;
align-items: center;
}
}
</style>

View File

@ -0,0 +1,366 @@
<template>
<div class="centent app-container">
<div class="menu-container">
<el-tabs
v-model="editableTabsValue"
type="card"
@tab-click="selectedTab()"
>
<el-tab-pane
v-for="(item, index) in tgList"
:key="item.name"
:label="item.name"
:name="item.name"
>
{{ item.content }}
</el-tab-pane>
</el-tabs>
</div>
<div class="button-box">
<div>
<el-button
v-for="(item, index) in buttonText"
:class="{ selected: selectedButton === item.productType }"
plain
@click="selected(item.productType)"
>{{ item.showName }}</el-button>
<el-button
class="custom-button selected"
type="primary"
@click="copyUrl($event)"
>复制投顾主页链接</el-button>
</div>
</div>
<div class="content-box">
<ShortTab v-if="selectedButton === 35" ref="shortTab" />
<LiveTab v-if="selectedButton === 3" ref="liveTab" :is-yx="true" />
<CourseTab v-if="selectedButton === 32" ref="courseTab" :is-yx="true" />
</div>
<el-dialog
:visible.sync="dialogTab"
:close-on-click-modal="false"
title="自定义tab"
append-to-body
>
<div ref="contentContainer" class="dialog-content">
<div
v-for="(item, index) in buttonTextEdit"
:key="item.productType"
class="dialog-content-item"
draggable="true"
>
<div class="dialog-content-item-left">{{ item.showName }}</div>
<div class="dialog-content-item-right">
<el-switch
v-model="item.status"
:active-value="1"
:inactive-value="2"
/>
<i
class="el-icon-edit-outline"
style="font-size: 24px;margin-left: 10px;cursor: pointer;"
@click="openEditTab(item)"
/>
<i
class="el-icon-set-up"
style="font-size: 24px;margin-left: 10px;cursor: pointer;"
/>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button
size="mini"
type="primary"
@click="editTab()"
>提交</el-button>
<el-button size="mini" @click="cancelTab()">取消</el-button>
</div>
</el-dialog>
<!-- 修改名称 -->
<el-dialog
:visible.sync="editDialog"
:close-on-click-modal="false"
:title="titleList[editItem.productType]"
append-to-body
>
<el-form>
<el-form-item>
<el-input v-model="editItem.showName" label="请输入名称" />
</el-form-item>
<el-form-item>
系统推荐名称
</el-form-item>
<el-form-item>
<el-button
v-for="(item, index) in buttonTextEditList[editItem.productType]"
:key="index"
@click="editItem.showName = JSON.parse(JSON.stringify(item))"
>{{ item }}</el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
size="mini"
type="primary"
@click="submitEditDialog()"
>提交</el-button>
<el-button size="mini" @click="cancelEditDialog()">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Sortable from "sortablejs";
import LiveTab from "./components/LiveTab.vue";
import CourseTab from "./components/CourseTab.vue";
import { mapGetters } from "vuex";
import { tgList, mainTabInfoList, mainTabInfoSave } from "@/api/adviser";
import { handleClipboard } from "@/views/liveBroadcast/manage/config";
import ShortTab from "./components/ShortTab.vue";
import { urlResize } from "@/api/videoLive";
import { create } from "simple-drawing-board";
export default {
components: { LiveTab, CourseTab, ShortTab },
data() {
return {
editableTabsValue: "",
selectedButton: null,
buttonText: [],
tgList: [],
advisorId: null,
dialogTab: false,
sortable: null,
buttonTextEdit: [],
editDialog: false,
editItem: {},
titleList: {
3: "修改直播tab名称",
6: "修改图文tab名称",
31: "修改甄选服务tab名称",
32: "修改课程tab名称",
35: "修改短视频tab名称"
},
buttonTextEditList: {
3: ["视频直播", "直播课", "直播"],
6: ["图文直播", "圈子", "服务圈", "财富圈"],
31: ["甄选服务", "会员"],
32: ["课程", "产品", "系列课"],
35: ["短视频", "视频", "作品"]
}
};
},
mounted() {
this.getTgList();
},
computed: {
...mapGetters(["user"])
},
watch: {
editableTabsValue(value) {
if (value === "0" && value === null) return;
this.$nextTick(() => {
if (this.selectedButton === 3 && this.$refs.liveTab) {
const selectTg = this.tgList.find(item => item.name === value);
this.advisorId = selectTg.id;
this.$refs.liveTab.getList(this.advisorId);
} else if (this.selectedButton === 32 && this.$refs.courseTab) {
const selectTg = this.tgList.find(item => item.name === value);
this.advisorId = selectTg.id;
this.$refs.courseTab.getList(this.advisorId);
}
});
},
selectedButton(value) {
if (value) {
this.$nextTick(() => {
if (this.selectedButton === 3 && this.$refs.liveTab) {
const selectTg = this.tgList.find(item => item.name === value);
this.advisorId = selectTg.id;
this.$refs.liveTab.getList(this.advisorId);
} else if (this.selectedButton === 32 && this.$refs.courseTab) {
const selectTg = this.tgList.find(
item => item.name === this.editableTabsValue
);
this.advisorId = selectTg.id;
this.$refs.courseTab.getList(this.advisorId);
}
});
}
},
advisorId(value) {
if (value) {
this.getMainTabInfoList();
}
}
},
methods: {
initSortable() {
this.sortable = Sortable.create(this.$refs.contentContainer, {
animation: 150, //
ghostClass: "ghost", //
onEnd: ({ newIndex, oldIndex }) => {
this.updateOrder(newIndex, oldIndex);
}
});
},
updateOrder(newIndex, oldIndex) {
if (newIndex !== oldIndex) {
const movedItem = this.buttonTextEdit.splice(oldIndex, 1)[0];
this.buttonTextEdit.splice(newIndex, 0, movedItem);
}
},
selected(productType) {
this.selectedButton = productType;
this.$nextTick(() => {
if (this.selectedButton === 3 && this.$refs.liveTab) {
this.$refs.liveTab.getList(this.advisorId);
} else if (this.selectedButton === 32 && this.$refs.courseTab) {
this.$refs.courseTab.getList(this.advisorId);
} else if (this.selectedButton === 35 && this.$refs.shortTab) {
this.$refs.shortTab.queryList(this.advisorId);
}
});
},
async getTgList(name) {
const ret = await tgList({
current: 1,
name,
showName: "",
size: 100000,
staffNo: "",
status: 3,
deptId: this.user.user.deptId
});
if (ret.code === 0) {
this.tgList = ret.data.list;
this.advisorId = this.tgList[0].id;
this.editableTabsValue = this.tgList[0].name;
// tab
}
},
selectedTab() {
const selectTg = this.tgList.find(
item => item.name === this.editableTabsValue
);
this.advisorId = selectTg.id;
},
//
customDialog() {
this.dialogTab = true;
this.$nextTick(() => {
this.initSortable();
});
},
async getMainTabInfoList() {
const data = {
id: this.advisorId
};
const res = await mainTabInfoList(data);
if (res.code === 0) {
this.buttonText = res.data;
this.buttonText.sort((a, b) => a.sort - b.sort);
this.buttonTextEdit = JSON.parse(JSON.stringify(this.buttonText));
this.selectedButton = this.buttonText[0].productType;
this.selected(this.selectedButton);
}
},
async editTab() {
this.buttonTextEdit.forEach((item, index) => {
item.sort = index + 1;
});
const data = {
advisorId: this.advisorId,
tabList: this.buttonTextEdit
};
const res = await mainTabInfoSave(data);
if (res.code === 0) {
this.$message.success("修改成功");
this.dialogTab = false;
this.getMainTabInfoList();
}
},
cancelTab() {
this.buttonTextEdit = JSON.parse(JSON.stringify(this.buttonText));
this.dialogTab = false;
},
//
openEditTab(item) {
this.editItem = JSON.parse(JSON.stringify(item));
this.editDialog = true;
},
//
cancelEditDialog() {
this.editItem = {};
this.editDialog = false;
},
//
submitEditDialog() {
if (!this.editItem.showName) return this.$message.error("请输入名称");
// productType
const index = this.buttonTextEdit.findIndex(
item => item.productType === this.editItem.productType
);
if (index !== -1) {
this.buttonTextEdit[index].showName = JSON.parse(
JSON.stringify(this.editItem.showName)
);
}
this.editDialog = false;
},
async copyUrl(event) {
const currentTarget = event.currentTarget;
const ret = await urlResize({
url: `/tg?id=${this.advisorId}&saleUserId=${this.user.user.id}`
});
if (ret.code === 0) {
handleClipboard(ret.data, event, currentTarget);
}
}
}
};
</script>
<style scoped lang="scss">
.centent {
padding: 20px;
.menu-container {
padding: 0 10px;
}
.button-box {
padding: 20px 0;
display: inline-flex;
.custom-button {
margin-left: 40px;
}
.selected {
background-color: #409eff !important;
color: #ffffff !important;
}
}
.content-box {
margin-top: 20px;
}
}
.dialog-content-item {
display: flex;
flex-direction: row;
padding: 20px;
margin-bottom: 10px;
border-radius: 4px;
background-color: #c0c4cc;
justify-content: space-between;
align-items: center;
.dialog-content-item-left {
font-size: 18px;
}
.dialog-content-item-right {
display: flex;
flex-direction: row;
align-items: center;
}
}
</style>

View File

@ -2,6 +2,7 @@
const path = require("path");
const defaultSettings = require("./src/settings.js");
const CompressionPlugin = require("compression-webpack-plugin");
const ZipPlugin = require("zip-webpack-plugin");
function resolve(dir) {
return path.join(__dirname, dir);
@ -14,8 +15,8 @@ const port = 8013; // 端口配置
module.exports = {
// hash 模式下可使用
// publicPath: process.env.NODE_ENV === 'development' ? '/' : './',
publicPath: "/admin/",
outputDir: "dist",
publicPath: "/syAdmin/",
outputDir: "build/syAdmin",
assetsDir: "static",
lintOnSave: process.env.NODE_ENV === "development",
productionSourceMap: false,
@ -60,6 +61,10 @@ module.exports = {
filename: "[path].gz[query]", // 压缩后的文件名
algorithm: "gzip", // 使用gzip压缩
minRatio: 0.8 // 压缩率小于1才会压缩
}),
new ZipPlugin({
path: "./", //路径名
filename: "./syAdmin.zip" //打包名
})
]
},