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
@@ -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>