fix:项目初始化

This commit is contained in:
ouyangxiu
2025-06-10 17:11:41 +07:00
commit db9bffd2c5
713 changed files with 159746 additions and 0 deletions
+186
View File
@@ -0,0 +1,186 @@
<template>
<div>
<el-row class="table-form">
<el-form :inline="true" :model="searchData" class="form-inline" size="mini">
<el-form-item>
<el-input @clear="onClear('userId')" clearable placeholder="用户ID" v-model.number="searchData.param.userId" />
</el-form-item>
<el-form-item>
<el-date-picker :default-time="['00:00:00', '23:59:59']" end-placeholder="结束日期" range-separator="" start-placeholder="开始日期" type="datetimerange" v-model="time" value-format="yyyy-MM-ddTHH:mm:ss+08:00" />
</el-form-item>
<el-form-item>
<el-button @click="onSearch" icon="el-icon-search" plain type="primary">搜索</el-button>
<el-button @click="refreshView" icon="el-icon-refresh" plain type="info">刷新</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table :data="tableData" element-loading-text="拼命加载中" v-loading="loading" @sort-change="sortChange" border height="750" highlight-current-row style="width: 100%">
<el-table-column align="center" label="封禁ID" width="150">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column align="center" label="封禁原因" width="100">
<template slot-scope="scope">{{
scope.row.cause | changeCause
}}</template>
</el-table-column>
<el-table-column align="center" label="更多原因" width="150">
<template slot-scope="scope">{{ scope.row.content }}</template>
</el-table-column>
<el-table-column align="center" label="封禁截图" width="150">
<template slot-scope="scope">
<ShowImg style="width: 50px; height: 50px; margin: 0 auto" :urls="scope.row.imgUrl"></ShowImg>
</template>
</el-table-column>
<el-table-column align="center" label="用户头像">
<template slot-scope="scope">
<ShowImg style="width: 50px; height: 50px; margin: 0 auto" :urls="scope.row.userAvatar"></ShowImg>
</template>
</el-table-column>
<el-table-column align="center" label="用户ID">
<template slot-scope="scope">{{ scope.row.userId }}</template>
</el-table-column>
<el-table-column align="center" label="用户IP" width="120">
<template slot-scope="scope">{{ scope.row.userIp }}</template>
</el-table-column>
<el-table-column align="center" label="用户昵称">
<template slot-scope="scope">{{ scope.row.userNickName }}</template>
</el-table-column>
<el-table-column align="center" label="用户当前状态">
<template slot-scope="scope">
<el-button :type="scope.row.userStatus ? 'danger' : 'success'" plain size="mini">{{ scope.row.userStatus ? "封禁" : "正常" }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="封禁时间" width="150">
<template slot-scope="scope">{{
scope.row.createdAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="100">
<template slot-scope="scope">
<el-button v-if="scope.row.userStatus" @click="unbanUser(scope.row, 'status')" size="mini" type="success">解封</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<!-- 分页 -->
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[10, 20, 30, 50, 100]" :total="totals" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
</div>
</div>
</template>
<script>
import { userBanlogs } from '@/api/user/banList'
import { userUnBan } from '@/api/user/userList'
import ShowImg from '@/components/ShowImg/index.vue'
export default {
name: 'BanList',
components: {
ShowImg,
},
data() {
return {
loading: true, // 列表加载状态
totals: 0, // 数据总条数
time: undefined,
searchData: {
param: {
userId: undefined, // 作者id
start: undefined,
end: undefined,
},
pageNum: 1,
pageSize: 10,
},
tableData: [],
}
},
mounted() {
this.onSubmit()
},
methods: {
//TODO:请求封禁日志列表
onSubmit() {
this.loading = true
if (this.time) {
this.searchData.param.startAt = this.time[0]
this.searchData.param.endAt = this.time[1]
} else {
this.searchData.param.startAt = undefined
this.searchData.param.endAt = undefined
}
userBanlogs(this.searchData).then((res) => {
if (res.code === 200) {
this.tableData = res.data.list
this.totals = res.data.total
} else {
this.tableData = []
this.totals = 0
this.$message.error('请求列表失败')
}
this.loading = false
})
},
//TODO:用户解封
unbanUser(row) {
userUnBan({ userId: row.userId }).then((res) => {
if (res.code === 200) {
this.$message.success('解封成功')
this.onSubmit()
} else {
this.$message.error('解封失败')
}
})
},
// 搜索按钮调用方法
onSearch() {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.onSubmit()
},
// 升序降序
sortChange(columns) {
if (columns.order === 'ascending') {
this.searchData.finishAtsort = -1
this.searchData.amountSort = 1
} else if (columns.order === 'descending') {
this.searchData.finishAtsort = 1
this.searchData.amountSort = -1
}
this.onSubmit()
},
// 刷新
refreshView() {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.onSubmit()
},
// 清理搜索框
onClear(key) {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.searchData.param[key] = undefined
this.onSubmit()
},
// 切换列表条数
handleSizeChange(val) {
this.searchData.pageSize = Number(val)
this.onSubmit()
},
// 切换列表页码
handleCurrentChange(val) {
this.searchData.pageNum = Number(val)
this.onSubmit()
},
},
}
</script>
@@ -0,0 +1,166 @@
<template>
<el-dialog :title="title" :visible.sync="Visible" width="900px" center class="ac-dialog" :close-on-click-modal="false" @close="close">
<el-form :inline="true" :model="form" :rules="rules" ref="ruleForm" class="demo-form-inline" label-width="120px" label-position="right">
<el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="排序">
<el-input placeholder="请输入排序" v-model.number="form.rank">
</el-input>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="名称">
<el-input placeholder="请输入名称" v-model="form.name">
</el-input>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="简介">
<el-input placeholder="请输入简介" v-model="form.introduction">
</el-input>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="用户id">
<el-input placeholder="请输入用户id" v-model.number="form.userId">
</el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="价格">
<el-input v-model.number="form.price" placeholder="请输入价格" />
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="圈子图片">
<UploadImg @onRemove="onRemove('image')" @changeImgUrl="changeImage" :img="form.image"> </UploadImg>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="圈子背景图">
<UploadImg @onRemove="onRemove('backgroundImage')" @changeImgUrl="changeBackgroundImage" :img="form.backgroundImage"> </UploadImg>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="是否推荐">
<el-select placeholder="请选择是否推荐" v-model="form.recommend" style="width: 163px">
<el-option label="推荐" :value="true" />
<el-option label="不推荐" :value="false" />
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="虚拟订阅数">
<el-input v-model.number="form.fakeSubscribes" placeholder="请输入虚拟订阅数" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="Visible = false"> </el-button>
<el-button type="primary" @click="submit('ruleForm')"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { updateCircle,addCircle } from '@/api/user/circleList'
import UploadImg from '@/components/UploadImg/index'
import { changeMoneyFen, changeMoneyYuan } from '@/filters'
export default {
name: 'EditCircle',
props: ['data', 'creatData'],
data() {
return {
Visible: true,
title: '',
// 表单数据
form: {
name:undefined,
introduction:undefined, //简介
fakeSubscribes:undefined, // 虚拟订阅数
rank:undefined, // 排序
image:undefined,
backgroundImage:undefined,
recommend: undefined, // 是否推荐
price: undefined // 价格
},
}
},
components:{
UploadImg
},
mounted() {
this.title = this.data.title
if (this.title === '编辑') {
this.form = { ...this.data.data, ...{}}
this.form.price = changeMoneyYuan(this.data.data.price)
}
},
methods: {
// 移除图片地址到form表单
onRemove(key) {
this.form[key] = ''
},
changeImage(data){
this.form.image = data
},
changeBackgroundImage(data){
this.form.backgroundImage = data
},
// TODO:编辑圈子列表数据
update(data) {
updateCircle({ id: data.id, param: data }).then((res) => {
if (res.code === 200) {
this.$message.success('更新成功')
this.close()
} else {
this.$message.error(res.data)
}
})
},
// 新增 
add(data){
addCircle({...data}).then((res) => {
if (res.code === 200) {
this.$message.success('新增成功')
this.close()
} else {
this.$message.error(res.data)
}
})
},
// 添加图片地址到form表单
changeImageUrl(key, data) {
this.form[key] = data
},
// 提交按钮
submit(formName) {
this.form.price = changeMoneyFen(this.form.price)
this.$refs[formName].validate((valid) => {
if (valid) {
if(this.title === '编辑'){
this.update(this.form)
}else{
this.add(this.form)
}
} else {
return false
}
})
},
// 关闭编辑
close() {
this.$emit('close')
}
}
}
</script>
+283
View File
@@ -0,0 +1,283 @@
<template>
<div class="container">
<el-row class="table-form">
<el-form :inline="true" :model="searchData" class="form-inline" size="mini">
<el-form-item>
<el-input placeholder="请输入圈子ID" clearable v-model.number="searchData.circleId" @clear="onClear('circleId')" />
</el-form-item>
<el-form-item>
<el-input placeholder="请输入圈子名称" clearable v-model="searchData.name" @clear="onClear('name')" />
</el-form-item>
<el-form-item>
<el-input placeholder="请输入创建者ID" clearable v-model.number="searchData.userId" @clear="onClear('userId')" />
</el-form-item>
<el-form-item>
<el-select placeholder="请选推荐状态" clearable v-model="searchData.recommend" @clear="onClear('recommend')">
<el-option label="推荐" :value="true"></el-option>
<el-option label="不推荐" :value="false"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="add" icon="el-icon-circle-plus-outline" plain type="success">新增</el-button>
<el-button @click="onSearch" icon="el-icon-search" plain type="primary">搜索</el-button>
<el-button @click="batchDel" icon="el-icon-search" plain type="primary">批量删除</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table
:data="resData"
element-loading-text="拼命加载中"
border
height="750"
@selection-change="handleSelectionChange"
highlight-current-row
style="width: 100%"
v-loading="loading"
:row-style="{ height: '70px' }">
<el-table-column type="selection" width="50" fixed="left"> </el-table-column>
<el-table-column align="center" width="55px" label="排序">
<template slot-scope="scope">{{ scope.row.rank }}</template>
</el-table-column>
<el-table-column align="center" width="65px" label="圈子ID">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column align="center" width="85px" label="创建者ID">
<template slot-scope="scope">{{ scope.row.userId }}</template>
</el-table-column>
<el-table-column align="center" width="65px" label="圈子名称">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column align="center" show-overflow-tooltip width="65px" label="圈子简介">
<template slot-scope="scope">{{ scope.row.introduction }}</template>
</el-table-column>
<el-table-column align="center" width="85px" label="解锁圈子的价格">
<template slot-scope="scope">{{ scope.row.price / 100 }}</template>
</el-table-column>
<el-table-column align="center" width="85px" label="推荐状态">
<template slot-scope="scope">{{ scope.row.recommend ? '推荐' : '不推荐' }}</template>
</el-table-column>
<el-table-column align="center" width="155px" label="虚订阅数">
<template slot-scope="scope">{{ scope.row.fakeSubscribes }}</template>
</el-table-column>
<el-table-column align="center" label="圈子图片">
<template slot-scope="scope">
<ShowImg style="width: 40px; height: 40px; margin: 0 auto" :urls="scope.row.image"></ShowImg>
</template>
</el-table-column>
<el-table-column align="center" label="圈子背景图">
<template slot-scope="scope">
<ShowImg style="width: 40px; height: 40px; margin: 0 auto" :urls="scope.row.backgroundImage"></ShowImg>
</template>
</el-table-column>
<el-table-column align="center" width="155px" label="合集数量">
<template slot-scope="scope">{{ scope.row.comics }}</template>
</el-table-column>
<el-table-column align="center" width="155px" label="视频数量">
<template slot-scope="scope">{{ scope.row.videos }}</template>
</el-table-column>
<el-table-column align="center" width="155px" label="订阅数">
<template slot-scope="scope">{{ scope.row.subscribes }}</template>
</el-table-column>
<el-table-column align="center" width="155px" label="备注">
<template slot-scope="scope">{{ scope.row.remark }}</template>
</el-table-column>
<el-table-column align="center" width="90px" label="最新上架时间">
<template slot-scope="scope">{{ scope.row.contentAddedAt | BeiJingTime }}</template>
</el-table-column>
<el-table-column align="center" width="90px" label="创建时间">
<template slot-scope="scope">{{ scope.row.createdAt | BeiJingTime }}</template>
</el-table-column>
<el-table-column align="center" width="90px" label="更新时间">
<template slot-scope="scope">{{ scope.row.updatedAt | BeiJingTime }}</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="250">
<template slot-scope="scope">
<!-- <el-button @click="subscription(scope.$index, scope.row)" size="mini" type="primary">订阅价格
</el-button> -->
<el-button @click="handleEdit(scope.$index, scope.row)" size="mini" type="primary">编辑 </el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<div class="table-pagination">
<el-pagination
:current-page="searchData.pageNum"
:page-size="searchData.pageSize"
:page-sizes="[10, 20, 30, 50, 100]"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper"/>
</div>
<!-- 新增及编辑 -->
<EditCircle :data="editData" :creatData="creatData" v-if="editVisible" @close="closeEdit" />
</div>
</template>
<script>
import { circleListSearch, circleDelAll } from '@/api/user/circleList'
import EditCircle from './components/editCircle'
import ShowImg from '@/components/ShowImg/index.vue'
export default {
name: 'CircleList',
components: { EditCircle, ShowImg },
data() {
return {
// 请求列表参数
searchData: {
userId: undefined, // 创建者ID
circleId: undefined, // 圈子iID
pageNum: 1,
pageSize: 10,
name: undefined,
recommend: undefined
},
resData: [], // el-table表格数据
total: 0, // 数据总条数
loading: true, // 列表加载状态
editVisible: false, // 编辑圈子弹窗
SubscriptionPopup: false, // 订阅价格弹窗
auditVisible: false,
// 编辑数据
editData: {
title: '新增',
data: {}
},
// 创建圈子数据
creatData: {},
// 推荐状态
RecommendedStatus: [
{
value: '推荐'
}
],
selectArr: []
}
},
mounted() {
this.getCircleListSearch()
// 如果是从创建圈子进来的
if (this.$route.query.creat === '1') {
this.editVisible = true
const { creat, id, mobile } = this.$route.query
this.creatData = {
creat,
id,
mobile
}
}
},
methods: {
batchDel() {
if (this.selectArr.length) {
this.$confirm('确认批量删除?').then(() => {
const data = []
this.selectArr.forEach(item => {
data.push(item.id)
})
circleDelAll({ ids: data }).then(res => {
if (res.code === 200) {
this.$message.success('删除圈子成功')
} else {
this.$message.error('删除圈子失败')
}
})
})
} else {
return this.$message.error('请选择圈子')
}
},
// 新增按钮
add() {
this.editVisible = true
this.editData = {
title: '新增',
data: {}
}
},
// 批量选择
handleSelectionChange(val) {
this.selectArr = val
},
// TODO:请求圈子列表数据
getCircleListSearch() {
this.loading = true
circleListSearch(this.searchData).then(res => {
if (res.code === 200) {
this.resData = res.data.list
this.total = res.data.total
} else {
this.$message.error('请求列表失败!')
this.resData = []
this.total = 0
}
this.loading = false
})
},
onSearch() {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.getCircleListSearch()
},
// 清空某一项筛选列表
onClear(key) {
this.searchData[key] = undefined
this.getCircleListSearch()
},
subscription(index, row) {
this.SubscriptionPopup = true
this.editData = {
data: row
}
},
handleEdit(index, row) {
this.editVisible = true
this.editData = {
title: '编辑',
data: row
}
this.creatData = {}
},
handleCheck(row) {
this.auditVisible = true
this.editData = {
title: '审核',
data: row
}
},
// 切换每页数据量
handleSizeChange(val) {
this.searchData.pageSize = val
this.getCircleListSearch()
},
// 切换页数
handleCurrentChange(val) {
this.searchData.pageNum = val
this.getCircleListSearch()
},
// 关闭编辑弹窗
closeEdit() {
this.editData = {
title: '新增',
data: {}
}
this.editVisible = false
this.auditVisible = false
this.SubscriptionPopup = false
this.getCircleListSearch()
}
}
}
</script>
@/api/user/circleList
@@ -0,0 +1,105 @@
<!--
* @Author:
* @Mail:
* @Date: 2022-06-09 17:13:18
* @LastEditTime: 2022-06-10 11:02:09
* @LastEditors:
* @FilePath: /comics-admin/src/views/user/feedbackList/components/AddOrEdit.vue
-->
<template>
<el-dialog :title="title" :visible.sync="Visible" width="700px" center class="ac-dialog" :close-on-click-modal="false" @close="close">
<el-form :inline="true" :model="form" :rules="rules" ref="ruleForm" class="demo-form-inline" label-width="100px" label-position="right">
<el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="反馈处理状态" prop="status">
<el-select placeholder="请选择反馈处理状态" clearable v-model="form.status">
<el-option label="处理中" :value="0" />
<el-option label="已忽略" :value="1" />
<el-option label="处理完成" :value="2" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="Visible = false"> </el-button>
<el-button type="primary" @click="submit('ruleForm')"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { feedbackUpdate } from '@/api/user/feedbackList'
export default {
name: 'AddOrEdit',
props: ['data'],
data() {
return {
Visible: true,
title: '',
// 表单数据
form: {
content: undefined, // 'string',反馈内容
sysInfo: undefined, // 'string',系统信息
id: undefined, //'string',
pics: undefined, //['string'],
status: undefined, // 0,反馈处理状态
type: undefined, // 0,反馈类型
userId: undefined, // 0,反馈人Id
},
rules: {},
}
},
mounted() {
this.title = this.data.title
if (this.title === '编辑') {
this.form = JSON.parse(JSON.stringify(this.data.data))
}
},
methods: {
//TODO:新增视频分类数据
add(data) {
mediacategoryAdd(data).then((res) => {
if (res.code === 200) {
this.$message.success('新增成功')
this.Visible = false
} else {
this.$message.error('新增失败')
}
})
},
//TODO:编辑视频分类数据
update(data) {
feedbackUpdate(data).then((res) => {
if (res.code === 200) {
this.$message.success('更新成功')
this.Visible = false
} else {
this.$message.error('更新失败')
}
})
},
// 提交按钮
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.title === '新增') {
this.add(this.form)
} else if (this.title === '编辑') {
this.update(this.form)
}
} else {
return false
}
})
},
// 关闭编辑
close() {
this.$emit('close')
},
},
}
</script>
@@ -0,0 +1,89 @@
<template>
<el-dialog :title="title" :visible.sync="Visible" width="700px" center class="ac-dialog" :close-on-click-modal="false" @close="close">
<el-form :inline="true" :rules="rules" :model="form" ref="ruleForm" class="demo-form-inline" label-width="150px" label-position="right">
<el-row :gutter="24">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
<el-form-item label="系统消息标题">
<el-input placeholder="请输入系统消息标题" v-model="form.title" style="width: 400px" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
<el-form-item label="跳转链接" prop="content">
<el-input placeholder="请输入跳转链接" v-model="form.link" style="width: 400px" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
<el-form-item label="内容" prop="content">
<el-input placeholder="请输入内容" v-model="form.content" type="textarea" style="width: 400px" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="Visible = false"> </el-button>
<el-button type="primary" @click="submit('ruleForm')"> </el-button>
</div>
</el-dialog>
</template>
<script>
import moment from 'moment'
import { msgAdd } from '@/api/activity/msg'
export default {
name: 'AddOrEdit',
props: ['data'],
components: {},
data() {
return {
Visible: true,
title: '',
// 表单数据
form: {
content: undefined, // "string",内容
title: undefined, // "string",标题
},
rules: {
content: [{ required: true, message: '必填', trigger: 'blur' }],
},
}
},
mounted() {
this.title = this.data.title
},
methods: {
//TODO:新增消息列表数据
add(data) {
msgAdd(data).then((res) => {
if (res.code === 200) {
this.$message.success('新增成功')
this.Visible = false
} else {
this.$message.error('新增失败')
}
})
},
// 提交按钮
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
const data = { ...this.form,userId:this.data.data.userId }
this.add(data)
} else {
return false
}
})
},
// 关闭编辑
close() {
this.$emit('close')
},
},
}
</script>
+172
View File
@@ -0,0 +1,172 @@
<!-- 提现列表 -->
<template>
<div>
<el-row class="table-form">
<el-form :inline="true" :model="searchData" class="form-inline" label-width="80px" ref="form" size="mini">
<el-form-item>
<el-input placeholder="用户ID" clearable v-model.number="searchData.userId" @clear="onClear('userId')" />
</el-form-item>
<el-form-item>
<el-select placeholder="类型" clearable v-model="searchData.fType" @clear="onClear('fType')">
<el-option label="用户反馈" :value="1" />
<el-option label="程序反馈" :value="2" />
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="onSearch" icon="el-icon-search" plain type="primary">搜索</el-button>
<el-button @click="refreshView" icon="el-icon-refresh" plain type="info">刷新</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table v-loading="loading" :data="tableData" border height="750" highlight-current-row style="width: 100%" :row-style="{ height: '70px' }">
<el-table-column align="center" label="反馈人ID">
<template slot-scope="scope">{{ scope.row.userId }}</template>
</el-table-column>
<el-table-column align="center" label="反馈内容" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.content }}</template>
</el-table-column>
<el-table-column align="center" label="反馈图片" width="100px">
<template slot-scope="scope">
<ShowImg style="width: 70px; height: 40px; margin: 0 auto" :urls="scope.row.pics"></ShowImg>
</template>
</el-table-column>
<el-table-column align="center" label="系统信息" width="200">
<template slot-scope="scope">{{ scope.row.sysInfo }}</template>
</el-table-column>
<el-table-column align="center" label="反馈类型">
<template slot-scope="scope">{{
scope.row.type | changeFeedBackType
}}</template>
</el-table-column>
<el-table-column align="center" label="处理状态">
<template slot-scope="scope">{{
scope.row.status | changeFeedBackStatu
}}</template>
</el-table-column>
<el-table-column align="center" label="创建时间">
<template slot-scope="scope">{{
scope.row.createdAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="150">
<template slot-scope="scope">
<el-button @click="handleEdit(scope.$index, scope.row)" size="mini" type="primary">编辑</el-button>
<el-button @click="handleCallBack(scope.$index, scope.row)" size="mini" type="success">回复</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<!-- 分页 -->
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[10, 20, 30, 50, 100]" :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
</div>
<Edit :data="editData" v-if="editVisible" @close="closeEdit" />
<CallBack :data="editData" v-if="callBackVisible" @close="closeEdit" />
</div>
</template>
<script>
import { feedbackList, feedbackUpdate } from '@/api/user/feedbackList'
import { feedBackTypeList } from '@/filters/user/feedbackList'
import Edit from './components/AddOrEdit'
import CallBack from './components/CallBack'
import ShowImg from '@/components/ShowImg/index.vue'
export default {
name: 'FeedbackList',
components: { Edit, ShowImg,CallBack },
data() {
return {
total: 0,
loading: true, // 列表加载状态
feedBackTypeList: feedBackTypeList(),
// 请求数据
searchData: {
pageNum: 1,
pageSize: 10,
},
tableData: [],
editVisible: false, // 新增或编辑弹出框
callBackVisible:false,
editData: {
title: '回复',
data: undefined,
},
}
},
mounted() {
// 获取表格列表
this.onSubmit()
},
methods: {
// 回复
handleCallBack(index,row){
this.callBackVisible = true
this.editData = {
title: '新增',
data: row,
}
},
// TODO:请求用户反馈列表数据
onSubmit(data) {
feedbackList(this.searchData).then((res) => {
if (res.code === 200) {
this.tableData = res.data.list
this.total = res.data.total
} else {
this.tableData = []
this.total = 0
}
this.loading = false
})
},
// 编辑按钮
handleEdit(index, row) {
this.editVisible = true
this.editData = {
title: '编辑',
data: row,
}
},
onSearch() {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.onSubmit()
},
// 刷新
refreshView() {
this.onSubmit()
},
// 清理列表请求筛选项
onClear(key) {
this.searchData[key] = undefined
this.onSubmit()
},
// 切换每页条数
handleSizeChange(val) {
this.searchData.pageSize = Number(val)
this.onSubmit()
},
// 翻页
handleCurrentChange(val) {
this.searchData.pageNum = Number(val)
this.onSubmit()
},
closeEdit() {
this.editData = {}
this.editVisible = false
this.callBackVisible = false
this.onSubmit()
},
},
}
</script>
@@ -0,0 +1,183 @@
<template>
<div class="container">
<el-row class="table-form">
<el-form :inline="true" :model="searchData" class="form-inline" size="mini">
<el-form-item>
<el-input placeholder="请输入圈子ID" clearable v-model.number="searchData.id" @clear="onClear('id')" />
</el-form-item>
<el-form-item>
<el-input placeholder="请输入创建者ID" clearable v-model.number="searchData.userId" @clear="onClear('userId')" />
</el-form-item>
<el-form-item>
<el-button @click="onSearch" icon="el-icon-search" plain type="primary">搜索</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table :data="resData" element-loading-text="拼命加载中" border height="750" highlight-current-row style="width: 100%" v-loading="loading" :row-style="{ height: '70px' }">
<el-table-column align="center" label="表ID">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column align="center" label="圈子ID">
<template slot-scope="scope">{{ scope.row.circleId }}</template>
</el-table-column>
<el-table-column align="center" label="创建者ID">
<template slot-scope="scope">{{ scope.row.userId }}</template>
</el-table-column>
<el-table-column align="center" label="创建时间">
<template slot-scope="scope">{{ scope.row.createdAt | BeiJingTime }}</template>
</el-table-column>
<el-table-column align="center" label="更新时间">
<template slot-scope="scope">{{ scope.row.updatedAt | BeiJingTime }}</template>
</el-table-column>
<!-- <el-table-column align="center" fixed="right" label="操作" width="250">
<template slot-scope="scope">
</template>
</el-table-column> -->
</el-table>
</el-col>
</el-row>
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[10, 20, 30, 50, 100]" :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
</div>
<!-- 新增及编辑 -->
<EditCircle :data="editData" :creatData="creatData" v-if="editVisible" @close="closeEdit" />
</div>
</template>
<script>
import {
subscribedCircle
} from '@/api/user/circleList'
export default {
name: 'CircleList',
data() {
return {
// 请求列表参数
searchData: {
userId: undefined, // 圈住ID
id: undefined, // 圈子iID
pageNum: 1,
pageSize: 10,
recommend: undefined
},
resData: [], // el-table表格数据
total: 0, // 数据总条数
loading: true, // 列表加载状态
editVisible: false, // 编辑圈子弹窗
SubscriptionPopup: false, // 订阅价格弹窗
auditVisible: false,
// 编辑数据
editData: {
title: '新增',
data: {}
},
// 创建圈子数据
creatData: {},
// 推荐状态
RecommendedStatus: [
{
value: '推荐'
}
]
}
},
mounted() {
this.getsubscribedCircle()
// 如果是从创建圈子进来的
if (this.$route.query.creat === '1') {
this.editVisible = true
const { creat, id, mobile } = this.$route.query
this.creatData = {
creat,
id,
mobile
}
}
},
methods: {
// TODO:请求圈子列表数据
getsubscribedCircle() {
this.loading = true
subscribedCircle(this.searchData).then((res) => {
if (res.code === 200) {
this.resData = res.data.list
this.total = res.data.total
} else {
this.$message.error('请求列表失败!')
this.resData = []
this.total = 0
}
this.loading = false
})
},
onSearch() {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.getsubscribedCircle()
},
// 清空某一项筛选列表
onClear(key) {
this.searchData[key] = undefined
this.getsubscribedCircle()
},
subscription(index, row) {
this.SubscriptionPopup = true
this.editData = {
data: row
}
},
handleEdit(index, row) {
this.editVisible = true
this.editData = {
title: '编辑',
data: row
}
this.creatData = {}
},
handleCheck(row) {
this.auditVisible = true
this.editData = {
title: '审核',
data: row
}
},
// 切换每页数据量
handleSizeChange(val) {
this.searchData.pageSize = val
this.getsubscribedCircle()
},
// 切换页数
handleCurrentChange(val) {
this.searchData.pageNum = val
this.getsubscribedCircle()
},
// 关闭编辑弹窗
closeEdit() {
this.editData = {
title: '新增',
data: {}
}
this.editVisible = false
this.auditVisible = false
this.SubscriptionPopup = false
this.getsubscribedCircle()
}
}
}
</script>
@/api/user/circleList
+146
View File
@@ -0,0 +1,146 @@
<template>
<div>
<el-row class="table-form">
<el-form :inline="true" :model="searchData" class="form-inline" size="mini">
<el-form-item>
<el-button @click="refreshView" icon="el-icon-refresh" plain type="info">刷新</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table :data="tableData" border height="750" highlight-current-row style="width: 100%" :row-style="{ height: '70px' }">
<el-table-column align="center" label="统计日期" width="140">
<template slot-scope="scope">{{scope.row.date}}</template>
</el-table-column>
<el-table-column align="center" label="每日新增总数">
<el-table-column align="center" label="礼包积分">
<template slot-scope="scope">
{{scope.row.addInfos.typeCardNum}}
</template>
</el-table-column>
<el-table-column align="center" label="签到积分">
<template slot-scope="scope">
{{scope.row.addInfos.typeCheckinNum}}
</template>
</el-table-column>
<el-table-column align="center" label="兑换码积分">
<template slot-scope="scope">
{{scope.row.addInfos.typeCodeNum}}
</template>
</el-table-column>
<el-table-column align="center" label="任务积分">
<template slot-scope="scope">
{{scope.row.addInfos.typeTaskNum}}
</template>
</el-table-column>
<el-table-column align="center" label="合计">
<template slot-scope="scope">
{{scope.row.addCount}}
</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="每日消耗总数">
<el-table-column align="center" label="vip天数">
<template slot-scope="scope">
{{scope.row.useInfos.typeVipDays?-scope.row.useInfos.typeVipDays:scope.row.useInfos.typeVipDays}}
</template>
</el-table-column>
<el-table-column align="center" label="观影劵数">
<template slot-scope="scope">
{{scope.row.useInfos.typeFreeTimes?-scope.row.useInfos.typeFreeTimes:scope.row.useInfos.typeFreeTimes}}
</template>
</el-table-column>
<el-table-column align="center" label="金币数量">
<template slot-scope="scope">
{{scope.row.useInfos.typeCoinNum?-scope.row.useInfos.typeCoinNum:scope.row.useInfos.typeCoinNum}}
</template>
</el-table-column>
<el-table-column align="center" label="折扣劵数">
<template slot-scope="scope">
{{scope.row.useInfos.typeAllCardTimes?-scope.row.useInfos.typeAllCardTimes:scope.row.useInfos.typeAllCardTimes}}
</template>
</el-table-column>
<el-table-column align="center" label="ai脱衣次数">
<template slot-scope="scope">
{{scope.row.useInfos.typeTopicCardTimes?-scope.row.useInfos.typeTopicCardTimes:scope.row.useInfos.typeTopicCardTimes}}
</template>
</el-table-column>
<el-table-column align="center" label="ai换脸次数">
<template slot-scope="scope">
{{scope.row.useInfos.typeFaceCount?-scope.row.useInfos.typeFaceCount:scope.row.useInfos.typeFaceCount}}
</template>
</el-table-column>
<el-table-column align="center" label="合计">
<template slot-scope="scope">
{{scope.row.useCount?-scope.row.useCount:scope.row.useCount}}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-col>
</el-row>
<!-- 分页 -->
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-sizes="[10, 20, 30, 50, 100]" :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
</div>
</div>
</template>
<script>
import { tpList } from '@/api/user/tpList'
export default {
name: 'TpList',
data() {
return {
// 请求列表筛选参数
searchData: {
pageNum: 1,
pageSize: 10,
},
tableData: [],
total: 0,
}
},
mounted() {
this.getData()
},
methods: {
//TODO:请求用户积分统计列表
getData() {
tpList(this.searchData).then((res) => {
if (res.code === 200) {
this.tableData = res.data.list
this.total = res.data.total
} else {
this.tableData = []
this.total = 0
}
})
},
// 刷新
refreshView() {
this.onSearch()
},
onSearch() {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.getData()
},
// 切换每页显示的条数触发
handleSizeChange(val) {
this.searchData.pageSize = val
this.getData()
},
// 切换页码时触发
handleCurrentChange(val) {
this.searchData.pageNum = val
this.getData()
},
},
}
</script>
+163
View File
@@ -0,0 +1,163 @@
<template>
<div class="pf-warpper avlist">
<el-row class="table-form">
<el-form :inline="true" :model="searchData" class="form-inline" size="mini">
<el-form-item>
<el-input placeholder="请输入被邀请码" clearable v-model="searchData.agentInviteCode" @clear="onClear('agentInviteCode')" />
</el-form-item>
<el-form-item>
<el-input placeholder="请输入用户ID" clearable v-model.number="searchData.id" @clear="onClear('id')" />
</el-form-item>
<el-form-item>
<el-input placeholder="请输入邀请码" clearable v-model="searchData.inviteCode" @clear="onClear('inviteCode')" />
</el-form-item>
<el-form-item>
<el-select placeholder="请选择排序方式" clearable v-model="searchData.sortType" @clear="onClear('sortType')">
<el-option v-for="item in agentSortTypeList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="onSearch" icon="el-icon-search" plain type="primary">搜索</el-button>
<el-button @click="onSearch" icon="el-icon-circle-plus-outline" plain type="info">刷新</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table :data="resData" element-loading-text="拼命加载中" border height="750" highlight-current-row style="width: 100%" v-loading="loading" :row-style="{ height: '70px' }">
<el-table-column align="center" label="用户ID">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column align="center" label="邀请码">
<template slot-scope="scope">{{ scope.row.inviteCode }}</template>
</el-table-column>
<el-table-column align="center" label="被邀请码">
<template slot-scope="scope">{{ scope.row.agentInviteCode }}</template>
</el-table-column>
<el-table-column align="center" label="代理总业绩">
<template slot-scope="scope">{{ scope.row.proxyTotalIncome | changeMoneyYuan }}</template>
</el-table-column>
<el-table-column align="center" label="当月推广收益">
<template slot-scope="scope">{{ scope.row.currentMonthIncome | changeMoneyYuan }}</template>
</el-table-column>
<el-table-column align="center" label="当月推广人数">
<template slot-scope="scope">{{ scope.row.currentMonthProxy }}</template>
</el-table-column>
<el-table-column align="center" label="一级推广用户">
<template slot-scope="scope">{{ scope.row.level1 }}</template>
</el-table-column>
<el-table-column align="center" label="二级推广用户">
<template slot-scope="scope">{{ scope.row.level2 }}</template>
</el-table-column>
<el-table-column align="center" label="三级推广用户">
<template slot-scope="scope">{{ scope.row.level3 }}</template>
</el-table-column>
<el-table-column align="center" label="四级推广用户">
<template slot-scope="scope">{{ scope.row.level4 }}</template>
</el-table-column>
<el-table-column align="center" label="上次收益时间" width="180">
<template slot-scope="scope">{{
scope.row.lastIncomeAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="上次推广时间" width="180">
<template slot-scope="scope">{{
scope.row.lastProxyAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="创建时间" width="180">
<template slot-scope="scope">{{
scope.row.createdAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="更新时间" width="180">
<template slot-scope="scope">{{
scope.row.updatedAt | BeiJingTime
}}</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[10, 20, 30, 50, 100]" :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
</div>
</div>
</template>
<script>
// 引入模块
import { userAgentList } from '@/api/user/userList'
import { agentSortTypeList } from '@/filters/user/userList'
export default {
name: 'UserAgentList',
data() {
return {
agentSortTypeList: agentSortTypeList(),
// 请求列表参数
searchData: {
pageNum: 1,
pageSize: 10,
sortType: undefined,
agentInviteCode: undefined,
id: undefined,
inviteCode: undefined,
},
resData: [], // el-table表格数据
total: 0, // 数据总条数
totalInfo: undefined,
loading: true, // 列表加载状态
// 编辑数据
editData: {
title: '新增',
data: {},
},
}
},
mounted() {
this.onSearch()
},
methods: {
//TODO:请求代理管理数据列表
getDatingModelList() {
this.loading = true
userAgentList(this.searchData).then((res) => {
if (res.code === 200) {
this.resData = res.data.list
this.total = res.data.total
this.totalInfo = res.data.totalInfo
this.resData.unshift(this.totalInfo)
} else {
this.resData = []
this.total = 0
this.$message.error('请求列表失败!')
}
this.loading = false
})
},
onSearch() {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.getDatingModelList()
},
// 切换每页数据量
handleSizeChange(val) {
this.searchData.pageSize = val
this.getDatingModelList()
},
// 切换页数
handleCurrentChange(val) {
this.searchData.pageNum = val
this.getDatingModelList()
},
// 清空某一项筛选列表
onClear(key) {
this.searchData[key] = undefined
this.getDatingModelList()
},
},
}
</script>
@@ -0,0 +1,164 @@
<template>
<el-dialog :close-on-click-modal="false" title="编辑金币" :visible.sync="Visible" @close="close" center class="ac-dialog"
width="900px">
<el-form :inline="true" :model="form" class="demo-form-inline" label-position="right" label-width="130px"
:rules="rules" ref="ruleForm">
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="余额">
<el-input v-model.number="recharge" disabled>
<template slot="append">金币</template>
</el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="" style="margin-bottom:10px;">
<el-input placeholder="请输入充值金币" v-model.number="coin">
<template slot="append"></template>
</el-input>
<p style="margin:0;color:red">*用户通过充值获得的金币正负皆可</p>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="签到返现收益">
<el-input disabled v-model.number="checkinCashbackIncomeCoin">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="" >
<el-input placeholder="请输入签到返现收益" v-model.number="checkinCashbackIncomeCoin">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="推广收益余额">
<el-input disabled v-model.number="promIncome">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="">
<el-input placeholder="推广收益金币(例:+100)" v-model.number="promIncomeCoin">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="作品收益余额">
<el-input disabled v-model.number="workIncome">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="">
<el-input placeholder="添加收益(例:+100)" v-model.number="workIncomeCoin">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="原因" prop="record">
<el-input v-model="form.record" type="textarea" style="width:400px">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible = false"> </el-button>
<el-button @click="submit('ruleForm')" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { userIncCoin } from '@/api/user/userList'
import { changeMoneyYuan, changeMoneyFen } from '@/filters/index'
export default {
name: 'AddIncCoin',
props: ['data'],
components: {
// UploadImgArr
},
data() {
return {
Visible: true,
recharge: 0, // 充值金币余额展示
coin: undefined, // 充值金币
promIncome: 0, // 收益余额展示
promIncomeCoin: undefined,// 推广收益金币
checkinCashbackIncomeCoin: undefined, //签到返现收益
workIncome: 0, // 作品收益余额展示
workIncomeCoin: 0, // 作品收益余额充值
// 表单数据
form: {
id: 0,
record: undefined
},
rules: {
record: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
created() {
this.form = { ...this.data }
this.recharge = changeMoneyYuan(this.form.recharge)
this.promIncome = changeMoneyYuan(this.form.promIncome)
this.workIncome = changeMoneyYuan(this.form.workIncome)
this.checkinCashbackIncomeCoin = changeMoneyYuan(this.form.checkinCashbackIncome)
},
methods: {
// 提交
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
const data = {
userId: this.form.id,
coin: changeMoneyFen(this.coin),
workIncomeCoin: changeMoneyFen(this.workIncomeCoin),
promIncomeCoin: changeMoneyFen(this.promIncomeCoin),
checkinCashbackIncomeCoin: changeMoneyFen(this.checkinCashbackIncomeCoin),
record: this.form.record // 原因
}
userIncCoin(data).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '添加成功'
})
this.Visible = false
} else {
this.$message({
type: 'error',
message: res.data
})
}
})
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
}
}
}
</script>
@@ -0,0 +1,191 @@
<!--
* @Author: your name
* @Date: 2020-06-04 19:49:03
* @LastEditTime: 2022-05-03 13:49:19
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /comics-admin/src/views/user/userList/components/AddOrEdit.vue
-->
<template>
<el-dialog :close-on-click-modal="false" title="编辑用户" :visible.sync="Visible" @close="close" center class="ac-dialog" width="980px">
<el-form :inline="true" :model="form" class="demo-form-inline" label-position="right" label-width="100px">
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="用户头像">
<UploadImg @changeImgUrl="changeavatarnUrl" :img="form.avatar"></UploadImg>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12" v-if="form.type === 4">
<el-form-item label="背景图">
<UploadImg @changeImgUrl="changebackgroudsUrl" :img="form.backgrouds[0]"></UploadImg>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="昵称">
<el-input placeholder="请输入昵称" v-model="form.nickName" />
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="年龄">
<el-input placeholder="请输入年龄" v-model.number="form.age" />
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="账号" v-if="form.account">
<el-input placeholder="请输入账号" disabled v-model="form.account" />
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="密码" v-if="form.account">
<el-input placeholder="请输入密码" v-model="form.password" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="手机号码">
<el-input placeholder="请输入手机号码" v-model="form.mobile">
<template slot="prepend">
<country-code-selector :countryCode.sync="countryCode" class="tel-container"></country-code-selector>
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24" v-if="form.mobile">
<el-button type="success" @click="getVerificationCode">获取验证码</el-button>
<el-form-item>
<el-input placeholder="请输入验证码" v-model="VerificationCode" :disabled="true" />
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="用户类型">
<el-select placeholder="请选择是否是管理员" v-model="form.type">
<el-option label="正常用户" :value="1" />
<el-option label="原创作者" :value="2" />
<el-option label="up主" :value="3" />
<el-option label="创作者" :value="4" />
<el-option label="up主认证中" :value="5" />
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="分成比例" v-if="form.type === 4">
<el-input placeholder="请输入分成比例" v-model="form.taxRate" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="简介">
<el-input placeholder="请输入简介" v-model="form.introduction" type="textarea" style="width: 600px" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible = false"> </el-button>
<el-button @click="submit" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { userUpdate, userCaptcha } from '@/api/user/userList'
import UploadImg from '@/components/UploadImg/index'
import countryCodeSelector from 'vue-country-code9-selector'
export default {
name: 'AddOrEdit',
props: ['data'],
components: {
UploadImg,
countryCodeSelector
},
data() {
return {
Visible: true,
coin: 0, // 加金币
countryCode: 86,
VerificationCode: '',
// 表单数据
form: {
country: 86,
avatar: 'string',
backgrouds: [],
id: 0,
mobile: 'string',
nickName: 'string',
taxRate: 0,
introduction: undefined,
account: undefined,
password: undefined
}
}
},
created() {
this.form = {
...this.data,
...{ country: Number(this.data.country) || 86 }
}
this.countryCode = this.form.country
this.form.password = undefined
},
methods: {
// 获取验证码
getVerificationCode() {
this.form.country = this.countryCode.toString()
const data = {
mobile: this.form.mobile,
country:this.form.country
}
userCaptcha(data).then((res) => {
if (res.code === 200) {
this.VerificationCode = res.data.code
this.$message({
type: 'success',
message: '获取成功'
})
} else {
this.$message({
type: 'error',
message: '获取失败'
})
}
})
},
// 修改背景图路径
changeavatarnUrl(data) {
this.form.avatar = data
},
changebackgroudsUrl(data) {
this.form.backgrouds[0] = data
},
// 提交
submit() {
this.form.taxRate = Number(this.form.taxRate)
this.form.country = this.countryCode.toString()
userUpdate(this.form).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '更新成功'
})
this.Visible = false
} else {
this.$message({
type: 'error',
message: res.tip
})
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
}
}
}
</script>
@@ -0,0 +1,95 @@
<!--
* @Author: your name
* @Date: 2020-06-04 19:49:03
* @LastEditTime: 2021-02-25 16:11:55
* @LastEditors: 江涛
* @Description: In User Settings Edit
* @FilePath: /web-admin/src/views/user/userList/components/Addcoupon.vue
-->
<template>
<el-dialog :close-on-click-modal="false" title="添加优惠券" :visible.sync="Visible" center width="300px" append-to-body @close="close">
<el-form :inline="true" :model="form" class="demo-form-inline" label-position="right" label-width="100px">
<el-select v-model="form.couponId" filterable placeholder="请选择优惠券 ">
<el-option v-for="item in couponList" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible=false"> </el-button>
<el-button @click="submit" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getDiscountcard } from '@/api/commodity/discountcard'
import { couponHandsel } from '@/api/user/userList'
export default {
name: 'Addcoupon',
props: ['data'],
data() {
return {
Visible: true,
couponList: [],
// 表单数据
form: {
userId: undefined,
couponId: undefined
}
}
},
created() {
this.form.userId = this.data.userId
getDiscountcard({
pageNum: 1,
pageSize: 500,
param: {},
}).then((res) => {
if (res.code === 200) {
res.data.list.forEach((item) => {
this.couponList.push({ value: item.id, label: item.name })
})
} else {
this.$message({
type: 'error',
message: '请求优惠券失败!',
})
}
})
},
methods: {
// 提交
submit() {
couponHandsel(this.form).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '添加成功!'
})
this.close()
} else {
this.$message({
type: 'error',
message: '添加失败!'
})
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
}
}
}
</script>
<style lang="scss">
.videoBox {
display: flex;
justify-content: center;
overflow: hidden;
}
.el-textarea.is-disabled.ti .el-textarea__inner {
color: red;
}
</style>
@@ -0,0 +1,136 @@
<template>
<el-dialog :close-on-click-modal="false" title="编辑游戏币" :visible.sync="Visible" @close="close" center class="ac-dialog" width="700px">
<el-form :inline="true" :model="form" class="demo-form-inline" label-position="right" label-width="100px">
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="游戏余额">
<el-input v-model.number="balance" disabled>
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="可提现">
<el-input v-model.number="transferable" disabled>
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="划转游戏币">
<el-input placeholder="请输入划转游戏币" v-model.number="form.coins" >
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="原因">
<el-input placeholder="请输入划转原因" type="textarea" style="width:500px" v-model="form.remark" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="备注">
<el-input placeholder="请输入备注" type="textarea" style="width:500px" v-model="form.record" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="谷歌验证码">
<el-input placeholder="请输入谷歌验证码" v-model="form.code" ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible=false"> </el-button>
<el-button @click="submit" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getBalance, updateGameCoin } from '@/api/user/userList'
import { changeMoneyYuan } from '@/filters/index'
export default {
name: 'EditGameCoin',
props: ['data'],
components: {
// UploadImgArr
},
data() {
return {
Visible: true,
transferable: 0, // 可提现金额
balance: 0, // 余额
// 表单数据
form: {
coins: undefined,
remark: undefined,
userId: undefined,
record: undefined,
code: undefined
}
}
},
created() {
this.form.userId = this.data.id
this.getBalanceSearch()
},
methods: {
getBalanceSearch() {
getBalance({ 'userId': this.form.userId }).then((res) => {
if (res.code === 200) {
this.balance = changeMoneyYuan(res.data.balance)
this.transferable = changeMoneyYuan(res.data.transferable)
} else {
this.$message({
type: 'error',
message: '请求余额失败!'
})
}
})
},
// 提交
submit() {
updateGameCoin(this.form).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '修改成功'
})
this.Visible = false
} else {
this.$message({
type: 'error',
message: res.tip
})
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
}
}
}
</script>
<style lang="scss">
.videoBox {
display: flex;
justify-content: center;
overflow: hidden;
}
.el-textarea.is-disabled.ti .el-textarea__inner {
color: red;
}
</style>
@@ -0,0 +1,121 @@
<template>
<el-dialog :close-on-click-modal="false" title="编辑会员" :visible.sync="Visible" @close="close" center class="ac-dialog"
width="700px">
<el-form :inline="true" :model="form" :rules="rules" class="demo-form-inline" label-position="right"
label-width="100px">
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="会员类型" prop="vipType">
<el-select :clearable="true" @change="setOne" placeholder="请选择用户身份类型" v-model.number="form.cardId"
style="width: 160px">
<el-option :key="item.id" :label="item.title" :value="item.id" v-for="item in newVipTypeList"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="会员到期时间" prop="vipExpire">
<el-date-picker v-model="form.vipExpire" type="date" placeholder="选择日期" size="mini" style="width: 160px">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible = false"> </el-button>
<el-button @click="submit" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { userUpdateVip } from '@/api/user/userList'
import { getVipCardList } from '@/api/commodity/vipcard'
import { current } from '@/filters/index'
export default {
name: 'EditVip',
props: ['data'],
data() {
return {
// vipTypeList: vipTypeList(),
newVipTypeList: [],
Visible: true,
defaltTime: current() + 'T00:00:00.000Z',
// 表单数据
form: {
vipExpire: undefined,
id: 0,
cardId: undefined,
cardCategory: undefined,
},
rules: {},
changemovdiscount: false,
changedownload: false,
}
},
created() {
const { vipExpire } = this.data;
this.form = { ...this.data }
this.newGetVipCardList()
this.form.vipExpire = vipExpire ? (vipExpire === '0001-01-01T00:00:00Z' ? '' : vipExpire) : '';
},
methods: {
async newGetVipCardList() {
const res = await getVipCardList({
category: this.form.cardCategory,
pageSize: 100,
pageNum: 1,
})
if (res && res.code === 200) {
let list = []
list = res.data.list ? res.data.list : []
this.newVipTypeList = list.filter((item) => {
return item
})
}
},
setOne(val) {
this.form.cardId = val
},
// 提交
submit() {
const data = {
cardCategory: this.form.cardCategory,
cardId: this.form.cardId ? this.form.cardId : 0,
id: this.form.userId,
vipExpire: this.form.vipExpire,
}
// data.vipExpire = this.form.vipExpire
data.vipExpire = this.form.vipExpire
? this.form.vipExpire === '0001-01-01T00:00:00Z'
? this.defaltTime
: this.form.vipExpire
: this.defaltTime
userUpdateVip(data).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '更新成功',
})
this.Visible = false
} else {
this.$message({
type: 'error',
message: '更新失败',
})
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
},
changeDownload() {
this.changedownload = true
},
changeMovDiscount() {
this.changemovdiscount = true
},
},
}
</script>
@@ -0,0 +1,115 @@
<!--
* @Author:
* @Mail:
* @Date: 2022-03-14 15:22:04
* @LastEditTime: 2022-08-31 15:32:25
* @LastEditors: Please set LastEditors
* @FilePath: /comics-admin/src/views/user/userList/components/MovieTickets.vue
-->
<template>
<el-dialog :close-on-click-modal="false" title="编辑观影券" :visible.sync="Visible" @close="close" center class="ac-dialog" width="400px">
<el-form :inline="true" :model="form" label-width="100px">
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="用户Id">
<el-input v-model.number="form.id" disabled> </el-input>
</el-form-item>
</el-col>
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="积分">
<el-input v-model.number="form.score"> </el-input>
</el-form-item>
</el-col>
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="观影券数量">
<el-input placeholder="请输入观影券数量" v-model.number="form.movieTickets" style="width:163px">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-col>
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="免费AI脱衣次数">
<el-input v-model.number="form.aiFreeRemoveClothCount"> </el-input>
</el-form-item>
</el-col>
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="免费AI换脸次数">
<el-input v-model.number="form.aiFreeChangeFaceCount"> </el-input>
</el-form-item>
</el-col>
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="Ai女友积分">
<el-input v-model.number="form.aiMateScore"> </el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible = false"> </el-button>
<el-button @click="submit" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { userMovieTicketsUpdate } from '@/api/user/userList'
export default {
name: 'MovieTickets',
props: ['data'],
data() {
return {
Visible: true,
recharge: 0,
// 表单数据
form: {
id: undefined,
movieTickets: undefined,
score: undefined,
lotteryFreeCount: undefined,
aiFreeRemoveClothCount: undefined,
aiFreeChangeFaceCount: undefined,
aiMateScore: undefined
}
}
},
created() {
this.form = { ...{}, ...this.data }
},
mounted() {
console.log(this.data)
},
methods: {
// 提交
submit() {
const data = {
userId: this.form.id,
movieTicket: this.form.movieTickets,
points: this.form.points,
score: this.form.score,
lotteryCount: this.form.lotteryFreeCount,
aiFreeRemoveClothCount: this.form.aiFreeRemoveClothCount,
aiFreeChangeFaceCount: this.form.aiFreeChangeFaceCount,
aiMateScore: this.form.aiMateScore
}
userMovieTicketsUpdate(data).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '修改成功'
})
this.Visible = false
} else {
this.$message({
type: 'error',
message: res.data
})
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
}
}
}
</script>
@@ -0,0 +1,121 @@
<!--
* @Author: 王涛
* @Mail: no
* @Date: 2020-12-30 17:27:01
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-03-18 11:22:11
-->
<!--
* @Author: your name
* @Date: 2020-06-04 19:49:03
* @LastEditTime: 2020-12-25 10:29:35
* @LastEditors: 王涛
* @Description: In User Settings Edit
* @FilePath: /comics-admin/src/views/user/userList/components/banUser.vue
-->
<template>
<el-dialog :close-on-click-modal="false" title="封禁用户" :visible.sync="Visible" @close="close" center class="ac-dialog" width="700px">
<el-form :inline="true" :model="form" class="demo-form-inline" label-position="right" label-width="100px">
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="封禁原因">
<!-- <el-input v-model="form.cause" /> -->
<el-select :clearable="true" placeholder="请选择用户身份类型" v-model.number="form.cause" style="width:180px">
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in causeList"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24">
<el-form-item label="更多原因">
<el-input v-model="form.content" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="24" :md="24" :sm="24" :xl="24" :xs="24">
<el-form-item label="封禁截图">
<!-- <UploadImg @changeImgUrl='changeImgUrl' :img='form.imgUrl'></UploadImg> -->
<UploadImgPaste @changeImgUrl='changeImgUrl' :img='form.imgUrl'></UploadImgPaste>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible=false"> </el-button>
<el-button @click="submit" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { userBan } from '@/api/user/userList'
import UploadImgPaste from '@/components/UploadImgPaste/index'
import { causeList } from '@/filters/user/banList'
export default {
name: 'BanUser',
props: ['data'],
components: {
UploadImgPaste,
},
data() {
return {
causeList: causeList(),
Visible: true,
coin: 0, // 加金币
incomeCoin: 0,
// 表单数据
form: {
cause: undefined,
content: undefined,
imgUrl: undefined,
userId: undefined,
},
}
},
created() {
this.form.userId = this.data.id
},
methods: {
changeImgUrl(data) {
this.form.imgUrl = data
},
// 提交
submit() {
userBan(this.form).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '添加成功',
})
this.Visible = false
} else {
this.$message({
type: 'error',
message: res.data,
})
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
},
},
}
</script>
<style lang="scss">
.videoBox {
display: flex;
justify-content: center;
overflow: hidden;
}
.el-textarea.is-disabled.ti .el-textarea__inner {
color: red;
}
</style>
@@ -0,0 +1,147 @@
<template>
<el-dialog title="优惠券列表" :visible.sync="Visible" width="1200px" center :close-on-click-modal="false" @close="close" :show-close="false">
<el-button @click="addCoupon()" size="mini" type="primary">添加优惠券</el-button>
<el-table :data="tabelData" border height="750" highlight-current-row style="width: 100%" :row-style="{ height: '70px' }">
<el-table-column align="center" label="id" width="80">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column align="center" label="折扣" width="80">
<template slot-scope="scope">{{ scope.row.discount }}</template>
</el-table-column>
<el-table-column align="center" label="抵用金额" width="80">
<template slot-scope="scope">{{ scope.row.coupon/100 }}</template>
</el-table-column>
<el-table-column align="center" label="使用门槛(满多少可用)" width="80">
<template slot-scope="scope">{{ scope.row.threshold/100 }}</template>
</el-table-column>
<el-table-column align="center" label="折扣券类型" width="80">
<template slot-scope="scope">{{ scope.row.couponsType===1?'抵用券':'折扣券' }}</template>
</el-table-column>
<el-table-column align="center" label="权重" width="80">
<template slot-scope="scope">{{ scope.row.rank }}</template>
</el-table-column>
<el-table-column align="center" label="有效天数" width="80">
<template slot-scope="scope">{{ scope.row.expireDay }}</template>
</el-table-column>
<el-table-column align="center" label="图片">
<template slot-scope="scope">
<ShowImg style="width: 40px; height: 40px; margin: 0 auto; line-height: 40px" :urls="scope.row.cover"></ShowImg>
</template>
</el-table-column>
<el-table-column align="center" label="名称" width="100">
<template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column>
<el-table-column align="center" label="描述" width="100">
<template slot-scope="scope">{{ scope.row.desc }}</template>
</el-table-column>
<el-table-column align="center" label="启用状态">
<template slot-scope="scope">
<el-button :type="scope.row.status ? 'success' : 'danger'" plain size="mini">{{ scope.row.status ? '上架' : '下架' }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作">
<template slot-scope="scope">
<el-button @click="delCoupon(scope.row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[10, 20, 30, 50, 100]" :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="Visible = false"> </el-button>
<el-button type="primary" @click="Visible = false"> </el-button>
</div>
<Addcoupon :data="editData" v-if="AddcouponVisible" @close="closeEdit"></Addcoupon>
</el-dialog>
</template>
<script>
import { couponList, couponDel } from '@/api/user/userList'
import ShowImg from '@/components/ShowImg/index.vue'
import Addcoupon from './Addcoupon'
export default {
name: 'Coupon',
props: ['data'],
components: {
Addcoupon,
ShowImg
},
data() {
return {
loading: true,
Visible: true,
// 表单数据
tabelData: [],
total: 0,
searchData: {
pageNum: 1,
pageSize: 10,
userId: 0,
},
AddcouponVisible: false,
editData: {},
}
},
mounted() {
this.searchData.userId = this.data.id
this.getCouponList()
},
methods: {
getCouponList() {
couponList(this.searchData).then((res) => {
if (res.code === 200) {
console.log(res.data,'rrr');
this.tabelData = res.data.list
this.total = res.data.total
this.loading = false
}
})
},
// 关闭编辑弹窗
closeEdit() {
this.AddcouponVisible = false
this.getCouponList()
},
addCoupon() {
this.editData = {
userId: this.searchData.userId,
}
this.AddcouponVisible = true
},
// 切换每页数据量
handleSizeChange(val) {
this.searchData.pageSize = val
this.getUserData()
},
// 切换页数
handleCurrentChange(val) {
this.searchData.pageNum = val
this.getUserData()
},
// 关闭编辑
close() {
this.$emit('close')
},
delCoupon(row) {
couponDel({ id: row.id }).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功!',
})
this.getCouponList()
} else {
this.$message({
type: 'error',
message: '删除失败!',
})
}
})
},
},
}
</script>
@@ -0,0 +1,52 @@
<template>
<el-dialog :close-on-click-modal="false" title="查看二维码" :visible.sync="Visible" center width="300px" append-to-body @close="close">
<div>
<qrcode-vue :value="code" level="H" size='200' style="width:200px;height:200px;margin:0 auto;"></qrcode-vue>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible=false"> </el-button>
<el-button @click="close" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { userQrcode } from '@/api/user/userList'
import QrcodeVue from 'qrcode.vue'
export default {
name: 'Addcoupon',
props: ['data'],
components: {
QrcodeVue,
},
data() {
return {
Visible: true,
couponList: [],
code: undefined,
// 表单数据
form: {
userId: undefined,
},
}
},
created() {
this.form.userId = this.data.userId
this.getQR()
},
methods: {
getQR() {
userQrcode(this.form).then((res) => {
if (res.code === 200) {
this.code = res.data.value
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
},
},
}
</script>
@@ -0,0 +1,113 @@
<template>
<el-dialog :before-close="handleClose" :title="dialogTit" :visible.sync="dialogFormVisible" width="550px" center calss="ac-dialog" :destroy-on-close="true" :close-on-click-modal="false">
<div class="ac-dia-form">
<el-form ref="ruleForm" :model="diaData" size="mini" :rules="rules" label-width="105px" label-position="center">
<!-- <el-col :span="24">
<el-form-item label="手机号" prop="mobile">
<el-row type="flex">
<el-input v-model="diaData.mobile" placeholder="请输入手机号" />
<el-button type="success" plain @click="getCode">获取验证码</el-button>
</el-row>
</el-form-item>
</el-col> -->
<el-col :span="24">
<!-- <el-form-item label="手机号" prop="mobile">
</el-form-item> -->
<el-input placeholder="请输入手机号码" v-model="diaData.mobile" class="input-with-select" style="width:480px">
<country-code-selector slot="prepend" :countryCode.sync="diaData.country" class="tel-container"></country-code-selector>
<el-button slot="append" type="success" plain @click="getCode">获取验证码</el-button>
</el-input>
</el-col>
<el-col :span="24">
<el-form-item label="验证码:" prop="code">
<span>{{diaData.code}}</span>
</el-form-item>
</el-col>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('ruleForm')">关闭</el-button>
</div>
</el-dialog>
</template>
<script>
import { userCaptcha } from '@/api/user/userList'
import countryCodeSelector from 'vue-country-code9-selector'
export default {
components: {
countryCodeSelector
},
data() {
return {
rules: {
mobile: [{ required: true, message: '必填', trigger: 'blur' }]
},
dialogTit: '获取验证码',
dialogFormVisible: false,
diaData: {
mobile: null,
code: null,
country: 86
}
}
},
mounted() {},
methods: {
// 关闭弹窗
handleClose(done) {
this.diaData = {
mobile: null,
code: null
}
done()
},
// 获取验证码
async getCode() {
try {
if(!this.diaData.mobile) return this.$message('请输入手机号!')
if(this.diaData.country){
const res = await userCaptcha({ mobile: this.diaData.mobile, country: this.diaData.country.toString() })
if (res.code === 200) {
if (res.data) {
this.diaData.code = res.data.code
this.$message.success('查询成功')
}
} else {
this.$message.error(res.tip)
}
}
} catch (err) {
console.log(err)
}
},
// 打开弹出框
openDialog() {
this.dialogFormVisible = true
},
/**
* @param {String} 传入表单的ref
* 重置表单
*/
resetForm(formName) {
this.diaData = {
mobile: null,
code: null
}
this.dialogFormVisible = false
}
}
}
</script>
<style lang="scss">
.el-dialog{
.el-input-group__prepend{
.scroll-bar{
background: #fff;
}
}
}
</style>
@@ -0,0 +1,101 @@
<template>
<el-dialog :close-on-click-modal="false" title="编辑用户" :visible.sync="Visible" @close="close" center class="ac-dialog" width="700px">
<el-form :inline="true" :model="form" ref="form" :rules="rules" class="demo-form-inline" label-position="right" label-width="100px">
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="银行名称" prop="bankName">
<el-input v-model="form.bankName" placeholder="请输入银行名称" />
</el-form-item>
</el-col>
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="开户名称" prop="bankAccountName">
<el-input v-model="form.bankAccountName" placeholder="请输入开户名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="12">
<el-form-item label="银行卡号" prop="bankAccountNo">
<el-input v-model="form.bankAccountNo" placeholder="请输入银行卡号" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="Visible = false"> </el-button>
<el-button @click="submit('form')" type="primary"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { updateUserBank } from '@/api/user/userList'
export default {
name: 'EditVip',
props: ['data'],
data() {
return {
Visible: true,
// 表单数据
form: {
bankName: undefined,
bankAccountName: undefined,
bankAccountNo: undefined,
id: 0
},
rules: {
bankName: [
{ required: true, message: '请输入银行名称', trigger: 'blur' }
],
bankAccountName: [
{ required: true, message: '请输入开户名称', trigger: 'change' }
],
bankAccountNo: [
{ required: true, message: '请输入银行卡号', trigger: 'blur' }
]
}
}
},
created() {
this.form = { ...this.data }
},
methods: {
// 提交
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
const { bankName, bankAccountName, bankAccountNo, id } = this.form
const data = {
bankName: bankName,
bankAccountName: bankAccountName,
bankAccountNo: bankAccountNo,
id: id
}
updateUserBank(data).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '更新成功'
})
this.Visible = false
} else {
this.$message({
type: 'error',
message: '更新失败'
})
}
})
} else {
console.log('error submit!!')
return false
}
})
},
// 关闭编辑
close() {
this.$emit('close', false)
}
}
}
</script>
+650
View File
@@ -0,0 +1,650 @@
<template>
<div>
<el-row>
<el-form :inline="true" :model="searchData" class="form-inline" label-width="80px" size="mini">
<el-form-item>
<el-input @clear="clear('id')" clearable placeholder="请输入用户ID" v-model.number="searchData.id" />
</el-form-item>
<el-form-item>
<el-select @clear="clear('vipType')" clearable placeholder="请选择用户VIP等级" v-model.number="searchData.vipType">
<el-option
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in vipTypeList"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input @clear="clear('nickName')" clearable placeholder="请输入用户昵称" v-model="searchData.nickName" />
</el-form-item>
<el-form-item>
<el-input @clear="clear('account')" clearable placeholder="请输入用户账号" v-model="searchData.account" />
</el-form-item>
<el-form-item>
<el-input @clear="clear('mobile')" clearable placeholder="请输入用户手机号" v-model="searchData.mobile" />
</el-form-item>
<el-form-item>
<el-select @clear="clear('type')" clearable placeholder="请选择用户类型" v-model="searchData.type">
<el-option
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in userTypeList"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input @clear="clear('inviteCode')" clearable placeholder="请输入用户邀请码" v-model="searchData.inviteCode" />
</el-form-item>
<el-form-item>
<el-select @clear="clear('status')" clearable placeholder="请选择账号状态" v-model="searchData.status">
<el-option :value="0" label="正常" />
<el-option :value="1" label="封禁" />
</el-select>
</el-form-item>
<el-form-item>
<el-input @clear="clear('districtCode')" clearable placeholder="请输入商区码" v-model="searchData.districtCode" />
</el-form-item>
<el-form-item>
<el-input
@clear="clear('SuperiorUserId')"
clearable
placeholder="请输入用户上级ID"
v-model="searchData.SuperiorUserId" />
</el-form-item>
<el-form-item>
<el-button @click="onSearch" icon="el-icon-search" plain type="primary">搜索</el-button>
<el-button @click="refreshView" icon="el-icon-refresh" plain type="info">刷新</el-button>
<el-button @click="exportExcel" icon="el-icon-download" plain type="primary">导出</el-button>
<el-button type="success" plain @click="viewCode">点击查看验证码</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table
:data="userData"
element-loading-text="拼命加载中"
border
height="700"
highlight-current-row
style="width: 100%"
v-loading="loading"
:row-style="{ height: '70px' }">
<el-table-column align="center" label="用户ID" width="100" fixed="left">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column align="center" label="昵称" width="100">
<template slot-scope="scope">{{ scope.row.nickName }}</template>
</el-table-column>
<el-table-column align="center" label="账号" width="100">
<template slot-scope="scope">{{ scope.row.account }}</template>
</el-table-column>
<el-table-column align="center" label="用户头像" width="100">
<template slot-scope="scope">
<ShowImg style="width: 50px; height: 50px; margin: 0 auto" :urls="scope.row.avatar"></ShowImg>
</template>
</el-table-column>
<el-table-column align="center" label="普通会员" width="100">
<el-table-column align="center" label="普通会员" width="100">
<template slot-scope="scope">
{{
scope.row.normalVip.cardName
}}
</template>
</el-table-column>
<el-table-column align="center" label="会员到期时间" width="160">
<template slot-scope="scope">{{
scope.row.normalVip.vipExpire | BeiJingTime
}}</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="暗网" width="100">
<el-table-column align="center" label="暗网会员" width="100">
<template slot-scope="scope">
{{
scope.row.darkVip.cardName
}}
</template>
</el-table-column>
<el-table-column align="center" label="会员到期时间" width="160">
<template slot-scope="scope">{{
scope.row.darkVip.vipExpire | BeiJingTime
}}</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="全网通" width="100">
<el-table-column align="center" label="全网通会员" width="100">
<template slot-scope="scope">
{{
scope.row.supremeVip.cardName
}}
</template>
</el-table-column>
<el-table-column align="center" label="会员到期时间" width="160">
<template slot-scope="scope">{{
scope.row.supremeVip.vipExpire | BeiJingTime
}}</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="直播" width="100">
<el-table-column align="center" label="直播会员" width="100">
<template slot-scope="scope">
{{
scope.row.liveVip.cardName
}}
</template>
</el-table-column>
<el-table-column align="center" label="会员到期时间" width="160">
<template slot-scope="scope">{{
scope.row.liveVip.vipExpire | BeiJingTime
}}</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="用户类型" width="">
<template slot-scope="scope">{{
scope.row.type | changeUserType
}}</template>
</el-table-column>
<el-table-column align="center" label="商户认证" width="100">
<template slot-scope="scope">
<el-button :type="scope.row.auth ? 'success' : 'danger'" plain size="mini">{{ scope.row.auth ? "已认证" :
"未认证" }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="会员到期时间" width="160">
<template slot-scope="scope">{{
scope.row.vipExpire | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="充值余额(金币)" width="135">
<template slot-scope="scope">{{
scope.row.recharge | changeMoneyYuan
}}</template>
</el-table-column>
<el-table-column align="center" label="收益余额" width="135">
<template slot-scope="scope">{{
scope.row.income | changeMoneyYuan
}}</template>
</el-table-column>
<el-table-column align="center" label="作品收益" width="120">
<template slot-scope="scope">{{ scope.row.workIncome | changeMoneyYuan }}</template>
</el-table-column>
<el-table-column align="center" label="设备" width="100">
<template slot-scope="scope">{{ scope.row.device }}</template>
</el-table-column>
<el-table-column align="center" label="app版本" width="100">
<template slot-scope="scope">{{ scope.row.appVer }}</template>
</el-table-column>
<el-table-column align="center" label="每周可缓存总次数" width="100">
<template slot-scope="scope">{{
scope.row.downLoadTotal
}}</template>
</el-table-column>
<el-table-column align="center" label="购买视频折扣" width="100">
<template slot-scope="scope">{{
scope.row.movieDiscount
}}</template>
</el-table-column>
<el-table-column align="center" label="观影券数量" width="120">
<template slot-scope="scope">{{ scope.row.movieTickets }}</template>
</el-table-column>
<el-table-column align="center" label="免费抽奖次数" width="120">
<template slot-scope="scope">{{ scope.row.lotteryFreeCount }}</template>
</el-table-column>
<el-table-column align="center" label="免费AI脱衣次数" width="120">
<template slot-scope="scope">{{ scope.row.aiFreeRemoveClothCount }}</template>
</el-table-column>
<el-table-column align="center" label="免费AI换脸次数" width="120">
<template slot-scope="scope">{{ scope.row.aiFreeChangeFaceCount }}</template>
</el-table-column>
<el-table-column align="center" label="Ai女友积分" width="120">
<template slot-scope="scope">{{ scope.row.aiMateScore }}</template>
</el-table-column>
<el-table-column align="center" label="积分" width="120">
<template slot-scope="scope">{{ scope.row.points }}</template>
</el-table-column>
<el-table-column align="center" label="签到返现收益" width="120">
<template slot-scope="scope">{{ scope.row.checkinCashbackIncome / 100 }}</template>
</el-table-column>
<el-table-column align="center" label="在线时长" width="120">
<template slot-scope="scope">{{ scope.row.onlineTimeSecDay }}</template>
</el-table-column>
<el-table-column align="center" label="总在线时长" width="120">
<template slot-scope="scope">{{ scope.row.onlineTimeSecTotal }}</template>
</el-table-column>
<el-table-column align="center" label="最后在线时间" width="120">
<template slot-scope="scope">{{ scope.row.onlineTimeAt }}</template>
</el-table-column>
<el-table-column align="center" label="手机号码" width="150">
<template slot-scope="scope">{{
scope.row.country + scope.row.mobile
}}</template>
</el-table-column>
<el-table-column align="center" label="状态" width="80">
<template slot-scope="scope">
<el-button :type="scope.row.status === 1 ? 'danger' : 'success'" plain size="mini">{{ scope.row.status ===
1 ? "已封号" : "正常" }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="年龄" width="100">
<template slot-scope="scope">{{ scope.row.age }}</template>
</el-table-column>
<el-table-column align="center" label="最后购买时间" width="160">
<template slot-scope="scope">{{
scope.row.vipLastPayTime | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="邀请码" width="100">
<template slot-scope="scope">{{ scope.row.inviteCode }}</template>
</el-table-column>
<el-table-column align="center" label="设备唯一标示" width="200" :show-overflow-tooltip="true">
<template slot-scope="scope">{{ scope.row.devID }}</template>
</el-table-column>
<el-table-column align="center" label="系统类型" width="100">
<template slot-scope="scope">{{ scope.row.sysType }}</template>
</el-table-column>
<el-table-column align="center" label="邀请数" width="100">
<template slot-scope="scope">{{ scope.row.invites }}</template>
</el-table-column>
<el-table-column align="center" label="上级邀请码" width="100">
<template slot-scope="scope">{{
scope.row.agentInviteCode
}}</template>
</el-table-column>
<el-table-column align="center" label="商区码" width="100">
<template slot-scope="scope">{{ scope.row.districtCode }}</template>
</el-table-column>
<el-table-column align="center" label="是否直推" width="100">
<template slot-scope="scope">
<el-button :type="scope.row.isDirect ? 'success' : 'danger'" plain size="mini">{{ scope.row.isDirect ?
"直推" : "非直推" }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="最后登陆Ip" width="120">
<template slot-scope="scope">{{ scope.row.lastIp }}</template>
</el-table-column>
<el-table-column align="center" label="注册IP" width="120">
<template slot-scope="scope">{{ scope.row.regIp }}</template>
</el-table-column>
<el-table-column align="center" label="简介" width="100" show-overflow-tooltip>
<template slot-scope="scope">{{ scope.row.introduction }}</template>
</el-table-column>
<el-table-column align="center" label="注册时间" width="160">
<template slot-scope="scope">{{
scope.row.createdAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="最后活跃" width="160">
<template slot-scope="scope">{{
scope.row.lastLoginAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="更新时间" width="160">
<template slot-scope="scope">{{
scope.row.updatedAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="650">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="openQr(scope.$index, scope.row)">查看二维码</el-button>
<el-button
v-if="scope.row.status === 0"
@click="banUser(scope.row, 'status')"
size="mini"
type="danger">封禁</el-button>
<el-button v-else @click="unbanUser(scope.row, 'status')" size="mini" type="success">解封</el-button>
<el-button
v-if="scope.row.slient === 0"
@click="changeStatus(scope.row, 'slient')"
size="mini"
type="warning">禁言</el-button>
<el-button @click="handleEdit(scope.$index, scope.row)" size="mini" type="primary">编辑</el-button>
<el-dropdown trigger="click">
<el-button type="primary" size="mini">
会员积分金币操作<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item> <span
@click="handleEditMovieTickets(scope.$index, scope.row)">观影券及积分</span></el-dropdown-item>
<el-dropdown-item> <span
@click="handleEditVip(scope.$index, scope.row)">编辑标准会员</span></el-dropdown-item>
<el-dropdown-item> <span @click="handleEditVip(1, scope.row)">编辑猎奇会员</span></el-dropdown-item>
<el-dropdown-item> <span @click="handleEditVip(3, scope.row)">编辑直播会员</span></el-dropdown-item>
<el-dropdown-item> <span @click="handleEditVip(2, scope.row)">编辑全网通会员</span></el-dropdown-item>
<el-dropdown-item><span @click="addIncCoin(scope.$index, scope.row)">编辑金币</span></el-dropdown-item>
<el-dropdown-item><span @click="addCoupon(scope.$index, scope.row)">编辑优惠券</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button @click="BindBankCard(scope.$index, scope.row)" size="mini" type="success">绑定银行卡</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<div class="table-pagination">
<el-pagination
:current-page="searchData.page"
:page-size="searchData.pageSize"
:page-sizes="[10, 20, 30, 50, 100]"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper" />
</div>
<Edit :data="editData" v-if="editVisible" @close="closeEdit" />
<EditVip :data="editData" v-if="editVipVisible" @close="closeEdit"></EditVip>
<AddIncCoin :data="editData" v-if="addIncCoinVisible" @close="closeEdit"></AddIncCoin>
<EditGameCoin :data="editData" v-if="addGamecoinVisible" @close="closeEdit"></EditGameCoin>
<BanUser :data="editData" v-if="banUserVisible" @close="closeEdit"></BanUser>
<WaterList :data="editData" v-if="BankCard" @close="closeEdit"></WaterList>
<!-- 查看验证码 -->
<ViewCode ref="showCode" />
<Coupon :data="editData" v-if="couponVisible" @close="closeEdit"></Coupon>
<MovieTickets :data="editMovieTicketsData" v-if="editMovieTicketsVisible" @close="closeEdit"></MovieTickets>
<ShowQR :data='editData' v-if="QRVisible" @close="closeEdit"></ShowQR>
</div>
</template>
<script>
import {
getUserList,
userExport,
userUpdate,
userUnBan
} from '@/api/user/userList'
import { vipTypeList, userTypeList } from '@/filters/user/userList'
import Edit from './components/AddOrEdit'
import EditVip from './components/EditVip'
import AddIncCoin from './components/AddIncCoin'
import EditGameCoin from './components/EditGameCoin'
import ShowImg from '@/components/ShowImg/index.vue'
import BanUser from './components/banUser'
import ViewCode from './components/viewVerificationCode'
import Coupon from './components/coupon'
import MovieTickets from './components/MovieTickets'
import WaterList from './components/waterList.vue'
import { BeiJingTime } from '@/filters/index'
import { getVipCardList } from '@/api/commodity/vipcard'
import ShowQR from './components/showQR.vue'
export default {
name: 'UserList',
components: {
Edit,
ShowImg,
EditVip,
AddIncCoin,
EditGameCoin,
BanUser,
ViewCode,
Coupon,
MovieTickets,
WaterList,
ShowQR
},
data() {
return {
vipTypeList: vipTypeList(),
userTypeList: userTypeList(),
// 列表加载状态
loading: false,
// 请求或搜索数据参数
searchData: {
id: undefined, // 用户id
account: undefined,
vipType: undefined, // vip等级
nickName: undefined, // 昵称
mobile: undefined, // 手机号码
inviteCode: undefined, // 邀请码
status: undefined, // string 账号状态; 0:正常 1:封禁
type: undefined, // 用户类型
SuperiorUserId: undefined, // 用户上级id
districtCode: undefined, // 被邀请的inviteCode
page: 1,
pageSize: 10
},
// 用户列表数据
userData: [],
// 数据总条数
total: 0,
// 编辑数据
editData: {},
// 编辑观影券数据
editMovieTicketsData: {},
editMovieTicketsVisible: false,
// 新增或编辑弹出框
editVisible: false,
editVipVisible: false,
// 添加金币弹窗
addIncCoinVisible: false,
addGamecoinVisible: false, // 添加游戏币弹窗
// 封禁用户弹窗
banUserVisible: false,
couponVisible: false,
// 会员类型列表
newVipTypeList: [],
// 银行卡绑定弹窗
BankCard: false,
QRVisible: false
}
},
mounted() {
this.newGetVipCardList()
},
methods: {
openQr(index, row) {
this.QRVisible = true
this.editData = {
userId: row.id
}
},
// TODO:请求用户VIP类型数据
async newGetVipCardList() {
getVipCardList({ pageSize: 100, pageNum: 1 }).then((res) => {
if (res.code === 200) {
if (res.data.list && res.data.list.length) {
this.newVipTypeList = res.data.list
} else {
this.newVipTypeList = []
}
this.getUserData()
}
})
},
// TODO:禁言
changeStatus(row, key) {
const data = { ...row }
if (row[key] === 0) {
data[key] = 1
} else if (row[key] === 1) {
data[key] = 0
}
userUpdate(data).then((res) => {
if (res.code === 200) {
this.$message.success('更新成功')
this.getUserData()
} else {
this.$message.error('更新失败')
}
})
},
// TODO:请求用户列表数据
getUserData() {
this.loading = true
getUserList(this.searchData).then((res) => {
if (res.code === 200) {
this.userData = res.data.list
this.total = res.data.total
} else {
this.userData = []
this.total = 0
this.$message.error('请求失败')
}
this.loading = false
})
},
// TODO:导出用户列表数据
exportExcel() {
const data = { ...this.searchData }
data.pageSize = this.searchData.pageSize
data.page = this.searchData.page
userExport(data).then((res) => {
if (res.code) {
this.$message.error('导出列表失败!')
} else {
const a = document.createElement('a')
var blob = new Blob([res], {
type: 'application/vnd.ms-excel;charset=utf-8'
})
const t = BeiJingTime(new Date())
const url = window.URL.createObjectURL(blob)
a.setAttribute('href', url)
a.download = `用户列表${t}.xlsx`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
},
// TODO:用户解封
unbanUser(row) {
userUnBan({ userId: row.id }).then((res) => {
if (res.code === 200) {
this.$message.success('解封成功')
this.getUserData()
} else {
this.$message.error('解封失败')
}
})
},
clear(key) {
this.searchData[key] = undefined
this.getUserData()
},
/**
* 点击按钮查看验证码
*/
viewCode() {
this.$refs['showCode'].openDialog()
},
// 搜索按钮
onSearch() {
this.searchData.page = 1
this.searchData.pageSize = 10
this.searchData.SuperiorUserId = this.searchData.SuperiorUserId
? Number(this.searchData.SuperiorUserId)
: ''
this.getUserData()
},
// 刷新
refreshView() {
this.searchData.page = 1
this.searchData.pageSize = 10
this.getUserData()
},
// 切换每页数据量
handleSizeChange(val) {
this.searchData.pageSize = val
this.getUserData()
},
// 切换页数
handleCurrentChange(val) {
this.searchData.page = val
this.getUserData()
},
// 关闭编辑弹窗
closeEdit() {
this.editData = {}
this.editVisible = false
this.editVipVisible = false
// this.addFansGroupVisible = false
this.banUserVisible = false
this.addIncCoinVisible = false
this.addGamecoinVisible = false
this.couponVisible = false
this.editMovieTicketsVisible = false
this.BankCard = false
this.QRVisible = false
this.getUserData()
},
handleEditMovieTickets(index, row) {
this.editMovieTicketsVisible = true
this.editMovieTicketsData = row
},
// 编辑
handleEdit(index, row) {
this.editVisible = true
this.editData = row
},
// 编辑VIP
handleEditVip(index, row) {
this.editVipVisible = true
if (index === 0) {
this.editData = {
...row.normalVip,
userId: row.id,
cardCategory: index
}
} else if (index === 1) {
this.editData = {
...row.darkVip,
userId: row.id,
cardCategory: index
}
} else if (index === 2) {
this.editData = {
...row.supremeVip,
userId: row.id,
cardCategory: index
}
} else if (index === 3) {
this.editData = {
...row.liveVip,
userId: row.id,
cardCategory: index
}
}
},
// 编辑金币
addIncCoin(index, row) {
this.addIncCoinVisible = true
this.editData = row
},
// 编辑优惠券
addCoupon(index, row) {
this.couponVisible = true
this.editData = row
},
// 编辑游戏币
addGameCoin(index, row) {
this.addGamecoinVisible = true
this.editData = row
},
banUser(row) {
this.editData = row
this.banUserVisible = true
},
// 绑定银行卡
BindBankCard(index, row) {
console.log('银行卡添加')
this.BankCard = true
this.editData = row
}
}
}
</script>
+233
View File
@@ -0,0 +1,233 @@
<template>
<div>
<el-row class="table-form">
<el-form :inline="true" :model="searchData" class="form-inline" size="mini">
<el-form-item>
<el-date-picker
:default-time="['00:00:00', '23:59:59']"
end-placeholder="结束日期"
range-separator=""
start-placeholder="开始日期"
type="datetimerange"
v-model="time"
value-format="yyyy-MM-ddTHH:mm:ss+08:00"/>
</el-form-item>
<el-form-item>
<el-button @click="onSearch()" icon="el-icon-search" plain type="primary" :disabled="loading">搜索</el-button>
<el-button @click="exportExcel()" icon="el-icon-refresh" plain type="info" :disabled="loading">导出</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table :data="tableData" border height="750" highlight-current-row style="width: 100%"
:row-style="{ height: '70px' }">
<el-table-column align="center" label="日期" width="140">
<template slot-scope="scope">{{
scope.row.date
}}</template>
</el-table-column>
<el-table-column align="center" label="当日增加的金币总数量">
<template slot-scope="scope">{{
scope.row.totalIncCoin | changeMoneyYuan
}}</template>
</el-table-column>
<el-table-column align="center" label="当日增加的金币明细" width="300">
<template slot-scope="scope">
<template>
<el-table :data="getDataByMark(scope.row.todayCoinInfoList, 1)" max-height="200" border
style="width: 100%">
<el-table-column prop="tranType" label="类型" width="135">
<template slot-scope="scope">{{
scope.row.tranType | changeTranTradeType
}}</template>
</el-table-column>
<el-table-column prop="total" label="增加" width="135">
<template slot-scope="scope">{{
scope.row.total | changeMoneyYuan
}}</template>
</el-table-column>
</el-table>
</template>
</template>
</el-table-column>
<el-table-column align="center" label="当日增加消耗的金币总数量">
<template slot-scope="scope">{{
scope.row.totalDecCoin | changeMoneyYuan
}}</template>
</el-table-column>
<el-table-column align="center" label="当日增加消耗的金币明细" width="300">
<template slot-scope="scope">
<template>
<el-table :data="getDataByMark(scope.row.todayCoinInfoList, -1)" max-height="200" border
style="width: 100%">
<el-table-column prop="tranType" label="类型" width="135">
<template slot-scope="scope">{{
scope.row.tranType | changeTranTradeType
}}</template>
</el-table-column>
<el-table-column prop="total" label="消耗" width="135">
<template slot-scope="scope">{{
scope.row.total | changeMoneyYuan
}}</template>
</el-table-column>
</el-table>
</template>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="当日增加的观影券总数量">
<template slot-scope="scope">{{
scope.row.totalIncMovieTicket
}}</template>
</el-table-column>
<el-table-column align="center" label="当日消耗的观影券总数量">
<template slot-scope="scope">{{
scope.row.totalDecMovieTicket
}}</template>
</el-table-column> -->
<el-table-column align="center" label="系统未消耗的金币数">
<template slot-scope="scope">{{
scope.row.unUsedCoins | changeMoneyYuan
}}</template>
</el-table-column>
<!-- <el-table-column align="center" label="系统未使用的观影券">
<template slot-scope="scope">{{
scope.row.unUsedMovieTicket
}}</template>
</el-table-column> -->
</el-table>
</el-col>
</el-row>
<!-- 分页 -->
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-sizes="[10, 20, 30, 50, 100]" :total="total"
@current-change="handleCurrentChange" @size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper" />
</div>
</div>
</template>
<script>
import { getUserStatList,userStatExport } from '@/api/user/userStat'
export default {
name: 'UserStat',
data() {
return {
loading: false, // 列表加载状态
time: [],
// time: [moment(moment(new Date()).format('YYYY-MM-DDT00:00:00+08:00'))['_i'], moment(moment(new Date()).format('YYYY-MM-DDT23:59:59+08:00'))['_i']],
searchData: {
// 表单参数
pageNum: 1,
pageSize: 10,
start: undefined, // 开始时间
end: undefined // 结束时间
},
// 请求列表筛选参数
tableData: [],
total: 0,
}
},
mounted() {
this.getData()
},
methods: {
//TODO;请求用户收支统计列表
getData() {
if (this.time) {
this.searchData.start = this.time[0]
this.searchData.end = this.time[1]
} else {
this.searchData.start = undefined
this.searchData.end = undefined
}
getUserStatList(this.searchData).then((res) => {
if (res.code === 200) {
this.tableData = res.data.list
this.total = res.data.total
} else {
this.tableData = []
this.total = 0
}
})
},
getDataByMark(data, mark) {
console.log('ppp', data)
if (data && data.length > 0) {
const res = data.filter((item) => {
return item.mark === mark
})
console.log('www', res)
return res
} else {
return []
}
},
onSearch() {
this.searchData.pageNum = 1
this.searchData.pageSize = 10
this.getData()
},
// 切换每页显示的条数触发
handleSizeChange(val) {
this.searchData.pageSize = val
this.getData()
},
exportExcel() {
if (this.time) {
this.searchData.start = this.time[0]
this.searchData.end = this.time[1]
} else {
this.searchData.start = undefined
this.searchData.end = undefined
}
const a = JSON.parse(JSON.stringify(this.searchData))
userStatExport(a).then((res) => {
if (res.code) {
this.$message.error('导出列表失败!')
} else {
const a = document.createElement('a')
var blob = new Blob([res], {
type: 'application/vnd.ms-excel;charset=utf-8',
})
const t = new Date().valueOf()
const url = window.URL.createObjectURL(blob)
a.setAttribute('href', url)
a.download = `用户收支分析${t}.xlsx`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
}
})
// userStatExport(data).then((res) => {
// if (res.code) {
// this.$message.error('导出列表失败!')
// } else {
// const a = document.createElement('a')
// var blob = new Blob([res], {
// type: 'application/vnd.ms-excel;charset=utf-8',
// })
// // const t = BeiJingTime(new Date())
// const url = window.URL.createObjectURL(blob)
// a.setAttribute('href', url)
// a.download = `用户收支统计.xlsx`
// document.body.appendChild(a)
// a.click()
// document.body.removeChild(a)
// }
// })
},
// 切换页码时触发
handleCurrentChange(val) {
this.searchData.pageNum = val
this.getData()
},
},
}
</script>