Compare commits
19 Commits
luckyTycoo
...
medal
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f34a7b9430 | ||
![]() |
fbd4fdcbd1 | ||
![]() |
7ea73622cd | ||
![]() |
6e66ca4864 | ||
![]() |
12761b956c | ||
![]() |
76f9bcddab | ||
![]() |
3e490e2631 | ||
![]() |
00b2bf5917 | ||
![]() |
5b41dbabed | ||
![]() |
b53103c162 | ||
![]() |
4fcc220759 | ||
![]() |
386966a84e | ||
![]() |
e2c6898f16 | ||
![]() |
ef83e6d239 | ||
![]() |
942cd1e479 | ||
![]() |
939940a217 | ||
![]() |
de2c0fe8ea | ||
![]() |
ab3b8c2871 | ||
![]() |
3a39476782 |
28
package-lock.json
generated
28
package-lock.json
generated
@@ -25,6 +25,7 @@
|
||||
"popper.js": "^1.16.1",
|
||||
"sass": "^1.67.0",
|
||||
"sass-loader": "^13.3.2",
|
||||
"unplugin-element-plus": "^0.8.0",
|
||||
"vue-router": "^4.0.3",
|
||||
"vuex": "^4.0.0",
|
||||
"xlsx": "^0.18.5"
|
||||
@@ -2193,7 +2194,6 @@
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.5.tgz",
|
||||
"integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/estree": "^1.0.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
@@ -12376,7 +12376,6 @@
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.5.0.tgz",
|
||||
"integrity": "sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"acorn": "^8.10.0",
|
||||
"chokidar": "^3.5.3",
|
||||
@@ -12448,6 +12447,28 @@
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/unplugin-element-plus": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/unplugin-element-plus/-/unplugin-element-plus-0.8.0.tgz",
|
||||
"integrity": "sha512-jByUGY3FG2B8RJKFryqxx4eNtSTj+Hjlo8edcOdJymewndDQjThZ1pRUQHRjQsbKhTV2jEctJV7t7RJ405UL4g==",
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^5.0.2",
|
||||
"es-module-lexer": "^1.3.0",
|
||||
"magic-string": "^0.30.1",
|
||||
"unplugin": "^1.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.19.0"
|
||||
}
|
||||
},
|
||||
"node_modules/unplugin-element-plus/node_modules/magic-string": {
|
||||
"version": "0.30.10",
|
||||
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.10.tgz",
|
||||
"integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==",
|
||||
"dependencies": {
|
||||
"@jridgewell/sourcemap-codec": "^1.4.15"
|
||||
}
|
||||
},
|
||||
"node_modules/unplugin-vue-components": {
|
||||
"version": "0.25.2",
|
||||
"resolved": "https://registry.npmmirror.com/unplugin-vue-components/-/unplugin-vue-components-0.25.2.tgz",
|
||||
@@ -12527,8 +12548,7 @@
|
||||
"node_modules/unplugin/node_modules/webpack-virtual-modules": {
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmmirror.com/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz",
|
||||
"integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw=="
|
||||
},
|
||||
"node_modules/update-browserslist-db": {
|
||||
"version": "1.0.13",
|
||||
|
@@ -25,6 +25,7 @@
|
||||
"popper.js": "^1.16.1",
|
||||
"sass": "^1.67.0",
|
||||
"sass-loader": "^13.3.2",
|
||||
"unplugin-element-plus": "^0.8.0",
|
||||
"vue-router": "^4.0.3",
|
||||
"vuex": "^4.0.0",
|
||||
"xlsx": "^0.18.5"
|
||||
|
34
src/api/VipGive/VipGive.js
Normal file
34
src/api/VipGive/VipGive.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import request from '@/utils/request';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
// 查询用户接口
|
||||
export const getByErbanNo = query => {
|
||||
return request({
|
||||
url: '/admin/user/getByErbanNo',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 获取VIP列表接口
|
||||
export const listAll = query => {
|
||||
return request({
|
||||
url: '/admin/vip/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 获取列表接口
|
||||
export const pageRecord = query => {
|
||||
return request({
|
||||
url: '/vipSend/pageRecord',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 赠送VIP接口
|
||||
export const vipSendSend = query => {
|
||||
return request({
|
||||
url: '/vipSend/send',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
21
src/api/feedBack/feedBack.js
Normal file
21
src/api/feedBack/feedBack.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from '@/utils/request';
|
||||
import qs from 'qs';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
|
||||
// ==================================每日数据====================================
|
||||
// 反馈类型
|
||||
export const listType = query => {
|
||||
return request({
|
||||
url: '/admin/feedback/listType',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 反馈列表
|
||||
export const pageRecord = query => {
|
||||
return request({
|
||||
url: '/admin/feedback/pageRecord',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
29
src/api/gameInfo/gameInfo.js
Normal file
29
src/api/gameInfo/gameInfo.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import request from '@/utils/request';
|
||||
import qs from 'qs';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
|
||||
// ==================================每日数据====================================
|
||||
// 列表
|
||||
export const page = query => {
|
||||
return request({
|
||||
url: '/admin/gamePartner/info/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 编辑修改
|
||||
export const save = query => {
|
||||
return request({
|
||||
url: '/admin/gamePartner/info/save',
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
};
|
||||
// 删除
|
||||
export const delGame = query => {
|
||||
return request({
|
||||
url: '/admin/gamePartner/info/delGame',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
58
src/api/medal/medal.js
Normal file
58
src/api/medal/medal.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/utils/request';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
// 地区接口
|
||||
export const listPartitionInfo = query => {
|
||||
return request({
|
||||
url: '/partition/listPartitionInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章信息-列表
|
||||
export const medalPage = query => {
|
||||
return request({
|
||||
url: '/admin/medal/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章信息-新增&保存
|
||||
export const medalSave = query => {
|
||||
return request({
|
||||
url: '/admin/medal/save',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章信息-发放
|
||||
export const medalSend = query => {
|
||||
return request({
|
||||
url: '/admin/medal/send',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章记录-撤销
|
||||
export const rollback = query => {
|
||||
return request({
|
||||
url: '/admin/medalRecord/rollback',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章记录-列表
|
||||
export const medalRecordPage = query => {
|
||||
return request({
|
||||
url: '/admin/medalRecord/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章记录-勋章列表
|
||||
export const listAll = query => {
|
||||
return request({
|
||||
url: '/admin/medal/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@@ -115,3 +115,8 @@ export const exportFamilyMember = query => {
|
||||
window.location.href = `/admin/family/manage/exportFamilyMember?${genQueryParam(query)}`;
|
||||
return;
|
||||
};
|
||||
// 导出-公会信息
|
||||
export const exportInfo = query => {
|
||||
window.location.href = `/admin/family/manage/exportFamily?${genQueryParam(query)}`;
|
||||
return;
|
||||
};
|
||||
|
@@ -212,19 +212,12 @@ export default {
|
||||
this.childMenu.parentName = menu.parentstr;
|
||||
this.childMenu.description = menu.description;
|
||||
store.dispatch("getViewComponent", menu.path).then((componentName) => {
|
||||
console.log(componentName);
|
||||
this.componentName = componentName;
|
||||
const files = require.context("@/views", true, /\.vue$/);
|
||||
let components = {};
|
||||
files.keys().forEach((key) => {
|
||||
components[key.replace(/(\.\/|\.vue)/g, "")] = files(key).default;
|
||||
});
|
||||
Object.keys(components).forEach((item) => {
|
||||
if (components[item].name == componentName) {
|
||||
Vue.component(components[item].name, components[item]);
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
search() {
|
||||
|
@@ -1,100 +1,136 @@
|
||||
<template>
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<div id="toolbar">
|
||||
<div class="col-sm-12">
|
||||
<button id="btnAdd" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>增加
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<div id="toolbar">
|
||||
<div class="col-sm-12">
|
||||
<button id="btnAdd"
|
||||
class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>增加
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="roomTagModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="modalLabel">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="addForm">
|
||||
<input type="hidden" name="id" id="id" />
|
||||
<div class="form-group">
|
||||
<label for="dressType" class="col-sm-3 control-label">装扮类型:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="dressType" id="dressType">
|
||||
<option value="">-- 请选择 --</option>
|
||||
<option value="0">头饰</option>
|
||||
<option value="1">座驾</option>
|
||||
<option value="2">铭牌</option>
|
||||
<option value="3">资料卡</option>
|
||||
<option value="4">聊天气泡</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="txtBox">
|
||||
<label for="dressId" class="col-sm-3 control-label">装扮id<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="dressId" id="dressId"
|
||||
placeholder="请输入对应的装扮id">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressSeq" class="col-sm-3 control-label">展示排序<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="dressSeq" id="dressSeq"
|
||||
placeholder="数字小的排前面,必填">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressPrice" class="col-sm-3 control-label">装扮价格:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="dressPrice" id="dressPrice"
|
||||
placeholder="请输入价格">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressDay" class="col-sm-3 control-label">有效期(天):</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="dressDay" id="dressDay"
|
||||
placeholder="请输入天数">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressLimitStatus" class="col-sm-3 control-label">装扮限时状态:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="dressType" id="dressLimitStatus">
|
||||
<option value="0">是</option>
|
||||
<option value="1">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" id="add">确定</button>
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade"
|
||||
id="roomTagModal"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog"
|
||||
role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"
|
||||
id="modalLabel">新增</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal"
|
||||
id="addForm">
|
||||
<input type="hidden"
|
||||
name="id"
|
||||
id="id" />
|
||||
<div class="form-group">
|
||||
<label for="dressType"
|
||||
class="col-sm-3 control-label">装扮类型:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="dressType"
|
||||
id="dressType">
|
||||
<option value="">-- 请选择 --</option>
|
||||
<option value="0">头饰</option>
|
||||
<option value="1">座驾</option>
|
||||
<option value="2">铭牌</option>
|
||||
<option value="3">资料卡</option>
|
||||
<option value="4">聊天气泡</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"
|
||||
id="txtBox">
|
||||
<label for="dressId"
|
||||
class="col-sm-3 control-label">装扮id<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
class="form-control validate[required]"
|
||||
name="dressId"
|
||||
id="dressId"
|
||||
placeholder="请输入对应的装扮id">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressSeq"
|
||||
class="col-sm-3 control-label">展示排序<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
class="form-control validate[required]"
|
||||
name="dressSeq"
|
||||
id="dressSeq"
|
||||
placeholder="数字小的排前面,必填">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressPrice"
|
||||
class="col-sm-3 control-label">装扮价格:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
class="form-control validate[required]"
|
||||
name="dressPrice"
|
||||
id="dressPrice"
|
||||
placeholder="请输入价格">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressDay"
|
||||
class="col-sm-3 control-label">有效期(天):</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text"
|
||||
class="form-control validate[required]"
|
||||
name="dressDay"
|
||||
id="dressDay"
|
||||
placeholder="请输入天数">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dressLimitStatus"
|
||||
class="col-sm-3 control-label">装扮限时状态:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="dressType"
|
||||
id="dressLimitStatus">
|
||||
<option value="0">是</option>
|
||||
<option value="1">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button type="button"
|
||||
class="btn btn-primary"
|
||||
id="add">确定</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -102,326 +138,326 @@ import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { serverError } from '@/utils/maintainer';
|
||||
|
||||
export default {
|
||||
name: "DressShopAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
name: "DressShopAdminView",
|
||||
setup () {
|
||||
return {};
|
||||
},
|
||||
created () {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData () {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressId', title: '装扮id', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'name.zh', title: '装扮名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{ field: 'name.ar', title: '阿语装扮名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{ field: 'name.en', title: '英语装扮名称', align: 'left', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'pic', title: '装扮图片', align: 'left', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
if (null != val && val != '') {
|
||||
return '<img src="' + val + '" alt="" style="width: 30px; height: 30px;">';
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'dressType',
|
||||
title: '装扮类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == '0') {
|
||||
return "头饰";
|
||||
} else if (val == '1') {
|
||||
return '座驾';
|
||||
} else if (val == '2') {
|
||||
return '铭牌';
|
||||
} else if (val == '3') {
|
||||
return '资料卡';
|
||||
} else if (val == '4') {
|
||||
return '聊天气泡';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{ field: 'dressSeq', title: '装扮排序', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressPrice', title: '装扮展示价值', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressDay', title: '装扮有效期(天)', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'buyNum', title: '购买数量', align: '购买数量 ', valign: 'middle', width: '10%' },
|
||||
{ field: 'userDonateNum', title: '购买赠送用户数量', align: '购买数量', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'dressLimitStatus',
|
||||
title: '装扮限时状态',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == '0') {
|
||||
return "有效";
|
||||
} else {
|
||||
return '无效';
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
||||
' <button class="btn btn-sm btn-danger opt-remove" data-id=' + val + ' data-new-status=' + 2 +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
undefinedText: "-",
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 50,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams (params) { //设置查询参数
|
||||
var param = {
|
||||
pageNum: params.pageNumber,
|
||||
pageSize: params.pageSize
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax: function (request) { //使用ajax请求
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/admin/dress/shop/list',
|
||||
contentType: 'application/json;charset=utf-8',
|
||||
dataType: 'json',
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
apiResult(res);
|
||||
console.log(res)
|
||||
request.success({
|
||||
total: res.data.total,
|
||||
rows: res.data.rows.map(i => {
|
||||
let value = i.name;
|
||||
if (value.startsWith('{') && value.endsWith('}')) {
|
||||
i.name = JSON.parse(i.name);
|
||||
} else {
|
||||
i.name = {
|
||||
zh: i.name,
|
||||
ar: i.name,
|
||||
en: i.name,
|
||||
};
|
||||
}
|
||||
return i;
|
||||
})
|
||||
});
|
||||
},
|
||||
error: function (req) {
|
||||
serverError(req);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: 'ID', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressId', title: '装扮id', align: 'center', valign: 'middle', width: '10%' },
|
||||
{field: 'name.zh', title: '装扮名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'name.ar', title: '阿语装扮名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{field: 'name.en', title: '英语装扮名称', align: 'left', valign: 'middle', width: '10%'},
|
||||
{
|
||||
field: 'pic', title: '装扮图片', align: 'left', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
if (null != val && val != '') {
|
||||
return '<img src="' + val + '" alt="" style="width: 30px; height: 30px;">';
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'dressType',
|
||||
title: '装扮类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == '0') {
|
||||
return "头饰";
|
||||
} else if (val == '1') {
|
||||
return '座驾';
|
||||
} else if (val == '2') {
|
||||
return '铭牌';
|
||||
} else if (val == '3') {
|
||||
return '资料卡';
|
||||
} else if (val == '4') {
|
||||
return '聊天气泡';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{ field: 'dressSeq', title: '装扮排序', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressPrice', title: '装扮展示价值', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'dressDay', title: '装扮有效期(天)', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'buyNum', title: '购买数量', align: '购买数量 ', valign: 'middle', width: '10%' },
|
||||
{ field: 'userDonateNum', title: '购买赠送用户数量', align: '购买数量', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'dressLimitStatus',
|
||||
title: '装扮限时状态',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == '0') {
|
||||
return "有效";
|
||||
} else {
|
||||
return '无效';
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
||||
' <button class="btn btn-sm btn-danger opt-remove" data-id=' + val + ' data-new-status=' + 2 +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
undefinedText: "-",
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 50,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100, 200, 300, 500],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
pageNum: params.pageNumber,
|
||||
pageSize: params.pageSize
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax: function (request) { //使用ajax请求
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/admin/dress/shop/list',
|
||||
contentType: 'application/json;charset=utf-8',
|
||||
dataType: 'json',
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
apiResult(res);
|
||||
console.log(res)
|
||||
request.success({
|
||||
"rows": res.data.rows.map(i=>{
|
||||
let value = i.name;
|
||||
if (value.startsWith('{') && value.endsWith('}')) {
|
||||
i.name = JSON.parse(i.name);
|
||||
} else {
|
||||
i.name = {
|
||||
zh: i.name,
|
||||
ar: i.name,
|
||||
en: i.name,
|
||||
};
|
||||
}
|
||||
return i;
|
||||
}),
|
||||
"total": res.total
|
||||
});
|
||||
},
|
||||
error: function (req) {
|
||||
serverError(req);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
|
||||
//新建标签
|
||||
$("#btnAdd").click(function () {
|
||||
clearModal();
|
||||
$("#roomTagModal").modal('show');
|
||||
});
|
||||
//新建标签
|
||||
$("#btnAdd").click(function () {
|
||||
clearModal();
|
||||
$("#roomTagModal").modal('show');
|
||||
});
|
||||
|
||||
$("#add").click(function () {
|
||||
var id = $("#id").val();
|
||||
var dressType = $('#dressType').val();
|
||||
var dressId = $("#dressId").val();
|
||||
var dressSeq = $('#dressSeq').val();
|
||||
var dressPrice = $('#dressPrice').val();
|
||||
var dressDay = $('#dressDay').val();
|
||||
var dressLimitStatus = $('#dressLimitStatus').val();
|
||||
$("#add").click(function () {
|
||||
var id = $("#id").val();
|
||||
var dressType = $('#dressType').val();
|
||||
var dressId = $("#dressId").val();
|
||||
var dressSeq = $('#dressSeq').val();
|
||||
var dressPrice = $('#dressPrice').val();
|
||||
var dressDay = $('#dressDay').val();
|
||||
var dressLimitStatus = $('#dressLimitStatus').val();
|
||||
|
||||
if ($("#addForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/dress/shop/saveOrUpdate",
|
||||
data: {
|
||||
id: id,
|
||||
dressId: dressId,
|
||||
dressType: dressType,
|
||||
dressSeq: dressSeq,
|
||||
dressPrice: dressPrice,
|
||||
dressDay: dressDay,
|
||||
dressLimitStatus: dressLimitStatus,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagModal").modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
clearModal();
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/dress/shop/getById",
|
||||
data: { id: id },
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
var json = res.data;
|
||||
if (json) {
|
||||
$("#id").val(id);
|
||||
$('#dressId').val(json.dressId);
|
||||
$('#dressType').val(json.dressType);
|
||||
$('#dressSeq').val(json.dressSeq);
|
||||
$('#dressPrice').val(json.dressPrice);
|
||||
$('#dressDay').val(json.dressDay);
|
||||
$('#dressLimitStatus').val(json.dressLimitStatus);
|
||||
// 打开编辑弹窗
|
||||
$("#roomTagModal").modal('show');
|
||||
$("#modalLabel").text("编辑");
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-remove', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
|
||||
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
|
||||
const requestParam = {
|
||||
id: id
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/dress/shop/delById",
|
||||
data: requestParam,
|
||||
dataType: "json",
|
||||
contentType: 'application/json',
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("修改成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("修改失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function apiResult(json) {
|
||||
if (json.code == 200 && json.message == 'success') {
|
||||
return true;
|
||||
}
|
||||
$("#tipMsg").text("请求失败,错误信息:" + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
return false;
|
||||
if ($("#addForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/dress/shop/saveOrUpdate",
|
||||
data: {
|
||||
id: id,
|
||||
dressId: dressId,
|
||||
dressType: dressType,
|
||||
dressSeq: dressSeq,
|
||||
dressPrice: dressPrice,
|
||||
dressDay: dressDay,
|
||||
dressLimitStatus: dressLimitStatus,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagModal").modal('hide');
|
||||
}
|
||||
|
||||
|
||||
$('#iconBtn').on('click', function () {
|
||||
if ($('#iconFile').val() == '') {
|
||||
$('#tipMsg').text('上传图片为空');
|
||||
$('#tipModal').modal('show');
|
||||
return;
|
||||
}
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'iconFile', //需要上传的文件域的ID,即<input type="file">的ID。
|
||||
url: '/admin/upload/img', //后台方法的路径
|
||||
type: 'post', //当要提交自定义参数时,这个参数要设置成post
|
||||
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写,jQuery会自动判断。
|
||||
secureuri: false, //是否启用安全提交,默认为false。
|
||||
async: true, //是否是异步
|
||||
success: function (json) { //提交成功后自动执行的处理函数,参数data就是服务器返回的数据。
|
||||
if (json.path) {
|
||||
$('#iconUrl').val(json.path);
|
||||
$('#iconImgUrl').attr("src", json.path);
|
||||
|
||||
console.log(json.path);
|
||||
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
},
|
||||
error: function (data, status, e) { //提交失败自动执行的处理函数。
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
function clearModal() {
|
||||
$('#iconImgUrl').attr('src', '');
|
||||
|
||||
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
|
||||
$(this).val('');
|
||||
})
|
||||
|
||||
$('#type').val(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$("#type").change(function () {
|
||||
var optVal = $(this).val();
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
clearModal();
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/dress/shop/getById",
|
||||
data: { id: id },
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
var json = res.data;
|
||||
if (json) {
|
||||
$("#id").val(id);
|
||||
$('#dressId').val(json.dressId);
|
||||
$('#dressType').val(json.dressType);
|
||||
$('#dressSeq').val(json.dressSeq);
|
||||
$('#dressPrice').val(json.dressPrice);
|
||||
$('#dressDay').val(json.dressDay);
|
||||
$('#dressLimitStatus').val(json.dressLimitStatus);
|
||||
// 打开编辑弹窗
|
||||
$("#roomTagModal").modal('show');
|
||||
$("#modalLabel").text("编辑");
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-remove', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
|
||||
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
|
||||
const requestParam = {
|
||||
id: id
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/dress/shop/delById",
|
||||
data: requestParam,
|
||||
dataType: "json",
|
||||
contentType: 'application/json',
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("修改成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("修改失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
function apiResult (json) {
|
||||
if (json.code == 200 && json.message == 'success') {
|
||||
return true;
|
||||
}
|
||||
$("#tipMsg").text("请求失败,错误信息:" + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
$('#iconBtn').on('click', function () {
|
||||
if ($('#iconFile').val() == '') {
|
||||
$('#tipMsg').text('上传图片为空');
|
||||
$('#tipModal').modal('show');
|
||||
return;
|
||||
}
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'iconFile', //需要上传的文件域的ID,即<input type="file">的ID。
|
||||
url: '/admin/upload/img', //后台方法的路径
|
||||
type: 'post', //当要提交自定义参数时,这个参数要设置成post
|
||||
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写,jQuery会自动判断。
|
||||
secureuri: false, //是否启用安全提交,默认为false。
|
||||
async: true, //是否是异步
|
||||
success: function (json) { //提交成功后自动执行的处理函数,参数data就是服务器返回的数据。
|
||||
if (json.path) {
|
||||
$('#iconUrl').val(json.path);
|
||||
$('#iconImgUrl').attr("src", json.path);
|
||||
|
||||
console.log(json.path);
|
||||
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
},
|
||||
error: function (data, status, e) { //提交失败自动执行的处理函数。
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
function clearModal () {
|
||||
$('#iconImgUrl').attr('src', '');
|
||||
|
||||
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
|
||||
$(this).val('');
|
||||
})
|
||||
|
||||
$('#type').val(1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$("#type").change(function () {
|
||||
var optVal = $(this).val();
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
475
src/views/gamepartner/GameInfo.vue
Normal file
475
src/views/gamepartner/GameInfo.vue
Normal file
@@ -0,0 +1,475 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<!-- 时间选择器 -->
|
||||
<!-- <div class="inquire">
|
||||
<div class="block">
|
||||
<span class="demonstration">创建时间</span>
|
||||
<el-date-picker
|
||||
v-model="inquire.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="inquire">
|
||||
<span>游戏昵称</span>
|
||||
<el-input
|
||||
v-model="inquire.gameName"
|
||||
placeholder="请输入..."
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()">
|
||||
查询</el-button
|
||||
>
|
||||
<!-- 添加 -->
|
||||
<el-button class="primary" type="primary" @click="add()"> 添加</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="gameName" align="center" label="游戏名称" />
|
||||
<!-- <el-table-column prop="x" align="center" label="分区" /> -->
|
||||
<el-table-column align="center" prop="giftInfo" label="游戏icon">
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
v-if="scope.row.logo"
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.logo"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.logo"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
<div v-else>/</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="giftInfo" label="游戏背景">
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
v-if="scope.row.background"
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.background"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.background"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
<div v-else>/</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="giftInfo" label="下单弹窗背景">
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
v-if="scope.row.pic"
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.pic"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.pic"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
<div v-else>/</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="x" align="center" label="创建日期" />
|
||||
<el-table-column prop="x" align="center" label="添加人" /> -->
|
||||
<el-table-column align="center" label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="eir(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="
|
||||
delObj = scope.row;
|
||||
delDialog = true;
|
||||
"
|
||||
class="danger"
|
||||
type="danger"
|
||||
size="default"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 二次确认 -->
|
||||
<el-dialog v-model="delDialog" title="提示" width="30%" center>
|
||||
<span> 确认要删除吗?</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="delDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="sureClick()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加和编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="operationDialog"
|
||||
:title="operationTitle"
|
||||
width="30%"
|
||||
center
|
||||
>
|
||||
<!-- 地区 -->
|
||||
<!-- <div class="selectBox">
|
||||
<span class="left" style="margin-right: 20px">地区</span>
|
||||
<el-checkbox-group v-model="operation.checkList">
|
||||
<el-checkbox label="1">英语</el-checkbox>
|
||||
<el-checkbox label="2">阿语</el-checkbox>
|
||||
<el-checkbox label="4">华语</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div> -->
|
||||
<!-- 游戏昵称 -->
|
||||
<div class="selectBox">
|
||||
<span class="left" style="margin-right: 20px">游戏昵称</span>
|
||||
<el-input
|
||||
v-model="operation.gameName"
|
||||
size="default"
|
||||
placeholder="请输入游戏昵称..."
|
||||
class="right"
|
||||
style="width: 70%"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 游戏icon -->
|
||||
<div class="selectBox selectBoxImg">
|
||||
<span class="left" style="margin-right: 20px">游戏icon</span>
|
||||
<!-- action="/admin/tencent/cos/upload/file" -->
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/admin/tencent/cos/upload/file"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:on-error="handleAvatarError"
|
||||
>
|
||||
<img
|
||||
v-if="operation.imageUrl1"
|
||||
:src="operation.imageUrl1"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||
</el-upload>
|
||||
</div>
|
||||
<!-- 游戏背景 -->
|
||||
<div class="selectBox selectBoxImg">
|
||||
<span class="left" style="margin-right: 20px">游戏背景</span>
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/admin/tencent/cos/upload/file"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess2"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:on-error="handleAvatarError"
|
||||
>
|
||||
<img
|
||||
v-if="operation.imageUrl2"
|
||||
:src="operation.imageUrl2"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||
</el-upload>
|
||||
</div>
|
||||
<!-- 下单弹窗icon -->
|
||||
<div class="selectBox selectBoxImg">
|
||||
<span class="left" style="margin-right: 20px">下单弹窗icon</span>
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/admin/tencent/cos/upload/file"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess3"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:on-error="handleAvatarError"
|
||||
>
|
||||
<img
|
||||
v-if="operation.imageUrl3"
|
||||
:src="operation.imageUrl3"
|
||||
class="avatar"
|
||||
/>
|
||||
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||
</el-upload>
|
||||
</div>
|
||||
<!-- 操作 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="operationDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="operationClick()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { page, save, delGame } from "@/api/gameInfo/gameInfo";
|
||||
import { Plus } from "@element-plus/icons-vue";
|
||||
import { uploadQiNiuFile } from "@/api/common/upload";
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
export default {
|
||||
name: "GameInfo",
|
||||
components: {
|
||||
Plus,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inquire: {
|
||||
time: "",
|
||||
gameName: "",
|
||||
},
|
||||
loading: false,
|
||||
// 表格数据
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
// 二次确认
|
||||
delDialog: false,
|
||||
//操作和编辑
|
||||
operationDialog: false,
|
||||
operationType: 1, //1添加2编辑
|
||||
operationTitle: "编辑&添加",
|
||||
operatioObj: {},
|
||||
operation: {
|
||||
gameName: "",
|
||||
imageUrl1: "",
|
||||
imageUrl2: "",
|
||||
imageUrl3: "",
|
||||
},
|
||||
delObj: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.loading = true;
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
if (this.inquire.time && this.inquire.time.length > 0) {
|
||||
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
page({
|
||||
gameName: this.inquire.gameName,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData = res.data.rows;
|
||||
this.total = res.data.total;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.operationDialog = true;
|
||||
this.operationType = 1;
|
||||
this.operationTitle = "添加";
|
||||
this.operation = {
|
||||
gameName: "",
|
||||
imageUrl1: "",
|
||||
imageUrl2: "",
|
||||
imageUrl3: "",
|
||||
};
|
||||
},
|
||||
eir(val) {
|
||||
this.operatioObj = val;
|
||||
this.operationDialog = true;
|
||||
this.operationType = 2;
|
||||
this.operationTitle = "编辑";
|
||||
this.operation = {
|
||||
gameName: this.operatioObj.gameName,
|
||||
imageUrl1: this.operatioObj.logo,
|
||||
imageUrl2: this.operatioObj.background,
|
||||
imageUrl3: this.operatioObj.pic,
|
||||
};
|
||||
},
|
||||
operationClick() {
|
||||
save({
|
||||
gameId: this.operationType == 1 ? null : this.operatioObj.gameId,
|
||||
gameName: this.operation.gameName,
|
||||
logo: this.operation.imageUrl1,
|
||||
background: this.operation.imageUrl2,
|
||||
pic: this.operation.imageUrl3,
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.operationDialog = false;
|
||||
this.getData();
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
sureClick() {
|
||||
delGame({ gameId: this.delObj.gameId }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.delDialog = false;
|
||||
this.getData();
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
JsonFunc(val) {
|
||||
var res = JSON.parse(val);
|
||||
return res;
|
||||
},
|
||||
beforeAvatarUpload() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传中~",
|
||||
type: "warning",
|
||||
});
|
||||
},
|
||||
handleAvatarError() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传失败!",
|
||||
type: "error",
|
||||
});
|
||||
},
|
||||
handleAvatarSuccess(res, file) {
|
||||
console.log(file);
|
||||
// this.operation.imageUrl1 = URL.createObjectURL();
|
||||
this.operation.imageUrl1 = file.response.data;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传成功!",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
handleAvatarSuccess2(res, file) {
|
||||
// this.operation.imageUrl2 = URL.createObjectURL(file.raw);
|
||||
this.operation.imageUrl2 = file.response.data;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传成功!",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
handleAvatarSuccess3(res, file) {
|
||||
// this.operation.imageUrl3 = URL.createObjectURL(file.raw);
|
||||
this.operation.imageUrl3 = file.response.data;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传成功!",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.currentPage = page;
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
.selectBox {
|
||||
display: flex;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.selectBoxImg {
|
||||
height: 150px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.avatar-uploader .avatar {
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed var(--el-border-color);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: var(--el-transition-duration-fast);
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.avatar-uploader .el-upload .el-upload__input {
|
||||
display: none;
|
||||
}
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
</style>
|
230
src/views/gamepartner/GamePartnerOrderDetailView.vue
Normal file
230
src/views/gamepartner/GamePartnerOrderDetailView.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
<form id="searchForm1" action="/admin/gamePartner/order/dayExport" method="get" target="_blank">
|
||||
<div class="col-sm-12">
|
||||
<label for="startTime" class="col-sm-2 control-label">日期:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="startTime" id="startTime">
|
||||
</div>
|
||||
<label for="endTime" class="col-sm-1 control-label">-</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="endTime" id="endTime"></div>
|
||||
</div>
|
||||
</form>
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
<button id="btnExport" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-export"></i>导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" style="width: 190%; left: 50%; transform: translateX(-50%);">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="modalLabel">订单详情</h4>
|
||||
</div>
|
||||
<form id="searchForm2" action="/admin/gamePartner/order/dayDetailExport" method="get" target="_blank">
|
||||
<input type="hidden" name="orderDate" id="orderDate" />
|
||||
<div class="modal-body">
|
||||
<!-- .content -->
|
||||
<div id="detailTable"></div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary" id="detailExport">导出</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">提示信息</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="tipMsg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
export default {
|
||||
name: "GamePartnerOrderDetailView",
|
||||
setup() { },
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
// 清空分页组件的容器
|
||||
$('.fixed-table-pagination').empty();
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'orderTime', title: '日期', align: 'center', width: '5%' },
|
||||
{ field: 'orderNum', title: '下单用户数', align: 'center', width: '5%' },
|
||||
{ field: 'totalInning', title: '累积下单局数', align: 'center', width: '5%' },
|
||||
{ field: 'orderCount', title: '累积下单次数', align: 'center', width: '5%' },
|
||||
{ field: 'totalAmount', title: '累积下单金额(钻)', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'handle',
|
||||
title: '详情',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
return '<button class="btn btn-sm btn-default opt-detail" data-index="' + index + '">详情</button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/gamePartner/order/dayPage',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
var picker1 = $("#startTime").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
});
|
||||
var picker2 = $("#endTime").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
todayBtn: true,
|
||||
autoclose: true
|
||||
});
|
||||
picker1.on('changeDate', function () {
|
||||
var date = $('#startTime').datepicker('getDate');
|
||||
picker2.datepicker('setStartDate', date);
|
||||
});
|
||||
picker2.on('changeDate', function () {
|
||||
var date = $('#endTime').datepicker('getDate');
|
||||
picker1.datepicker('setEndDate', date);
|
||||
});
|
||||
$('#table').on('click', '.opt-detail', function () {
|
||||
const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
|
||||
var orderTime = currentData.orderTime;
|
||||
$('#orderDate').val(orderTime);
|
||||
$("#detailModal").modal('show');
|
||||
$('#detailTable').bootstrapTable('destroy');
|
||||
// 清空分页组件的容器
|
||||
$('.fixed-table-pagination').empty();
|
||||
$('#detailTable').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'fromErBanNo', title: '下单用户id', align: 'center', width: '5%' },
|
||||
{ field: 'fromNick', title: '下单用户昵称', align: 'center', width: '5%' },
|
||||
{ field: 'toErBanNo', title: '接单用户id', align: 'center', width: '5%' },
|
||||
{ field: 'toNick', title: '接单用户昵称', align: 'center', width: '5%' },
|
||||
{ field: 'hallErBanNo', title: '房主id', align: 'center', width: '5%' },
|
||||
{ field: 'hallRoomName', title: '房间名称', align: 'center', width: '5%' },
|
||||
{ field: 'gameName', title: '下单游戏', align: 'center', width: '5%' },
|
||||
{ field: 'amount', title: '下单金额(钻)', align: 'center', width: '5%' },
|
||||
{ field: 'orderTime', title: '下单时间', align: 'center', width: '5%' },
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100],
|
||||
search: false,
|
||||
//表示服务端请求
|
||||
sidePagination: "server",
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
//设置查询参数
|
||||
queryParams: function queryParams(params) {
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
orderDate: orderTime
|
||||
};
|
||||
return param;
|
||||
},
|
||||
url: '/admin/gamePartner/order/dayDetailPage',
|
||||
//加载成功时执行
|
||||
onLoadSuccess: function () {
|
||||
console.log("load success");
|
||||
},
|
||||
//加载失败时执行
|
||||
onLoadError: function () {
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
});
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
//导出功能
|
||||
$("#btnExport").on('click', function () {
|
||||
$("#searchForm1").submit();
|
||||
});
|
||||
//导出功能
|
||||
$("#detailExport").on('click', function () {
|
||||
$("#searchForm2").submit();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fixed-table-pagination .page-list {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.fixed-table-pagination div.pagination,
|
||||
.fixed-table-pagination .pagination-detail {
|
||||
display: block !important;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
175
src/views/gamepartner/GamePartnerOrderView.vue
Normal file
175
src/views/gamepartner/GamePartnerOrderView.vue
Normal file
@@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
<form id="searchForm" action="/admin/gamePartner/order/orderExport" method="get" target="_blank">
|
||||
<div class="col-sm-12">
|
||||
<label for="fromErBanNo" class="col-sm-2 control-label">下单用户id:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="fromErBanNo"
|
||||
id="fromErBanNo"></div>
|
||||
<label for="gameId" class="col-sm-2 control-label">下单游戏:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="gameId" id="gameId" data-btn-class="btn-warning" class="form-control">
|
||||
<option value="" selected="selected">全部</option>
|
||||
</select>
|
||||
</div>
|
||||
<label for="orderNo" class="col-sm-2 control-label">订单号:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="orderNo" id="orderNo"></div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="startTime" class="col-sm-2 control-label">下单时间:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="startTime" id="startTime">
|
||||
</div>
|
||||
<label for="endTime" class="col-sm-2 control-label">-</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="endTime" id="endTime"></div>
|
||||
<label for="toErBanNo" class="col-sm-2 control-label">接单用户id:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="toErBanNo" id="toErBanNo">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
<button id="btnExport" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-export"></i>导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="tipModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">提示信息</h4>
|
||||
</div>
|
||||
<div class="modal-body" id="tipMsg"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
export default {
|
||||
name: "GamePartnerOrderView",
|
||||
setup() { },
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
getGamePartnerInfo();
|
||||
$('#table').bootstrapTable('destroy');
|
||||
// 清空分页组件的容器
|
||||
$('.fixed-table-pagination').empty();
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'orderNo', title: '订单号', align: 'center', width: '5%' },
|
||||
{ field: 'fromErBanNo', title: '下单用户id', align: 'center', width: '5%' },
|
||||
{ field: 'fromNick', title: '下单用户昵称', align: 'center', width: '5%' },
|
||||
{ field: 'toErBanNo', title: '接单用户id', align: 'center', width: '5%' },
|
||||
{ field: 'toNick', title: '接单用户昵称', align: 'center', width: '5%' },
|
||||
{ field: 'income', title: '接单用户收益(水晶)', align: 'center', width: '5%' },
|
||||
{ field: 'gameName', title: '下单游戏', align: 'center', width: '5%' },
|
||||
{ field: 'inning', title: '下单局数', align: 'center', width: '5%' },
|
||||
{ field: 'amount', title: '下单金额', align: 'center', width: '5%' },
|
||||
{ field: 'orderTime', title: '下单时间', align: 'center', width: '5%' },
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
fromErBanNo: $('#fromErBanNo').val(),
|
||||
toErBanNo: $('#toErBanNo').val(),
|
||||
gameId: $('#gameId').val(),
|
||||
orderNo: $('#orderNo').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/gamePartner/order/orderPage',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
var picker1 = $("#startTime").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
});
|
||||
var picker2 = $("#endTime").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
todayBtn: true,
|
||||
autoclose: true
|
||||
});
|
||||
picker1.on('changeDate', function () {
|
||||
var date = $('#startTime').datepicker('getDate');
|
||||
picker2.datepicker('setStartDate', date);
|
||||
});
|
||||
picker2.on('changeDate', function () {
|
||||
var date = $('#endTime').datepicker('getDate');
|
||||
picker1.datepicker('setEndDate', date);
|
||||
});
|
||||
//导出功能
|
||||
$("#btnExport").on('click', function () {
|
||||
$("#searchForm").submit();
|
||||
});
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
//游戏
|
||||
function getGamePartnerInfo() {
|
||||
var array;
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/gamePartner/info/listAll",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function (json) {
|
||||
if (json.success == 'true' || json.code == 200) {
|
||||
array = json.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
var $select = $('#gameId');
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
var $option = $('<option value="' + array[i].gameId + '" />');
|
||||
$option.html(array[i].gameName);
|
||||
$select.append($option);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
501
src/views/gamepartner/UserGamePartnerInfoAdminView.vue
Normal file
501
src/views/gamepartner/UserGamePartnerInfoAdminView.vue
Normal file
@@ -0,0 +1,501 @@
|
||||
<template>
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<div id="toolbar">
|
||||
<div class="col-sm-12">
|
||||
<label for="erbanNo"
|
||||
class="col-sm-1 control-label">用户ID:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="number"
|
||||
class="form-control"
|
||||
name="erbanNo"
|
||||
id="erbanNo">
|
||||
</div>
|
||||
<label for="gameId"
|
||||
class="col-sm-1 control-label">游戏类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="gameId"
|
||||
id="gameId"
|
||||
class="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="startTime"
|
||||
class="col-sm-1 control-label">添加日期:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text"
|
||||
class="input-sm form-control"
|
||||
name="startTime"
|
||||
id="startTime">
|
||||
</div>
|
||||
|
||||
<label for="endTime"
|
||||
class="col-sm-1 control-label">至:</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text"
|
||||
class="input-sm form-control"
|
||||
name="endTime"
|
||||
id="endTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch"
|
||||
class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
<button id="btnAdd"
|
||||
class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>增加
|
||||
</button>
|
||||
<button id="btnBatchInvaild"
|
||||
class="btn btn-danger">
|
||||
<i class="glyphicon glyphicon-remove"></i>批量失效
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade"
|
||||
id="userModal"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog"
|
||||
role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title"
|
||||
id="modalLabel">添加陪玩</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal"
|
||||
id="modalForm">
|
||||
<input type="hidden"
|
||||
name="uid"
|
||||
id="uid" />
|
||||
<div class="form-group">
|
||||
<label for="modalErbanNo"
|
||||
class="col-sm-3 control-label">用户ID:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="number"
|
||||
class="form-control validate[required]"
|
||||
name="modalErbanNo"
|
||||
id="modalErbanNo"
|
||||
onchange="inputErbanNo(this)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-12">
|
||||
<input type="button"
|
||||
class="form-control"
|
||||
value="添加游戏"
|
||||
id="modalAddBtn"
|
||||
onclick="addGameInfo()" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="modalGames"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button"
|
||||
class="btn btn-default"
|
||||
data-dismiss="modal">关闭</button>
|
||||
<button type="button"
|
||||
class="btn btn-primary"
|
||||
id="submit">确定</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
let modalData = {};
|
||||
var gameInfoList = [];
|
||||
var gameInfoMap = {};
|
||||
export default {
|
||||
name: "UserGamePartnerInfoAdminView",
|
||||
setup () {
|
||||
function selectGameId (select, index) {
|
||||
const gameId = select.options[select.selectedIndex].value;
|
||||
const gameInfo = gameInfoMap[gameId];
|
||||
modalData.games[index] = { gameId: gameInfo.gameId, tags: Object.assign([], gameInfo.tags) }
|
||||
freshUserModal()
|
||||
}
|
||||
function inputErbanNo (input) {
|
||||
modalData.erbanNo = input.value;
|
||||
}
|
||||
function inputPrice (input, index) {
|
||||
modalData.games[index].price = input.value;
|
||||
}
|
||||
function inputProficiency (input, index) {
|
||||
modalData.games[index].proficiency = input.value;
|
||||
}
|
||||
function inputTag (input, index, tagIndex) {
|
||||
modalData.games[index].tags[tagIndex].tagVal = input.value;
|
||||
}
|
||||
function addGameInfo () {
|
||||
if (!modalData.games) {
|
||||
modalData.games = [];
|
||||
}
|
||||
const hasAddGameId = modalData.games.map(game => game.gameId);
|
||||
const gameInfo = gameInfoList.filter(gameInfo => !hasAddGameId.includes(gameInfo.gameId))[0];
|
||||
modalData.games.push({ gameId: gameInfo.gameId, tags: Object.assign([], gameInfo.tags) })
|
||||
freshUserModal()
|
||||
}
|
||||
window.selectGameId = selectGameId;
|
||||
window.inputErbanNo = inputErbanNo;
|
||||
window.inputPrice = inputPrice;
|
||||
window.inputProficiency = inputProficiency;
|
||||
window.inputTag = inputTag;
|
||||
window.addGameInfo = addGameInfo;
|
||||
return {
|
||||
selectGameId,
|
||||
inputErbanNo,
|
||||
inputPrice,
|
||||
inputProficiency,
|
||||
inputTag,
|
||||
addGameInfo,
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData () {
|
||||
$(function () {
|
||||
cacheGameInfo();
|
||||
$('#table').bootstrapTable('destroy');
|
||||
// 清空分页组件的容器
|
||||
$('.fixed-table-pagination').empty();
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'checkBox', title: 'id', align: 'center', checkbox: true, width: '5%' },
|
||||
{ field: 'erbanNo', title: '用户ID', align: 'center', width: '5%' },
|
||||
{ field: 'nick', title: '昵称', align: 'center', width: '10%' },
|
||||
{ field: 'games', title: '支持游戏', align: 'center', width: '60%', formatter: gameFormatter },
|
||||
{ field: 'updateTime', title: '更新时间', align: 'center', width: '10%' },
|
||||
{ field: 'adminName', title: '操作人', align: 'center', width: '10%' },
|
||||
{ field: 'status', title: '状态', align: 'center', width: '5%', formatter: function (val) { return val ? '有效' : '无效'; } },
|
||||
{
|
||||
field: 'operate',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm opt-edit" data-id=' + row.uid + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button> ' +
|
||||
(row.status ?
|
||||
'<button class="btn btn-sm btn-danger opt-invaild" data-id=' + row.uid +
|
||||
'><i class="glyphicon glyphicon-remove"></i>失效</button>'
|
||||
:
|
||||
'<button class="btn btn-sm btn-success opt-vaild" data-id=' + row.uid +
|
||||
'><i class="glyphicon glyphicon-save"></i>生效</button>'
|
||||
)
|
||||
}
|
||||
}
|
||||
],
|
||||
uniqueId: 'uid',
|
||||
undefinedText: 0,
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams (params) { //设置查询参数
|
||||
var param = {
|
||||
pageNum: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
gameId: $('#gameId').val(),
|
||||
startTime: $('#startTime').val(),
|
||||
endTime: $('#endTime').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/gamePartner/user/page',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
var chargeStart = $('#startTime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
});
|
||||
var chargeEnd = $('#endTime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
});
|
||||
$("#btnBatchInvaild").click(function () {
|
||||
const row = $('#table').bootstrapTable('getSelections');
|
||||
if (!row || row.length < 1) {
|
||||
$("#tipMsg").text("未勾选任何用户");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (confirm("确认批量失效吗? ")) {
|
||||
const uidStr = row.map(row => row.uid).join(",");
|
||||
console.info(uidStr)
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/gamePartner/user/changeStatus",
|
||||
data: { uidStr: uidStr, status: 0 },
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#userModal").modal('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//新建标签
|
||||
$("#btnAdd").click(function () {
|
||||
openUserModal()
|
||||
});
|
||||
$("#submit").click(function () {
|
||||
if ($("#modalForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/gamePartner/user/save",
|
||||
data: JSON.stringify(modalData),
|
||||
dataType: "json",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#userModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
const id = $(this).attr("data-id");
|
||||
if (!id) {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
const row = $('#table').bootstrapTable('getRowByUniqueId', id);
|
||||
openUserModal(row);
|
||||
});
|
||||
$("#table").on("click", '.opt-vaild', function () {
|
||||
const id = $(this).attr("data-id");
|
||||
if (!id) {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (confirm("确认该用户生效吗? ")) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/gamePartner/user/changeStatus",
|
||||
data: { uidStr: id, status: 1 },
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#userModal").modal('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$("#table").on("click", '.opt-invaild', function () {
|
||||
const id = $(this).attr("data-id");
|
||||
if (!id) {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (confirm("确认该用户失效吗? ")) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/gamePartner/user/changeStatus",
|
||||
data: { uidStr: id, status: 0 },
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#userModal").modal('hide');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function openUserModal (data) {
|
||||
clearUserModal();
|
||||
if (data) {
|
||||
setUserModal(data);
|
||||
}
|
||||
$("#userModal").modal('show');
|
||||
}
|
||||
function clearUserModal () {
|
||||
modalData = {};
|
||||
$("#modalErbanNo").val("");
|
||||
$("#modalGames").empty();
|
||||
}
|
||||
function setUserModal (data) {
|
||||
modalData = {
|
||||
uid: data.uid, erbanNo: data.erbanNo,
|
||||
games: Object.assign([], data.games.map(game => { return { gameId: game.gameId, price: game.price, proficiency: game.proficiency, tags: Object.assign([], game.tags) } }))
|
||||
};
|
||||
freshUserModal();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function cacheGameInfo () {
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '/admin/gamePartner/info/listAll',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.code === 200) {
|
||||
const data = res.data;
|
||||
gameInfoList = data
|
||||
gameInfoList.forEach(gameInfo => gameInfoMap[gameInfo.gameId] = gameInfo);
|
||||
makeOption(data);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
function makeOption (data) {
|
||||
var str = '<option value=""></option>';
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
str += '<option value="' + data[i].gameId + '">' + data[i].gameName + '</option>';
|
||||
}
|
||||
$('#gameId').html(str);
|
||||
}
|
||||
function gameFormatter (val) {
|
||||
var str = ''
|
||||
if (!val || val.size < 1) {
|
||||
return str;
|
||||
}
|
||||
str += '<table>'
|
||||
val.forEach((game, gameIndex) => {
|
||||
if (gameIndex % 2 === 0) {
|
||||
str += '<tr>'
|
||||
}
|
||||
str += '<td width="50%"><table style="border-collapse:separate; border-spacing:5px 5px;">'
|
||||
str += ('<tr><td width="24%"><b>' + game.gameName + '</b></td><td width="24%">价格: ' + game.price + '</td><td width="24%">熟练度: ' + game.proficiency + '</td><td width="24%">接单次数: ' + game.finishNum + '</td></tr>');
|
||||
game.tags.forEach((tag, index) => {
|
||||
if (index / 3 === 0) {
|
||||
str += '<tr>'
|
||||
}
|
||||
str += ('<td width="33%" style="word-break: break-all;word-wrap: break-word;">' + tag.tagName + ': ' + tag.tagVal + '</td>');
|
||||
if ((index / 3 > 0 && index % 2 === 0) || index === (game.tags.size - 1)) {
|
||||
str += '</tr>'
|
||||
}
|
||||
})
|
||||
str += '</table></td>'
|
||||
if ((gameIndex / 2 > 0 && (gameIndex + 1) % 2 === 0) || gameIndex === (val.size - 1)) {
|
||||
str += '</tr>'
|
||||
}
|
||||
})
|
||||
str += '</table>'
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function freshUserModal () {
|
||||
$("#modalUid").val(modalData.uid ?? "");
|
||||
$("#modalErbanNo").val(modalData.erbanNo ?? "");
|
||||
const hasAddGameId = modalData.games ? modalData.games.map(game => game.gameId) : [];
|
||||
const canAdd = gameInfoList.filter(gameInfo => !hasAddGameId.includes(gameInfo.gameId)).length !== 0;
|
||||
if (canAdd) {
|
||||
$("#modalAddBtn").show();
|
||||
} else {
|
||||
$("#modalAddBtn").hide();
|
||||
}
|
||||
const gameStr = modalData.games.map((game, index) =>
|
||||
'<div class="form-group">' +
|
||||
'<label for="modalGameId" class="col-sm-3 control-label">游戏:</label>' +
|
||||
'<div class="col-sm-9">' +
|
||||
'<select name="type" name="modalGameId" class="form-control validate[required]" onchange="selectGameId(this,' + index + ')">' +
|
||||
gameInfoList.map(gameInfo =>
|
||||
'<option value="' + gameInfo.gameId + '" ' + (game.gameId === gameInfo.gameId ? 'selected' : '') + '>' + gameInfo.gameName + '</option>')
|
||||
.join("") +
|
||||
'</select>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="form-group">' +
|
||||
'<label for="modalPrice" class="col-sm-3 control-label">单价:</label>' +
|
||||
'<div class="col-sm-9">' +
|
||||
'<input type="number" class="form-control validate[required]" name="modalPrice" onchange="inputPrice(this, ' + index + ')" value="' + (game.price ?? 0) + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="form-group">' +
|
||||
'<label for="modalProficiency" class="col-sm-3 control-label">熟练度:</label>' +
|
||||
'<div class="col-sm-9">' +
|
||||
'<input type="text" class="form-control validate[required]" name="modalProficiency" onchange="inputProficiency(this, ' + index + ')" value="' + (game.proficiency ?? '') + '">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
game.tags.map((tag, tagIndex) =>
|
||||
'<div class="form-group">' +
|
||||
'<label for="modalTag" class="col-sm-3 control-label">' + tag.tagName + ':</label>' +
|
||||
'<div class="col-sm-9">' +
|
||||
'<input type="text" class="form-control validate[required]" name="modalTag" onchange="inputTag(this, ' + index + ',' + tagIndex + ')" value="' + (tag.tagVal ?? '') + '">' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
).join("")
|
||||
).join("<hr>");
|
||||
$("#modalGames").html(gameStr);
|
||||
}
|
||||
</script>
|
||||
|
@@ -1,174 +1,183 @@
|
||||
<template>
|
||||
<div class="outer">
|
||||
<!-- 查询条件 -->
|
||||
<div class="inquire" style="display: inline-block; margin-right: 20px">
|
||||
<div class="inquire"
|
||||
style="display: inline-block; margin-right: 20px">
|
||||
<div class="block">
|
||||
<span class="demonstration">日期</span>
|
||||
<el-date-picker
|
||||
v-model="inquire.time"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
<el-date-picker v-model="inquire.time"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inquire" style="display: inline-block; margin-right: 20px">
|
||||
<div class="inquire"
|
||||
style="display: inline-block; margin-right: 20px">
|
||||
<span class="demonstration">排序方式</span>
|
||||
<el-select v-model="inquire.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-select v-model="inquire.value"
|
||||
placeholder="请选择">
|
||||
<el-option v-for="item in inquire.options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="inquire" style="margin-right: 20px">
|
||||
<span class="demonstration" style="margin-top: 5px">用户ID </span>
|
||||
<el-input v-model="inquire.userId" placeholder="" class="input"></el-input>
|
||||
<div class="inquire"
|
||||
style="margin-right: 20px">
|
||||
<span class="demonstration"
|
||||
style="margin-top: 5px">用户ID </span>
|
||||
<el-input v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button style="" type="primary" @click="getData()">查询</el-button>
|
||||
<el-button style=""
|
||||
type="primary"
|
||||
@click="getData()">查询</el-button>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="erBanNo" align="center" label="用户id" />
|
||||
<el-table-column prop="nick" align="center" label="用户昵称" />
|
||||
<el-table-column prop="inviteCode" align="center" label="邀请码" />
|
||||
<el-table-column prop="directNum" align="center" label="直接邀请人数" />
|
||||
<el-table-column prop="indirectNum" align="center" label="间接邀请人数" />
|
||||
<el-table-column
|
||||
prop="directChargeAmount"
|
||||
align="center"
|
||||
label="直接邀请人总充值"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="indirectChargeAmount"
|
||||
align="center"
|
||||
label="间接邀请人总充值"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="activityRegisterProfit"
|
||||
align="center"
|
||||
label="活动内注册收益"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="activityReturnProfit"
|
||||
align="center"
|
||||
label="活动内返点收益"
|
||||
/>
|
||||
<el-table-column align="center" label="操作" width="300">
|
||||
<el-table v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px">
|
||||
<el-table-column prop="erBanNo"
|
||||
align="center"
|
||||
label="用户id" />
|
||||
<el-table-column prop="nick"
|
||||
align="center"
|
||||
label="用户昵称" />
|
||||
<el-table-column prop="inviteCode"
|
||||
align="center"
|
||||
label="邀请码" />
|
||||
<el-table-column prop="directNum"
|
||||
align="center"
|
||||
label="直接邀请人数" />
|
||||
<el-table-column prop="indirectNum"
|
||||
align="center"
|
||||
label="间接邀请人数" />
|
||||
<el-table-column prop="directChargeAmount"
|
||||
align="center"
|
||||
label="直接邀请人总充值" />
|
||||
<el-table-column prop="indirectChargeAmount"
|
||||
align="center"
|
||||
label="间接邀请人总充值" />
|
||||
<el-table-column prop="activityRegisterProfit"
|
||||
align="center"
|
||||
label="活动内注册收益" />
|
||||
<el-table-column prop="activityReturnProfit"
|
||||
align="center"
|
||||
label="活动内返点收益" />
|
||||
<el-table-column align="center"
|
||||
label="操作"
|
||||
width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="details(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>查看详情</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="set(scope.row)"
|
||||
:class="scope.row.isBlack == 0 ? 'primary' : 'info'"
|
||||
:type="scope.row.isBlack == 0 ? 'primary' : 'info'"
|
||||
size="default"
|
||||
>{{ scope.row.isBlack == 0 ? "设为活动黑名单" : "取消活动黑名单" }}</el-button
|
||||
>
|
||||
<el-button @click="details(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default">查看详情</el-button>
|
||||
<el-button @click="set(scope.row)"
|
||||
:class="scope.row.isBlack == 0 ? 'primary' : 'info'"
|
||||
:type="scope.row.isBlack == 0 ? 'primary' : 'info'"
|
||||
size="default">{{ scope.row.isBlack == 0 ? "设为活动黑名单" : "取消活动黑名单" }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<el-pagination style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
|
||||
<!-- 详情 -->
|
||||
<el-dialog v-model="detailsDialog" :title="detailsTitle" width="65%" center>
|
||||
<el-dialog v-model="detailsDialog"
|
||||
:title="detailsTitle"
|
||||
width="65%"
|
||||
center>
|
||||
<!-- 条件 -->
|
||||
<span>用户ID </span>
|
||||
<el-input
|
||||
style="display: inline-block; width: 200px"
|
||||
v-model="detailsUserId"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
<el-input style="display: inline-block; width: 200px"
|
||||
v-model="detailsUserId"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button style="" type="primary" @click="getDataDetailsDialog()">查询</el-button>
|
||||
<el-button style=""
|
||||
type="primary"
|
||||
@click="getDataDetailsDialog()">查询</el-button>
|
||||
<!-- 内表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableDataIn"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="createTime" align="center" label="新增时间" />
|
||||
<el-table-column prop="nick" align="center" label="用户昵称" />
|
||||
<el-table-column prop="erbanNo" align="center" label="用户ID" />
|
||||
<el-table-column prop="inviteCode" align="center" label="填写邀请码" />
|
||||
<el-table-column align="center" label="是否补填">
|
||||
<el-table v-loading="loading"
|
||||
:data="tableDataIn"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px">
|
||||
<el-table-column prop="createTime"
|
||||
align="center"
|
||||
label="新增时间" />
|
||||
<el-table-column prop="nick"
|
||||
align="center"
|
||||
label="用户昵称" />
|
||||
<el-table-column prop="erbanNo"
|
||||
align="center"
|
||||
label="用户ID" />
|
||||
<el-table-column prop="inviteCode"
|
||||
align="center"
|
||||
label="填写邀请码" />
|
||||
<el-table-column align="center"
|
||||
label="是否补填">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isRepair == 1 ? "是" : "否" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="邀请者">
|
||||
<el-table-column align="center"
|
||||
label="邀请者">
|
||||
<template v-slot="scope">
|
||||
昵称:{{ scope.row.inviteNick }} ID:{{ scope.row.inviteErBanNo }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="邀请者的邀请者">
|
||||
<el-table-column align="center"
|
||||
label="邀请者的邀请者">
|
||||
<template v-slot="scope">
|
||||
昵称:{{ scope.row.grandInviteNick }} ID:{{ scope.row.grandInviteErBanNo }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="是否充值">
|
||||
<el-table-column align="center"
|
||||
label="是否充值">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.isCharge == 1 ? "是" : "否" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="inviteCharge30Amount"
|
||||
align="center"
|
||||
label="邀请30天内充值"
|
||||
/>
|
||||
<el-table-column prop="inviteChargeAmount" align="center" label="累计充值" />
|
||||
<el-table-column
|
||||
prop="inviteGiveAmount"
|
||||
align="center"
|
||||
label="累计接收代充转增"
|
||||
/>
|
||||
<el-table-column prop="inviteCharge30Amount"
|
||||
align="center"
|
||||
label="邀请30天内充值" />
|
||||
<el-table-column prop="inviteChargeAmount"
|
||||
align="center"
|
||||
label="累计充值" />
|
||||
<el-table-column prop="inviteGiveAmount"
|
||||
align="center"
|
||||
label="累计接收代充转增" />
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage2"
|
||||
v-model:page-size="pageSize2"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"
|
||||
/>
|
||||
<el-pagination style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage2"
|
||||
v-model:page-size="pageSize2"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2" />
|
||||
<!-- 操作 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="exportDate()"> 导出 </el-button>
|
||||
<el-button type="primary"
|
||||
@click="exportDate()"> 导出 </el-button>
|
||||
<el-button @click="detailsDialog = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
@@ -186,12 +195,12 @@ import { dateFormat } from "@/utils/system-helper";
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "invitationRanking",
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
inquire: {
|
||||
time: "",
|
||||
userId: "",
|
||||
value: "",
|
||||
value: "0",
|
||||
options: [
|
||||
{
|
||||
value: "0",
|
||||
@@ -225,24 +234,24 @@ export default {
|
||||
tableDataIn: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
// 查询
|
||||
getData() {
|
||||
getData () {
|
||||
this.loading = true;
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
let startDate = "";
|
||||
let endDate = "";
|
||||
if (this.inquire.time && this.inquire.time.length > 0) {
|
||||
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
startDate = dateFormat(this.inquire.time[0], "yyyy-MM-dd");
|
||||
endDate = dateFormat(this.inquire.time[1], "yyyy-MM-dd");
|
||||
}
|
||||
userInviteFissionRecordGetInviteRank({
|
||||
pageNum: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
erBanNo: this.inquire.userId,
|
||||
rankType: this.inquire.value,
|
||||
}).then((res) => {
|
||||
@@ -252,7 +261,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 查看详情
|
||||
details(val) {
|
||||
details (val) {
|
||||
this.detailsTitle = `用户ID:${val.erBanNo}的数据`;
|
||||
this.getDataDetailsDialogVal = val;
|
||||
this.detailsDialog = true;
|
||||
@@ -269,7 +278,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 设置黑名单
|
||||
set(val) {
|
||||
set (val) {
|
||||
userInviteFissionRecordSetBlack({
|
||||
status: val.isBlack == 0 ? 1 : 0,
|
||||
uid: val.uid,
|
||||
@@ -278,7 +287,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 详情查询
|
||||
getDataDetailsDialog() {
|
||||
getDataDetailsDialog () {
|
||||
this.loading = true;
|
||||
userInviteFissionRecordGetDailyDetailList({
|
||||
// date: this.getDataDetailsDialogVal.date,
|
||||
@@ -294,24 +303,24 @@ export default {
|
||||
});
|
||||
},
|
||||
// 导出
|
||||
exportDate() {
|
||||
exportDate () {
|
||||
userInviteFissionRecordExport({
|
||||
invitedErBanNo: this.detailsUserId,
|
||||
inviteErBanNo: this.getDataDetailsDialogVal.erBanNo,
|
||||
}).then((res) => {});
|
||||
}).then((res) => { });
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
handleSizeChange () {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
handleCurrentChange () {
|
||||
this.getData();
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange2() {
|
||||
handleSizeChange2 () {
|
||||
this.getDataDetailsDialog();
|
||||
},
|
||||
handleCurrentChange2() {
|
||||
handleCurrentChange2 () {
|
||||
this.getDataDetailsDialog();
|
||||
},
|
||||
},
|
||||
|
@@ -1,44 +1,67 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div class="main_box" :style="[smsSwitch ? 'height: 350px' : '']">
|
||||
<div class="login_box">
|
||||
<div class="login_logo">
|
||||
<span
|
||||
style="font-size:24px;color:#222;font-weight:bold;"> MOLISTAR 管 理 系 统</span>
|
||||
</div>
|
||||
<div class="login_form">
|
||||
<form id="loginForm" method="post">
|
||||
<input type="hidden" id="smsSwitch" :value="smsSwitch" />
|
||||
<div class="form-group">
|
||||
<label for="account" class="t">账 号:</label>
|
||||
<input id="account" name="account" type="text" class="form-control x319 in" autocomplete="off">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="t">密 码:</label>
|
||||
<input id="password" name="password" type="password" class="password form-control x319 in">
|
||||
</div>
|
||||
<div v-if="smsSwitch">
|
||||
<div class="form-group">
|
||||
<label for="validateCode" class="t">验证码:</label>
|
||||
<input id="validateCode" name="authCode" type="text" class="form-control x319 in"
|
||||
style="width: 210px;">
|
||||
<button type="button" id="validateSend" class="btn btn-primary btn-lg">发送验证码</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom: 0px;">
|
||||
<label class="t"></label>
|
||||
<span class="loginTips"></span>
|
||||
</div>
|
||||
<div class="form-group space">
|
||||
<button type="button" id="loginBtn" class="btn btn-primary btn-lg">登 录</button>
|
||||
|
||||
<input type="reset" value="重 置" class="btn btn-default btn-lg">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-container">
|
||||
<div class="main_box"
|
||||
:style="[smsSwitch ? 'height: 350px' : '']">
|
||||
<div class="login_box">
|
||||
<div class="login_logo">
|
||||
<span style="font-size:24px;color:#222;font-weight:bold;"> MOLISTAR 管 理 系 统</span>
|
||||
</div>
|
||||
<div class="login_form">
|
||||
<form id="loginForm"
|
||||
method="post">
|
||||
<input type="hidden"
|
||||
id="smsSwitch"
|
||||
:value="smsSwitch" />
|
||||
<div class="form-group">
|
||||
<label for="account"
|
||||
class="t">账 号:</label>
|
||||
<input id="account"
|
||||
name="account"
|
||||
type="text"
|
||||
class="form-control x319 in"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password"
|
||||
class="t">密 码:</label>
|
||||
<input id="password"
|
||||
name="password"
|
||||
type="password"
|
||||
class="password form-control x319 in">
|
||||
</div>
|
||||
<div v-if="smsSwitch">
|
||||
<div class="form-group">
|
||||
<label for="validateCode"
|
||||
class="t">验证码:</label>
|
||||
<input id="validateCode"
|
||||
name="authCode"
|
||||
type="text"
|
||||
class="form-control x319 in"
|
||||
style="width: 210px;">
|
||||
<button type="button"
|
||||
id="validateSend"
|
||||
class="btn btn-primary btn-lg">发送验证码</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group"
|
||||
style="margin-bottom: 0px;">
|
||||
<label class="t"></label>
|
||||
<span class="loginTips"></span>
|
||||
</div>
|
||||
<div class="form-group space">
|
||||
<button type="button"
|
||||
id="loginBtn"
|
||||
class="btn btn-primary btn-lg">登 录</button>
|
||||
|
||||
<input type="reset"
|
||||
value="重 置"
|
||||
class="btn btn-default btn-lg">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -46,187 +69,188 @@ import store from '@/store';
|
||||
|
||||
var sendFlag = true;
|
||||
export default {
|
||||
name: "LoginView",
|
||||
data() {
|
||||
return {
|
||||
smsSwitch: true,
|
||||
};
|
||||
},
|
||||
setup() {
|
||||
return {
|
||||
name: "LoginView",
|
||||
data () {
|
||||
return {
|
||||
smsSwitch: true,
|
||||
};
|
||||
},
|
||||
setup () {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.smsSwitch = true;
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
var $ul = $('<ul id="bubble-wrapper"/>');
|
||||
for (var i = 0; i < 10; i++) {
|
||||
$ul.append($('<li/>'));
|
||||
}
|
||||
$("body").append($ul);
|
||||
|
||||
var rememberMe = getCookie("wolfbe.remember");
|
||||
if (rememberMe == 1) {
|
||||
var account = getCookie("wolfbe.account");
|
||||
if (account) $("#account").val(account);
|
||||
}
|
||||
|
||||
$("#loginBtn").click(function () {
|
||||
var account = $("#account").val();
|
||||
var password = $("#password").val();
|
||||
if (account.trim() == '') {
|
||||
$(".loginTips").html("账号不能为空!");
|
||||
return;
|
||||
} else if (password.trim() == '') {
|
||||
$(".loginTips").html("密码不能为空!");
|
||||
return;
|
||||
}
|
||||
password = $.md5(password);
|
||||
var param = { 'account': account, 'password': password };
|
||||
var smsSwitch = $('#smsSwitch').val();
|
||||
console.info('smsSwitch:' + smsSwitch);
|
||||
if (smsSwitch && smsSwitch == 'true') {
|
||||
var authCode = $("#validateCode").val();
|
||||
if (authCode.trim() == '') {
|
||||
$(".loginTips").html("验证码不能为空!");
|
||||
return;
|
||||
}
|
||||
authCode = $.md5(authCode);
|
||||
param = { 'account': account, 'password': password, 'authCode': authCode };
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/login/login",
|
||||
data: param,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
console.log("data is: " + data.success);
|
||||
//刷新验证码
|
||||
$("#validateImg").click();
|
||||
if (data.success == 'true') {
|
||||
console.log('login success!');
|
||||
var array = new String(data.msg).split('@');
|
||||
store.dispatch('getUser', array[0]).then(res => {
|
||||
store.commit('updateUser', {
|
||||
adminId: array[0],
|
||||
username: res.username
|
||||
});
|
||||
window.location.href = '#/blank';
|
||||
});
|
||||
} else {
|
||||
if (data.msg == "4003" || data.msg == "404") {
|
||||
if (data.data == "0") {
|
||||
data.msg = "输入超过次数限制,请联系管理员";
|
||||
} else {
|
||||
data.msg = "密码或验证码错误!你今天还有" + data.data + "次重试机会";
|
||||
}
|
||||
}
|
||||
$(".loginTips").html(data.msg).css("padding", "3px 5px");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#loginForm :input").not("#rememberAccount").focus(function () {
|
||||
$(".loginTips").html("").css("padding", "0");
|
||||
}).keyup(function (e) {
|
||||
var keyCode = e.which || e.keyCode;
|
||||
if (keyCode == 13) {
|
||||
$("#loginBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
$("#validateImg").click(function () {
|
||||
$(this).attr("src", "/admin/kaptcha?t=" + new Date().getTime());
|
||||
});
|
||||
|
||||
$("#validateSend").click(function () {
|
||||
var account = $("#account").val();
|
||||
if (account.trim() == '') {
|
||||
$(".loginTips").html("账号不能为空!");
|
||||
return;
|
||||
}
|
||||
if (sendFlag) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/login/sendSmsCode",
|
||||
data: { 'account': account },
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
sendSmsSuccess();
|
||||
} else {
|
||||
$(".loginTips").html(data.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
},
|
||||
created () {
|
||||
this.smsSwitch = true;
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData () {
|
||||
$(function () {
|
||||
var $ul = $('<ul id="bubble-wrapper"/>');
|
||||
for (var i = 0; i < 10; i++) {
|
||||
$ul.append($('<li/>'));
|
||||
}
|
||||
},
|
||||
$("body").append($ul);
|
||||
|
||||
var rememberMe = getCookie("wolfbe.remember");
|
||||
if (rememberMe == 1) {
|
||||
var account = getCookie("wolfbe.account");
|
||||
if (account) $("#account").val(account);
|
||||
}
|
||||
|
||||
$("#loginBtn").click(function () {
|
||||
var account = $("#account").val();
|
||||
var password = $("#password").val();
|
||||
if (account.trim() == '') {
|
||||
$(".loginTips").html("账号不能为空!");
|
||||
return;
|
||||
} else if (password.trim() == '') {
|
||||
$(".loginTips").html("密码不能为空!");
|
||||
return;
|
||||
}
|
||||
password = $.md5(password);
|
||||
var param = { 'account': account, 'password': password };
|
||||
var smsSwitch = $('#smsSwitch').val();
|
||||
console.info('smsSwitch:' + smsSwitch);
|
||||
if (smsSwitch && smsSwitch == 'true') {
|
||||
var authCode = $("#validateCode").val();
|
||||
if (authCode.trim() == '') {
|
||||
$(".loginTips").html("验证码不能为空!");
|
||||
return;
|
||||
}
|
||||
authCode = $.md5(authCode);
|
||||
param = { 'account': account, 'password': password, 'authCode': authCode };
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/login/login",
|
||||
data: param,
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
console.log("data is: " + data.success);
|
||||
//刷新验证码
|
||||
$("#validateImg").click();
|
||||
if (data.success == 'true') {
|
||||
console.log('login success!');
|
||||
var array = new String(data.msg).split('@');
|
||||
store.dispatch('getUser', array[0]).then(res => {
|
||||
store.commit('updateUser', {
|
||||
adminId: array[0],
|
||||
username: res.username
|
||||
});
|
||||
window.location.href = '#/blank';
|
||||
});
|
||||
} else {
|
||||
if (data.msg == "4003" || data.msg == "404") {
|
||||
if (data.data == "0") {
|
||||
data.msg = "输入超过次数限制,请联系管理员";
|
||||
} else {
|
||||
data.msg = "密码或验证码错误!你今天还有" + data.data + "次重试机会";
|
||||
}
|
||||
}
|
||||
$(".loginTips").html(data.msg).css("padding", "3px 5px");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#loginForm :input").not("#rememberAccount").focus(function () {
|
||||
$(".loginTips").html("").css("padding", "0");
|
||||
}).keyup(function (e) {
|
||||
var keyCode = e.which || e.keyCode;
|
||||
if (keyCode == 13) {
|
||||
$("#loginBtn").click();
|
||||
}
|
||||
});
|
||||
|
||||
$("#validateImg").click(function () {
|
||||
$(this).attr("src", "/admin/kaptcha?t=" + new Date().getTime());
|
||||
});
|
||||
|
||||
$("#validateSend").click(function () {
|
||||
var account = $("#account").val();
|
||||
if (account.trim() == '') {
|
||||
$(".loginTips").html("账号不能为空!");
|
||||
return;
|
||||
}
|
||||
if (sendFlag) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/login/sendSmsCode",
|
||||
data: { 'account': account },
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
sendSmsSuccess();
|
||||
} else {
|
||||
$(".loginTips").html(data.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function sendSmsSuccess() {
|
||||
if (sendFlag) {
|
||||
sendFlag = false;
|
||||
var time = 181;
|
||||
var timer = setInterval(() => {
|
||||
time--;
|
||||
$("#validateSend").html(time + ' 秒');
|
||||
if (time === 0) {
|
||||
clearInterval(timer);
|
||||
$("#validateSend").html('重新获取');
|
||||
sendFlag = true;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
function sendSmsSuccess () {
|
||||
if (sendFlag) {
|
||||
sendFlag = false;
|
||||
var time = 181;
|
||||
var timer = setInterval(() => {
|
||||
time--;
|
||||
$("#validateSend").html(time + ' 秒');
|
||||
if (time === 0) {
|
||||
clearInterval(timer);
|
||||
$("#validateSend").html('重新获取');
|
||||
sendFlag = true;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
//获取cookie的信息
|
||||
function getCookie(name) {
|
||||
var reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
||||
var arr = document.cookie.match(reg);
|
||||
if (arr) {
|
||||
return (arr[2]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
function getCookie (name) {
|
||||
var reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
||||
var arr = document.cookie.match(reg);
|
||||
if (arr) {
|
||||
return (arr[2]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import '../../css/supersized.css';
|
||||
@import '../../css/login.css';
|
||||
@import "../../css/supersized.css";
|
||||
@import "../../css/login.css";
|
||||
|
||||
* {
|
||||
font-family: "Helvetica Neue", Helvetica, STheiti, 微软雅黑, 宋体, Arial, Tahoma, sans-serif, serif;
|
||||
font-family: "Helvetica Neue", Helvetica, STheiti, 微软雅黑, 宋体, Arial,
|
||||
Tahoma, sans-serif, serif;
|
||||
}
|
||||
|
||||
.btn-lg {
|
||||
padding: 8px 25px;
|
||||
padding: 8px 25px;
|
||||
}
|
||||
|
||||
#captcha_img {
|
||||
margin-left: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.loginTips {
|
||||
color: red;
|
||||
font-size: 14px;
|
||||
margin-left: 10px;
|
||||
color: red;
|
||||
font-size: 14px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#validateSend {
|
||||
width: 106px;
|
||||
padding: 6px 17px;
|
||||
font-size: 14px;
|
||||
width: 106px;
|
||||
padding: 6px 17px;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
@@ -65,11 +65,11 @@
|
||||
{{ row.rewardGiftPrice || "/" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="该用户是否中奖">
|
||||
<!-- <el-table-column prop="x" align="center" label="该用户是否中奖">
|
||||
<template #default="{ row }">
|
||||
{{ row.x ? "是" : "否" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
|
624
src/views/medal/MedalInfo.vue
Normal file
624
src/views/medal/MedalInfo.vue
Normal file
@@ -0,0 +1,624 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>勋章ID</span>
|
||||
<el-input v-model="inquire.id" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>勋章昵称</span>
|
||||
<el-input v-model="inquire.nick" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span class="demonstration">地区</span>
|
||||
<el-select filterable v-model="inquire.partitionId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button class="primary" type="primary" @click="add()"> 新增 </el-button>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="id" align="center" label="勋章ID" />
|
||||
<el-table-column prop="partitionFlag" align="center" label="地区">
|
||||
<template v-slot="scope">{{
|
||||
partitionFlagFun(scope.row.partitionFlag, 1)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="勋章名称-华语区">
|
||||
<template v-slot="scope">{{ JSON.parse(scope.row.name).zh }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="勋章名称-英语区">
|
||||
<template v-slot="scope">{{ JSON.parse(scope.row.name).en }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="勋章名称-阿语区">
|
||||
<template v-slot="scope">{{ JSON.parse(scope.row.name).ar }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="picUrl"
|
||||
label="勋章图片"
|
||||
width="120"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.picUrl"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.picUrl"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="enable" align="center" label="状态">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.enable ? "生效" : "不生效"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" align="center" label="添加时间" />
|
||||
<el-table-column align="center" label="操作" width="220">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="eidFun(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="grantFun(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
:disabled="!scope.row.enable"
|
||||
>
|
||||
发放
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 新增&编辑弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
class="pub"
|
||||
v-model="controlsDialog"
|
||||
:title="controlsTitle"
|
||||
width="32%"
|
||||
center
|
||||
>
|
||||
<!-- 地区 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>地区</span
|
||||
>
|
||||
<el-select
|
||||
multiple
|
||||
filterable
|
||||
v-model="controlsObj.value"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in controlsObj.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 勋章名称-华语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章名称-华语</span
|
||||
>
|
||||
<el-input
|
||||
v-model="controlsObj.nickZh"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 勋章名称-英语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章名称-英语</span
|
||||
>
|
||||
<el-input
|
||||
v-model="controlsObj.nickEn"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 勋章名称-阿语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章名称-阿语</span
|
||||
>
|
||||
<el-input
|
||||
v-model="controlsObj.nickAr"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 勋章图片 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章图片</span
|
||||
>
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/admin/tencent/cos/upload/file"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:on-error="handleAvatarError"
|
||||
>
|
||||
<img
|
||||
:src="controlsObj.imageUrl1"
|
||||
class="avatar"
|
||||
/>
|
||||
</el-upload>
|
||||
</div>
|
||||
|
||||
<!-- 状态 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>状态</span
|
||||
>
|
||||
<el-select filterable v-model="controlsObj.value2" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in controlsObj.options2"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 弹窗按钮 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="controlsDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="controlsDialogOut()">
|
||||
确认
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 发放勋章弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
class="pub"
|
||||
v-model="grantDialog"
|
||||
title="发放勋章"
|
||||
width="32%"
|
||||
center
|
||||
>
|
||||
<!-- 勋章名称 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章名称</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.nick"
|
||||
placeholder="默认展示的是中文勋章名称"
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 发放对象平台号 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>发放对象平台号</span
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="grantObj.userId"
|
||||
placeholder="多个平台号用英文“,”号分开分隔"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 发放天数 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>发放天数</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.days"
|
||||
placeholder="输入天数,不输入则视为无限制"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 备注 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>备注</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.desc"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 弹窗按钮 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="grantDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="grantOut()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
listPartitionInfo,
|
||||
medalPage,
|
||||
medalSave,
|
||||
medalSend,
|
||||
} from "@/api/medal/medal";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "MedalInfo",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
id: "",
|
||||
nick: "",
|
||||
partitionId: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
// 操作弹窗
|
||||
controlsDialog: false,
|
||||
controlsTitle: "新增&编辑",
|
||||
controlsType: 1,
|
||||
controlsObj: {
|
||||
value: [],
|
||||
options: [],
|
||||
nickZh: "",
|
||||
nickEn: "",
|
||||
nickAr: "",
|
||||
imageUrl1: "",
|
||||
value2: "",
|
||||
options2: [
|
||||
{
|
||||
desc: "生效",
|
||||
id: true,
|
||||
},
|
||||
{
|
||||
desc: "不生效",
|
||||
id: false,
|
||||
},
|
||||
],
|
||||
id: "",
|
||||
},
|
||||
// 发放弹窗
|
||||
grantDialog: false,
|
||||
grantObj: {
|
||||
nick: "",
|
||||
userId: "",
|
||||
days: "",
|
||||
desc: "",
|
||||
},
|
||||
grantObjNew: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listPartitionInfo().then((res) => {
|
||||
this.inquire.options = res.data;
|
||||
this.inquire.options.push({
|
||||
desc: "全部",
|
||||
id: "",
|
||||
});
|
||||
listPartitionInfo().then((res) => {
|
||||
this.controlsObj.options = res.data;
|
||||
this.getData();
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
medalPage({
|
||||
id: this.inquire.id,
|
||||
name: this.inquire.nick,
|
||||
partitionId: this.inquire.partitionId,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.data.total;
|
||||
this.tableData = res.data.records;
|
||||
this.loading = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
add() {
|
||||
this.controlsTitle = "新增";
|
||||
this.controlsType = 1;
|
||||
this.controlsObj.value = [];
|
||||
this.controlsObj.nickZh = "";
|
||||
this.controlsObj.nickEn = "";
|
||||
this.controlsObj.nickAr = "";
|
||||
this.controlsObj.imageUrl1 = "";
|
||||
this.controlsObj.value2 = "";
|
||||
this.controlsDialog = true;
|
||||
},
|
||||
// 编辑
|
||||
eidFun(val) {
|
||||
this.controlsTitle = "编辑";
|
||||
this.controlsType = 2;
|
||||
this.controlsObj.value = this.partitionFlagFun(val.partitionFlag, 2);
|
||||
this.controlsObj.nickZh = JSON.parse(val.name).zh;
|
||||
this.controlsObj.nickEn = JSON.parse(val.name).en;
|
||||
this.controlsObj.nickAr = JSON.parse(val.name).ar;
|
||||
this.controlsObj.imageUrl1 = val.picUrl;
|
||||
this.controlsObj.value2 = val.enable;
|
||||
this.controlsObj.id = val.id;
|
||||
this.controlsDialog = true;
|
||||
},
|
||||
// 确认保存按钮
|
||||
controlsDialogOut() {
|
||||
if (this.controlsType == 1) {
|
||||
// 新增
|
||||
var obj = {};
|
||||
var partitionFlagVal = 0;
|
||||
console.log(this.controlsObj.value);
|
||||
console.log(this.controlsObj.options);
|
||||
this.controlsObj.value.forEach((res, i) => {
|
||||
partitionFlagVal |= this.controlsObj.options[i].id;
|
||||
});
|
||||
obj.partitionFlag = partitionFlagVal;
|
||||
obj.name = JSON.stringify({
|
||||
zh: this.controlsObj.nickZh,
|
||||
en: this.controlsObj.nickEn,
|
||||
ar: this.controlsObj.nickAr,
|
||||
});
|
||||
obj.picUrl = this.controlsObj.imageUrl1;
|
||||
obj.enable = this.controlsObj.value2;
|
||||
console.log(obj);
|
||||
medalSave(obj).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getData();
|
||||
this.controlsDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
var obj1 = {};
|
||||
var partitionFlagVal1 = 0;
|
||||
this.controlsObj.value.forEach((res, i) => {
|
||||
partitionFlagVal1 += res;
|
||||
});
|
||||
obj1.partitionFlag = partitionFlagVal1;
|
||||
obj1.name = JSON.stringify({
|
||||
zh: this.controlsObj.nickZh,
|
||||
en: this.controlsObj.nickEn,
|
||||
ar: this.controlsObj.nickAr,
|
||||
});
|
||||
obj1.picUrl = this.controlsObj.imageUrl1;
|
||||
obj1.enable = this.controlsObj.value2;
|
||||
obj1.id = this.controlsObj.id;
|
||||
console.log(1111111111, this.controlsObj.value);
|
||||
console.log(this.controlsObj.options);
|
||||
console.log(obj1);
|
||||
medalSave(obj1).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getData();
|
||||
this.controlsDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//发放按钮
|
||||
grantFun(val) {
|
||||
this.grantObjNew = val;
|
||||
this.grantObj.nick = JSON.parse(val.name).zh;
|
||||
this.grantDialog = true;
|
||||
},
|
||||
// 确认发放
|
||||
grantOut() {
|
||||
medalSend({
|
||||
days: this.grantObj.days,
|
||||
erbanNoStr: this.grantObj.userId,
|
||||
medalId: this.grantObjNew.id,
|
||||
remark: this.grantObj.desc,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "发放成功",
|
||||
type: "success",
|
||||
});
|
||||
this.grantDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
partitionFlagFun(num, type) {
|
||||
//1 2 4
|
||||
var val = 0;
|
||||
if (type == 2) {
|
||||
if (num == 0 || num == 7) {
|
||||
val = [4, 1, 2];
|
||||
} else if (num == 1) {
|
||||
val = [1];
|
||||
} else if (num == 3) {
|
||||
val = [1, 2];
|
||||
} else if (num == 2) {
|
||||
val = [2];
|
||||
} else if (num == 6) {
|
||||
val = [2, 4];
|
||||
} else if (num == 4) {
|
||||
val = [4];
|
||||
}
|
||||
} else {
|
||||
if (num == 0 || num == 7) {
|
||||
val = "华语区、英语区、阿语区";
|
||||
} else if (num == 1) {
|
||||
val = "英语区";
|
||||
} else if (num == 3) {
|
||||
val = "英语区、阿语区";
|
||||
} else if (num == 2) {
|
||||
val = "阿语区";
|
||||
} else if (num == 6) {
|
||||
val = "阿语区、华语区";
|
||||
} else if (num == 4) {
|
||||
val = "华语区";
|
||||
}
|
||||
}
|
||||
return val;
|
||||
},
|
||||
beforeAvatarUpload() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传中~",
|
||||
type: "warning",
|
||||
});
|
||||
},
|
||||
handleAvatarError() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传失败!",
|
||||
type: "error",
|
||||
});
|
||||
},
|
||||
handleAvatarSuccess(res, file) {
|
||||
console.log(file);
|
||||
this.controlsObj.imageUrl1 = file.response.data;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传成功!",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
363
src/views/medal/MedalRecord.vue
Normal file
363
src/views/medal/MedalRecord.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>勋章ID</span>
|
||||
<el-input v-model="inquire.id" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>用户平台ID</span>
|
||||
<el-input
|
||||
v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button class="primary" type="primary" @click="grantDialog = true">
|
||||
发放勋章
|
||||
</el-button>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="createTime" align="center" label="发放时间" />
|
||||
<el-table-column prop="source" align="center" label="发放渠道">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.source == 1 ? "管理后台" : scope.row.source
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" align="center" label="发放勋章ID" />
|
||||
<el-table-column prop="medalName" align="center" label="勋章名称" />
|
||||
<el-table-column align="center" prop="x" label="勋章图片" width="120">
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.picUrl"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.picUrl"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="生效天数">
|
||||
<template v-slot="scope">{{ scope.row.days }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="备注">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.remark == "" ? "-" : scope.row.remark
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="状态">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.status == 1
|
||||
? "生效中"
|
||||
: scope.row.status == 0
|
||||
? "已失效"
|
||||
: "撤销"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="erbanNo" align="center" label="发放对象平台号" />
|
||||
<el-table-column prop="nick" align="center" label="发放对象昵称" />
|
||||
<el-table-column
|
||||
prop="partitionName"
|
||||
align="center"
|
||||
label="发放对象分区"
|
||||
/>
|
||||
<el-table-column align="center" label="操作" width="220">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="eidFun(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
:disabled="scope.row.status <= 0 ? true : false"
|
||||
>
|
||||
撤销
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 发放勋章弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
class="pub"
|
||||
v-model="grantDialog"
|
||||
title="发放勋章"
|
||||
width="32%"
|
||||
center
|
||||
>
|
||||
<!-- 勋章昵称 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章昵称</span
|
||||
>
|
||||
<el-select filterable v-model="grantObj.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in grantObj.options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 发放对象平台号 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>发放对象平台号</span
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="grantObj.userId"
|
||||
placeholder="多个平台号用英文“,”号分开分隔"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 发放天数 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>发放天数</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.days"
|
||||
placeholder="输入天数,不输入则视为无限制"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 备注 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>备注</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.desc"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 弹窗按钮 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="grantDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="grantOut()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 二次确认弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
v-model="delDialog"
|
||||
title="提示"
|
||||
width="30%"
|
||||
center
|
||||
>
|
||||
<span> 确定要撤销吗?</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="delDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="delClick()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
medalRecordPage,
|
||||
listAll,
|
||||
medalSend,
|
||||
rollback,
|
||||
} from "@/api/medal/medal";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "MedalRecord",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
id: "",
|
||||
userId: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
// 发放弹窗
|
||||
grantDialog: false,
|
||||
grantObj: {
|
||||
value: "",
|
||||
options: [],
|
||||
userId: "",
|
||||
days: "",
|
||||
desc: "",
|
||||
},
|
||||
// 撤销
|
||||
delDialog: false,
|
||||
delObj: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listAll().then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.grantObj.options = res.data;
|
||||
this.getData();
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
medalRecordPage({
|
||||
medalId: this.inquire.id,
|
||||
erbanNo: this.inquire.userId,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.data.total;
|
||||
this.tableData = res.data.records;
|
||||
this.loading = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 确认发放
|
||||
grantOut() {
|
||||
medalSend({
|
||||
days: this.grantObj.days,
|
||||
erbanNoStr: this.grantObj.userId,
|
||||
medalId: this.grantObj.value,
|
||||
remark: this.grantObj.desc,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "发放成功",
|
||||
type: "success",
|
||||
});
|
||||
this.grantDialog = false;
|
||||
this.getData();
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 撤销按钮
|
||||
eidFun(val) {
|
||||
this.delObj = val;
|
||||
this.delDialog = true;
|
||||
},
|
||||
// 确认撤销按钮
|
||||
delClick() {
|
||||
console.log(this.delObj);
|
||||
rollback({ recordId: this.delObj.id }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "撤销成功",
|
||||
type: "success",
|
||||
});
|
||||
this.getData();
|
||||
this.delDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -38,6 +38,9 @@
|
||||
<el-button class="primary" type="primary" @click="addDialog = true"
|
||||
>添加</el-button
|
||||
>
|
||||
<el-button class="primary" type="primary" @click="exportInfoFun()"
|
||||
>导出</el-button
|
||||
>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
@@ -49,6 +52,11 @@
|
||||
<el-table-column prop="referrer" align="center" label="推荐人" />
|
||||
<el-table-column prop="ownerErbanNo" align="center" label="会长ID" />
|
||||
<el-table-column prop="ownerNick" align="center" label="会长昵称" />
|
||||
<el-table-column
|
||||
prop="ownerPartitionName"
|
||||
align="center"
|
||||
label="会长分区"
|
||||
/>
|
||||
<el-table-column prop="name" align="center" label="公会昵称" />
|
||||
<el-table-column align="center" prop="giftInfo" label="公会背景图">
|
||||
<template v-slot="scope">
|
||||
@@ -65,15 +73,14 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" align="center" label="创建日期" />
|
||||
<!-- <el-table-column prop="memberNum" align="center" label="成员数量" /> -->
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="成员数量/上限"
|
||||
<el-table-column align="center" label="成员数量/上限"
|
||||
><template v-slot="scope"
|
||||
>{{ scope.row.memberNum }}/{{ scope.row.memberNumLimit }}</template
|
||||
></el-table-column>
|
||||
></el-table-column
|
||||
>
|
||||
<el-table-column prop="goldIncome" align="center" label="金币总收入" />
|
||||
<el-table-column prop="diamondRemain" align="center" label="钻石总收入" />
|
||||
|
||||
|
||||
<el-table-column align="center" label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@@ -234,7 +241,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { pageFamily, create, update, dismiss } from "@/api/nobleman/nobleman";
|
||||
import {
|
||||
pageFamily,
|
||||
exportInfo,
|
||||
create,
|
||||
update,
|
||||
dismiss,
|
||||
} from "@/api/nobleman/nobleman";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
@@ -305,6 +318,23 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 导出
|
||||
exportInfoFun() {
|
||||
let time = this.inquire.time;
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
if (time && time.length > 0) {
|
||||
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
exportInfo({
|
||||
erbanNo: this.inquire.userId,
|
||||
referrer: this.inquire.referrer,
|
||||
familyName: this.inquire.nick,
|
||||
startDate: startTime,
|
||||
endDate: endTime,
|
||||
}).then((res) => {});
|
||||
},
|
||||
// 添加
|
||||
add() {
|
||||
this.addDialog = false;
|
||||
|
@@ -3,172 +3,163 @@
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>ID</span>
|
||||
<el-input
|
||||
v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
<el-input v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 工会昵称 -->
|
||||
<div class="inquire">
|
||||
<span>工会名称</span>
|
||||
<el-input v-model="inquire.nick" placeholder="" class="input"></el-input>
|
||||
<el-input v-model="inquire.nick"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
</div>
|
||||
<!-- 时间选择器 -->
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<span class="demonstration">日期</span>
|
||||
<el-date-picker
|
||||
v-model="inquire.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
<el-date-picker v-model="inquire.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="getData()">查询</el-button>
|
||||
<!-- 导出按钮 -->
|
||||
<el-button class="primary" type="primary" @click="exportFamilyMemberFun()"
|
||||
>导出</el-button
|
||||
>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="exportFamilyMemberFun()">导出</el-button>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column
|
||||
prop="familyOwnerErbanNo"
|
||||
align="center"
|
||||
label="公会长ID"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="familyOwnerNick"
|
||||
align="center"
|
||||
label="公会长昵称"
|
||||
/>
|
||||
<el-table-column prop="familyName" align="center" label="公会昵称" />
|
||||
<el-table-column prop="erbanNo" align="center" label="成员ID" />
|
||||
<el-table-column prop="nick" align="center" label="成员昵称" />
|
||||
<el-table-column prop="goldIncome" align="center" label="金币总收入" />
|
||||
<el-table-column prop="diamondRemain" align="center" label="钻石总收入" />
|
||||
<el-table-column prop="micRemainTime" align="center" label="开播时长" />
|
||||
<el-table-column
|
||||
prop="sendGiftUserNum"
|
||||
align="center"
|
||||
label="送礼用户数"
|
||||
/>
|
||||
<el-table-column align="center" label="成员状态">
|
||||
<el-table v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px">
|
||||
<el-table-column prop="familyName"
|
||||
align="center"
|
||||
label="公会昵称" />
|
||||
<el-table-column prop="erbanNo"
|
||||
align="center"
|
||||
label="成员ID" />
|
||||
<el-table-column prop="nick"
|
||||
align="center"
|
||||
label="成员昵称" />
|
||||
<el-table-column prop="partitionName"
|
||||
align="center"
|
||||
label="成员分区" />
|
||||
<el-table-column prop="goldIncome"
|
||||
align="center"
|
||||
label="金币总收入" />
|
||||
<el-table-column prop="diamondRemain"
|
||||
align="center"
|
||||
label="钻石总收入" />
|
||||
<el-table-column prop="micRemainTime"
|
||||
align="center"
|
||||
label="开播时长" />
|
||||
<el-table-column prop="sendGiftUserNum"
|
||||
align="center"
|
||||
label="送礼用户数" />
|
||||
<el-table-column align="center"
|
||||
label="成员状态">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.enable ? "有效" : "无效"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="是否违规">
|
||||
<el-table-column align="center"
|
||||
label="是否违规">
|
||||
<template v-slot="scope">{{ scope.row.violationNum }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="300">
|
||||
<el-table-column align="center"
|
||||
label="操作"
|
||||
width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="warnClick(scope)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>违规警告</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="listRecordFun(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
:disabled="scope.row.violationNum == 0 ? 'disabled' : ''"
|
||||
>警告详情</el-button
|
||||
>
|
||||
<el-button @click="warnClick(scope)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default">违规警告</el-button>
|
||||
<el-button @click="listRecordFun(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
:disabled="scope.row.violationNum == 0 ? 'disabled' : ''">警告详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 详情设备信息弹窗 -->
|
||||
<el-dialog v-model="dialogTableVisible" title="警告详情">
|
||||
<el-table style="width: 100%" :data="tableData2">
|
||||
<el-table-column property="x" label="成员ID" min-width="100px" />
|
||||
<el-table-column property="x" label="成员昵称" min-width="100px" />
|
||||
<el-table-column property="x" label="违规日期" min-width="100px" />
|
||||
<el-table-column property="x" label="被警告日期" min-width="100px" />
|
||||
<el-table-column property="x" label="违规类型" min-width="100px" />
|
||||
<el-dialog v-model="dialogTableVisible"
|
||||
title="警告详情">
|
||||
<el-table style="width: 100%"
|
||||
:data="tableData2">
|
||||
<el-table-column property="x"
|
||||
label="成员ID"
|
||||
min-width="100px" />
|
||||
<el-table-column property="x"
|
||||
label="成员昵称"
|
||||
min-width="100px" />
|
||||
<el-table-column property="x"
|
||||
label="违规日期"
|
||||
min-width="100px" />
|
||||
<el-table-column property="x"
|
||||
label="被警告日期"
|
||||
min-width="100px" />
|
||||
<el-table-column property="x"
|
||||
label="违规类型"
|
||||
min-width="100px" />
|
||||
</el-table>
|
||||
<el-button
|
||||
class="dialogTableVisibleBut"
|
||||
type="primary"
|
||||
@click="dialogTableVisible = false"
|
||||
>
|
||||
<el-button class="dialogTableVisibleBut"
|
||||
type="primary"
|
||||
@click="dialogTableVisible = false">
|
||||
关闭
|
||||
</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 违规弹窗 -->
|
||||
<el-dialog v-model="violationDialog" title="新增" width="28%" center>
|
||||
<el-dialog v-model="violationDialog"
|
||||
title="新增"
|
||||
width="28%"
|
||||
center>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label"
|
||||
>成员ID</span
|
||||
>
|
||||
<el-input
|
||||
v-model="violationObj.id"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">成员ID</span>
|
||||
<el-input v-model="violationObj.id"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 25px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label"
|
||||
>成员昵称</span
|
||||
>
|
||||
<el-input
|
||||
v-model="violationObj.nick"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">成员昵称</span>
|
||||
<el-input v-model="violationObj.nick"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 25px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label"
|
||||
>违规日期</span
|
||||
>
|
||||
<el-date-picker
|
||||
v-model="violationObj.time"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间"
|
||||
>
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">违规日期</span>
|
||||
<el-date-picker v-model="violationObj.time"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 25px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label"
|
||||
>违规类型</span
|
||||
>
|
||||
<el-select v-model="violationObj.nowValue" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in violationObj.options"
|
||||
:key="item.id"
|
||||
:label="item.type"
|
||||
:value="item.id"
|
||||
>
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">违规类型</span>
|
||||
<el-select v-model="violationObj.nowValue"
|
||||
placeholder="请选择">
|
||||
<el-option v-for="item in violationObj.options"
|
||||
:key="item.id"
|
||||
:label="item.type"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -176,7 +167,8 @@
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="violationDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="add(violationObj)">
|
||||
<el-button type="primary"
|
||||
@click="add(violationObj)">
|
||||
确认
|
||||
</el-button>
|
||||
</span>
|
||||
@@ -184,17 +176,15 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<el-pagination style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -211,7 +201,7 @@ import { dateFormat } from "@/utils/system-helper";
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "GuildMemberInfo",
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
@@ -220,15 +210,8 @@ export default {
|
||||
nick: "",
|
||||
time: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [],
|
||||
// 内嵌表格
|
||||
dialogTableVisible: false,
|
||||
tableData2: [],
|
||||
// 新增弹窗
|
||||
violationDialog: false,
|
||||
// 违规对象
|
||||
violationObj: {
|
||||
//新增所需对象
|
||||
resource: {
|
||||
id: "",
|
||||
nick: "",
|
||||
time: "",
|
||||
@@ -236,13 +219,17 @@ export default {
|
||||
options: [],
|
||||
familyMemberId: null,
|
||||
},
|
||||
// 表格
|
||||
tableData: [],
|
||||
// 新增弹窗
|
||||
addDialog: false,
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
this.getData();
|
||||
listFun().then((res) => {
|
||||
this.violationObj.options = res.data;
|
||||
@@ -250,7 +237,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
getData () {
|
||||
this.loading = true;
|
||||
let time = this.inquire.time;
|
||||
let startTime = "";
|
||||
@@ -275,7 +262,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 导出
|
||||
exportFamilyMemberFun() {
|
||||
exportFamilyMemberFun () {
|
||||
this.loading = true;
|
||||
let time = this.inquire.time;
|
||||
let startTime = "";
|
||||
@@ -295,7 +282,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 违规警告
|
||||
warnClick(val) {
|
||||
warnClick (val) {
|
||||
console.log(val.row);
|
||||
var obj = val.row;
|
||||
this.violationObj.id = val.row.erbanNo;
|
||||
@@ -303,7 +290,7 @@ export default {
|
||||
this.violationObj.familyMemberId = val.row.familyMemberId;
|
||||
this.violationDialog = true;
|
||||
},
|
||||
add(val) {
|
||||
add (val) {
|
||||
var num = this.violationObj.options.map((item, i) => {
|
||||
return this.violationObj.nowValue == item.id ? i : null;
|
||||
});
|
||||
@@ -331,7 +318,7 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
listRecordFun(val) {
|
||||
listRecordFun (val) {
|
||||
let time = this.inquire.time;
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
@@ -361,10 +348,10 @@ export default {
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
handleSizeChange () {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
handleCurrentChange () {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
|
203
src/views/users/FeedBack.vue
Normal file
203
src/views/users/FeedBack.vue
Normal file
@@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<!-- 时间选择器 -->
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<span class="demonstration">日期</span>
|
||||
<el-date-picker
|
||||
v-model="inquire.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>反馈类型</span>
|
||||
<el-select filterable v-model="inquire.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.type"
|
||||
:label="JsonFunc(item.desc).zh"
|
||||
:value="item.type"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="desc" align="center" label="问题描述" />
|
||||
<el-table-column prop="type" align="center" label="反馈类型">
|
||||
<template #default="{ row }">
|
||||
{{
|
||||
row.type == 1
|
||||
? "应用异常"
|
||||
: row.type == 2
|
||||
? "充值或收入"
|
||||
: row.type == 3
|
||||
? "账号申诉"
|
||||
: row.type == 4
|
||||
? "建议"
|
||||
: ""
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="giftInfo"
|
||||
label="反馈截图"
|
||||
width="120"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
v-if="scope.row.screenUrl"
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.screenUrl"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.screenUrl"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
<div v-else>/</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contact" align="center" label="联系方式" />
|
||||
<el-table-column prop="createTime" align="center" label="生成时间" />
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listType, pageRecord } from "@/api/feedBack/feedBack";
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
export default {
|
||||
name: "FeedBack",
|
||||
data() {
|
||||
return {
|
||||
inquire: {
|
||||
giftId: "",
|
||||
userId: "",
|
||||
time: "",
|
||||
value: "",
|
||||
options: [],
|
||||
},
|
||||
loading: false,
|
||||
// 表格数据
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listType().then((res) => {
|
||||
this.inquire.options = res.data;
|
||||
});
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.loading = true;
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
if (this.inquire.time && this.inquire.time.length > 0) {
|
||||
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
pageRecord({
|
||||
startTime,
|
||||
endTime,
|
||||
type: this.inquire.value,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData = res.data.rows;
|
||||
this.total = res.data.total;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
JsonFunc(val) {
|
||||
var res = JSON.parse(val);
|
||||
return res;
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.currentPage = page;
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -1,128 +0,0 @@
|
||||
<template>
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
用户uid: <input type="text" name="uid" id="uid" class="input-sm">
|
||||
选择时间: <input type="text" name="beginDate" id="beginDate" class="input-sm">
|
||||
至 <input type="endDate" id="endDate" class="input-sm">
|
||||
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "FeedbackAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'uid', title: '用户uid', align: 'center', width: '10%' },
|
||||
{
|
||||
field: 'feedbackDesc', title: '反馈信息', align: 'center', width: '20%',
|
||||
formatter: function (val, row, index) {
|
||||
return val ? val.replace('<', '《').replace('>', '》') : '';
|
||||
}
|
||||
},
|
||||
{ field: 'imgUrl', title: '反馈截图', align: 'center', width: '10%' },
|
||||
{ field: 'contact', title: '摘要', align: 'center', width: '10%' },
|
||||
{
|
||||
field: 'createTime', title: '生成时间', align: 'center',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
pageSize: params.pageSize,
|
||||
pageNum: params.pageNumber,
|
||||
uid: $('#uid').val(),
|
||||
beginDate: $('#beginDate').val(),
|
||||
endDate: $('#endDate').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'code',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/feedback/list',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
|
||||
})
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
})
|
||||
var picker1 = $("#beginDate").datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
startDate: "2016-01-01"
|
||||
});
|
||||
var picker2 = $("#endDate").datepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
todayBtn: true,
|
||||
autoclose: true
|
||||
});
|
||||
picker1.on('changeDate', function () {
|
||||
var date = $('#beginDate').datepicker('getDate');
|
||||
picker2.datepicker('setStartDate', date);
|
||||
});
|
||||
picker2.on('changeDate', function () {
|
||||
var date = $('#endDate').datepicker('getDate');
|
||||
picker1.datepicker('setEndDate', date);
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#btnSearch {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
#uid {
|
||||
margin-right: 4px;
|
||||
}</style>
|
302
src/views/vip/VipGive.vue
Normal file
302
src/views/vip/VipGive.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>ID</span>
|
||||
<el-input
|
||||
v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询
|
||||
</el-button>
|
||||
<el-button class="primary" type="primary" @click="editDialog = true"
|
||||
>赠送VIP
|
||||
</el-button>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="erbanNo" align="center" label="平台号" />
|
||||
<el-table-column prop="nick" align="center" label="昵称" />
|
||||
<el-table-column
|
||||
prop="registerTime"
|
||||
align="center"
|
||||
label="用户注册时间"
|
||||
/>
|
||||
<el-table-column prop="createTime" align="center" label="赠送贵族时间" />
|
||||
<el-table-column prop="vipLevel" align="center" label="赠送贵族等级">
|
||||
<template v-slot="scope">VIP{{ scope.row.vipLevel }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="adminName" align="center" label="操作人" />
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 赠送VIP弹窗 -->
|
||||
<el-dialog
|
||||
v-model="editDialog"
|
||||
title="赠送VIP(点击确认直接赠送,请认真核对谨慎操作!!)"
|
||||
width="36%"
|
||||
center
|
||||
>
|
||||
<!-- 赠送用户平台ID -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>赠送用户平台ID</span
|
||||
>
|
||||
<el-input
|
||||
v-model="editObj.userId"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请输入赠送用户平台ID"
|
||||
@input="inputFun()"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 赠送等级 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>赠送VIP等级</span
|
||||
>
|
||||
<el-select v-model="editObj.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in editObj.options"
|
||||
:key="item.vipLevel"
|
||||
:label="item.vipName"
|
||||
:value="item.vipLevel"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- 用户昵称 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>用户昵称</span
|
||||
>
|
||||
<el-input
|
||||
v-model="editObj.nick"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请先输入用户平台id"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 用户地区 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>用户地区</span
|
||||
>
|
||||
<el-input
|
||||
v-model="editObj.region"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请先输入用户平台id"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 用户注册时间 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>用户注册时间</span
|
||||
>
|
||||
<el-input
|
||||
v-model="editObj.time"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请先输入用户平台id"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="editDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="editDialogClick()">
|
||||
确认
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getByErbanNo,
|
||||
listAll,
|
||||
pageRecord,
|
||||
vipSendSend,
|
||||
} from "@/api/VipGive/VipGive";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "VipGive",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
userId: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
// 赠送VIP
|
||||
editDialog: false,
|
||||
timeout: "",
|
||||
editObj: {
|
||||
userId: "",
|
||||
value: "",
|
||||
options: [],
|
||||
nick: "",
|
||||
time: "",
|
||||
region: "",
|
||||
uid: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
listAll().then((res) => {
|
||||
this.editObj.options = res.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
pageRecord({
|
||||
erbanNo: this.inquire.userId,
|
||||
current: this.currentPage,
|
||||
size: this.pageSize,
|
||||
}).then((res) => {
|
||||
this.total = res.data.total;
|
||||
this.tableData = res.data.rows;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 监听弹窗用户id输入
|
||||
inputFun() {
|
||||
var than = this;
|
||||
clearTimeout(than.timeout);
|
||||
than.timeout = setTimeout(function () {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "查询中~",
|
||||
type: "warning",
|
||||
});
|
||||
getByErbanNo({
|
||||
erbanNo: than.editObj.userId,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
than.editObj.nick = res.data.nick;
|
||||
than.editObj.region = res.data.partitionName;
|
||||
than.editObj.time = res.data.createTime;
|
||||
than.editObj.uid = res.data.uid;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "查询成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
},
|
||||
// 赠送按钮
|
||||
editDialogClick() {
|
||||
vipSendSend({
|
||||
uid: this.editObj.uid,
|
||||
vipLevel: this.editObj.value,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getData();
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "赠送成功",
|
||||
type: "success",
|
||||
});
|
||||
this.editDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user