init
This commit is contained in:
@@ -26,10 +26,9 @@ export function addUserAlbum(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改相册管理
|
||||
export function updateUserAlbum(data) {
|
||||
return request({
|
||||
url: '/cai/userAlbum',
|
||||
url: '/cai/userAlbum/audit',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
||||
103
src/views/cai/anchor/add-anchor-dialog.vue
Normal file
103
src/views/cai/anchor/add-anchor-dialog.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="蜜瓜号" prop="usercode">
|
||||
<el-autocomplete
|
||||
class="inline-input"
|
||||
v-model="form.usercode"
|
||||
:fetch-suggestions="querySearch"
|
||||
placeholder="请输入内容"
|
||||
@select="handleSelect"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
<el-form-item label="昵称" v-if="info.nickname">
|
||||
{{ info.nickname }} 【{{ info.usercode }}】
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" v-if="info.gender">
|
||||
<cai-dict-tag :options="genderList" :value="info.gender" />
|
||||
</el-form-item>
|
||||
<el-form-item label="头像" v-if="info.avatar">
|
||||
<image-avatar :src="info.avatar"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
注意:若用户已是会员,再次设置时将会使用最新的会员信息
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getUserByUsercode, listUserByUserCode} from "@/api/cai/user";
|
||||
import {addAnchor} from "@/api/cai/anchor";
|
||||
import {genderList} from "@/constant/statusMap";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
genderList,
|
||||
open: false,
|
||||
title: '',
|
||||
form:{
|
||||
usercode: undefined,
|
||||
},
|
||||
info:{
|
||||
},
|
||||
memberPriceList:[],
|
||||
// 表单校验
|
||||
rules: {
|
||||
usercode: [
|
||||
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
buttonLoading: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.open = true;
|
||||
this.title = "新增主播"
|
||||
this.info = {};
|
||||
this.form.usercode = undefined
|
||||
},
|
||||
querySearch(querySearch,cb){
|
||||
listUserByUserCode(querySearch).then(res => {
|
||||
cb(res.data.map((terminal) => {
|
||||
return {
|
||||
value: terminal,
|
||||
name: terminal,
|
||||
};
|
||||
}))
|
||||
})
|
||||
},
|
||||
handleSelect(item){
|
||||
getUserByUsercode(item.value).then(res => {
|
||||
this.info = res.data
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
submitForm () {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
addAnchor(this.form).then(data => {
|
||||
this.$modal.msgSuccess("新增工会成功");
|
||||
this.buttonLoading = false;
|
||||
this.open = false
|
||||
this.$emit('refreshDataList')
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,22 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="蜜瓜号" prop="usercode">
|
||||
<el-input
|
||||
v-model="queryParams.usercode"
|
||||
placeholder="请输入蜜瓜号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -70,9 +86,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评分" align="center" prop="giveScore" />
|
||||
<el-table-column label="视频分成比例" align="center" prop="videoRate" />
|
||||
<el-table-column label="礼物的邀请比例" align="center" prop="giftInviteRate" />
|
||||
<el-table-column label="礼物分成比列" align="center" prop="giftRate" />
|
||||
<el-table-column label="视频分成" align="center" prop="videoRate" />
|
||||
<el-table-column label="守护分成" align="center" prop="guardRate" />
|
||||
<el-table-column label="礼物分成" align="center" prop="giftRate" />
|
||||
<el-table-column label="服务总次数" align="center" prop="serviceCount" />
|
||||
<el-table-column label="服务总时长" align="center" prop="serviceTime" />
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
@@ -80,7 +96,7 @@
|
||||
<cai-dict-tag :options="userStatusList" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100">
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="140">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@@ -89,6 +105,13 @@
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['cai:anchor:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['cai:anchor:remove']"
|
||||
>取消</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -100,18 +123,28 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<add-anchor-dialog v-if="addAnchorDialogVisible" ref="addAnchorDialog" @refreshDataList="getList" />
|
||||
<update-anchor-dialog v-if="updateAnchorDialogVisible" ref="updateAnchorDialog" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAnchor, updateAnchor } from '@/api/cai/anchor'
|
||||
import {delAnchor, listAnchor, updateAnchor} from '@/api/cai/anchor'
|
||||
import { genderList, userStatusList } from '@/constant/statusMap'
|
||||
import AddAnchorDialog from "@/views/cai/anchor/add-anchor-dialog";
|
||||
import UpdateAnchorDialog from "@/views/cai/anchor/update-anchor-dialog";
|
||||
|
||||
export default {
|
||||
name: "Anchor",
|
||||
components:{
|
||||
AddAnchorDialog,UpdateAnchorDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
genderList,userStatusList,
|
||||
addAnchorDialogVisible: false,
|
||||
updateAnchorDialogVisible: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -130,21 +163,8 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: undefined,
|
||||
openVideoStatus: undefined,
|
||||
videoStatus: undefined,
|
||||
orderSwitch: undefined,
|
||||
indexDisplay: undefined,
|
||||
giveScore: undefined,
|
||||
serviceCount: undefined,
|
||||
serviceTime: undefined,
|
||||
giftInviteRate: undefined,
|
||||
videoRate: undefined,
|
||||
giftRate: undefined,
|
||||
recommendStatus: undefined,
|
||||
status: undefined,
|
||||
jifen: undefined,
|
||||
lastJifen: undefined
|
||||
usercode: undefined,
|
||||
mobile: undefined
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -177,11 +197,18 @@ export default {
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
handleAdd(row) {
|
||||
this.addAnchorDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addAnchorDialog.init(row?.usercode)
|
||||
})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.updateAnchorDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.updateAnchorDialog.init(row)
|
||||
})
|
||||
},
|
||||
handleOpenVideoStatusChange(row){
|
||||
let text = row.openVideoStatus === 0 ? '封禁' : '恢复'
|
||||
@@ -225,6 +252,19 @@ export default {
|
||||
row.recommendStatus = row.recommendStatus === 1 ? 1 : 0
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认取消"' + row.nickname + '"的主播?').then(() => {
|
||||
this.loading = true;
|
||||
return delAnchor(row.userId);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("取消成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
97
src/views/cai/anchor/update-anchor-dialog.vue
Normal file
97
src/views/cai/anchor/update-anchor-dialog.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="蜜瓜号" prop="usercode">
|
||||
<el-input v-model="form.usercode" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="守护分成" prop="guardRate">
|
||||
<el-input v-model="form.guardRate" />
|
||||
</el-form-item>
|
||||
<el-form-item label="礼物分成" prop="giftRate">
|
||||
<el-input v-model="form.giftRate" />
|
||||
</el-form-item>
|
||||
<el-form-item label="视频分成" prop="videoRate">
|
||||
<el-input v-model="form.videoRate" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ImageUpload from '@/components/ImageUpload/index'
|
||||
import {getAnchor, updateAnchor} from "@/api/cai/anchor";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ImageUpload,
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
open: false,
|
||||
title: '',
|
||||
form:{
|
||||
id: undefined,
|
||||
usercode: undefined,
|
||||
guardRate: undefined,
|
||||
giftRate: undefined,
|
||||
videoRate: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
guardRate: [
|
||||
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||
],
|
||||
giftRate: [
|
||||
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||
],
|
||||
videoRate: [
|
||||
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
buttonLoading: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
init (row) {
|
||||
let id = row.id
|
||||
this.form.id = id || undefined;
|
||||
this.title = "修改主播";
|
||||
this.open = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form'].resetFields();
|
||||
getAnchor(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.usercode = row.usercode
|
||||
});
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
submitForm () {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
updateAnchor({
|
||||
id: this.form.id,
|
||||
guardRate: this.form.guardRate,
|
||||
giftRate: this.form.giftRate,
|
||||
videoRate: this.form.videoRate,
|
||||
}).then(data => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.buttonLoading = false;
|
||||
this.open = false
|
||||
this.$emit('refreshDataList')
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,33 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="蜜瓜号" prop="usercode">
|
||||
<el-input
|
||||
v-model="queryParams.usercode"
|
||||
placeholder="请输入蜜瓜号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="auditStatus">
|
||||
<el-select v-model="queryParams.auditStatus" placeholder="审核状态" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in auditStatusList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -13,22 +40,62 @@
|
||||
|
||||
<el-table v-loading="loading" :data="userAlbumList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="" align="center" prop="id" v-if="true"/>
|
||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
||||
<el-table-column label="" align="center" prop="url" />
|
||||
<el-table-column label="状态 0 未审核 1 审核通过 2 审核未通过" align="center" prop="status" />
|
||||
<el-table-column label="审核时间" align="center" prop="auditTime" width="180" />
|
||||
<el-table-column label="审核备注" align="center" prop="auditRemark" />
|
||||
<el-table-column label="是否为大咖 " align="center" prop="isAnchor" />
|
||||
<el-table-column label="审核状态" align="center" prop="auditStatus">
|
||||
<template v-slot="scope">
|
||||
<cai-dict-tag :options="auditStatusList" :value="scope.row.auditStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="蜜瓜号" align="center" prop="usercode"/>
|
||||
<el-table-column label="手机号" align="center" prop="mobile"/>
|
||||
<el-table-column label="昵称" align="center" prop="nickname"/>
|
||||
<el-table-column label="头像" align="center" prop="avatar">
|
||||
<template v-slot="scope">
|
||||
<image-avatar :src="scope.row.avatar"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="性别" align="center" prop="gender">
|
||||
<template v-slot="scope">
|
||||
<cai-dict-tag :options="genderList" :value="scope.row.gender"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主播" align="center" prop="isAnchor">
|
||||
<template v-slot="scope">
|
||||
<cai-dict-tag :options="isAnchorList" :value="scope.row.isAnchor"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template v-slot="scope">
|
||||
<cai-dict-tag :options="isAnchorList" :value="scope.row.isAnchor"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="相册" align="center" prop="url">
|
||||
<template v-slot="scope">
|
||||
<image-preview :src="scope.row.url" width="40px" height="40px"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="新增时间" align="center" prop="createTime" />
|
||||
<el-table-column label="审核时间" align="center" prop="auditTime" />
|
||||
<!-- <el-table-column label="审核备注" align="center" prop="auditRemark" />-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-if="scope.row.auditStatus === 1"
|
||||
@click="handleAudit(scope.row,3)"
|
||||
v-hasPermi="['cai:userAlbum:edit']"
|
||||
>修改</el-button>
|
||||
>通过
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-if="scope.row.auditStatus === 1"
|
||||
@click="handleAudit(scope.row,2)"
|
||||
v-hasPermi="['cai:userAlbum:edit']"
|
||||
>不通过
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@@ -51,12 +118,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUserAlbum, getUserAlbum, delUserAlbum, addUserAlbum, updateUserAlbum } from "@/api/cai/userAlbum";
|
||||
import {delUserAlbum, listUserAlbum, updateUserAlbum} from "@/api/cai/userAlbum";
|
||||
import {auditStatusList, genderList, isAnchorList, userStatusList, yesOrNoList} from "@/constant/statusMap";
|
||||
|
||||
export default {
|
||||
name: "UserAlbum",
|
||||
data() {
|
||||
return {
|
||||
genderList, userStatusList, yesOrNoList, isAnchorList,auditStatusList,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -75,12 +144,9 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: undefined,
|
||||
url: undefined,
|
||||
status: undefined,
|
||||
auditTime: undefined,
|
||||
auditRemark: undefined,
|
||||
isAnchor: undefined
|
||||
auditStatus: 1,
|
||||
mobile: undefined,
|
||||
usercode: undefined,
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -113,47 +179,21 @@ export default {
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加相册管理";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
handleAudit(row,auditStatus){
|
||||
let message = auditStatus === 3 ? "通过" : "不通过";
|
||||
this.$modal.confirm('是否确认'+message+'用户为"' + row.usercode + '"的相册?').then(() => {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getUserAlbum(id).then(response => {
|
||||
return updateUserAlbum({
|
||||
id: row.id,
|
||||
auditStatus: auditStatus
|
||||
});
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改相册管理";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.id != null) {
|
||||
updateUserAlbum(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addUserAlbum(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
|
||||
Reference in New Issue
Block a user