搬迁代码【第四版】
This commit is contained in:
@@ -98,7 +98,21 @@ export default {
|
||||
columns: [
|
||||
{ field: 'fromErbanNo', title: 'Peko号', align: 'center', width: '5%' },
|
||||
{ field: 'content', title: '发送内容', align: 'center', width: '5%' },
|
||||
{ field: 'type', title: '表示形式', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'type',
|
||||
title: '表示形式',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
var value = '';
|
||||
if (val == 0) {
|
||||
value = '房间静态飘屏';
|
||||
} else if (val == 1) {
|
||||
value = '全服动态飘屏';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{ field: 'createTime', title: '创建时间', align: 'center', width: '5%' },
|
||||
],
|
||||
cache: false,
|
||||
|
@@ -69,6 +69,7 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { cleanArray } from '@/utils/maintainer';
|
||||
|
||||
const TEAM_ROLE = {
|
||||
"1": '组员',
|
||||
@@ -318,13 +319,13 @@ export default {
|
||||
});
|
||||
});
|
||||
|
||||
function param(obj) {
|
||||
let str = '';
|
||||
for (let key in obj) {
|
||||
let value = obj[key];
|
||||
str = key + '=' + value + '&';
|
||||
}
|
||||
return str.substring(0, str.length - 1);
|
||||
function param(json) {
|
||||
if (!json) return ''
|
||||
return cleanArray(Object.keys(json).map(key => {
|
||||
if (json[key] === undefined) return ''
|
||||
return encodeURIComponent(key) + '=' +
|
||||
encodeURIComponent(json[key])
|
||||
})).join('&')
|
||||
}
|
||||
|
||||
$("#exportTeamDetail").on("click", function () {
|
||||
|
@@ -104,17 +104,17 @@
|
||||
<h4 class="modal-title" id="introModalTitle">统计说明</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
分组统计展示每个小组的整体数据,按不同的小组分别显示,查询前需要:<br/>
|
||||
1)输入查询的小组:非必填,不填写展示全部小组<br/>
|
||||
2)选择被邀请用户的新增时间范围:指的是被邀请的人新增的时间段,非必填,不填写展示截止到目前的全部数据<br/>
|
||||
3)选择被邀请用户的充值时间范围:指的是被邀请的人的充值行为发生的时间段,非必填,不填写展示截止到目前的全部数据<br/>
|
||||
表格按照选取的被邀请用户新增时间展示累计新增用户数<br/>
|
||||
表头说明:<br/>
|
||||
--新增用户数:该小组在所设置的被邀请用户新增时间范围内所引入的新用户数量<br/>
|
||||
--新增充值人数:该小组满足新增时间筛选的新增用户,在所设置的充值时间范围内发生首次充值的人数<br/>
|
||||
--付费转化:付费转化=表格显示的新增充值人数/表格显示的新增用户数<br/>
|
||||
--充值次数:该小组满足新增时间筛选的新增用户,在所设置的充值时间范围内发生的累计充值次数<br/>
|
||||
--充值金额:该小组满足新增时间筛选的新增用户,在所设置的充值时间范围内发生的累计充值金额<br/>
|
||||
分组统计展示每个小组的整体数据,按不同的小组分别显示,查询前需要:<br />
|
||||
1)输入查询的小组:非必填,不填写展示全部小组<br />
|
||||
2)选择被邀请用户的新增时间范围:指的是被邀请的人新增的时间段,非必填,不填写展示截止到目前的全部数据<br />
|
||||
3)选择被邀请用户的充值时间范围:指的是被邀请的人的充值行为发生的时间段,非必填,不填写展示截止到目前的全部数据<br />
|
||||
表格按照选取的被邀请用户新增时间展示累计新增用户数<br />
|
||||
表头说明:<br />
|
||||
--新增用户数:该小组在所设置的被邀请用户新增时间范围内所引入的新用户数量<br />
|
||||
--新增充值人数:该小组满足新增时间筛选的新增用户,在所设置的充值时间范围内发生首次充值的人数<br />
|
||||
--付费转化:付费转化=表格显示的新增充值人数/表格显示的新增用户数<br />
|
||||
--充值次数:该小组满足新增时间筛选的新增用户,在所设置的充值时间范围内发生的累计充值次数<br />
|
||||
--充值金额:该小组满足新增时间筛选的新增用户,在所设置的充值时间范围内发生的累计充值金额<br />
|
||||
--送礼金额:该小组满足新增时间筛选的新增用户,截止到目前时刻的送礼金额
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -170,7 +170,7 @@
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { formatTime } from '@/utils/maintainer';
|
||||
import { formatTime, cleanArray } from '@/utils/maintainer';
|
||||
|
||||
const TEAM_ROLE = {
|
||||
"1": '组员',
|
||||
@@ -357,6 +357,9 @@ export default {
|
||||
{ field: 'chargeMoney', title: '充值金额(美元)', align: 'center', width: '5%', },
|
||||
{ field: 'sendGiftMony', title: '送礼钻石数', align: 'center', width: '5%', },
|
||||
{ field: 'arpu', title: 'Arpu', align: 'center', width: '5%', },
|
||||
{ field: 'twoRemainCount', title: '次留', align: 'center', width: '5%', },
|
||||
{ field: 'sevenRemainCount', title: '七留', align: 'center', width: '5%', },
|
||||
{ field: 'thirtyRemainCount', title: '月留', align: 'center', width: '5%', },
|
||||
{
|
||||
field: 'teamId',
|
||||
title: '操作',
|
||||
@@ -744,13 +747,13 @@ export default {
|
||||
});
|
||||
});
|
||||
|
||||
function param(obj) {
|
||||
let str = '';
|
||||
for (let key in obj) {
|
||||
let value = obj[key];
|
||||
str = key + '=' + value + '&';
|
||||
}
|
||||
return str.substring(0, str.length - 1);
|
||||
function param(json) {
|
||||
if (!json) return ''
|
||||
return cleanArray(Object.keys(json).map(key => {
|
||||
if (json[key] === undefined) return ''
|
||||
return encodeURIComponent(key) + '=' +
|
||||
encodeURIComponent(json[key])
|
||||
})).join('&')
|
||||
}
|
||||
|
||||
$("#table").on("click", '.opt-exprot-user-detail-of-team', function () {
|
||||
|
516
src/views/guild/GuildRoomAdminView.vue
Normal file
516
src/views/guild/GuildRoomAdminView.vue
Normal file
@@ -0,0 +1,516 @@
|
||||
<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/guild/room/export" method="post" target="_blank">
|
||||
<div class="col-sm-12">
|
||||
<label for="sErbanNo" class="col-sm-2 control-label">平台号:</label>
|
||||
<div class="col-sm-3"><input type="text" class="form-control" name="erbanNo" id="sErbanNo">
|
||||
</div>
|
||||
|
||||
<label for="sAccount" class="col-sm-2 control-label">房主支付宝账号:</label>
|
||||
<div class="col-sm-3"><input type="text" class="form-control" name="sAccount" id="sAccount">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="sSponsorAccount" class="col-sm-2 control-label">介绍人支付宝账号:</label>
|
||||
<div class="col-sm-3"><input type="text" class="form-control" name="sSponsorAccount"
|
||||
id="sSponsorAccount"></div>
|
||||
</div>
|
||||
</form>
|
||||
<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-search"></i>新增
|
||||
</button>
|
||||
<button id="btnExport" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-adjust"></i>导出
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="guildModal" tabindex="-1" role="dialog" aria-labelledby="guildLabel">
|
||||
<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="guildForm">
|
||||
<input type="hidden" name="id" id="id" />
|
||||
<div class="form-group">
|
||||
<label for="erbanNo" class="col-sm-3 control-label">平台号:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="erbanNo" id="erbanNo">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="phone" class="col-sm-3 control-label">房主手机号码:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="phone" id="phone">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="flowRate" class="col-sm-3 control-label">房主流水比例(%):</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="flowRate" id="flowRate">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="account" class="col-sm-3 control-label">房主支付宝账号:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="account" id="account">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="accountName" class="col-sm-3 control-label">房主支付宝名称:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[required]" name="accountName"
|
||||
id="accountName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 目前不支持银行卡转账-->
|
||||
<div class="form-group">
|
||||
<label for="bankAccount" class="col-sm-3 control-label">房主银行卡账号:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="bankAccount" id="bankAccount"
|
||||
placeholder="暂不支持银行卡付款">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="bankAccountName" class="col-sm-3 control-label">房主银行卡账户名:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="bankAccountName" id="bankAccountName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="bankType" class="col-sm-3 control-label">房主银行卡开户行:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="bankType" id="bankType">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sponsorName" class="col-sm-3 control-label">介绍人:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="sponsorName" id="sponsorName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sponsorPhone" class="col-sm-3 control-label">介绍人手机号码:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="sponsorPhone" id="sponsorPhone">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sponsorRate" class="col-sm-3 control-label">介绍人流水比例(%):</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="sponsorRate" id="sponsorRate">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sponsorAccount" class="col-sm-3 control-label">介绍人支付宝账号:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="sponsorAccount" id="sponsorAccount">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sponsorAccountName" class="col-sm-3 control-label">介绍人支付宝名称:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="sponsorAccountName" id="sponsorAccountName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 目前不支持银行卡转账-->
|
||||
<div class="form-group">
|
||||
<label for="sponBankAccount" class="col-sm-3 control-label">介绍人银行卡账号:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="sponBankAccount" id="sponBankAccount">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sponBankAccountName" class="col-sm-3 control-label">介绍人银行卡账户名:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="sponBankAccountName" id="sponBankAccountName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="sponBankType" class="col-sm-3 control-label">介绍人银行卡开户行:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="sponBankType" id="sponBankType">
|
||||
</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="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "GuildRoomAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'tmp', title: 'id', align: 'center', checkbox: true, width: '5%' },
|
||||
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'roomType',
|
||||
title: '厅类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return "热门";
|
||||
} else if (val == 3) {
|
||||
return "新秀";
|
||||
} else if (val == 2) {
|
||||
return "个人";
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'roomGender',
|
||||
title: '厅类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return "男模";
|
||||
} else if (val == 2) {
|
||||
return "女模";
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'roomTag', title: '厅类型', align: 'center', width: '5%' },
|
||||
{ field: 'roomTitle', title: '厅标题', align: 'center', width: '5%' },
|
||||
{ field: 'phone', title: '房主手机号', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'flowRate',
|
||||
title: '流水比例(%)',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var rate = val * 100;
|
||||
return rate + "%";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'alipayAccount', title: '支付宝账号', align: 'center', width: '5%' },
|
||||
{ field: 'alipayAccountName', title: '支付宝名称', align: 'center', width: '5%' },
|
||||
{ field: 'sponsorName', title: '介绍人', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'sponsorRate',
|
||||
title: '介绍人流水比例',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var rate = val * 100;
|
||||
return rate + "%";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'sponsorPhone', title: '介绍人手机号', align: 'center', width: '5%' },
|
||||
{ field: 'sponsorAlipayAccount', title: '介绍人支付宝账号', align: 'center', width: '5%' },
|
||||
{ field: 'sponsorAlipayAccountName', title: '介绍人支付宝名称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'createTime', title: '创建时间', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'updateTime', title: '修改时间', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'temp',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
var key = row.id;
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + key + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button> ' +
|
||||
'<button id="btnMove" name="btnMove" class="btn btn-sm btn-success opt-delete" data-id=' + key + '>' +
|
||||
'<i class="glyphicon glyphicon-move"></i> 删除</button> ';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100, 200, 300, 500],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
pageNum: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
account: $('#sAccount').val(),
|
||||
erbanNo: $('#sErbanNo').val(),
|
||||
sponsorAccount: $('#sSponsorAccount').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/guild/room/list.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
// 发起提现申请
|
||||
$("#btnAdd").click(function () {
|
||||
clearForm($("#guildForm"));
|
||||
$("#guildModal").modal('show');
|
||||
});
|
||||
|
||||
|
||||
$("#save").click(function () {
|
||||
var id = $("#id").val();
|
||||
var roomUid = $('#erbanNo').val();
|
||||
var flowRate = $('#flowRate').val();
|
||||
var alipayAccount = $("#account").val();
|
||||
var alipayAccountName = $("#accountName").val();
|
||||
var bankAccount = $("#bankAccount").val();
|
||||
var bankAccountName = $("#bankAccountName").val();
|
||||
var depositBank = $("#bankType").val();
|
||||
var sponsor = $("#sponsorName").val();
|
||||
var sponsorRate = $('#sponsorRate').val();
|
||||
var sponsorAlipayAccount = $("#sponsorAccount").val();
|
||||
var sponsorAlipayAccountName = $("#sponsorAccountName").val();
|
||||
var sponsorBankAccount = $("#sponBankAccount").val();
|
||||
var sponsorBankAccountName = $("#sponBankAccountName").val();
|
||||
var sponsorDepositBank = $("#sponBankType").val();
|
||||
var phone = $("#phone").val();
|
||||
var sponsorPhone = $("#sponsorPhone").val();
|
||||
if (flowRate > 100 || sponsorRate > 100) {
|
||||
$('#tipMsg').text("房间流水比例不能超过100%");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if ($("#guildForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/guild/room/save.action",
|
||||
data: {
|
||||
id: id,
|
||||
roomUid: roomUid,
|
||||
flowRate: flowRate,
|
||||
alipayAccount: alipayAccount,
|
||||
alipayAccountName: alipayAccountName,
|
||||
bankAccount: bankAccount,
|
||||
bankAccountName: bankAccountName,
|
||||
depositBank: depositBank,
|
||||
sponsorName: sponsor,
|
||||
sponsorRate: sponsorRate,
|
||||
sponsorAlipayAccount: sponsorAlipayAccount,
|
||||
sponsorAlipayAccountName: sponsorAlipayAccountName,
|
||||
sponsorBankAccount: sponsorBankAccount,
|
||||
sponsorBankAccountName: sponsorBankAccountName,
|
||||
sponsorDepositBank: sponsorDepositBank,
|
||||
phone: phone,
|
||||
sponsorPhone: sponsorPhone
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#guildModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#guildModal").modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
clearForm($("#guildForm"));
|
||||
var id = $(this).attr("data-id");
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/guild/room/getById.action.action",
|
||||
data: { id: id },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json) {
|
||||
$("#id").val(json.id);
|
||||
$("#erbanNo").val(json.erbanNo);
|
||||
if (json.flowRate) {
|
||||
$("#flowRate").val(json.flowRate * 100);
|
||||
} else {
|
||||
$("#flowRate").val(0);
|
||||
}
|
||||
$("#sponsorName").val(json.sponsorName);
|
||||
if (json.sponsorRate) {
|
||||
$("#sponsorRate").val(json.sponsorRate * 100);
|
||||
} else {
|
||||
$("#sponsorRate").val(0);
|
||||
}
|
||||
$("#account").val(json.alipayAccount);
|
||||
$("#accountName").val(json.alipayAccountName);
|
||||
$("#bankAccount").val(json.bankAccount);
|
||||
$("#bankAccountName").val(json.bankAccountName);
|
||||
$("#bankType").val(json.depositBank);
|
||||
$("#sponsorAccount").val(json.sponsorAlipayAccount);
|
||||
$("#sponsorAccountName").val(json.sponsorAlipayAccountName);
|
||||
$("#sponBankAccount").val(json.sponsorBankAccount);
|
||||
$("#sponBankAccountName").val(json.sponsorBankAccountName);
|
||||
$("#sponBankType").val(json.sponsorDepositBank);
|
||||
$("#phone").val(json.phone);
|
||||
$("#sponsorPhone").val(json.sponsorPhone);
|
||||
$("#guildModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("获取公会信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-delete', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
if (id == 'undefined') {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (confirm("你确认删除该记录吗?" +
|
||||
"\r\n删除后再也不能找回,请谨慎操作!")) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/guild/room/delete.action",
|
||||
data: { 'id': id },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
$("#tipMsg").text("删除成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btnExport").on("click", function () {
|
||||
$("#searchForm").submit();
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
function clearForm(obj) {
|
||||
//清空输入框
|
||||
obj.find('input:text').val('');
|
||||
//清空隐藏域
|
||||
obj.find('input:hidden').val('');
|
||||
//清空单选按钮
|
||||
obj.find('input:radio').attr("checked", false);
|
||||
//清空文本域
|
||||
obj.find('textarea').val('');
|
||||
//清空图片
|
||||
obj.find('img').attr("src", "");
|
||||
//清空已上传
|
||||
obj.find('span').html("");
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
718
src/views/hall/ClanAdminView.vue
Normal file
718
src/views/hall/ClanAdminView.vue
Normal file
@@ -0,0 +1,718 @@
|
||||
<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="clanId" class="col-sm-2 control-label">家族id:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="clanId"
|
||||
placeholder="请输入家族id,填多个用,隔开"></div>
|
||||
<label for="erbanNo" class="col-sm-2 control-label">族长平台号:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="erbanNo"
|
||||
placeholder="请输入族长平台号,填多个用,隔开"></div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="queryClanLevel" class="col-sm-2 control-label">家族等级</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="queryClanLevel" name="queryClanLevel" class="input-sm">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
<button id="addBtn" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>添加
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="addClanModal" 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="modal_elderErbanNo" 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="modal_elderErbanNo"
|
||||
id="modal_elderErbanNo">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="module_clanName" class="col-sm-3 control-label">家族名称:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="module_clanName" id="module_clanName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="module_hallOwnerErbanNoStr" class="col-sm-3 control-label">会长平台号<font color="red">*
|
||||
</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="input-sm form-control validate[required]"
|
||||
name="module_hallOwnerErbanNoStr" id="module_hallOwnerErbanNoStr" placeholder="用,隔开填多个">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="module_associateAccount" class="col-sm-3 control-label">关联房间:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="input-sm form-control" name="module_associateAccount"
|
||||
id="module_associateAccount" placeholder="用,隔开填多个">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="addClanLevel" class="col-sm-3 control-label">家族等级<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="addClanLevel" name="addClanLevel" class="input-sm">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">家族封面:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="addAvatarUrl" style='width:40px;height:40px;' alt="">
|
||||
<input type="file" id="addUploadFile" name='uploadFile'
|
||||
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
|
||||
<button class="btn btn-success" type='button' id="addUploadBtn">上传</button>
|
||||
<input type="hidden" id="addAvatar" name='avatar' class="form-control">
|
||||
<span id="addPicImgInfo" style="color:red;"></span>
|
||||
</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>
|
||||
|
||||
<div class="modal fade" id="updateClanModal" 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="updateModalLabel">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="updateForm">
|
||||
<input type="hidden" name="id" id="updateId" />
|
||||
<div class="form-group">
|
||||
<label for="updatemodal_elderErbanNo" 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="modal_elderErbanNo"
|
||||
id="updatemodal_elderErbanNo">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="updatemodule_clanName" class="col-sm-3 control-label">家族名称:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="module_clanName" id="updatemodule_clanName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="updatemodule_hallOwnerErbanNoStr" class="col-sm-3 control-label">会长平台号<font
|
||||
color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="input-sm form-control validate[required]"
|
||||
name="module_hallOwnerErbanNoStr" id="updatemodule_hallOwnerErbanNoStr"
|
||||
placeholder="用,隔开填多个">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="updatemodule_associateAccount" class="col-sm-3 control-label">关联房:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="input-sm form-control validate[required]"
|
||||
name="module_associateAccount" id="updatemodule_associateAccount" placeholder="用,隔开填多个">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="editClanLevel" class="col-sm-3 control-label">家族等级<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="editClanLevel" name="editClanLevel" class="input-sm">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">家族封面:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="editAvatarUrl" style='width:40px;height:40px;' alt="">
|
||||
<input type="file" id="editUploadFile" name='uploadFile'
|
||||
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
|
||||
<button class="btn btn-success" type='button' id="editUploadBtn">上传</button>
|
||||
<input type="hidden" id="editAvatar" name='avatar' class="form-control">
|
||||
<span id="editPicImgInfo" style="color:red;"></span>
|
||||
</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="updateClan">确定</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 超管信息 -->
|
||||
<div class="modal fade" id="worldTypeModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">x</span>
|
||||
</button>
|
||||
|
||||
<div class="modal-title" id="worldTypeModalLabel"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<form action="" id="addSuper" class="form-horizontal">
|
||||
<!-- <input type="hidden" id="modal_id" name="id"/>-->
|
||||
<div class="form-group" id="superManageList">
|
||||
<div class="col-sm-8" hidden="hidden">
|
||||
<input hidden="hidden" type="text" class="form-control " name="clanId" id="modal_clanId"
|
||||
placeholder="族长id">
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">超管:</label>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th hidden="hidden" style="width: 100px;text-align: center;">uid</th>
|
||||
<th style="width: 100px;text-align: center;">平台号</th>
|
||||
<th style="width: 100px;text-align: center;">昵称</th>
|
||||
<th style="width: 100px;text-align: center;">管理房间</th>
|
||||
<th style="width: 100px;text-align: center;">操作</th>
|
||||
</tr>
|
||||
</table>
|
||||
</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 js-quick-search" data-primary="addSave">新增超管</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="superManageModal" rabindex='-1' role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">x</span>
|
||||
</button>
|
||||
|
||||
<div class="modal-title" id="superManageModalLabel"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<form action="" id="addSuperManage" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<div hidden="hidden" class="col-sm-8">
|
||||
<input hidden="hidden" type="text" class="form-control validate[required,custom[integer]]"
|
||||
name="type" id="modal_type">
|
||||
</div>
|
||||
<label for="modal_superErbanNo" class="col-sm-3 control-label">平台号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required,custom[integer]]"
|
||||
name="superErbanNo" id="modal_superErbanNo" placeholder="请输入平台号">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_superManageErbanNo" class="col-sm-2 control-label">管理的房间:</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" name="superManageErbanNo" id="modal_superManageErbanNo"
|
||||
style="height:250px;" placeholder="多个用逗号隔开,只能输入属于该家族的房间"></textarea>
|
||||
</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" data-primary="addSave" id="superSave">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
let tableLoaded = false;
|
||||
let currParams = {};
|
||||
export default {
|
||||
name: "ClanAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'clanId', title: '家族id', align: 'center', width: '5%' },
|
||||
{ field: 'clanElderUid', title: '族长uid', align: 'center', width: '5%' },
|
||||
{ field: 'clanElderErbanNo', title: '族长平台号', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'avatar', title: '家族封面', align: 'center', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='40' height='40'>";
|
||||
}
|
||||
},
|
||||
{ field: 'hallNum', title: '公会数量', align: 'center', width: '5%' },
|
||||
{ field: 'clanMemberNum', title: '家族人数', align: 'center', width: '5%' },
|
||||
{ field: 'superAdminNum', title: '超管人数', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'level', title: '等级', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
const levelName = row.levelName;
|
||||
return `${val}-${levelName}`;
|
||||
}
|
||||
},
|
||||
{ field: 'clanAccountAssociate', title: '关联账号', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'clanId',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
const clanId = row.clanId;
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" clanId=' + clanId + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
||||
'<button class="btn btn-sm btn-danger opt-remove" clanId=' + clanId +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>' +
|
||||
'<button id="superAdmin" name="superAdmin" class="btn btn-sm btn-success opt-super" clanId=' + clanId + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 设置超管</button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
undefinedText: 0,
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 50, 100, 200, 300, 500],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
pageNum: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
clanId: $('#clanId').val(),
|
||||
level: $("#queryClanLevel").val()
|
||||
};
|
||||
currParams = param;
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/clan/listStats.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
tableLoaded = true;
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
if (tableLoaded || currParams.pageNumber > 1) {
|
||||
TableHelper.doRefreshAndToPage1('#table');
|
||||
} else {
|
||||
TableHelper.doRefresh('#table');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//新建标签
|
||||
$("#addBtn").click(function () {
|
||||
$("#modal_elderErbanNo").val(""),
|
||||
$("#module_clanName").val(""),
|
||||
$("#module_hallOwnerErbanNoStr").val(""),
|
||||
$("#addAvatar").val(""),
|
||||
$('#addAvatarUrl').attr("src", '');
|
||||
$("#addPicImgInfo").html('');
|
||||
$("#addUploadFile").val('');
|
||||
$("#addClanModal").modal('show');
|
||||
});
|
||||
|
||||
//获取家族信息
|
||||
$('#table').on('click', '.opt-edit', function () {
|
||||
const clanId = $(this).attr('clanId');
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/clan/getClanInfo.action",
|
||||
data: {
|
||||
clanId: clanId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
console.log(json.data)
|
||||
$("#updatemodal_elderErbanNo").val(json.data.clanElderErbanNo);
|
||||
$("#updatemodule_clanName").val(json.data.clanName);
|
||||
$("#updatemodule_hallOwnerErbanNoStr").val(json.data.hallOwnerErbanNo);
|
||||
$("#editClanLevel").val(json.data.level);
|
||||
// 设置图片
|
||||
$("#editUploadFile").val('');
|
||||
$('#editAvatar').val(json.data.avatar);
|
||||
$('#editAvatarUrl').attr("src", json.data.avatar);
|
||||
$('#updatemodule_associateAccount').val(json.data.associateAccount);
|
||||
|
||||
if (json.data.avatar != '') {
|
||||
$("#editPicImgInfo").html('已上传');
|
||||
} else {
|
||||
$("#editPicImgInfo").html('未上传');
|
||||
}
|
||||
} else {
|
||||
$("#tipMsg").text("获取家族信息失败." + json.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
$("#updateId").val(clanId);
|
||||
$("#updateClanModal").modal('show');
|
||||
});
|
||||
|
||||
|
||||
// 获取超管列表
|
||||
$('#table').on('click', '.opt-super', function () {
|
||||
$('#superManageList table td').remove();
|
||||
$('#superManageList table button').remove();
|
||||
const clanId = $(this).attr('clanId');
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/clan/getClanSuperAdminInfo.action",
|
||||
data: {
|
||||
clanId: clanId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
var data = json.data;
|
||||
var superManage = '';
|
||||
data.forEach(function (res) {
|
||||
superManage += `
|
||||
<tr>
|
||||
<td hidden="hidden" class="superUid" style="text-align: center;">${res.uid}</td>
|
||||
<td style="text-align: center;">${res.erbanNo}</td>
|
||||
<td style="text-align: center;">${res.nick}</td>
|
||||
<td style="text-align: center;">${res.manageRoomErbanNoList}</td>
|
||||
<td style="text-align: center;">
|
||||
<button type="button" class="btn btn-sm btn-success opt-super-update" >编辑</button>
|
||||
<button type="button" class="btn btn-sm btn-danger opt-delete" >删除</button>
|
||||
</td>
|
||||
</tr>
|
||||
`
|
||||
});
|
||||
$('#superManageList table').append(superManage);
|
||||
|
||||
$('#modal_clanId').val(clanId);
|
||||
|
||||
// 编辑超管点击事件
|
||||
$('.opt-super-update').click(function () {
|
||||
var superUid = $(this).parent().siblings('.superUid').text();
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/clan/getSuperAdminManageInfo.action",
|
||||
data: { superUid: superUid },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
var data = json.data;
|
||||
$('#modal_superErbanNo').val(data.erbanNo);
|
||||
$('#modal_superManageErbanNo').val(data.manageRoomErbanNoList);
|
||||
$('#modal_type').val("1");
|
||||
}
|
||||
});
|
||||
$('#superManageModalLabel').text('设置超管');
|
||||
$('#superManageModal').modal('show');
|
||||
})
|
||||
|
||||
$('.opt-delete').click(function () {
|
||||
var param = {};
|
||||
var superUid = $(this).parent().siblings('.superUid').text();
|
||||
param.superUid = superUid;
|
||||
console.log(param)
|
||||
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/clan/deleteSuperAdmin.action",
|
||||
data: param,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
console.log(json)
|
||||
if (json.success) {
|
||||
$("#tipMsg").text("删除成功,请刷新页面更新数据");
|
||||
$("#tipModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text(json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$("#tipMsg").text("获取超管列表失败." + json.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
$('#worldTypeModalLabel').text('编辑超管');
|
||||
$('#worldTypeModal').modal('show');
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 保存超管
|
||||
$('#superSave').on('click', function () {
|
||||
if ($('#addSuperManage').validationEngine('validate')) {
|
||||
var param = {};
|
||||
param.superErbanNo = $('#modal_superErbanNo').val();
|
||||
param.superManageErbanNo = $('#modal_superManageErbanNo').val();
|
||||
param.clanId = $('#modal_clanId').val();
|
||||
param.type = $('#modal_type').val();
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/admin/clan/superSaveOrUpdate.action',
|
||||
data: param,
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
console.log(res)
|
||||
if (res.success) {
|
||||
$('#tipMsg').text('保存成功,请刷新页面更新数据');
|
||||
$('#tipModal').modal('show');
|
||||
// TableHelper.doRefresh('#table')
|
||||
} else {
|
||||
$('#tipMsg').text('保存失败,错误码:' + res.message);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// 新增超管弹窗
|
||||
$('.js-quick-search').click(function () {
|
||||
$("#modal_superErbanNo").val(""),
|
||||
$("#modal_superManageErbanNo").val(""),
|
||||
$("#modal_type").val(""),
|
||||
$('#superManageModalLabel').text('新增超管');
|
||||
$('#superManageModal').modal('show');
|
||||
})
|
||||
|
||||
|
||||
//删除家族
|
||||
$('#table').on('click', '.opt-remove', function () {
|
||||
const clanId = $(this).attr('clanId');
|
||||
if (confirm("你确认删除该家族吗?")) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/clan/del.action",
|
||||
data: {
|
||||
clanId: clanId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
console.log(json.data)
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除家族失败." + json.message);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 编辑
|
||||
$("#updateClan").click(function () {
|
||||
console.log("this", this);
|
||||
console.log("updateId", $("#updateId").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/clan/update.action",
|
||||
data: {
|
||||
clanId: $("#updateId").val(),
|
||||
elderErbanNo: $("#updatemodal_elderErbanNo").val(),
|
||||
clanName: $("#updatemodule_clanName").val(),
|
||||
hallOwnerErbanNoStr: $("#updatemodule_hallOwnerErbanNoStr").val(),
|
||||
associateAccount: $("#updatemodule_associateAccount").val(),
|
||||
level: $("#editClanLevel").val(),
|
||||
avatar: $("#editAvatar").val()
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagEditModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 新增
|
||||
$("#add").click(function () {
|
||||
console.log("$(#avatar).val()", $("#addAvatar").val())
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/clan/add.action",
|
||||
data: {
|
||||
elderErbanNo: $("#modal_elderErbanNo").val(),
|
||||
clanName: $("#module_clanName").val(),
|
||||
hallOwnerErbanNoStr: $("#module_hallOwnerErbanNoStr").val(),
|
||||
associateAccount: $("#module_associateAccount").val(),
|
||||
level: $("#addClanLevel").val(),
|
||||
avatar: $("#addAvatar").val()
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagEditModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/clan/listClanLevelForSelect.action",
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
renderLevelSelector(json.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function renderLevelSelector(levelList) {
|
||||
let options = [];
|
||||
levelList.forEach(item => {
|
||||
options.push(`<option value="${item.level}">${item.levelName}</option>`)
|
||||
});
|
||||
$('#queryClanLevel').html(options.join())
|
||||
$('#addClanLevel').html(options.join())
|
||||
$('#editClanLevel').html(options.join())
|
||||
}
|
||||
|
||||
|
||||
$('#addUploadBtn').on('click', function () {
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'addUploadFile', //需要上传的文件域的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就是服务器返回的数据。
|
||||
console.log('path', json.path)
|
||||
if (json.path) {
|
||||
$('#addAvatar').val(json.path);
|
||||
$('#addAvatarUrl').attr('src', json.path);
|
||||
if (json.path != '') {
|
||||
$("#addPicImgInfo").html('已上传成功');
|
||||
} else {
|
||||
$("#addPicImgInfo").html('未上传成功');
|
||||
}
|
||||
} else {
|
||||
$('#tipMsg').text(json.msg);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$('#editUploadBtn').on('click', function () {
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'editUploadFile', //需要上传的文件域的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就是服务器返回的数据。
|
||||
console.log('path', json.path)
|
||||
if (json.path) {
|
||||
$('#editAvatar').val(json.path);
|
||||
$('#editAvatarUrl').attr('src', json.path);
|
||||
if (json.path != '') {
|
||||
$("#editPicImgInfo").html('已上传成功');
|
||||
} else {
|
||||
$("#editPicImgInfo").html('未上传成功');
|
||||
}
|
||||
} else {
|
||||
$('#tipMsg').text(json.msg);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
359
src/views/hall/ClanFlowStatisAdminView.vue
Normal file
359
src/views/hall/ClanFlowStatisAdminView.vue
Normal file
@@ -0,0 +1,359 @@
|
||||
<template>
|
||||
<section class="content">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
<div id="toolbar">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="col-sm-3">
|
||||
<label htmlFor="erbanNo" class="col-sm-4 control-label">族长平台号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="input-sm form-control" name="erbanNo" id="erbanNo"
|
||||
placeholder="多个之间用,隔开">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<label htmlFor="clanId" class="col-sm-4 control-label">家族id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="input-sm form-control" name="clanId" id="clanId"
|
||||
placeholder="多个之间用,隔开">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<label class="col-sm-4 control-label">开始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="input-sm datetime" name="queryStartDate" id="queryStartDate">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<label class="col-sm-4 control-label">结束时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="input-sm datetime" name="queryEndDate" id="queryEndDate">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<button class="btn btn-default js-quick-search js-quick-search-1 active" data-days="1">
|
||||
昨天
|
||||
</button>
|
||||
<button class="btn btn-default js-quick-search js-quick-search-7" data-days="7">
|
||||
最近7天
|
||||
</button>
|
||||
<button class="btn btn-default js-quick-search js-quick-search-30" data-days="30">
|
||||
最近30天
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" id="exportclanFlowstatsList">导出</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<!-- 详情弹窗列表 -->
|
||||
<div class="modal fade" id="editModal" 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="editModalLabel">流水详情</h4>
|
||||
</div>
|
||||
<form id="form" action="" method="post" target="_blank">
|
||||
<input type="hidden" name="queryStartDate" id="queryStartDateExport">
|
||||
<input type="hidden" name="queryEndDate" id="queryEndDateExport">
|
||||
<input type="hidden" name="clanId" id="clanIdExport">
|
||||
</form>
|
||||
<div class="modal-body">
|
||||
<div id="toolbar2">
|
||||
<div class="col-sm-12">
|
||||
<button id="flowDetailBtn" class="btn btn-sm btn-primary">总计导出</button>
|
||||
<button id="flowDetailByDayBtn" class="btn btn-sm btn-primary">按天导出</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="table2"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { cleanArray, formatTime } from '@/utils/maintainer';
|
||||
|
||||
export default {
|
||||
name: "ClanFlowStaticAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
|
||||
let clanFlowstatsListQueryParams = {};
|
||||
|
||||
$('.datetime').datetimepicker({
|
||||
format: 'yyyy-mm-dd 00:00:00',
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
$("#queryStartDate").datetimepicker({
|
||||
minView: "month",
|
||||
language: 'zh-CN',
|
||||
todayBtn: 1,
|
||||
autoclose: 1
|
||||
}).on("changeDate", function (event) {
|
||||
$("#queryEndDate").datetimepicker('setStartDate', event.date);
|
||||
});
|
||||
|
||||
$("#queryEndDate").datetimepicker({
|
||||
minView: "month",
|
||||
language: 'zh-CN',
|
||||
todayBtn: 1,
|
||||
autoclose: 1,
|
||||
useCurrent: false
|
||||
}).on("changeDate", function (event) {
|
||||
$("#queryStartDate").datetimepicker('setEndDate', event.date);
|
||||
});
|
||||
|
||||
initDefaultDate();
|
||||
function initDefaultDate() {
|
||||
var today = new Date();
|
||||
today.setHours(0);
|
||||
today.setMinutes(0);
|
||||
today.setSeconds(0);
|
||||
today.setMilliseconds(0);
|
||||
|
||||
var oneDay = 1000 * 24 * 60 * 60;
|
||||
|
||||
var startDate = new Date(today.getTime() - oneDay);
|
||||
$('#queryStartDate').val(startDate.format("yyyy-MM-dd hh:mm:ss"));
|
||||
$('#queryEndDate').val(today.format("yyyy-MM-dd hh:mm:ss"));
|
||||
}
|
||||
|
||||
$('.js-quick-search').on('click', function () {
|
||||
$('.js-quick-search').removeClass('active')
|
||||
$(this).addClass('active');
|
||||
setSearchTimeUseQuickWay($(this));
|
||||
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
function setSearchTimeUseQuickWay(quickDom) {
|
||||
const days = quickDom.attr("data-days");
|
||||
const today = new Date(new Date().setHours(0, 0, 0, 0));
|
||||
const todayStr = formatTime(today);
|
||||
const startTime = formatTime(new Date(today.getTime() - days * 24 * 60 * 60 * 1000));
|
||||
|
||||
$('#queryStartDate').val(startTime);
|
||||
$('#queryEndDate').val(todayStr);
|
||||
}
|
||||
|
||||
|
||||
buildTable();
|
||||
|
||||
// 列表设置
|
||||
function buildTable() {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10000,
|
||||
pagination: true,
|
||||
pageList: [50],
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) {
|
||||
var param = {
|
||||
queryClanIdStr: $('#clanId').val(),
|
||||
queryErbanNoStr: $('#erbanNo').val(),
|
||||
queryStartDate: $('#queryStartDate').val(),
|
||||
queryEndDate: $('#queryEndDate').val()
|
||||
};
|
||||
clanFlowstatsListQueryParams = param;
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'id',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/clan/clanFlowstatsList.action',
|
||||
onLoadSuccess: function (res) { //加载成功时执行
|
||||
if (res.code == undefined || res.code === 200) {
|
||||
console.log("加载成功!");
|
||||
} else {
|
||||
$("#tipMsg").text(res.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
|
||||
},
|
||||
onLoadError: function (res) { //加载失败时执行
|
||||
console.log("load fail");
|
||||
},
|
||||
columns: [
|
||||
{ field: 'clanName', title: '家族名称', align: 'center', width: '5%' },
|
||||
{ field: 'clanErbanNo', title: '族长平台号', align: 'center', width: '5%' },
|
||||
{ field: 'clanId', title: '家族id', align: 'center', width: '10%' },
|
||||
{ field: 'roomIncome', title: '房间总流水', align: 'center', width: '10%' },
|
||||
{ field: 'bagIncome', title: '背包礼物总流水', align: 'center', width: '10%' },
|
||||
{ field: 'normalGiftIncome', title: '普通礼物总流水', align: 'center', width: '10%' },
|
||||
{ field: 'giftUv', title: '送礼人数', align: 'center', width: '10%' },
|
||||
{ field: 'newUserSendGiftNum', title: '新用户送礼人数', align: 'center', width: '10%' },
|
||||
{ field: 'queryTime', title: '流水统计时间', align: 'center', width: '10%' },
|
||||
{
|
||||
field: 'clanId',
|
||||
title: '备注',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val) {
|
||||
console.log("clanId = " + val);
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + val + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i>详情</button>';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
// 详情列表信息
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
let clanId = $(this).attr("data-id");
|
||||
$('#table2').bootstrapTable('destroy');
|
||||
$('#table2').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'clanName', title: '家族名称', align: 'center', width: '5%' },
|
||||
{ field: 'clanErbanNo', title: '家族平台号', align: 'center', width: '5%' },
|
||||
{ field: 'clanId', title: '家族id', align: 'center', width: '5%' },
|
||||
{ field: 'roomTitle', title: '房间名称', align: 'center', width: '5%' },
|
||||
{ field: 'roomErbanNo', title: '房主平台号', align: 'center', width: '5%' },
|
||||
{ field: 'roomIncome', title: '房间流水', align: 'center', width: '5%' },
|
||||
{ field: 'bagIncome', title: '背包流水', align: 'center', width: '5%' },
|
||||
{ field: 'normalGiftIncome', title: '普通礼物流水', align: 'center', width: '5%' },
|
||||
{ field: 'intoRoomNum', title: '进房人数', align: 'center', width: '5%' },
|
||||
{ field: 'sendUserNum', title: '送礼人数', align: 'center', width: '5%' },
|
||||
{ field: 'intoRoomNewUserNum', title: '进房新用户数', align: 'center', width: '5%' },
|
||||
{ field: 'sendNewUserNum', title: '新用户送礼人数', align: 'center', width: '5%' }
|
||||
],
|
||||
//undefinedText: "0",
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pageList: [20, 50, 100],
|
||||
pagination: true,
|
||||
//search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
clanId: clanId,
|
||||
queryStartDate: $('#queryStartDate').val(),
|
||||
queryEndDate: $('#queryEndDate').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'id',
|
||||
toolbar: '#toolbar2',
|
||||
url: '/admin/clan/clanFlowDetailList.action',
|
||||
onLoadSuccess: function (res) { //加载成功时执行
|
||||
console.log("加载成功!");
|
||||
$("#editModal").modal('show');
|
||||
$('#clanIdExport').val(clanId);
|
||||
|
||||
},
|
||||
onLoadError: function (res) { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// 总计导出
|
||||
$('#flowDetailBtn').on('click', function () {
|
||||
var form = $("#form");
|
||||
form.attr("action", "/admin/clan/exportFlowDetail.action");
|
||||
|
||||
$('#queryStartDateExport').val($('#queryStartDate').val());
|
||||
$('#queryEndDateExport').val($('#queryEndDate').val());
|
||||
form.submit();
|
||||
})
|
||||
|
||||
// 按天导出
|
||||
$('#flowDetailByDayBtn').on('click', function () {
|
||||
var form = $("#form");
|
||||
form.attr("action", "/admin/clan/exportFlowDetailByDay.action");
|
||||
|
||||
$('#queryStartDateExport').val($('#queryStartDate').val());
|
||||
$('#queryEndDateExport').val($('#queryEndDate').val());
|
||||
form.submit();
|
||||
})
|
||||
|
||||
function param(json) {
|
||||
if (!json) return ''
|
||||
return cleanArray(Object.keys(json).map(key => {
|
||||
if (json[key] === undefined) return ''
|
||||
return encodeURIComponent(key) + '=' +
|
||||
encodeURIComponent(json[key])
|
||||
})).join('&')
|
||||
}
|
||||
|
||||
$("#exportclanFlowstatsList").on("click", function () {
|
||||
window.location.href = `/admin/clan/exportclanFlowstatsList?${param(clanFlowstatsListQueryParams)}`
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.control-label {
|
||||
padding-right: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.col-sm-3 {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.col-sm-8 {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#editModal .modal-dialog {
|
||||
width: 1200px;
|
||||
height: 80%;
|
||||
}</style>
|
183
src/views/hall/ClanGoldFlowAdminView.vue
Normal file
183
src/views/hall/ClanGoldFlowAdminView.vue
Normal file
@@ -0,0 +1,183 @@
|
||||
<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-body">
|
||||
<div id="toolbar">
|
||||
<div class="col-sm-6">
|
||||
<label class="col-sm-4 control-label">收益周期:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="input-sm form-control" name="startDate" id="startDate">
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="input-sm form-control" name="endDate" id="endDate">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<label for="clan" class="col-sm-4 control-label">公会:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="input-sm form-control" name="clan" id="clan"
|
||||
placeholder="公会Id/公会名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<div class="btn-group">
|
||||
<button id="btnSearch" class="btn btn-default"><i
|
||||
class="glyphicon glyphicon-search"></i>查询</button>
|
||||
<button type="button" class="btn btn-default" id="export">导出</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { cleanArray } from '@/utils/maintainer';
|
||||
|
||||
export default {
|
||||
name: "ClanGoldFlowAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
|
||||
let clanFlowstatsListQueryParams = {};
|
||||
|
||||
$("#startDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
minView: "month",
|
||||
language: 'zh-CN',
|
||||
todayBtn: 1,
|
||||
autoclose: 1
|
||||
}).on("changeDate", function (event) {
|
||||
$("#endDate").datetimepicker('setStartDate', event.date);
|
||||
});
|
||||
|
||||
$("#endDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
minView: "month",
|
||||
language: 'zh-CN',
|
||||
todayBtn: 1,
|
||||
autoclose: 1,
|
||||
useCurrent: false
|
||||
}).on("changeDate", function (event) {
|
||||
$("#startDate").datetimepicker('setEndDate', event.date);
|
||||
});
|
||||
|
||||
buildTable();
|
||||
|
||||
// 列表设置
|
||||
function buildTable() {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pagination: false,
|
||||
sidePagination: "none", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) {
|
||||
const param = {
|
||||
startDate: $('#startDate').val(),
|
||||
endDate: $('#endDate').val()
|
||||
};
|
||||
const clan = $('#clan').val()
|
||||
if (clan) {
|
||||
if (!isNaN(clan)) {
|
||||
param.clanId = clan
|
||||
} else {
|
||||
param.clanName = clan
|
||||
}
|
||||
}
|
||||
clanFlowstatsListQueryParams = param;
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'clanId',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/clanGoldFlow/list.action',
|
||||
onLoadSuccess: function (res) { //加载成功时执行
|
||||
if (res.code === 200) {
|
||||
console.log("加载成功!");
|
||||
} else {
|
||||
$("#tipMsg").text(res.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
},
|
||||
onLoadError: function (res) { //加载失败时执行
|
||||
console.log("load fail");
|
||||
},
|
||||
columns: [
|
||||
{ field: 'clanId', title: '公会ID', align: 'center', width: '5%' },
|
||||
{ field: 'clanName', title: '公会名称', align: 'center', width: '5%' },
|
||||
{ field: 'clanElderErbanNo', title: '会长平台号', align: 'center', width: '5%' },
|
||||
{ field: 'clanElderNick', title: '会长昵称', align: 'center', width: '5%' },
|
||||
{ field: 'hallCount', title: '房间数', align: 'center', width: '10%' },
|
||||
{ field: 'giftDiamonds', title: '公会收礼钻石数', align: 'center', width: '10%' },
|
||||
{ field: 'hallDiamonds', title: '签约房钻石数', align: 'center', width: '10%' },
|
||||
{ field: 'clanDiamonds', title: '非签约房钻石数', align: 'center', width: '10%' },
|
||||
{ field: 'otherDiamonds', title: '其他钻石数', align: 'center', width: '10%' },
|
||||
{ field: 'earnGolds', title: '公会收益金币数', align: 'center', width: '10%' },
|
||||
{ field: 'receiveGolds', title: '成员收益金币数', align: 'center', width: '10%' },
|
||||
{ field: 'exchangeGolds', title: '兑换金币数', align: 'center', width: '10%' },
|
||||
{ field: 'remainGolds', title: '可结算金币数', align: 'center', width: '10%' },
|
||||
{
|
||||
field: 'tmp',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return '<button class="btn btn-sm btn-default opt-export" data-id=' + row.clanId + '>导出明细</button>';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function param(json) {
|
||||
if (!json) return ''
|
||||
return cleanArray(Object.keys(json).map(key => {
|
||||
if (json[key] === undefined) return ''
|
||||
return encodeURIComponent(key) + '=' +
|
||||
encodeURIComponent(json[key])
|
||||
})).join('&')
|
||||
}
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
$("#export").on("click", function () {
|
||||
window.location.href = `/admin/clanGoldFlow/export?${param(clanFlowstatsListQueryParams)}`
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-export', function () {
|
||||
const clanId = $(this).attr("data-id");
|
||||
const startDate = clanFlowstatsListQueryParams.startDate
|
||||
const endDate = clanFlowstatsListQueryParams.endDate
|
||||
window.location.href = `/admin/clanGoldFlow/export?clanId=${clanId}&startDate=${startDate}&endDate=${endDate}`
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
413
src/views/hall/ClanLevelSettingView.vue
Normal file
413
src/views/hall/ClanLevelSettingView.vue
Normal file
@@ -0,0 +1,413 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<section class="content-header">
|
||||
<h1 id="itemTitle"></h1>
|
||||
</section>
|
||||
|
||||
<!-- 头部查询 -->
|
||||
<section class="content">
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
<div class="col-sm-12">
|
||||
<button id="addBtn" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>新增等级
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 新增弹窗 -->
|
||||
<div class="modal fade" id="addActModal" rabindex='-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-lable='Close'>
|
||||
<span aria-hidden='true'>x</span>
|
||||
</button>
|
||||
<h4 class="modal-tittle" id='addModalLabel'>新增</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<form id='addActForm' class="form-horizontal">
|
||||
<!-- 等级 -->
|
||||
<div class="form-group">
|
||||
<label for="addLevel" class="col-sm-3 control-label">等级:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required]" name='addLevel' id='addLevel'>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 等级名称 -->
|
||||
<div class="form-group">
|
||||
<label for="addLevelName" class="col-sm-3 control-label">名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required]" name='addLevelName'
|
||||
id='addLevelName'>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--等级色号-->
|
||||
<div class="form-group">
|
||||
<label for="addLevelColor" class="col-sm-3 control-label">字体色号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name='addLevelColor' id='addLevelColor'>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 上传等级图片 -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="addImgUrl" style='width:40px;height:40px;' alt="">
|
||||
<input type="file" id="addUploadFile" name='uploadFile'
|
||||
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
|
||||
<button class="btn btn-success" type='button' id="addUploadBtn">上传</button>
|
||||
<input type="hidden" id="addLevelIcon" name='alertWinPic'
|
||||
class="form-control validate[required]">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 上传等级背景图 -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">等级背景图:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="addBackGroundImgUrl" style='width:40px;height:40px;' alt="">
|
||||
<input type="file" id="addBackGroundUploadFile" name='uploadFile'
|
||||
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
|
||||
<button class="btn btn-success" type='button' id="addBackGroundUploadBtn">上传</button>
|
||||
<input type="hidden" id="levelBackGround" name='levelBackGround' class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 上传等级排行框图片 -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">排行框图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="addLevelRankBoxImgUrl" style='width:40px;height:40px;' alt="">
|
||||
<input type="file" id="addLevelRankBoxUploadFile" name='uploadFile'
|
||||
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
|
||||
<button class="btn btn-success" type='button' id="addLevelRankBoxUploadBtn">上传</button>
|
||||
<input type="hidden" id="levelRankBox" name='levelRankBox' class="form-control">
|
||||
</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" data-primary="addSave" id='addSave'>保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="imgMask"><img src="" alt=""></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "ClanLevelSettingView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
let isEdit = false;
|
||||
let levelList = [];
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'level', title: '等级', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'levelName', title: '名称', align: 'center', valign: 'middle', width: '20%' },
|
||||
{ field: 'levelColor', title: '色号', align: 'center', valign: 'middle', width: '20%' },
|
||||
{
|
||||
field: 'levelIcon', title: '图片', align: 'center', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='40' height='40'>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'levelBackGround', title: '背景图', align: 'center', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='40' height='40'>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'levelRankBox', title: '排行框', align: 'center', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='40' height='40'>";
|
||||
}
|
||||
},
|
||||
{ field: 'clanIds', title: '家族号', align: 'center', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'tmp', title: '操作', align: 'center', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
if (row.defaultLevel) {
|
||||
return "";
|
||||
}
|
||||
var key = row.actId;
|
||||
return "<button class='btn btn-sm btn-success opt-edit' data-idx=" + index + ">编辑</button>" +
|
||||
"<button class='btn btn-sm btn-danger opt-del' data-level=" + row.level + ">删除</button>";
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false, //禁用ajax数据缓存,默认true
|
||||
striped: true, //表格显示条纹,默认false
|
||||
showRefresh: false, //
|
||||
pageSize: 10, //页面数据条数
|
||||
pagination: true, //在表格底部显示分页组件,默认false
|
||||
pageList: [10, 20, 30, 50], //设置页面可以显示的数据条数
|
||||
sidePagination: 'client', //表示服务端请求
|
||||
// 设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
// 设置为limit可以获取limit,offset,search,sort,order
|
||||
queryParamsType: 'undefined',
|
||||
uniqueId: 'level', //对每一行指定唯一标识符
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/clan/listClanLevelSettings', //获取表格数据的url
|
||||
onLoadSuccess: function (val) {
|
||||
// 加载成功时执行
|
||||
console.log("load success", val);
|
||||
levelList = val;
|
||||
},
|
||||
onLoadError: function () {
|
||||
// 加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
function cleanModal() {
|
||||
$('#name').val('');
|
||||
$('#imgUrl').attr('arc', '');
|
||||
$('#skipUrlContent').val('');
|
||||
}
|
||||
|
||||
// 点击编辑事件
|
||||
$('#table').on('click', '.opt-edit', function () {
|
||||
cleanModal();
|
||||
var idx = parseInt($(this).data('idx'));
|
||||
console.debug('----idx', idx)
|
||||
if (idx == 'undefined' || idx < 0) {
|
||||
return;
|
||||
}
|
||||
var data = levelList[idx];
|
||||
isEdit = true;
|
||||
$('#addLevel').val(data.level);
|
||||
$('#addLevel').attr("disabled", "disabled")
|
||||
$('#addLevelName').val(data.levelName);
|
||||
$('#addLevelColor').val(data.levelColor);
|
||||
$('#addImgUrl').attr('src', data.levelIcon);
|
||||
$('#addLevelIcon').val(data.levelIcon);
|
||||
$('#addBackGroundImgUrl').attr('src', data.levelBackGround);
|
||||
$('#levelBackGround').val(data.levelBackGround);
|
||||
$('#addLevelRankBoxImgUrl').attr('src', data.levelRankBox);
|
||||
$('#levelRankBox').val(data.levelRankBox);
|
||||
$('#addActModal').modal('show');
|
||||
});
|
||||
|
||||
$('#addSave').on('click', function () {
|
||||
if ($('#addActForm').validationEngine('validate')) {
|
||||
const levelIcon = $("#addLevelIcon").val();
|
||||
if (!levelIcon) {
|
||||
$('#tipMsg').text('保存失败,图片未上传');
|
||||
$('#tipModal').modal('show');
|
||||
return;
|
||||
}
|
||||
let postData = {
|
||||
level: $("#addLevel").val(),
|
||||
levelName: $("#addLevelName").val(),
|
||||
levelColor: $("#addLevelColor").val(),
|
||||
levelBackGround: $("#levelBackGround").val(),
|
||||
levelRankBox: $("#levelRankBox").val(),
|
||||
levelIcon
|
||||
}
|
||||
console.debug('postData----', postData)
|
||||
let reqUrl = '/admin/clan/addClanLevelSetting';
|
||||
if (isEdit) {
|
||||
reqUrl = '/admin/clan/editClanLevelSetting';
|
||||
}
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: reqUrl,
|
||||
data: JSON.stringify(postData),
|
||||
contentType: "application/json",
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.code == 200) {
|
||||
$('#addActModal').modal('hide');
|
||||
$('#tipMsg').text('保存成功');
|
||||
$('#tipModal').modal('show');
|
||||
TableHelper.doRefresh('#table');
|
||||
} else {
|
||||
$('#tipMsg').text(res.message);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
},
|
||||
error: function (res) {
|
||||
console.log(res, '失败');
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
$('#addUploadBtn').on('click', function () {
|
||||
console.log($('#addUploadFile').val());
|
||||
if ($('#addUploadFile').val() == '') {
|
||||
$('#tipMsg').text('上传图片为空');
|
||||
$('#tipModal').modal('show');
|
||||
return;
|
||||
}
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/upload/img',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.path) {
|
||||
$('#addLevelIcon').val(res.path);
|
||||
$('#addImgUrl').attr('src', res.path);
|
||||
console.log(res.path);
|
||||
} else {
|
||||
$('#tipMsg').text(res.msg);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#addActForm').ajaxSubmit(options);
|
||||
})
|
||||
|
||||
// 上传背景图
|
||||
$('#addBackGroundUploadBtn').on('click', function () {
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'addBackGroundUploadFile', //需要上传的文件域的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就是服务器返回的数据。
|
||||
console.log('path', json.path)
|
||||
if (json.path) {
|
||||
$('#levelBackGround').val(json.path);
|
||||
$('#addBackGroundImgUrl').attr('src', json.path);
|
||||
} else {
|
||||
$('#tipMsg').text(json.msg);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
// 上传排行框
|
||||
$('#addLevelRankBoxUploadBtn').on('click', function () {
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'addLevelRankBoxUploadFile', //需要上传的文件域的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就是服务器返回的数据。
|
||||
console.log('path', json.path)
|
||||
if (json.path) {
|
||||
$('#levelRankBox').val(json.path);
|
||||
$('#addLevelRankBoxImgUrl').attr('src', json.path);
|
||||
} else {
|
||||
$('#tipMsg').text(json.msg);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
$('#addBtn').on('click', function () {
|
||||
isEdit = false;
|
||||
$('#addActForm')[0].reset();
|
||||
$('#addLevel').removeAttr("disabled");
|
||||
$('#addImgUrl').attr('src', '');
|
||||
$('#addLevelIcon').val('');
|
||||
$('#addBackGroundImgUrl').attr('src', '');
|
||||
$('#levelBackGround').val('');
|
||||
$('#addLevelRankBoxImgUrl').attr('src', '');
|
||||
$('#levelRankBox').val('');
|
||||
|
||||
$('#addActModal').modal('show');
|
||||
});
|
||||
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
|
||||
$('#table').on('mouseenter', 'img', function (e) {
|
||||
var src = $(this).attr('src')
|
||||
$('#imgMask img').attr('src', src);
|
||||
$('#imgMask').show();
|
||||
$('#imgMask').css({
|
||||
top: e.clientY + 20,
|
||||
left: e.clientX + 20
|
||||
});
|
||||
});
|
||||
|
||||
$('#table').on('mouseleave', 'img', function (e) {
|
||||
$('#imgMask').hide();
|
||||
});
|
||||
|
||||
//删除家族
|
||||
$('#table').on('click', '.opt-del', function () {
|
||||
const level = $(this).attr('data-level');
|
||||
console.log("level=======", level)
|
||||
if (confirm(`你确认删除等级${level}吗?`)) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/clan/deleteClanLevel.action",
|
||||
data: JSON.stringify({
|
||||
level,
|
||||
}),
|
||||
contentType: "application/json",
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
console.log(json.data)
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除等级失败." + json.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#imgMask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#imgMask img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}</style>
|
139
src/views/hall/HallAdminView.vue
Normal file
139
src/views/hall/HallAdminView.vue
Normal file
@@ -0,0 +1,139 @@
|
||||
<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="hallIdStr" class="col-sm-4 control-label">公会id:</label>
|
||||
<div class="col-sm-8"><input type="text" class="form-control" name="name" id="hallIdStr"
|
||||
placeholder="请输入公会id,填多个用,隔开"></div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="ownerErbanNo" class="col-sm-4 control-label">会长平台号:</label>
|
||||
<div class="col-sm-8"><input type="text" class="form-control" name="name" id="ownerErbanNo"
|
||||
placeholder="请输入会长平台号,填多个用,隔开"></div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="clanElderErbanNoStr" class="col-sm-4 control-label">族长平台号:</label>
|
||||
<div class="col-sm-8"><input type="text" class="form-control" name="name" id="clanElderErbanNoStr"
|
||||
placeholder="请输入族长平台号,填多个用,隔开"></div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "HallAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{
|
||||
field: 'clanId', title: '家族id', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'clanElderUid', title: '族长uid', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'clanElderErbanNo', title: '族长平台号', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'hallId', title: '公会id', align: 'center', width: '5%' },
|
||||
{ field: 'ownerUid', title: '会长uid', align: 'center', width: '5%' },
|
||||
{ field: 'ownerErbanNo', title: '会长平台号', align: 'center', width: '5%' },
|
||||
{ field: 'memberCount', title: '公会成员人数', align: 'center', width: '5%' },
|
||||
{ field: 'managerCount', title: '公会高管人数', align: 'center', width: '5%' },
|
||||
{ field: 'publicChatCount', title: '公开群数', align: 'center', width: '5%' },
|
||||
{ field: 'privateChatCount', title: '内部群数', align: 'center', width: '5%' }
|
||||
],
|
||||
undefinedText: 0,
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
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,
|
||||
ownerErbanNo: $('#ownerErbanNo').val(),
|
||||
hallIdStr: $('#hallIdStr').val(),
|
||||
clanElderErbanNoStr: $('#clanElderErbanNoStr').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/hall/statistic/get.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
341
src/views/hall/HallMemberView.vue
Normal file
341
src/views/hall/HallMemberView.vue
Normal file
@@ -0,0 +1,341 @@
|
||||
<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="clanElderErbanNo" class="col-sm-2 control-label">族长平台号:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="clanElderErbanNo"
|
||||
placeholder="请输入族长平台号,多个用,隔开"></div>
|
||||
<label for="ownerErbanNo" class="col-sm-2 control-label">会长平台号:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="ownerErbanNo"
|
||||
placeholder="请输入会长平台号,多个用,隔开"></div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="erbanNo" class="col-sm-2 control-label">成员平台号:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="erbanNo"
|
||||
placeholder="请输入成员平台号,多个用,隔开"></div>
|
||||
<label for="erbanNo" class="col-sm-2 control-label">成员身份:</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="allRoleType" name="allRoleType" class="input-sm">
|
||||
<option value="">全部</option>
|
||||
<option value="1">会长</option>
|
||||
<option value="2">高管</option>
|
||||
<option value="3">普通成员</option>
|
||||
<option value="4">族长</option>
|
||||
</select>
|
||||
</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-search"></i>添加
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="addHallMemberModal" 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="modal_hallId" 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="modal_hallId"
|
||||
id="modal_hallId">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_memberErbanNo" class="col-sm-3 control-label">用户平台号<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="modal_memberErbanNo" id="modal_memberErbanNo">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_addRoleType" class="col-sm-3 control-label">职务<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="modal_addRoleType" name="addRoleType" class="input-sm">
|
||||
<option value="2">高管</option>
|
||||
<option value="3">普通成员</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="modal_addBtn">确定</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "HallMemberView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{
|
||||
field: 'clanId', title: '家族id', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'clanElderUid', title: '族长uid', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'clanElderErbanNo', title: '族长平台号', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'hallId', title: '公会id', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'ownerUid', title: '会长uid', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'ownerErbanNo', title: '会长平台号', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'erbanNo', title: '成员平台号', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'nick', title: '昵称', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'roleType', title: '身份', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return '会长';
|
||||
} else if (val == 2) {
|
||||
return '高管';
|
||||
} else if (val == 3) {
|
||||
return '普通成员';
|
||||
} else if (val == 4) {
|
||||
return '族长';
|
||||
} else if (val == 5) {
|
||||
return '族长、会长';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'signTime', title: '注册时间', align: 'center', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return val;
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'erbanNo',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
const hallId = row.hallId;
|
||||
const memberErbanNo = row.erbanNo;
|
||||
return '<button id="btnDel" name="btnDel" class="btn btn-sm btn-success opt-del" hallId=' + hallId + ' erbanNo=' + memberErbanNo + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 删除</button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
undefinedText: 0,
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
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,
|
||||
ownerErbanNo: $('#ownerErbanNo').val(),
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
clanElderErbanNo: $('#clanElderErbanNo').val(),
|
||||
roleType: $("#allRoleType").val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/hall/member/statistic/get.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
//新建标签
|
||||
$("#btnAdd").click(function () {
|
||||
$("#modal_hallId").val(""),
|
||||
$("#modal_memberErbanNo").val(""),
|
||||
$("#modal_addRoleType").val(""),
|
||||
$("#addHallMemberModal").modal('show');
|
||||
});
|
||||
|
||||
// 新增
|
||||
$("#modal_addBtn").click(function () {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/hall/addMember.action",
|
||||
data: {
|
||||
memberErbanNo: $("#modal_memberErbanNo").val(),
|
||||
hallId: $("#modal_hallId").val(),
|
||||
roleType: $("#modal_addRoleType").val(),
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
$("#tipMsg").text("添加成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#addHallMemberModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//删除成员
|
||||
$('#table').on('click', '.opt-del', function () {
|
||||
const memberErbanNo = $(this).attr('erbanNo');
|
||||
const hallId = $(this).attr('hallId');
|
||||
if (confirm("你确认删除该成员吗?")) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/hall/delMember.action",
|
||||
data: {
|
||||
memberErbanNo: memberErbanNo,
|
||||
hallId: hallId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
console.log(json)
|
||||
if (json.success) {
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
console.log(json.message)
|
||||
$("#tipMsg").text("删除成员失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
893
src/views/headwear/HeadwearAdminView.vue
Normal file
893
src/views/headwear/HeadwearAdminView.vue
Normal file
@@ -0,0 +1,893 @@
|
||||
<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">
|
||||
<div class="col-sm-12">
|
||||
<label for="sheadwearId" class="col-sm-1 control-label">头饰ID:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="headwearId" id="sheadwearId">
|
||||
</div>
|
||||
|
||||
<label for="sheadwearName" class="col-sm-1 control-label">头饰名称:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="headwearName"
|
||||
id="sheadwearName"></div>
|
||||
|
||||
<label for="slimitType" class="col-sm-1 control-label">限定类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="limitType" id="slimitType" data-btn-class="btn-warning" class="form-control">
|
||||
<option value="" selected="selected">全部</option>
|
||||
<option value="1">贵族限定</option>
|
||||
<option value="2">怪兽限定</option>
|
||||
<option value="3">活动限定</option>
|
||||
<option value="4">周星榜限定</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="senable" class="col-sm-1 control-label">头饰状态:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="enable" id="senable" data-btn-class="btn-warning" class="form-control">
|
||||
<option value="" selected="selected">全部</option>
|
||||
<option value="1">上架</option>
|
||||
<option value="0">下架</option>
|
||||
</select>
|
||||
</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 opt-apply">
|
||||
<i class="glyphicon glyphicon-adjust"></i>新增
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="headwearModal" 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="headwearId" id="headwearId" />
|
||||
<div class="form-group">
|
||||
<label for="headwearName" class="col-sm-3 control-label">头饰名称:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="headwearName" id="headwearName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">使用萝卜购买</label>
|
||||
<div class="col-sm-9">
|
||||
<label class="radio-inline"><input type="radio" name="radishSale" value="0"
|
||||
checked>否</label>
|
||||
<label class="radio-inline"><input type="radio" name="radishSale" value="1">是</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="radishPrice" class="col-sm-3 control-label">首次价格:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="radishPrice" id="radishPrice">
|
||||
</div>
|
||||
<span class="col-sm-3">萝卜</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="radishRenewPrice" class="col-sm-3 control-label">续费价格:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="radishRenewPrice" id="radishRenewPrice">
|
||||
</div>
|
||||
<span class="col-sm-3">萝卜</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="radishOriginalPrice" class="col-sm-3 control-label">原价:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control" placeholder="没有填0" value="0"
|
||||
name="radishOriginalPrice" id="radishOriginalPrice">
|
||||
</div>
|
||||
<span class="col-sm-3">萝卜</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">使用金币购买</label>
|
||||
<div class="col-sm-9">
|
||||
<label class="radio-inline"><input type="radio" name="goldSale" value="0">否</label>
|
||||
<label class="radio-inline"><input type="radio" name="goldSale" value="1" checked>是</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="price" class="col-sm-3 control-label">首次价格:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="price" id="price">
|
||||
</div>
|
||||
<span class="col-sm-3">金币</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="renewPrice" class="col-sm-3 control-label">续费价格:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="renewPrice" id="renewPrice">
|
||||
</div>
|
||||
<span class="col-sm-3">金币</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="originalPrice" class="col-sm-3 control-label">原价:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="number" class="form-control" placeholder="没有填0" value="0" name="originalPrice"
|
||||
id="originalPrice">
|
||||
</div>
|
||||
<span class="col-sm-3">金币</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="days" class="col-sm-3 control-label">购买天数:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="days" id="days">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">是否可售卖</label>
|
||||
<div class="col-sm-9">
|
||||
<label class="radio-inline"><input type="radio" name="isSale" value="1" checked>是</label>
|
||||
<label class="radio-inline"><input type="radio" name="isSale" value="0">否</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="nobleLimit" class="col-sm-3 control-label">限定类型:</label>
|
||||
<div class="col-sm-9">
|
||||
<!--<input type="text" class="form-control" name="limitType" id="limitType">-->
|
||||
<label><input type="checkbox" id="nobleLimit" name="nobleLimit"
|
||||
value="true">贵族限定 </label>
|
||||
<label><input type="checkbox" id="monsterLimit" name="monsterLimit"
|
||||
value="true">怪兽限定 </label>
|
||||
<label><input type="checkbox" id="activityLimit" name="activityLimit"
|
||||
value="true">活动限定 </label>
|
||||
<label><input type="checkbox" id="weekStarLimit" name="weekStarLimit"
|
||||
value="true">周星榜限定 </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="limitDesc" class="col-sm-3 control-label">限定描述:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="limitDesc" id="limitDesc">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="enable" class="col-sm-3 control-label">头饰状态:</label>
|
||||
<div class="col-sm-9">
|
||||
<!--<input type="text" class="form-control" name="status" id="status">-->
|
||||
<input type="radio" name="enable" id="enable" value="true">上架
|
||||
<input type="radio" name="enable" id="disable" value="false">下架
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="pic" class="col-sm-3 control-label">头饰图片:</label>
|
||||
<div class="col-sm-9">
|
||||
<img src="" id="picImage" style="width:250px;height:90px;" alt="">
|
||||
<input type="file" id="picFile" name="uploadFile">
|
||||
<button class="btn btn-success" type="button"
|
||||
onclick="uploadfile('picFile','picImage','pic','picInfo')">上传</button>
|
||||
<input type="hidden" id="pic" name="pic" class="form-control" />
|
||||
<span id="picInfo" style="color:red;"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="effect" class="col-sm-3 control-label">动效图片:</label>
|
||||
<div class="col-sm-9">
|
||||
<img src="" id="effectImage" style="width:250px;height:90px;" alt="">
|
||||
<input type="file" id="effectFile" name="uploadFile">
|
||||
<button class="btn btn-success" type="button"
|
||||
onclick="uploadfile('effectFile','effectImage','effect','effectInfo')">上传</button>
|
||||
<input type="hidden" id="effect" name="effect" class="form-control" />
|
||||
<span id="effectInfo" style="color:red;"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="seq" class="col-sm-3 control-label">排序:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="seq" id="seq">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">标签:</label>
|
||||
<div class="col-sm-9">
|
||||
<label class="radio-inline"><input type="radio" name="labelType" id="noOne" value="0"
|
||||
checked>无</label>
|
||||
<label class="radio-inline"><input type="radio" name="labelType" id="newOne"
|
||||
value="1">新品</label>
|
||||
<label class="radio-inline"><input type="radio" name="labelType" id="discountOne"
|
||||
value="2">折扣</label>
|
||||
<label class="radio-inline"><input type="radio" name="labelType" id="limitOne"
|
||||
value="3">限定</label>
|
||||
<label class="radio-inline"><input type="radio" name="labelType" id="exclusiveOne"
|
||||
value="4">专属</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="redirectLink" class="col-sm-3 control-label">跳转链接:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="redirectLink"
|
||||
placeholder="非必填,若填写,前端展示去看看按钮,反之则无按钮" id="redirectLink">
|
||||
</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>
|
||||
|
||||
<!-- 为用户赠送头饰弹窗 -->
|
||||
<div class="modal fade" id="sendHeadwearModal" 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">x</span></button>
|
||||
<h4 class="modal-title" id="modalSendLabel">赠送头饰</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="headwearSendForm">
|
||||
<input type="hidden" name="sendHeadwearId" id="sendHeadwearId" />
|
||||
<div class="form-group">
|
||||
<label for="sendErbanNo" class="col-sm-3 control-label">平台号</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea name="sendErbanNo" id="sendErbanNo" class="form-control validate[required]"
|
||||
placeholder="多个平台号使用换行符分隔"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="sendDays" class="col-sm-3 control-label">赠送天数</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" name="days" id="sendDays" class="form-control validate[required]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="sendDesc" class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" name="desc" id="sendDesc" class="form-control validate[required]" />
|
||||
</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="send">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
|
||||
|
||||
export default {
|
||||
name: "HeadwearAdminView",
|
||||
setup() {
|
||||
function uploadfile(file, image, path, info) {
|
||||
$(this).attr('disabled', "true");
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: file, //需要上传的文件域的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) {
|
||||
$('#' + path).val(json.path);
|
||||
$('#' + image).attr("src", json.path);
|
||||
if (json.path != '') {
|
||||
$("#" + info).html('已上传成功');
|
||||
} else {
|
||||
$("#" + info).html('未上传成功');
|
||||
}
|
||||
console.log(json.path);
|
||||
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
},
|
||||
error: function (data, status, e) { //提交失败自动执行的处理函数。
|
||||
$(this).removeAttr("disabled");
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
window.uploadfile = uploadfile;
|
||||
return {
|
||||
uploadfile
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
//{field: 'id', title: 'id', align: 'center', width: '5%'},
|
||||
{ field: 'tmp', title: 'headwearId', align: 'center', checkbox: true, width: '5%' },
|
||||
{ field: 'headwearId', title: '头饰ID', align: 'center', width: '5%' },
|
||||
{ field: 'name', title: '头饰名称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'goldSale',
|
||||
title: '金币购买',
|
||||
align: 'center',
|
||||
width: '3%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == true) {
|
||||
return "是";
|
||||
} else if (val == false) {
|
||||
return "否";
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'radishSale',
|
||||
title: '萝卜购买',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == true) {
|
||||
return "是";
|
||||
} else if (val == false) {
|
||||
return "否";
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'originalPrice', title: '原价(金币)', align: 'center', width: '5%' },
|
||||
{ field: 'price', title: '购买价格(金币)', align: 'center', width: '5%' },
|
||||
{ field: 'renewPrice', title: '续费价格(金币)', align: 'center', width: '5%' },
|
||||
{ field: 'radishOriginalPrice', title: '原价(萝卜)', align: 'center', width: '5%' },
|
||||
{ field: 'radishPrice', title: '购买价格(萝卜)', align: 'center', width: '5%' },
|
||||
{ field: 'radishRenewPrice', title: '续费价格(萝卜)', align: 'center', width: '5%' },
|
||||
{ field: 'days', title: '有效期', align: 'center', width: '5%' },
|
||||
{ field: 'seq', title: '排序', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'labelType',
|
||||
title: '标签',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
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: 'redirectLink', title: '跳转链接', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'enable',
|
||||
title: '上架状态',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == true) {
|
||||
return "上架";
|
||||
} else if (val == false) {
|
||||
return "下架";
|
||||
} else {
|
||||
return "未知状态";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'nobleLimit',
|
||||
title: '贵族限定',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == true) {
|
||||
return "是";
|
||||
} else if (val == false) {
|
||||
return "否";
|
||||
} else {
|
||||
return "未知状态";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'monsterLimit',
|
||||
title: '怪兽限定',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == true) {
|
||||
return "是";
|
||||
} else if (val == false) {
|
||||
return "否";
|
||||
} else {
|
||||
return "未知状态";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'weekStarLimit',
|
||||
title: '周星榜限定',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == true) {
|
||||
return "是";
|
||||
} else if (val == false) {
|
||||
return "否";
|
||||
} else {
|
||||
return "未知状态";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'activityLimit',
|
||||
title: '活动限定',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == true) {
|
||||
return "是";
|
||||
} else if (val == false) {
|
||||
return "否";
|
||||
} else {
|
||||
return "未知状态";
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'limitDesc', title: '限定描述', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:00");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'headwearId',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
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 id="btnSend" name="btnSend" class="btn btn-sm btn-success opt-send" data-id=' + val + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 赠送</button> ';
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100, 200, 300, 500],
|
||||
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,
|
||||
headwearId: $('#sheadwearId').val(),
|
||||
headwearName: $('#sheadwearName').val(),
|
||||
limitType: $('#slimitType').val(),
|
||||
enable: $('#senable').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/headwear/list.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
// 新建头饰
|
||||
$("#btnAdd").click(function () {
|
||||
$("#headwearId").val("");
|
||||
$("#headwearName").val("");
|
||||
$("#price").val("");
|
||||
$("#renewPrice").val("");
|
||||
$("#originalPrice").val("");
|
||||
$("#days").val("");
|
||||
|
||||
$("#nobleLimit").prop("checked", false);
|
||||
$("#monsterLimit").prop("checked", false);
|
||||
$("#activityLimit").prop("checked", false);
|
||||
$("#weekStarLimit").prop("checked", false);
|
||||
|
||||
$("#limitDesc").val("");
|
||||
$("#enable").prop("checked", false);
|
||||
|
||||
$('#pic').val('');
|
||||
$('#picImage').attr("src", '');
|
||||
$("#picInfo").html('');
|
||||
$("#picFile").val('');
|
||||
|
||||
$('#effect').val('');
|
||||
$('#effectImage').attr("src", '');
|
||||
$("#effectInfo").html('');
|
||||
$("#effectFile").val('');
|
||||
|
||||
$("#radishPrice").val("");
|
||||
$("#radishRenewPrice").val("");
|
||||
$("#radishOriginalPrice").val("");
|
||||
|
||||
$("#seq").val("");
|
||||
$("#redirectLink").val('');
|
||||
$("input:radio[name='goldSale']")[0].checked = true;
|
||||
$("input:radio[name='radishSale']")[0].checked = true;
|
||||
$("input:radio[name='labelType']")[0].checked = true;
|
||||
|
||||
$("#headwearModal").modal('show');
|
||||
});
|
||||
|
||||
$("#add").click(function () {
|
||||
var headwearId = $("#headwearId").val();
|
||||
var headwearName = $("#headwearName").val();
|
||||
var price = $("#price").val();
|
||||
var renewPrice = $("#renewPrice").val();
|
||||
var days = $("#days").val();
|
||||
|
||||
var nobleLimit = $("#nobleLimit").is(":checked");
|
||||
var monsterLimit = $("#monsterLimit").is(":checked");
|
||||
var activityLimit = $("#activityLimit").is(":checked");
|
||||
var weekStarLimit = $("#weekStarLimit").is(":checked");
|
||||
|
||||
var limitDesc = $("#limitDesc").val();
|
||||
var enable = $("#enable").is(":checked");
|
||||
var pic = $("#pic").val();
|
||||
var effect = $("#effect").val();
|
||||
var seq = $("#seq").val();
|
||||
var redirectLink = $("#redirectLink").val();
|
||||
var labelType = $('input[name="labelType"]:checked').val();
|
||||
var originalPrice = $("#originalPrice").val();
|
||||
var isSale = $('input[name="isSale"]:checked').val();
|
||||
var goldSale = $('input[name="goldSale"]:checked').val();
|
||||
var radishSale = $('input[name="radishSale"]:checked').val();
|
||||
var radishOriginalPrice = $("#radishOriginalPrice").val();
|
||||
var radishPrice = $("#radishPrice").val();
|
||||
var radishRenewPrice = $("#radishRenewPrice").val();
|
||||
|
||||
if (goldSale == 0 && radishSale == 0) {
|
||||
$("#tipMsg").text("请选择一种支持的购买方式");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (goldSale == 1 && (!price || !renewPrice || !originalPrice)) {
|
||||
$("#tipMsg").text("请填写完整金币价格");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
} else if (radishSale == 1 && (!radishPrice || !radishRenewPrice || !radishOriginalPrice)) {
|
||||
$("#tipMsg").text("请填写完整萝卜价格");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (!pic) {
|
||||
$("#tipMsg").text("请上传座驾图片");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (!effect) {
|
||||
$("#tipMsg").text("请上传动画图片");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!days || days <= 0) {
|
||||
$("#tipMsg").text("请输入合理的购买天数");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#addForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/headwear/save.action",
|
||||
data: {
|
||||
headwearId: headwearId,
|
||||
name: headwearName,
|
||||
price: price,
|
||||
renewPrice: renewPrice,
|
||||
days: days,
|
||||
nobleLimit: nobleLimit,
|
||||
monsterLimit: monsterLimit,
|
||||
activityLimit: activityLimit,
|
||||
weekStarLimit: weekStarLimit,
|
||||
limitDesc: limitDesc,
|
||||
enable: enable,
|
||||
pic: pic,
|
||||
effect: effect,
|
||||
seq: seq,
|
||||
labelType: labelType,
|
||||
originalPrice: originalPrice,
|
||||
redirectLink: redirectLink,
|
||||
isSale: isSale,
|
||||
goldSale: goldSale,
|
||||
radishSale: radishSale,
|
||||
radishOriginalPrice: radishOriginalPrice,
|
||||
radishPrice: radishPrice,
|
||||
radishRenewPrice: radishRenewPrice
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#headwearModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#headwearModal").modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/headwear/get.action",
|
||||
data: { headwearId: id },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json) {
|
||||
$("#headwearId").val(id);
|
||||
//$("#name").attr('readonly', true);
|
||||
//$("#price").attr('readonly', true);
|
||||
//$("#renewPrice").attr('readonly', true);
|
||||
|
||||
$("#headwearName").val(json.name);
|
||||
$("#price").val(json.price);
|
||||
$("#renewPrice").val(json.renewPrice);
|
||||
$("#limitDesc").val(json.limitDesc);
|
||||
$("#days").val(json.days);
|
||||
$("#seq").val(json.seq);
|
||||
$("#originalPrice").val(json.originalPrice);
|
||||
$("#labelType").val(json.labelType);
|
||||
$("#redirectLink").val(json.redirectLink);
|
||||
$("#radishPrice").val(json.radishPrice);
|
||||
$("#radishRenewPrice").val(json.radishRenewPrice);
|
||||
$("#radishOriginalPrice").val(json.radishOriginalPrice);
|
||||
|
||||
ComboboxHelper.setDef("#enable", json.enable);
|
||||
|
||||
if (json.goldSale == true) {
|
||||
$("input:radio[name='goldSale']")[1].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='goldSale']")[0].checked = true;
|
||||
}
|
||||
|
||||
if (json.radishSale == true) {
|
||||
$("input:radio[name='radishSale']")[1].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='radishSale']")[0].checked = true;
|
||||
}
|
||||
|
||||
// 礼物状态的值跟其他不同, 1为有效 0为无效
|
||||
if (json.enable == true) {
|
||||
//$("input:radio[name='enable']")[0].checked = true;
|
||||
$("#enable").prop("checked", true);
|
||||
$("#disable").prop("checked", false);
|
||||
} else {
|
||||
//$("input:radio[name='enable']")[1].checked = true;
|
||||
$("#enable").prop("checked", false);
|
||||
$("#disable").prop("checked", true);
|
||||
}
|
||||
|
||||
if (json.isSale == 1) {
|
||||
$("input:radio[name='isSale']")[0].checked = true;
|
||||
} else {
|
||||
$("input:radio[name='isSale']")[1].checked = true;
|
||||
}
|
||||
|
||||
// 贵族限定
|
||||
if (json.nobleLimit == true) {
|
||||
$("#nobleLimit").prop("checked", true);
|
||||
} else {
|
||||
$("#nobleLimit").prop("checked", false);
|
||||
}
|
||||
|
||||
// 怪兽限定
|
||||
if (json.monsterLimit == true) {
|
||||
$("#monsterLimit").prop("checked", true);
|
||||
} else {
|
||||
$("#monsterLimit").prop("checked", false);
|
||||
}
|
||||
|
||||
// 活动限定
|
||||
if (json.activityLimit == true) {
|
||||
$("#activityLimit").prop("checked", true);
|
||||
} else {
|
||||
$("#activityLimit").prop("checked", false);
|
||||
}
|
||||
|
||||
// 周星榜限定
|
||||
if (json.weekStarLimit == true) {
|
||||
$("#weekStarLimit").prop("checked", true);
|
||||
} else {
|
||||
$("#weekStarLimit").prop("checked", false);
|
||||
}
|
||||
|
||||
// 设置礼物图片
|
||||
$('#pic').val(json.pic);
|
||||
$('#picImage').attr("src", json.pic);
|
||||
if (json.pic != '') {
|
||||
$("#picImgInfo").html('已上传');
|
||||
} else {
|
||||
$("#picImgInfo").html('未上传');
|
||||
}
|
||||
|
||||
// 设置动画效果图片
|
||||
$('#effect').val(json.effect);
|
||||
$('#effectImage').attr("src", json.effect);
|
||||
if (json.effect != '') {
|
||||
$("#effectImgInfo").html('已上传');
|
||||
} else {
|
||||
$("#effectImgInfo").html('未上传');
|
||||
}
|
||||
|
||||
var labelType = json.labelType;
|
||||
switch (labelType) {
|
||||
case 0:
|
||||
$("#noOne").prop("checked", true);
|
||||
break;
|
||||
case 1:
|
||||
$("#newOne").prop("checked", true);
|
||||
break;
|
||||
case 2:
|
||||
$("#discountOne").prop("checked", true);
|
||||
break;
|
||||
case 3:
|
||||
$("#limitOne").prop("checked", true);
|
||||
break;
|
||||
case 4:
|
||||
$("#exclusiveOne").prop("checked", true);
|
||||
break
|
||||
}
|
||||
|
||||
// 打开编辑弹窗
|
||||
$("#headwearModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("获取菜单信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//打开赠送头饰弹窗
|
||||
$("#table").on('click', '.opt-send', function () {
|
||||
//清除数据
|
||||
$('#sendHeadwearModal').find('input').val('');
|
||||
$('#sendHeadwearModal').find('textarea').val('');
|
||||
//设置数据
|
||||
var headWearId = $(this).attr("data-id");
|
||||
$('#sendHeadwearId').val(headWearId);
|
||||
$('#sendHeadwearModal').modal('show');
|
||||
});
|
||||
|
||||
//赠送头饰
|
||||
$("#send").click(function () {
|
||||
debugger;
|
||||
var erbanNo = $('#sendErbanNo').val().trim();//去掉首尾的空格和换行符
|
||||
if (!(erbanNo.length > 0)) {
|
||||
$("#tipMsg").text("请输入平台号");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$('#sendDays').val()) {
|
||||
$("#tipMsg").text("请输入体验天数");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
var sendDays = $('#sendDays').val();
|
||||
var sendDesc = $('#sendDesc').val();
|
||||
var headwearId = $('#sendHeadwearId').val();
|
||||
$("#tipMsg").text("赠送中,请稍后...");
|
||||
$("#tipModal").modal('show');
|
||||
if ($("#HeadwearSendForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/headwear/send.action",
|
||||
data: {
|
||||
headwearId: headwearId,
|
||||
erbanNo: erbanNo,
|
||||
sendDesc: sendDesc,
|
||||
days: sendDays
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 100) {
|
||||
$('#sendHeadwearModal').modal('hide');
|
||||
$("#tipMsg").text("全部赠送成功");
|
||||
TableHelper.doRefresh("#table");
|
||||
} else if (json.code == 200) {
|
||||
$("#tipMsg").text("部分用户赠送失败,赠送失败平台号:" + json.erban + ",赠送失败原因:" + json.message);
|
||||
} else {
|
||||
$("#tipMsg").text("全部赠送失败,赠送失败原因:" + json.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
192
src/views/headwear/HeadwearRecordView.vue
Normal file
192
src/views/headwear/HeadwearRecordView.vue
Normal file
@@ -0,0 +1,192 @@
|
||||
<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="qErbanNo" class="col-sm-4 control-label">平台号:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" name="qErbanNo" id="qErbanNo" placeholder="">
|
||||
</div>
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "HeadwearRecordView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
|
||||
$(function () {
|
||||
$('.datetime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
});
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'headwearId', title: '头饰ID', align: 'center', width: '5%' },
|
||||
{ field: 'headwearName', title: '头饰名称', align: 'center', width: '5%' },
|
||||
{ field: 'uid', title: '用户ID', align: 'center', width: '5%' },
|
||||
{ field: 'erbanNo', title: '用户靓号', align: 'center', width: '5%' },
|
||||
{ field: 'nick', title: '用户昵称', align: 'center', width: '5%' },
|
||||
{ field: 'days', title: '天数', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return '撤回';
|
||||
} else {
|
||||
return '正常';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '10%',
|
||||
formatter: formatTime
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '操作',
|
||||
align: 'middle',
|
||||
width: '5%',
|
||||
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> ';
|
||||
}
|
||||
}
|
||||
],
|
||||
undefinedText: "0",
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100, 200, 300, 500],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
erbanNo: $('#qErbanNo').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax: function (request) { //使用ajax请求
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/admin/headwearRecord/list.action',
|
||||
contentType: 'application/json;charset=utf-8',
|
||||
dataType: 'json',
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
apiResult(res);
|
||||
request.success({
|
||||
rows: res.data.rows,
|
||||
total: res.data.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');
|
||||
});
|
||||
|
||||
$("#table").on("click", '#btnEdit', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/headwearRecord/recall.action",
|
||||
data: { id: id },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败, " + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
TableHelper.doRefresh('#table');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function formatTime(val) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format('yyyy-MM-dd hh:mm:ss');
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function serverError(req) {
|
||||
$("#tipMsg").text(req.responseJSON.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;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
134
src/views/headwear/HeadwearStatisticsView.vue
Normal file
134
src/views/headwear/HeadwearStatisticsView.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<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/headwear/export" method="get" target="_blank">
|
||||
<div class="col-sm-12">
|
||||
<label for="headwearId" class="col-sm-1 control-label">头饰ID:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="headwearId" id="headwearId">
|
||||
</div>
|
||||
<label for="headwearName" class="col-sm-1 control-label">头饰名称:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="headwearName"
|
||||
id="headwearName">
|
||||
</div>
|
||||
<label for="beginDate" class="col-sm-1 control-label">开始日期:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="beginDate" id="beginDate">
|
||||
</div>
|
||||
<label for="endDate" class="col-sm-1 control-label">结束日期:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="endDate" id="endDate"></div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="col-sm-12">
|
||||
<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>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "HeadwearStatisticsView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'tmp', title: 'id', align: 'center', checkbox: true, width: '5%' },
|
||||
{ field: 'createTime', title: '日期', align: 'center', width: '5%' },
|
||||
{ field: 'headwearId', title: '头饰ID', align: 'center', width: '5%' },
|
||||
{ field: 'headwearName', title: '头饰名称', align: 'center', width: '5%' },
|
||||
{ field: 'headwearPrice', title: '价格(金币)', align: 'center', width: '5%' },
|
||||
{ field: 'headwearRadishPrice', title: '价格(萝卜)', align: 'center', width: '5%' },
|
||||
{ field: 'headwearStatus', title: '头饰状态', align: 'center', width: '5%' },
|
||||
{ field: 'receivedHeadwearNum', title: '用户收到数量', align: 'center', width: '5%' },
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
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,
|
||||
headwearId: $('#headwearId').val(),
|
||||
headwearName: $('#headwearName').val(),
|
||||
beginDate: $('#beginDate').val(),
|
||||
endDate: $('#endDate').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/headwear/statisticsHeadwear.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 导出EXCEL
|
||||
$('#btnExport').on('click', function () {
|
||||
$("#searchForm").submit();
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
var picker1 = $("#beginDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
});
|
||||
var picker2 = $("#endDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
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></style>
|
993
src/views/home/BannerAdminView.vue
Normal file
993
src/views/home/BannerAdminView.vue
Normal file
@@ -0,0 +1,993 @@
|
||||
<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">
|
||||
跳转类型: <select name="skipType" id="skipType" class="input-m">
|
||||
<option value="0">--全部--</option>
|
||||
<!-- <option value="1">APP页面</option> -->
|
||||
<option value="2">聊天室</option>
|
||||
<option value="3">H5页面</option>
|
||||
<option value="4">tab页面</option>
|
||||
<option value="5">跳转App页面</option>
|
||||
</select>
|
||||
状态: <select name="status" id="status" class="input-m">
|
||||
<option value="0">--全部--</option>
|
||||
<option value="1">激活启用中</option>
|
||||
<option value="2">未激活</option>
|
||||
</select>
|
||||
app: <select name="app" id="app" class="input-m">
|
||||
<option value="">--全部--</option>
|
||||
</select>
|
||||
banner位置: <select name="bannerType" id="searchBannerType" class="input-m">
|
||||
<option value="0">--全部--</option>
|
||||
<option value="1">首页</option>
|
||||
<option value="2">家族广场</option>
|
||||
<option value="3">首页游戏banner</option>
|
||||
<option value="4">声控福利房</option>
|
||||
<option value="5">房间分类列表</option>
|
||||
<option value="6">发现页</option>
|
||||
<option value="7">新版首页Tab</option>
|
||||
<option value="8">话题首页</option>
|
||||
|
||||
</select>
|
||||
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
||||
|
||||
<button id="add" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>增加
|
||||
</button>
|
||||
|
||||
<button id="btnMultiDel" class="btn btn-default">
|
||||
<i class="glyphicon"></i>删除选中
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="bannerModal" 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">x</span></button>
|
||||
<h4 class="modal-title" id="modalLabel">banner信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="bannerForm">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-3 control-label">Banner名字:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required]" name="bannerName" id="name">
|
||||
<input type="hidden" id="bannerId" name="bannerId">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">banner图:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="imgUrl" style="width:250px;height:90px;" alt="">
|
||||
<input type="file" id="uploadFile" name="uploadFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
|
||||
<span class="attention">注意:图片尺寸请注意在750*250,选择图片后请点击上传按钮</span>
|
||||
<input type="hidden" id="bannerPic" name="bannerPic"
|
||||
class="form-control validate[required]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跳转类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="skipType" id="skipUrlSort">
|
||||
<!-- <option value="1">App</option> -->
|
||||
<option value="2">聊天室</option>
|
||||
<option value="3">H5页面</option>
|
||||
<option value="4">tab页面</option>
|
||||
<option value="5">跳转App页面</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="skipUrlGroup">
|
||||
<label for="skipUrlContent" class="col-sm-3 control-label">跳转链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="skipUri" id="skipUrlContent">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display:none" id="jumpAppGroup">
|
||||
<label for="routerType" class="col-sm-3 control-label">跳转类型值:</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="col-sm-3 form-control" name="routerType" id="routerType">
|
||||
</div>
|
||||
|
||||
<label for="routerValue" class="col-sm-3 control-label">跳转参数值:</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="col-sm-3 form-control" name="routerValue" id="routerValue">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="displayType" class="col-sm-3 control-label">显示类型:</label>
|
||||
<div class="col-sm-3">
|
||||
<select id="displayType" name="displayType" data-btn-class="btn-warning">
|
||||
<option value="1">顶部</option>
|
||||
<option value="2">底部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seqNo" class="col-sm-3 control-label">排序设置:</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" id="seqNo" name="seqNo" class="form-control validate[required]">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bannerStatus" class="col-sm-3 control-label">激活设置:</label>
|
||||
<select name="bannerStatus" id="bannerStatus" class="col-sm-2">
|
||||
<option value="1">激活</option>
|
||||
<option value="2">不激活</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="appId" class="col-sm-3 control-label">app:</label>
|
||||
<select name="appId" id="appId" class="col-sm-2">
|
||||
<option value="qingxun">66</option>
|
||||
<option value="ear">侧耳</option>
|
||||
<option value="planet">兔兔星球</option>
|
||||
<option value="mj">马甲</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Banner位置:</label>
|
||||
<div class="col-sm-4">
|
||||
<select name="bannerType" id="bannerType" class="col-sm-10"
|
||||
onchange="selectOnChange(this.value)">
|
||||
<option value="1">首页</option>
|
||||
<option value="2">家族广场</option>
|
||||
<option value="3">游戏banner</option>
|
||||
<option value="4">声控福利房</option>
|
||||
<option value="5">房间分类列表</option>
|
||||
<option value="6">发现页</option>
|
||||
<option value="7">新版首页Tab</option>
|
||||
<option value="8">话题首页</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-5 hidden titleListDev">
|
||||
<select name="titleId" id="titleList" class="col-sm-10 titleList">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" id="bannerTimeForm">
|
||||
<!--<div class="form-group startDateGroup">-->
|
||||
<!--<label for="addStartDate" class="col-sm-3 control-label">开始时间:</label>-->
|
||||
<!--<div class="col-sm-8">-->
|
||||
<!--<input type="text" id="addStartDate" type="date" name="startTime" class="form-control">-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<div class="form-group">
|
||||
<label for="endDate" class="col-sm-3 control-label">结束时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="endDate" type="date" name="endTime" class="form-control">
|
||||
<input id="startDate" type="date" name="startTime" class="form-control">
|
||||
</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="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="addBannerModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
|
||||
<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">x</span></button>
|
||||
<h4 class="modal-title" id="addModalLabel">新增banner</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="addBannerForm" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="addName" class="col-sm-3 control-label">Banner名字:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required]" name="bannerName" id="addName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">banner图:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="addImgUrl" style="width:250px;height:90px;" alt="">
|
||||
<input type="file" id="addUploadFile" name="uploadFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success" type="button" id="addUploadBtn">上传</button>
|
||||
<input type="hidden" id="addBannerPic" name="bannerPic"
|
||||
class="form-control validate[required]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跳转类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="skipType" id="addSkipUrlSort">
|
||||
<!-- <option value="1">App</option> -->
|
||||
<option value="2">聊天室</option>
|
||||
<option value="3">H5页面</option>
|
||||
<option value="4">tab页面</option>
|
||||
<option value="5">跳转App页面</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="addSkipUrlGroup">
|
||||
<label for="addSkipUrlContent" class="col-sm-3 control-label">跳转链接:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control" name="skipUri" id="addSkipUrlContent">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display:none" id="addJumpAppGroup">
|
||||
<label for="routerType" class="col-sm-3 control-label">跳转类型值:</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="col-sm-3 form-control" name="routerType" id="addRouterType">
|
||||
</div>
|
||||
|
||||
<label for="routerValue" class="col-sm-3 control-label">跳转参数值:</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" class="col-sm-3 form-control" name="routerValue" id="addRouterValue">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addDisplayType" class="col-sm-3 control-label">显示类型:</label>
|
||||
<div class="col-sm-3">
|
||||
<select id="addDisplayType" name="displayType" data-btn-class="btn-warning">
|
||||
<option value="1">顶部</option>
|
||||
<option value="2">底部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seqNo" class="col-sm-3 control-label">排序设置:</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" id="addSeqNo" name="seqNo" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bannerStatus" class="col-sm-3 control-label">激活设置:</label>
|
||||
<select name="bannerStatus" id="addBannerStatus" class="col-sm-2">
|
||||
<option value="1">激活</option>
|
||||
<option value="2">不激活</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="appId" class="col-sm-3 control-label">app:</label>
|
||||
<select name="appId" id="addAppId" class="col-sm-2 validate[required]">
|
||||
<option value="">请选择</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Banner位置:</label>
|
||||
<div class="col-sm-4">
|
||||
<select name="bannerType" id="addBannerType" class="col-sm-10"
|
||||
onchange="selectOnChange(this.value)">
|
||||
<option value="1">首页</option>
|
||||
<option value="2">家族广场</option>
|
||||
<option value="3">游戏banner</option>
|
||||
<option value="4">声控福利房</option>
|
||||
<option value="5">房间分类列表</option>
|
||||
<option value="6">发现页</option>
|
||||
<option value="7">新版首页Tab</option>
|
||||
<option value="8">话题首页</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-5 hidden titleListDev">
|
||||
<select name="titleId" id="addTitleList" class="col-sm-10 titleList">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="endDate" class="col-sm-3 control-label">起始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="addStartDate" type="date" name="startTime"
|
||||
class="form-control validate[required]">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="endDate" class="col-sm-3 control-label">结束时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="addEndDate" type="date" name="endTime"
|
||||
class="form-control validate[required]">
|
||||
</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="addSave">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="imgMask"><img src="" alt=""></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
|
||||
|
||||
ComboboxHelper.build(null, '#displayType');
|
||||
var app = {};
|
||||
var validApp = {};
|
||||
export default {
|
||||
name: "BannerAdminView",
|
||||
setup() {
|
||||
|
||||
function selectOnChange(val, titleId) {
|
||||
if (val == 5) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/title/getAllList.action",
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json) {
|
||||
var optionHtml = '<option value=""></option>';
|
||||
$.each(json, function (index, item) {
|
||||
if (titleId == item.id) {
|
||||
optionHtml += '<option value="' + item.id + '" selected="selected">' + item.name + '</option>';
|
||||
} else {
|
||||
optionHtml += '<option value="' + item.id + '">' + item.name + '</option>';
|
||||
}
|
||||
});
|
||||
$(".titleList").html(optionHtml);
|
||||
$('.titleListDev').removeClass("hidden");
|
||||
} else {
|
||||
$("#tipMsg").text("获取房间分类列表出错");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else if (val == 7) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/firstpagetab/getTabNameList",
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json) {
|
||||
var optionHtml = '<option value=""></option>';
|
||||
$.each(json.rows, function (index, item) {
|
||||
if (titleId == item.tabId) {
|
||||
optionHtml += '<option value="' + item.tabId + '" selected="selected">' + item.name + '</option>';
|
||||
} else {
|
||||
optionHtml += '<option value="' + item.tabId + '">' + item.name + '</option>';
|
||||
}
|
||||
});
|
||||
$(".titleList").html(optionHtml);
|
||||
$('.titleListDev').removeClass("hidden");
|
||||
} else {
|
||||
$("#tipMsg").text("获取房间分类列表出错");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$('.titleListDev').addClass("hidden");
|
||||
|
||||
}
|
||||
}
|
||||
window.selectOnChange = selectOnChange;
|
||||
return {
|
||||
selectOnChange
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
getAppNames();
|
||||
function getAppNames() {
|
||||
$.get('/admin/appName/listAll', {}, function (res) {
|
||||
if (res.rows.length > 0) {
|
||||
renderSelect(res.rows);
|
||||
renderAppObj(res.rows);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function renderSelect(data) {
|
||||
var $select = $('#app');
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var $option = $('<option value="' + data[i].app + '" />');
|
||||
$option.html(data[i].appName);
|
||||
$select.append($option);
|
||||
}
|
||||
}
|
||||
|
||||
function renderAppObj(rows) {
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var row = rows[i];
|
||||
app[row.app] = row.appName;
|
||||
// 有效的app
|
||||
if (row.status == 1) {
|
||||
validApp[row.app] = row.appName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var isEdit = false;
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'sel', title: 'ID', align: 'center', valign: 'middle', checkbox: true, width: '1%' },
|
||||
{ field: 'bannerId', title: 'bannerID', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'bannerName', title: '名称', align: 'center', valign: 'middle', width: '20%' },
|
||||
{ field: 'bannerType', title: 'banner位置', align: 'center', valign: 'middle', width: '20%' },
|
||||
|
||||
{
|
||||
field: 'bannerPic',
|
||||
title: 'banner图',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='60' height='30'>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'skipType', title: '跳转类型', align: 'center', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
return 'App页面';
|
||||
|
||||
case 2:
|
||||
return '聊天室';
|
||||
|
||||
case 3:
|
||||
return 'H5页面';
|
||||
|
||||
case 4:
|
||||
return 'tab页面';
|
||||
|
||||
case 5:
|
||||
return '跳转app页面';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'seqNo',
|
||||
title: 'banner排序',
|
||||
align: 'center',
|
||||
width: '8%',
|
||||
valign: 'middle'
|
||||
// formatter: function (val,row,index) {
|
||||
// return val+1;
|
||||
// }
|
||||
},
|
||||
{
|
||||
field: 'bannerStatus',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
console.log(val);
|
||||
switch (val) {
|
||||
case 1:
|
||||
return '正在启用';
|
||||
|
||||
case 2:
|
||||
return '未激活';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'appId',
|
||||
title: 'app',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
var name = app[val];
|
||||
if (name != null) {
|
||||
return name;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'displayType',
|
||||
title: '显示类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
return '顶部';
|
||||
|
||||
case 2:
|
||||
return '底部';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'startTime',
|
||||
title: '活动开始时间',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'endTime',
|
||||
title: '活动结束时间',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{ field: 'operator', title: '操作人', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'updateTime', title: '操作时间', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'tmp',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
var key = row.bannerId;
|
||||
var str = "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>";
|
||||
str += "<button class='btn btn-sm btn-success opt-del' data-id=" + key + ">删除</button>";
|
||||
return str;
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 30, 50],
|
||||
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,
|
||||
pageNumber: params.pageNumber,
|
||||
bannerStatus: parseInt($('#status').val()),
|
||||
skipType: parseInt($('#skipType').val()),
|
||||
bannerType: parseInt($('#searchBannerType').val()),
|
||||
appId: ($('#app').val()) ? $('#app').val() : null
|
||||
};
|
||||
// console.log(param);
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'code',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/banner/getBannerList.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
})
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
})
|
||||
$('#table').on('click', '.opt-edit', function () {
|
||||
$('#titleList').html('');
|
||||
$('.titleListDev').addClass("hidden");
|
||||
var id = parseInt($(this).data('id'));
|
||||
isEdit = true;
|
||||
// 处理appId
|
||||
$('#appId').empty();
|
||||
$('#appId').append('<option value="">请选择</option>');
|
||||
for (var key in app) {
|
||||
$('#appId').append('<option value="' + key + '">' + app[key] + '</option>');
|
||||
}
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/admin/banner/getOneBanner.action',
|
||||
data: { 'bannerId': id },
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.entity) {
|
||||
// var status = json.entity.bannerStatus?'true':'false';
|
||||
var date = json.entity.endTime ? new Date(json.entity.endTime).format("yyyy-MM-dd hh:mm:ss") : '';
|
||||
var startDate = new Date(json.entity.startTime).format("yyyy-MM-dd hh:mm:ss");
|
||||
$('#name').val(json.entity.bannerName);
|
||||
$('#imgUrl').attr('src', json.entity.bannerPic);
|
||||
$('#bannerPic').val(json.entity.bannerPic);
|
||||
$('#skipUrlSort').val(json.entity.skipType);
|
||||
$('#skipUrlContent').val(json.entity.skipUri);
|
||||
ComboboxHelper.setDef("#displayType", json.entity.displayType);
|
||||
$("#bannerType").val(json.entity.bannerType);
|
||||
$("#appId").val(json.entity.appId);
|
||||
$('#seqNo').val(json.entity.seqNo);
|
||||
$('#bannerStatus').val(json.entity.bannerStatus);
|
||||
$('#endDate').val(date);
|
||||
$('#bannerId').val(json.entity.bannerId);
|
||||
$('#startDate').val(startDate);
|
||||
window.selectOnChange(json.entity.bannerType, json.entity.titleId);
|
||||
$('#titleList').val(json.entity.titleId);
|
||||
if (json.entity.skipType == 5) {
|
||||
$('#skipUrlGroup').attr("style", "display:none");
|
||||
$('#jumpAppGroup').removeAttr("style");
|
||||
$('#routerType').val(json.entity.routerType);
|
||||
$('#routerValue').val(json.entity.routerValue);
|
||||
}
|
||||
$('#bannerModal').modal('show');
|
||||
picker1.datetimepicker('setStartDate', startDate);
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
$('#save').on('click', function () {
|
||||
if ($('#bannerForm').validationEngine('validate')) {
|
||||
if ($('#skipUrlSort').val() == 5) {
|
||||
if ($('#routerType').val().trim() == '' || $('#routerValue').val().trim() == '') {
|
||||
$("#tipMsg").text("跳转类型或跳转值不能为空!");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
$('#skipUrlContent').val('');
|
||||
} else {
|
||||
if ($('#skipUrlContent').val().trim() == '') {
|
||||
$("#tipMsg").text("跳转链接不能为空!");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
$('#routerType').val(0);
|
||||
$('#routerValue').val('');
|
||||
}
|
||||
if (!$('#appId').val()) {
|
||||
$("#tipMsg").text("请选择app");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/banner/save.action?isEdit=" + isEdit + "&startTimeString=" + $('#startDate').val()
|
||||
+ "&endTimeString=" + $('#endDate').val(),
|
||||
data: $('#bannerForm').serialize(),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#bannerModal").modal('hide');
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败,错误码:" + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
$("#add").click(function () {
|
||||
$('#addTitleList').html('');
|
||||
$('.titleListDev').addClass("hidden");
|
||||
});
|
||||
$('#addSave').on('click', function () {
|
||||
var startDateVal = $('#addStartDate').val();
|
||||
var endDateVal = $('#addEndDate').val();
|
||||
|
||||
if (!startDateVal || !endDateVal) {
|
||||
$("#tipMsg").text("请选择日期");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($('#addSkipUrlSort').val() == 5) {
|
||||
if ($('#addRouterType').val().trim() == '' || $('#addRouterValue').val().trim() == '') {
|
||||
$("#tipMsg").text("跳转类型或跳转值不能为空!");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
$('#addSkipUrlContent').val('');
|
||||
} else {
|
||||
if ($('#addSkipUrlContent').val().trim() == '') {
|
||||
$("#tipMsg").text("跳转链接不能为空!");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
$('#addRouterType').val(0);
|
||||
$('#addRouterValue').val('');
|
||||
}
|
||||
|
||||
if ($('#addBannerForm').validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/banner/save.action?isEdit=" + isEdit + "&startTimeString=" + $('#addStartDate').val()
|
||||
+ "&endTimeString=" + $('#addEndDate').val(),
|
||||
data: $('#addBannerForm').serialize(),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
if (json.code == 200) {
|
||||
$('#addBannerModal').modal('hide');
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败,错误码:" + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// $('#bannerModal').on('hidden.bs.modal',function () {
|
||||
//// TableHelper.doRefresh("#table");
|
||||
// $('#bannerForm').data('bootstrapValidator').destroy();
|
||||
// $('#bannerForm').data('bootstrapValidator', null);
|
||||
// $('#bannerTimeForm').data('bootstrapValidator').destroy();
|
||||
// $('#bannerTimeForm').data('bootstrapValidator', null);
|
||||
//
|
||||
// })
|
||||
var picker1 = $("#endDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
|
||||
var picker2 = $('#addStartDate').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
|
||||
var picker3 = $('#addEndDate').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
picker3.on('changeDate', function () {
|
||||
var date = $('#addEndDate').datetimepicker('getDate');
|
||||
console.log(date);
|
||||
picker2.datetimepicker('setEndDate', date);
|
||||
});
|
||||
picker2.on('changeDate', function () {
|
||||
var date = $('#addStartDate').datetimepicker('getDate');
|
||||
picker3.datetimepicker('setStartDate', date);
|
||||
});
|
||||
$('#uploadBtn').on('click', function () {
|
||||
console.log('wewawa');
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/banner/headimg.action',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.path) {
|
||||
$('#bannerPic').val(json.path);
|
||||
$('#imgUrl').attr("src", json.path);
|
||||
console.log(json.path);
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
$("#bannerForm").ajaxSubmit(options);
|
||||
})
|
||||
$('#addUploadBtn').on('click', function () {
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/banner/headimg.action',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.path) {
|
||||
$('#addBannerPic').val(json.path);
|
||||
$('#addImgUrl').attr('src', json.path);
|
||||
console.log(json.path);
|
||||
} else {
|
||||
$('#tipMsg').text(json.msg);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#addBannerForm').ajaxSubmit(options);
|
||||
})
|
||||
$('#add').on('click', function () {
|
||||
isEdit = false;
|
||||
$('#addBannerForm')[0].reset();
|
||||
$('#addImgUrl').attr('src', '');
|
||||
$('#addBannerPic').val('');
|
||||
ComboboxHelper.setDef("#displayType", 0);
|
||||
$('#addJumpAppGroup').attr("style", "display:none");
|
||||
$('#addSkipUrlGroup').removeAttr("style");
|
||||
// 处理appId
|
||||
$('#addAppId').empty();
|
||||
$('#addAppId').append('<option value="">请选择</option>');
|
||||
for (var key in validApp) {
|
||||
$('#addAppId').append('<option value="' + key + '">' + validApp[key] + '</option>');
|
||||
}
|
||||
$('#addBannerModal').modal('show');
|
||||
})
|
||||
$('#table').on('mouseenter', 'img', function (e) {
|
||||
console.log($(this), e.clientX);
|
||||
var src = $(this).attr('src');
|
||||
$('#imgMask img').attr('src', src);
|
||||
$('#imgMask').show();
|
||||
$('#imgMask').css({
|
||||
top: e.clientY + 20,
|
||||
left: e.clientX + 20
|
||||
})
|
||||
})
|
||||
$('#table').on('mouseleave', 'img', function (e) {
|
||||
console.log('移出');
|
||||
$('#imgMask').hide();
|
||||
})
|
||||
|
||||
$('#btnMultiDel').on('click', function () {
|
||||
var rows = $("#table").bootstrapTable("getSelections");
|
||||
if (rows.length == 0) {
|
||||
alert("请先选择要删除的记录");
|
||||
return;
|
||||
}
|
||||
var idArr = [];
|
||||
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
idArr.push(rows[i]['bannerId']);
|
||||
}
|
||||
|
||||
if (confirm("你确认删除选中Banner吗?")) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/banner/delBanner.action",
|
||||
data: {
|
||||
'ids': JSON.stringify(idArr)
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("已删除选中Banner");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#addSkipUrlSort').on('change', function () {
|
||||
if ($('#addSkipUrlSort').val() == 5) {
|
||||
$('#addSkipUrlGroup').attr("style", "display:none");
|
||||
$('#addJumpAppGroup').removeAttr("style");
|
||||
} else {
|
||||
$('#addJumpAppGroup').attr("style", "display:none");
|
||||
$('#addSkipUrlGroup').removeAttr("style");
|
||||
}
|
||||
});
|
||||
|
||||
$('#skipUrlSort').on('change', function () {
|
||||
if ($('#skipUrlSort').val() == 5) {
|
||||
$('#skipUrlGroup').attr("style", "display:none");
|
||||
$('#jumpAppGroup').removeAttr("style");
|
||||
} else {
|
||||
$('#jumpAppGroup').attr("style", "display:none");
|
||||
$('#skipUrlGroup').removeAttr("style");
|
||||
}
|
||||
});
|
||||
|
||||
$('#table').on('click', '.opt-del', function () {
|
||||
var key = parseInt($(this).attr('data-id'));
|
||||
var idArr = [];
|
||||
idArr.push(key);
|
||||
if (confirm("你确认删除Banner吗?")) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/banner/delBanner.action",
|
||||
data: {
|
||||
'ids': JSON.stringify(idArr)
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("已删除Banner");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#skipType,
|
||||
#status {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
#uploadBtn,
|
||||
#addUploadBtn {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
#skipUrlSort,
|
||||
#bannerStatus,
|
||||
#addSkipUrlSort,
|
||||
#addBannerStatus {
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.attention {
|
||||
line-height: 30px;
|
||||
display: inline-block;
|
||||
margin-top: 4px;
|
||||
color: red;
|
||||
}
|
||||
|
||||
#imgMask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 450px;
|
||||
height: 150px;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#imgMask img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}</style>
|
228
src/views/home/NewFriendAdminView.vue
Normal file
228
src/views/home/NewFriendAdminView.vue
Normal file
@@ -0,0 +1,228 @@
|
||||
<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="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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></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="modal_erbanNos" 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="erbanNos"
|
||||
id="modal_erbanNos" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="expireTimeStr" class="col-sm-2 control-label">失效时间:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control datetime" name="expireTimeStr" id="expireTimeStr">
|
||||
</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>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "NewFriendAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('.datetime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
});
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'erbanNo', title: '平台号', align: 'center', width: '20%' },
|
||||
{ field: 'nick', title: '昵称', align: 'center', width: '20%' },
|
||||
{
|
||||
field: 'avatar',
|
||||
title: '头像',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='40' height='40'>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'gender', title: '性别', align: 'center', valign: 'middle', width: '20%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return '男'
|
||||
} else {
|
||||
return '女'
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'createTime', title: '配置时间', align: 'center', valign: 'middle', width: '20%', formatter: formatTime },
|
||||
{ field: 'expireTime', title: '失效时间', align: 'center', valign: 'middle', width: '20%', formatter: formatTime },
|
||||
{
|
||||
field: 'uid',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '20%',
|
||||
formatter: function (val, row, index) {
|
||||
var text = '';
|
||||
text += '<button class="btn btn-sm btn-danger opt-remove" data-id=' + val + '>' +
|
||||
' <i class="glyphicon glyphicon-remove"></i>删除' +
|
||||
'</button>';
|
||||
return text;
|
||||
}
|
||||
}
|
||||
],
|
||||
undefinedText: 0,
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100, 200, 300, 500],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/new/friend/page',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
//新建标签
|
||||
$("#btnAdd").click(function () {
|
||||
$("#modal_erbanNo").val("");
|
||||
$("#roomTagModal").modal('show');
|
||||
});
|
||||
|
||||
$("#add").click(function () {
|
||||
var erBanNo = $("#modal_erbanNos").val();
|
||||
var expireTimeStr = $("#expireTimeStr").val();
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/new/friend/save?erBanNoStr=" + erBanNo + "&expireTimeStr=" + expireTimeStr,
|
||||
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');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-remove', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
if (id == 'undefined') {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (confirm("你确认删除该记录吗? \r\n 删除后再也不能找回,请谨慎操作!")) {
|
||||
$.ajax({
|
||||
type: 'delete',
|
||||
url: "/admin/new/friend/del?uid=" + id,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("删除成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function formatTime(val) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format('yyyy-MM-dd hh:mm:ss');
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
|
||||
$("#expireTimeStr").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true,
|
||||
startDate: new Date()
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
367
src/views/home/PanelAdminView.vue
Normal file
367
src/views/home/PanelAdminView.vue
Normal file
@@ -0,0 +1,367 @@
|
||||
<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 -->
|
||||
<section class="content">
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
<button id="panel-add" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>增加
|
||||
</button>
|
||||
|
||||
<button id="panel-multiDel" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-wrench"></i>批量删除
|
||||
</button>
|
||||
</div>
|
||||
</section><!-- .content -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="panelModal" 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="panelForm">
|
||||
<input type="hidden" name="panelId" id="panelId" />
|
||||
<div class="form-group">
|
||||
<label for="panelName" class="col-sm-2 control-label">面板名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="panelName" id="panelName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">面板背景:</label>
|
||||
<div class="col-sm-10">
|
||||
<img src="" id="panelPicImage" style="width:250px;height:90px;" alt="">
|
||||
<input type="file" id="panelPicFile" name="uploadFile" accept="application/x-ico">
|
||||
<button class="btn btn-success" type="button" id="panelPicUploadBtn">上传</button>
|
||||
<input type="hidden" id="panelPic" name="panelPic"
|
||||
class="form-control validate[required]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="skipType" class="col-sm-2 control-label">跳转类型</label>
|
||||
<select id="skipType" name="skipType" data-btn-class="btn-warning">
|
||||
<option value="1">App页面</option>
|
||||
<option value="2">聊天室</option>
|
||||
<option value="3">H5页面</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="skipUrl" class="col-sm-2 control-label">跳转地址</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control validate[required]" name="skipUrl" id="skipUrl">
|
||||
<span style="color:red">(当跳转类型为App页面时, 2为座驾商城 3为装饰商城)</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-2 control-label">状态</label>
|
||||
<div id="status" class="col-sm-3">
|
||||
<label class="radio-inline"><input type="radio" name="status" value="1" checked>66</label>
|
||||
<label class="radio-inline"><input type="radio" name="status" value="2">审核中</label>
|
||||
<label class="radio-inline"><input type="radio" name="status" value="3">66</label>
|
||||
<label class="radio-inline"><input type="radio" name="status" value="4">无效</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seqNo" class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control validate[required]" name="seqNo" id="seqNo">
|
||||
</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="save">保存</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';
|
||||
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
|
||||
|
||||
ComboboxHelper.build(null, '#skipType');
|
||||
export default {
|
||||
name: "PanelAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'tmp', title: 'ID', align: 'center', checkbox: true },
|
||||
{ field: 'panelId', title: '面板id', align: 'center', width: '5%' },
|
||||
{ field: 'panelName', title: '面板名称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'skipType', title: '跳转类型', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return 'App页面';
|
||||
} else if (val == 2) {
|
||||
return '聊天室';
|
||||
} else if (val == 3) {
|
||||
return 'H5页面';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'skipUrl', title: '跳转地址', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'status', title: '状态', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return '66';
|
||||
} else if (val == 2) {
|
||||
return '审核中';
|
||||
} else if (val == 3) {
|
||||
return '66';
|
||||
} else if (val == 4) {
|
||||
return '无效'
|
||||
} else {
|
||||
return '未知状态';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'seqNo', title: '排序', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'createTime', title: '创建时间', align: 'center', width: '15%', formatter: function (val, row, index) {
|
||||
var newDate = new Date();
|
||||
newDate.setTime(val);
|
||||
return newDate.toLocaleString();
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'panelId', title: '操作', align: 'center', width: '25%', formatter: function (val, row, index) {
|
||||
return '<button 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 +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: true,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [1, 10, 20, 30, 50],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
pageNumber: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
searchText: params.searchText
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/panel/getList.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-remove', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
if (id == 'undefined') {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (confirm("你确认删除该记录吗?" +
|
||||
"\r\n删除后再也不能找回,请谨慎操作!")) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/panel/del.action",
|
||||
data: { 'ids': JSON.stringify([id]) },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
$("#tipMsg").text("删除成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#panel-add").click(function () {
|
||||
// 打开编辑弹窗
|
||||
$("#panelModal").modal('show');
|
||||
$("#panelForm")[0].reset();
|
||||
$("#panelId").val('');
|
||||
|
||||
$("#panelPicImage").attr("src", "");
|
||||
$("#panelPic").val('');
|
||||
|
||||
ComboboxHelper.setDef("#skipType", 0);
|
||||
});
|
||||
|
||||
$("#panel-multiDel").click(function () {
|
||||
var rows = $("#table").bootstrapTable("getSelections");
|
||||
if (rows.length == 0) {
|
||||
alert("请先选择要删除的记录");
|
||||
return;
|
||||
}
|
||||
console.log("rows: " + rows.length);
|
||||
var idArr = [];
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
idArr.push(rows[i]['panelId']);
|
||||
}
|
||||
console.log(idArr);
|
||||
|
||||
if (confirm("你确认批量删除该记录吗?" +
|
||||
"\r\n删除后再也不能找回,请谨慎操作!")) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/panel/del.action",
|
||||
data: { 'ids': JSON.stringify(idArr) },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
$("#tipMsg").text("删除成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#cancel").click(function () {
|
||||
TableHelper.unCheckAll("#table");
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
console.log("btnEdit");
|
||||
var id = $(this).attr("data-id");
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/panel/get.action",
|
||||
data: { id: id },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.entity) {
|
||||
$("#panelId").val(json.entity.panelId);
|
||||
$("#panelName").val(json.entity.panelName);
|
||||
$("#skipUrl").val(json.entity.skipUrl);
|
||||
ComboboxHelper.setDef("#skipType", json.entity.skipType);
|
||||
$("#seqNo").val(json.entity.seqNo);
|
||||
$("#panelPic").val(json.entity.panelPic);
|
||||
$("#panelPicImage").attr("src", json.entity.panelPic);
|
||||
if (json.entity.status == 1) {
|
||||
$("input:radio[name='status']")[0].checked = true;
|
||||
} else if (json.entity.status == 2) {
|
||||
$("input:radio[name='status']")[1].checked = true;
|
||||
} else if (json.entity.status == 3) {
|
||||
$("input:radio[name='status']")[2].checked = true;
|
||||
} else if (json.entity.status == 4) {
|
||||
$("input:radio[name='status']")[3].checked = true;
|
||||
}
|
||||
|
||||
// 打开编辑弹窗
|
||||
$("#panelModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("获取菜单信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#panelPicUploadBtn').on('click', function () {
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'panelPicFile', //需要上传的文件域的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) {
|
||||
$('#panelPic').val(json.path);
|
||||
$('#panelPicImage').attr("src", json.path);
|
||||
console.log(json.path);
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
},
|
||||
error: function (data, status, e) { //提交失败自动执行的处理函数。
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#save").click(function () {
|
||||
if ($("#panelForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/panel/save.action",
|
||||
data: $('#panelForm').serialize(),
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success == 'true') {
|
||||
$("#panelModal").modal('hide');
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
347
src/views/home/RecommandAdminView.vue
Normal file
347
src/views/home/RecommandAdminView.vue
Normal file
@@ -0,0 +1,347 @@
|
||||
<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">
|
||||
<button id="add" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>增加
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="recommandModal" 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">x</span></button>
|
||||
<h4 class="modal-title" id="modalLabel">热门推荐详细信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="recomForm">
|
||||
<div class="form-group">
|
||||
<label for="seqNo" class="col-sm-3 control-label">修改次序:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" id="seqNo" name="seqNo" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" id="recommId" name="recommId">
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" id="recomFormTime">
|
||||
<div class="form-group">
|
||||
<label for="startDate" class="col-sm-3 control-label">起始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" id="startDate" name="startValidTime" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="endDate" class="col-sm-3 control-label">结束时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" id="endDate" name="endValidTime" class="form-control">
|
||||
</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="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
|
||||
<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">x</span></button>
|
||||
<h4 class="modal-title" id="addModalLabel">添加热门推荐</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="addRecomForm">
|
||||
<div class="form-group">
|
||||
<label for="addUid" class="col-sm-3 control-label">平台号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="addUid" id="addUid" class="validate[required] form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addSeqNo" class="col-sm-3 control-label">排列序号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="addSeqNo" id="addSeqNo" class="validate[required] form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addStartTime" class="col-sm-3 control-label">开始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="startValidTime" id="addStartTime"
|
||||
class="validate[required] form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addEndTime" class="col-sm-3 control-label">结束时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="endValidTime" id="addEndTime"
|
||||
class="validate[required] form-control">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="addBtn" class="btn btn-primary" id="addSave">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "RecommandAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'recommId', title: '推荐ID', align: 'center', valign: 'middle', width: '5%' },
|
||||
{ field: 'userVo.erbanNo', title: '平台号', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'seqNo', title: '排序', align: 'center', valign: 'middle', width: '10%' },
|
||||
{
|
||||
field: 'startValidTime', title: '开始时间', align: 'center', valign: 'middle', width: '20%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'endValidTime', title: '结束时间', align: 'center', valign: 'middle', width: '20%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime', title: '创建时间', align: 'center', valign: 'middle', width: '20%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'tmp',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '15%',
|
||||
formatter: function (val, row, index) {
|
||||
var key = row.recommId;
|
||||
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button><button class='btn btn-sm btn-danger opt-del' data-id=" + key + ">删除</button>";
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 30, 50],
|
||||
sidePagination: "client",
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
uniqueId: 'code',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/homerecomm/hot/voList.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
})
|
||||
$('#table').on('click', '.opt-edit', function () {
|
||||
var id = $(this).data('id');
|
||||
console.log(id);
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/admin/homerecomm/hot/getOneRecomm',
|
||||
data: { 'recommId': id },
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.code == 200) {
|
||||
var data = res.data;
|
||||
var startTime = data.startValidTime ? new Date(data.startValidTime).format('yyyy-MM-dd hh:mm:ss') : '';
|
||||
var endTime = data.endValidTime ? new Date(data.endValidTime).format('yyyy-MM-dd hh:mm:ss') : '';
|
||||
$('#seqNo').val(data.seqNo);
|
||||
$('#startDate').val(startTime);
|
||||
$('#endDate').val(endTime);
|
||||
$('#recommId').val(data.recommId);
|
||||
$('#recommandModal').modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
$('#table').on('click', '.opt-del', function () {
|
||||
var id = $(this).data('id');
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/admin/homerecomm/hot/del',
|
||||
data: { 'recommId': id },
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.code == 200) {
|
||||
$("#tipMsg").text("删除成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除失败,错误码:" + res.code);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
var picker1 = $('#startDate').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
picker1.on('changeDate', function () {
|
||||
var date = $('#startDate').datetimepicker('getDate');
|
||||
picker2.datetimepicker('setStartDate', date);
|
||||
});
|
||||
var picker2 = $('#endDate').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
picker2.on('changeDate', function () {
|
||||
var date = $('#endDate').datetimepicker('getDate');
|
||||
picker1.datetimepicker('setEndDate', date);
|
||||
});
|
||||
|
||||
$('#save').on('click', function () {
|
||||
console.log('wewawa');
|
||||
if ($('#recomForm').validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/admin/homerecomm/hot/updateRecomm',
|
||||
data: {
|
||||
startTimeString: $('#startDate').val(),
|
||||
endTimeString: $('#endDate').val(),
|
||||
recommId: $('#recommId').val(),
|
||||
seqNo: $('#seqNo').val()
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.code == 200) {
|
||||
$('#recommandModal').modal('hide');
|
||||
$("#tipMsg").text("修改成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("修改失败,错误信息:" + res.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
$('#addSave').on('click', function () {
|
||||
if ($('#addRecomForm').validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/admin/homerecomm/hot/add',
|
||||
data: {
|
||||
startTimeString: $('#addStartTime').val(),
|
||||
endTimeString: $('#addEndTime').val(),
|
||||
erbanNo: $('#addUid').val(),
|
||||
seqNo: $('#addSeqNo').val()
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.code == 200) {
|
||||
$('#addModal').modal('hide');
|
||||
if (res.message != 'success') {
|
||||
$("#tipMsg").text(res.message);
|
||||
} else {
|
||||
$("#tipMsg").text("增加成功");
|
||||
}
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("增加失败,错误信息:" + res.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
$('#add').on('click', function () {
|
||||
$(":input", "#addRecomForm")
|
||||
.not(":button", ":reset", "hidden", "submit")
|
||||
.val("")
|
||||
.removeAttr("checked")
|
||||
.removeAttr("selected");
|
||||
$('#addModal').modal('show');
|
||||
})
|
||||
var picker3 = $('#addStartTime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
picker3.on('changeDate', function () {
|
||||
var date = $('#addStartTime').datetimepicker('getDate');
|
||||
picker4.datetimepicker('setStartDate', date);
|
||||
});
|
||||
var picker4 = $('#addEndTime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
picker4.on('changeDate', function () {
|
||||
var date = $('#addEndTime').datetimepicker('getDate');
|
||||
picker3.datetimepicker('setEndDate', date);
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>.btn {
|
||||
margin: 0 4px;
|
||||
}</style>
|
663
src/views/home/RisingStarAdminView.vue
Normal file
663
src/views/home/RisingStarAdminView.vue
Normal file
@@ -0,0 +1,663 @@
|
||||
<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">
|
||||
平台号:<select name="skipType" id="skipType" class="input-m">
|
||||
<option value="0">--全部--</option>
|
||||
<!--<option value="1">APP页面</option>-->
|
||||
<option value="2">聊天室</option>
|
||||
<option value="3">H5页面</option>
|
||||
</select>
|
||||
状态: <select name="status" id="status" class="input-m">
|
||||
<option value="0">--全部--</option>
|
||||
<option value="1">激活启用中</option>
|
||||
<option value="2">未激活</option>
|
||||
</select>
|
||||
banner位置: <select name="bannerType" id="searchBannerType" class="input-m">
|
||||
<option value="0">--全部--</option>
|
||||
<option value="1">首页</option>
|
||||
<option value="2">家族广场</option>
|
||||
</select>
|
||||
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
||||
|
||||
<button id="add" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-plus"></i>增加
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="bannerModal" 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">x</span></button>
|
||||
<h4 class="modal-title" id="modalLabel">banner信息</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="bannerForm">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-3 control-label">Banner名字:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required]" name="bannerName" id="name">
|
||||
<input type="hidden" id="bannerId" name="bannerId">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">banner图:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="imgUrl" style="width:250px;height:90px;" alt="">
|
||||
<input type="file" id="uploadFile" name="uploadFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
|
||||
<span class="attention">注意:图片尺寸请注意在750*250,选择图片后请点击上传按钮</span>
|
||||
<input type="hidden" id="bannerPic" name="bannerPic"
|
||||
class="form-control validate[required]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跳转链接:</label>
|
||||
<select name="skipType" id="skipUrlSort" class="col-sm-2">
|
||||
<!--<option value="1">App</option>-->
|
||||
<option value="2">聊天室</option>
|
||||
<option value="3">H5页面</option>
|
||||
</select>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="skipUri"
|
||||
id="skipUrlContent">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="displayType" class="col-sm-3 control-label">显示类型:</label>
|
||||
<div class="col-sm-3">
|
||||
<select id="displayType" name="displayType" data-btn-class="btn-warning">
|
||||
<option value="1">顶部</option>
|
||||
<option value="2">底部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seqNo" class="col-sm-3 control-label">排序设置:</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" id="seqNo" name="seqNo" class="form-control validate[required]">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bannerStatus" class="col-sm-3 control-label">激活设置:</label>
|
||||
<select name="bannerStatus" id="bannerStatus" class="col-sm-2">
|
||||
<option value="1">激活</option>
|
||||
<option value="2">不激活</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Banner位置:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="bannerType" id="bannerType" class="col-sm-2">
|
||||
<option value="0">--请选择--</option>
|
||||
<option value="1">首页</option>
|
||||
<option value="2">家族广场</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal" id="bannerTimeForm">
|
||||
<!--<div class="form-group startDateGroup">-->
|
||||
<!--<label for="addStartDate" class="col-sm-3 control-label">开始时间:</label>-->
|
||||
<!--<div class="col-sm-8">-->
|
||||
<!--<input type="text" id="addStartDate" type="date" name="startTime" class="form-control">-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<div class="form-group">
|
||||
<label for="endDate" class="col-sm-3 control-label">结束时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="endDate" type="date" name="endTime" class="form-control">
|
||||
<input id="startDate" type="date" name="startTime" class="form-control">
|
||||
</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="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="addBannerModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel2">
|
||||
<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">x</span></button>
|
||||
<h4 class="modal-title" id="addModalLabel">新增banner</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="addBannerForm" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="addName" class="col-sm-3 control-label">Banner名字:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control validate[required]" name="bannerName" id="addName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">banner图:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="addImgUrl" style="width:250px;height:90px;" alt="">
|
||||
<input type="file" id="addUploadFile" name="uploadFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success" type="button" id="addUploadBtn">上传</button>
|
||||
<input type="hidden" id="addBannerPic" name="bannerPic"
|
||||
class="form-control validate[required]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">跳转链接:</label>
|
||||
<select name="skipType" id="addSkipUrlSort" class="col-sm-2">
|
||||
<!--<option value="1">App</option>-->
|
||||
<option value="2">聊天室</option>
|
||||
<option value="3">H5页面</option>
|
||||
</select>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="skipUri"
|
||||
id="addSkipUrlContent">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addDisplayType" class="col-sm-3 control-label">显示类型:</label>
|
||||
<div class="col-sm-3">
|
||||
<select id="addDisplayType" name="displayType" data-btn-class="btn-warning">
|
||||
<option value="1">顶部</option>
|
||||
<option value="2">底部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="seqNo" class="col-sm-3 control-label">排序设置:</label>
|
||||
<div class="col-sm-3">
|
||||
<input type="text" id="addSeqNo" name="seqNo" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bannerStatus" class="col-sm-3 control-label">激活设置:</label>
|
||||
<select name="bannerStatus" id="addBannerStatus" class="col-sm-2">
|
||||
<option value="1">激活</option>
|
||||
<option value="2">不激活</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Banner位置:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="bannerType" id="addBannerType" class="col-sm-2">
|
||||
<option value="0">--请选择--</option>
|
||||
<option value="1">首页</option>
|
||||
<option value="2">家族广场</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="endDate" class="col-sm-3 control-label">起始时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="addStartDate" type="date" name="startTime"
|
||||
class="form-control validate[required]">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="endDate" class="col-sm-3 control-label">结束时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="addEndDate" type="date" name="endTime"
|
||||
class="form-control validate[required]">
|
||||
</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="addSave">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="imgMask"><img src="" alt=""></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
|
||||
|
||||
ComboboxHelper.build(null, '#displayType');
|
||||
export default {
|
||||
name: "RisingStarAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
var isEdit = false;
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'bannerId', title: 'bannerID', align: 'center', valign: 'middle', width: '10%' },
|
||||
{ field: 'bannerName', title: '名称', align: 'center', valign: 'middle', width: '20%' },
|
||||
{
|
||||
field: 'bannerType',
|
||||
title: 'banner位置',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '20%',
|
||||
formatter: function (val, row, index) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
return '首页';
|
||||
|
||||
case 2:
|
||||
return '家族广场';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'bannerPic',
|
||||
title: 'banner图',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='60' height='30'>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'skipType', title: '跳转类型', align: 'center', valign: 'middle', width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
return 'App页面';
|
||||
|
||||
case 2:
|
||||
return '聊天室';
|
||||
|
||||
case 3:
|
||||
return 'H5页面';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'seqNo',
|
||||
title: 'banner排序',
|
||||
align: 'center',
|
||||
width: '8%',
|
||||
valign: 'middle'
|
||||
// formatter: function (val,row,index) {
|
||||
// return val+1;
|
||||
// }
|
||||
},
|
||||
{
|
||||
field: 'bannerStatus',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
console.log(val);
|
||||
switch (val) {
|
||||
case 1:
|
||||
return '正在启用';
|
||||
|
||||
case 2:
|
||||
return '未激活';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'displayType',
|
||||
title: '显示类型',
|
||||
align: 'center',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
return '顶部';
|
||||
|
||||
case 2:
|
||||
return '底部';
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'startTime',
|
||||
title: '活动开始时间',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'endTime',
|
||||
title: '活动结束时间',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'tmp',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
var key = row.bannerId;
|
||||
return "<button class='btn btn-sm btn-success opt-edit' data-id=" + key + ">编辑</button>";
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 30, 50],
|
||||
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,
|
||||
pageNumber: params.pageNumber,
|
||||
bannerStatus: parseInt($('#status').val()),
|
||||
skipType: parseInt($('#skipType').val()),
|
||||
bannerType: parseInt($('#searchBannerType').val())
|
||||
};
|
||||
// console.log(param);
|
||||
return param;
|
||||
},
|
||||
uniqueId: 'code',
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/banner/getBannerList.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
})
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
})
|
||||
$('#table').on('click', '.opt-edit', function () {
|
||||
var id = parseInt($(this).data('id'));
|
||||
isEdit = true;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/admin/banner/getOneBanner.action',
|
||||
data: { 'bannerId': id },
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.entity) {
|
||||
// var status = json.entity.bannerStatus?'true':'false';
|
||||
var date = json.entity.endTime ? new Date(json.entity.endTime).format("yyyy-MM-dd hh:mm:ss") : '';
|
||||
var startDate = new Date(json.entity.startTime).format("yyyy-MM-dd hh:mm:ss");
|
||||
$('#name').val(json.entity.bannerName);
|
||||
$('#imgUrl').attr('src', json.entity.bannerPic);
|
||||
$('#bannerPic').val(json.entity.bannerPic);
|
||||
$('#skipUrlSort').val(json.entity.skipType);
|
||||
$('#skipUrlContent').val(json.entity.skipUri);
|
||||
ComboboxHelper.setDef("#displayType", json.entity.displayType);
|
||||
$("#bannerType").val(json.entity.bannerType);
|
||||
$('#seqNo').val(json.entity.seqNo);
|
||||
$('#bannerStatus').val(json.entity.bannerStatus);
|
||||
$('#endDate').val(date);
|
||||
$('#bannerId').val(json.entity.bannerId);
|
||||
$('#startDate').val(startDate);
|
||||
$('#bannerModal').modal('show');
|
||||
picker1.datetimepicker('setStartDate', startDate);
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
$('#save').on('click', function () {
|
||||
if ($('#bannerForm').validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/banner/save.action?isEdit=" + isEdit + "&endTimeString=" + $('#endDate').val(),
|
||||
data: $('#bannerForm').serialize(),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#bannerModal").modal('hide');
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败,错误码:" + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
$('#addSave').on('click', function () {
|
||||
if ($('#addBannerForm').validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/banner/save.action?isEdit=" + isEdit + "&startTimeString=" + $('#addStartDate').val() + "&endTimeString=" + $('#addEndDate').val(),
|
||||
data: $('#addBannerForm').serialize(),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
if (json.code == 200) {
|
||||
$('#addBannerModal').modal('hide');
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败,错误码:" + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// $('#bannerModal').on('hidden.bs.modal',function () {
|
||||
//// TableHelper.doRefresh("#table");
|
||||
// $('#bannerForm').data('bootstrapValidator').destroy();
|
||||
// $('#bannerForm').data('bootstrapValidator', null);
|
||||
// $('#bannerTimeForm').data('bootstrapValidator').destroy();
|
||||
// $('#bannerTimeForm').data('bootstrapValidator', null);
|
||||
//
|
||||
// })
|
||||
var picker1 = $("#endDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
|
||||
var picker2 = $('#addStartDate').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
|
||||
var picker3 = $('#addEndDate').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true
|
||||
})
|
||||
picker3.on('changeDate', function () {
|
||||
var date = $('#addEndDate').datetimepicker('getDate');
|
||||
console.log(date);
|
||||
picker2.datetimepicker('setEndDate', date);
|
||||
});
|
||||
picker2.on('changeDate', function () {
|
||||
var date = $('#addStartDate').datetimepicker('getDate');
|
||||
picker3.datetimepicker('setStartDate', date);
|
||||
});
|
||||
$('#uploadBtn').on('click', function () {
|
||||
console.log('wewawa');
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/banner/headimg.action',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.path) {
|
||||
$('#bannerPic').val(json.path);
|
||||
$('#imgUrl').attr("src", json.path);
|
||||
console.log(json.path);
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
$("#bannerForm").ajaxSubmit(options);
|
||||
})
|
||||
$('#addUploadBtn').on('click', function () {
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/banner/headimg.action',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.path) {
|
||||
$('#addBannerPic').val(json.path);
|
||||
$('#addImgUrl').attr('src', json.path);
|
||||
console.log(json.path);
|
||||
} else {
|
||||
$('#tipMsg').text(json.msg);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#addBannerForm').ajaxSubmit(options);
|
||||
})
|
||||
$('#add').on('click', function () {
|
||||
isEdit = false;
|
||||
$('#addBannerForm')[0].reset();
|
||||
$('#addImgUrl').attr('src', '');
|
||||
$('#addBannerPic').val('');
|
||||
ComboboxHelper.setDef("#displayType", 0);
|
||||
$('#addBannerModal').modal('show');
|
||||
})
|
||||
$('#table').on('mouseenter', 'img', function (e) {
|
||||
console.log($(this), e.clientX);
|
||||
var src = $(this).attr('src');
|
||||
$('#imgMask img').attr('src', src);
|
||||
$('#imgMask').show();
|
||||
$('#imgMask').css({
|
||||
top: e.clientY + 20,
|
||||
left: e.clientX + 20
|
||||
})
|
||||
})
|
||||
$('#table').on('mouseleave', 'img', function (e) {
|
||||
console.log('移出');
|
||||
$('#imgMask').hide();
|
||||
})
|
||||
|
||||
|
||||
// $('#table').on('click','.opt-del',function () {
|
||||
// var key = parseInt($(this).attr('data-id'));
|
||||
// console.log(key,typeof key);
|
||||
// $.ajax({
|
||||
// type: 'post',
|
||||
// url: '/admin/banner/delBannerList.action',
|
||||
// data: {'bannerId':key},
|
||||
// dataType: 'json',
|
||||
// success: function(json){
|
||||
// if(json.result == 1){
|
||||
// $("#tipMsg").text("删除成功");
|
||||
// $("#tipModal").modal('show');
|
||||
// TableHelper.doRefresh("#table");
|
||||
// }else{
|
||||
// $("#tipMsg").text("删除失败,错误码:" + json.result);
|
||||
// $("#tipModal").modal('show');
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// })
|
||||
//
|
||||
// })
|
||||
})
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#skipType,
|
||||
#status {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
#uploadBtn,
|
||||
#addUploadBtn {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
#skipUrlSort,
|
||||
#bannerStatus,
|
||||
#addSkipUrlSort,
|
||||
#addBannerStatus {
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.attention {
|
||||
line-height: 30px;
|
||||
display: inline-block;
|
||||
margin-top: 4px;
|
||||
color: red;
|
||||
}
|
||||
|
||||
#imgMask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 450px;
|
||||
height: 150px;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#imgMask img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}</style>
|
467
src/views/infocard/InfocardManageView.vue
Normal file
467
src/views/infocard/InfocardManageView.vue
Normal file
@@ -0,0 +1,467 @@
|
||||
<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" style="height: auto;">
|
||||
<form id="searchForm" class="" action="" method="post" target="_blank">
|
||||
<div class="col-sm-12">
|
||||
<label for="type" class="col-sm-1 control-label">资料卡类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<select name="type" id="type" data-btn-class="btn-warning" class="form-control">
|
||||
<option value="" selected="selected">全部</option>
|
||||
<option value="1">普通</option>
|
||||
<option value="2">贵族</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="id" class="col-sm-1 control-label">资料卡id:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="id" id="id"></div>
|
||||
|
||||
<label for="name" class="col-sm-1 control-label">资料卡名称:</label>
|
||||
<div class="col-sm-2"><input type="text" class="form-control" name="name" id="name"></div>
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" style="width: 500px;">
|
||||
<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="modal_id" />
|
||||
<div class="form-group">
|
||||
<label for="modal_type" class="col-sm-4 control-label">装扮类型:</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="type" id="modal_type" data-btn-class="btn-warning" class="form-control">
|
||||
<option value="1">普通装扮</option>
|
||||
<option value="2">贵族装扮</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_name" class="col-sm-4 control-label">装扮名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="modal_name"
|
||||
placeholder="请输入资料卡名称">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">图片:</label>
|
||||
<div class="col-sm-6">
|
||||
<img src="" id="addIconPicUrl" style="height:44px;" alt="">
|
||||
<input type="file" id="addUploadIconPic" name="uploadFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success" type="button" id="uploadBtn">上传</button>
|
||||
<input type="hidden" id="pic" name="pic" class="form-control" />
|
||||
<a href="javascript:void(0)" id="removeIconPic">清除</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-4 control-label">装扮状态:</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="status" id="status" data-btn-class="btn-warning" class="form-control">
|
||||
<option value="1">有效</option>
|
||||
<option value="2">无效</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="button-save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 为用户赠送铭牌弹窗 -->
|
||||
<div class="modal fade" id="sendModal" 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">x</span></button>
|
||||
<h4 class="modal-title" id="modalSendLabel">赠送装扮</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="sendForm">
|
||||
<input type="hidden" name="id" id="sendId" />
|
||||
<div class="form-group">
|
||||
<label for="sendErbanNo" class="col-sm-3 control-label">ID</label>
|
||||
<div class="col-sm-9">
|
||||
<textarea name="erbanNos" id="sendErbanNo" class="form-control validate[required]"
|
||||
placeholder="多个ID使用,分隔,一次性不得超过100个"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="sendDays" class="col-sm-3 control-label">赠送天数</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" name="days" id="sendDays" class="form-control validate[required]" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="sendDesc" class="col-sm-3 control-label">备注</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" name="remake" id="sendDesc" class="form-control validate[required]" />
|
||||
</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="send">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "InfocardManageView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: '装扮id', align: 'middle', width: '5%' },
|
||||
{ field: 'name', title: '装扮名称', align: 'middle', width: '5%' },
|
||||
{
|
||||
field: 'pic',
|
||||
title: '装扮图片',
|
||||
align: 'middle',
|
||||
valign: 'middle',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return "<img style='max-width: 200px;max-height: 200px' src='" + val + "'>";
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'type', title: '装扮类型', align: 'middle', width: '5%',
|
||||
formatter: function (val) {
|
||||
if (val === 1) {
|
||||
return '普通装扮';
|
||||
} else if (val === 2) {
|
||||
return '贵族装扮';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status', title: '状态', align: 'middle', width: '5%',
|
||||
formatter: function (val) {
|
||||
if (val === 1) {
|
||||
return '有效';
|
||||
} else if (val === 2) {
|
||||
return '无效';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '添加时间',
|
||||
align: 'middle',
|
||||
width: '5%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:00");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: '操作',
|
||||
align: 'middle',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
let isSendDisabled = false;
|
||||
if (row.type === 2) {
|
||||
isSendDisabled = true;
|
||||
}
|
||||
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 id="btnSend" name="btnSend" class="btn btn-sm btn-success opt-send" data-id=' + val + " " + `${isSendDisabled ? ' disabled ' : ''}` + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 赠送</button> ';
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 30, 50],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "-",
|
||||
uniqueId: "id",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
type: $('#type').val(),
|
||||
name: $('#name').val(),
|
||||
id: $('#id').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/infocard/listByPage',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
// 编辑
|
||||
$("#table").on("click", '#btnEdit', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
var row = $('#table').bootstrapTable('getRowByUniqueId', id);
|
||||
// 赋值
|
||||
$("#addForm #modal_id").val(row.id);
|
||||
$("#addForm #modal_type").val(row.type);
|
||||
$("#addForm #modal_name").val(row.name);
|
||||
$('#addIconPicUrl').attr("src", row.pic);
|
||||
$("#addForm #pic").val(row.pic);
|
||||
$("#addForm #status").val(row.status);
|
||||
$("#addModal").modal('show');
|
||||
});
|
||||
|
||||
|
||||
$('#uploadBtn').on('click', function () {
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/upload/img',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.path) {
|
||||
$('#pic').val(json.path);
|
||||
$('#addIconPicUrl').attr("src", json.path);
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
};
|
||||
$("#addForm").ajaxSubmit(options);
|
||||
});
|
||||
|
||||
|
||||
$('#removeIconPic').on('click', function () {
|
||||
$('#addIconPicUrl').attr('src', '');
|
||||
$('#addUploadIconPic').val('');
|
||||
$('#iconPic').val('');
|
||||
});
|
||||
|
||||
//打开新增页面
|
||||
$('#btnAdd').on('click', function () {
|
||||
cleanModal();
|
||||
$("#addModal").modal('show');
|
||||
});
|
||||
|
||||
|
||||
//保存
|
||||
$('#button-save').on('click', function () {
|
||||
var pic = $('#pic').val();
|
||||
var name = $('#modal_name').val();
|
||||
//做下数据校验
|
||||
if (isEmpty(name)) {
|
||||
$("#tipMsg").text("装扮名字不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (isEmpty(pic)) {
|
||||
$("#tipMsg").text("图片不能为空");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if ($("#addForm").validationEngine('validate')) {
|
||||
console.log('$("#addForm").serialize()', $("#addForm").serialize())
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/infocard/saveOrUpdate",
|
||||
data: $("#addForm").serialize(),
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#addModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败,错误信息:" + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//打开赠送弹窗
|
||||
$("#table").on('click', '.opt-send', function () {
|
||||
//清除数据
|
||||
$('#sendModal').find('input').val('');
|
||||
$('#sendModal').find('textarea').val('');
|
||||
//设置数据
|
||||
var id = $(this).attr("data-id");
|
||||
$('#sendId').val(id);
|
||||
$('#sendModal').modal('show');
|
||||
});
|
||||
|
||||
//同步用户铭牌
|
||||
$("#table").on('click', '.opt-sync', function () {
|
||||
//设置数据
|
||||
var id = $(this).attr("data-id");
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/nameplate/sync.action",
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("同步成功");
|
||||
$("#tipModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("同步失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//赠送
|
||||
$("#send").click(function () {
|
||||
// debugger;
|
||||
var erbanNo = $('#sendErbanNo').val().trim();//去掉首尾的空格和换行符
|
||||
if (!(erbanNo.length > 0)) {
|
||||
$("#tipMsg").text("请输入ID");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (erbanNo.length > 100) {
|
||||
$("#tipMsg").text("单次赠送用户不得超过100");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$('#sendDays').val()) {
|
||||
$("#tipMsg").text("请输入天数");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
var sendDays = $('#sendDays').val();
|
||||
var sendDesc = $('#sendDesc').val();
|
||||
var sendId = $('#sendId').val();
|
||||
$("#tipMsg").text("赠送中,请稍后...");
|
||||
$("#tipModal").modal('show');
|
||||
if ($("#sendForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/infocard/send",
|
||||
data: {
|
||||
erbanNos: erbanNo,
|
||||
days: sendDays,
|
||||
cardId: sendId,
|
||||
remark: sendDesc
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
$('#sendModal').modal('hide');
|
||||
$("#tipMsg").text(json.message);
|
||||
TableHelper.doRefresh("#table");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function cleanModal() {
|
||||
$('#id').val('');
|
||||
$('#addIconPicUrl').attr('src', '');
|
||||
$('#addUploadIconPic').val('');
|
||||
$('#pic').val('');
|
||||
$('#status').val('');
|
||||
$('#modal_type').val('');
|
||||
$('#modal_name').val('');
|
||||
}
|
||||
//判断空值
|
||||
function isEmpty(data) {
|
||||
if (data == null || data == undefined || data == "") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fixed-table-body {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.pull-left {
|
||||
width: 100% !important;
|
||||
}</style>
|
250
src/views/infocard/InfocardRecordView.vue
Normal file
250
src/views/infocard/InfocardRecordView.vue
Normal file
@@ -0,0 +1,250 @@
|
||||
<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-2 control-label">用户ID:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" name="erbanNo" id="erbanNo" placeholder="">
|
||||
</div>
|
||||
<label for="cardId" class="col-sm-2 control-label">装扮ID:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" name="cardId" id="cardId" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "InfocardRecordView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: 'id', visible: false, align: 'center', width: '5%' },
|
||||
{ field: 'cardId', title: '装扮ID', align: 'center', width: '5%' },
|
||||
{ field: 'cardName', title: '装扮名称', align: 'center', width: '5%' },
|
||||
{ field: 'erbanNo', title: '获得用户ID', align: 'center', width: '5%' },
|
||||
{ field: 'nick', title: '用户昵称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'comeFrom', title: '获得来源', align: 'center', width: '5%',
|
||||
formatter: function (val) {
|
||||
if (val === 1) {
|
||||
return '获得贵族身份';
|
||||
} else if (val === 2) {
|
||||
return '后台手动发放';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime', title: '获得时间', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:00");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'days', title: '有效期(天)', align: 'center', width: '5%' },
|
||||
{ field: 'remake', title: '备注', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'status', title: '状态', align: 'center', width: '5%',
|
||||
formatter: function (val) {
|
||||
if (val === 1) {
|
||||
return '正常';
|
||||
} else if (val === 2) {
|
||||
return '已撤回';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'optTime', title: '撤回时间', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:00");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'opt',
|
||||
title: '操作',
|
||||
align: 'middle',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
let isRecoveryDisabled = false;
|
||||
let text = '撤回';
|
||||
if (row.comeFrom === 1 || row.status === 2) {
|
||||
isRecoveryDisabled = true;
|
||||
}
|
||||
if (row.status === 2) {
|
||||
text = '已撤回';
|
||||
}
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + row.id + " " + `${isRecoveryDisabled ? ' disabled ' : ''}` + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i>' + `${text}` + '</button> ';
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 50, 100],
|
||||
uniqueId: "id",
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "-",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
cardId: $('#cardId').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax: function (request) { //使用ajax请求
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/admin/infocard/listRecordByPage',
|
||||
contentType: 'application/json;charset=utf-8',
|
||||
dataType: 'json',
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
rows: res.rows,
|
||||
total: res.total
|
||||
});
|
||||
// $('#table-request').bootstrapTable('load', res.data.rows);
|
||||
},
|
||||
error: function (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
// 撤回
|
||||
$("#table").on("click", '#btnEdit', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/infocard/recoveryInfoCard",
|
||||
data: { recordId: id },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败, " + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
TableHelper.doRefresh('#table');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#imgMask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#imgMask img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.control-span {
|
||||
padding-top: 7px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.ul-li {
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.ul-i {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.i-font {
|
||||
color: #00acd6;
|
||||
}
|
||||
|
||||
.ul-li label {
|
||||
color: #c9cccf;
|
||||
}
|
||||
|
||||
.fixed-table-body {
|
||||
height: auto !important;
|
||||
}</style>
|
448
src/views/vip/VipAuthManageView.vue
Normal file
448
src/views/vip/VipAuthManageView.vue
Normal file
@@ -0,0 +1,448 @@
|
||||
<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="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></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="modal_seq" class="col-sm-3 control-label">排序<font color="red">*</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control validate[custom[integer]]" name="seq" id="modal_seq"
|
||||
placeholder="数字小的排前面,必填">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="modal_authName" 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="authName"
|
||||
id="modal_authName">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="modal_authDesc" 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="authDesc"
|
||||
id="modal_authDesc">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="modal_authIntro" 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="authIntro"
|
||||
id="modal_authIntro">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">icon<font color="red">*</font>:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="iconImgUrl" style='width:108px;height:45px;' alt="">
|
||||
<input type="file" id="iconFile" name='uploadFile'
|
||||
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
|
||||
<button class="btn btn-success" type='button' id="iconBtn">上传</button>
|
||||
<input type="hidden" id="iconUrl" name='authIcon' class="form-control validate[required]">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">描述图片<font color="red">*</font>:</label>
|
||||
<div class="col-sm-8">
|
||||
<img src="" id="descPicImgUrl" style='width:108px;height:45px;' alt="">
|
||||
<input type="file" id="descPicFile" name='uploadFile'
|
||||
accept='image/gif,image/jpeg,image/jpg,image/png,image/svg'>
|
||||
<button class="btn btn-success" type='button' id="descPicBtn">上传</button>
|
||||
<input type="hidden" id="descPicUrl" name='descPic' class="form-control validate[required]">
|
||||
</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>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "VipAuthManageView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'seq', title: '排序', visible: false, align: 'center', width: '5%' },
|
||||
{ field: 'authName', title: '特权名称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'authIcon',
|
||||
title: 'icon',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='40' height='40'>";
|
||||
}
|
||||
},
|
||||
{ field: 'authDesc', title: '短描述', align: 'center', width: '5%' },
|
||||
{ field: 'authIntro', title: '长描述', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'descPic',
|
||||
title: '描述图片',
|
||||
align: 'center',
|
||||
valign: 'middle',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
return "<img src='" + val + "' width='40' height='40'>";
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'opt',
|
||||
title: '操作',
|
||||
align: 'middle',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
let isRecoveryDisabled = false;
|
||||
let text = '编辑';
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + row.id + " " + `${isRecoveryDisabled ? ' disabled ' : ''}` + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i>' + `${text}` + '</button> ';
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 50, 100],
|
||||
uniqueId: "id",
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "-",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax: function (request) { //使用ajax请求
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/admin/vipAuthInfo/listByPage.action',
|
||||
contentType: 'application/json;charset=utf-8',
|
||||
dataType: 'json',
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
rows: res.rows,
|
||||
total: res.total
|
||||
});
|
||||
// $('#table-request').bootstrapTable('load', res.data.rows);
|
||||
},
|
||||
error: function (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* icon上传
|
||||
*/
|
||||
$('#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);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
/**
|
||||
* icon上传
|
||||
*/
|
||||
$('#descPicBtn').on('click', function () {
|
||||
if ($('#descPicFile').val() == '') {
|
||||
$('#tipMsg').text('上传图片为空');
|
||||
$('#tipModal').modal('show');
|
||||
return;
|
||||
}
|
||||
$.ajaxFileUpload({
|
||||
fileElementId: 'descPicFile', //需要上传的文件域的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) {
|
||||
$('#descPicUrl').val(json.path);
|
||||
$('#descPicImgUrl').attr("src", json.path);
|
||||
|
||||
console.log(json.path);
|
||||
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
},
|
||||
error: function (data, status, e) { //提交失败自动执行的处理函数。
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
$("#add").click(function () {
|
||||
var id = $("#id").val();
|
||||
var seq = $("#modal_seq").val();
|
||||
var authName = $("#modal_authName").val();
|
||||
var authDesc = $("#modal_authDesc").val();
|
||||
var authIntro = $("#modal_authIntro").val();
|
||||
|
||||
var authIcon = $("#iconUrl").val();
|
||||
var descPic = $("#descPicUrl").val();
|
||||
|
||||
|
||||
if (authIcon == null || authIcon == '') {
|
||||
$("#tipMsg").text("保存失败,请先上传icon!");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
|
||||
if (descPic == null || descPic == '') {
|
||||
$("#tipMsg").text("保存失败,请先上传描述图片!");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#addForm").validationEngine('validate')) {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/vipAuthInfo/save.action",
|
||||
data: {
|
||||
id: id,
|
||||
seq: seq,
|
||||
authName: authName,
|
||||
authDesc: authDesc,
|
||||
authIntro: authIntro,
|
||||
authIcon: authIcon,
|
||||
descPic: descPic
|
||||
},
|
||||
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/vipAuthInfo/getVipAuthInfoById.action",
|
||||
data: { id: id },
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
var json = res.data;
|
||||
if (json) {
|
||||
$("#id").val(id);
|
||||
$("#modal_seq").val(json.seq);
|
||||
$("#modal_authName").val(json.authName);
|
||||
$("#modal_authDesc").val(json.authDesc);
|
||||
$("#modal_authIntro").val(json.authIntro);
|
||||
|
||||
$('#iconUrl').val(json.authIcon);
|
||||
$('#iconImgUrl').attr('src', json.authIcon);
|
||||
|
||||
$('#descPicUrl').val(json.descPic);
|
||||
$('#descPicImgUrl').attr('src', json.descPic);
|
||||
|
||||
|
||||
// 打开编辑弹窗
|
||||
$("#roomTagModal").modal('show');
|
||||
$("#modalLabel").text("编辑特权信息");
|
||||
} else {
|
||||
$("#tipMsg").text("获取信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function clearModal() {
|
||||
$("#id").val('');
|
||||
$("#modal_seq").val('');
|
||||
$("#modal_authName").val('');
|
||||
$("#modal_authDesc").val('');
|
||||
$("#modal_authIntro").val('');
|
||||
|
||||
$('#iconUrl').val('');
|
||||
$('#iconImgUrl').attr('src', '');
|
||||
$('#iconFile').val('');
|
||||
|
||||
$('#descPicUrl').val('');
|
||||
$('#descPicImgUrl').attr('src', '');
|
||||
$('#descPicFile').val('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#imgMask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#imgMask img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.control-span {
|
||||
padding-top: 7px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.ul-li {
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.ul-i {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.i-font {
|
||||
color: #00acd6;
|
||||
}
|
||||
|
||||
.ul-li label {
|
||||
color: #c9cccf;
|
||||
}
|
||||
|
||||
.fixed-table-body {
|
||||
height: auto !important;
|
||||
}</style>
|
430
src/views/vip/VipFaceView.vue
Normal file
430
src/views/vip/VipFaceView.vue
Normal file
@@ -0,0 +1,430 @@
|
||||
<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="faceId" class="col-sm-2 control-label">表情id:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="faceId"
|
||||
placeholder="请输入表情id"></div>
|
||||
|
||||
<label for="faceName" class="col-sm-2 control-label">表情名:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="faceName"
|
||||
placeholder="请输入表情名"></div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="queryClanLevel" class="col-sm-2 control-label">可用贵族等级</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="queryClanLevel" name="queryClanLevel" class="input-sm">
|
||||
<option name="vipselect" value="">全部</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
<button id="addBtn" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>添加
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="addClanModal" 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="model_faceId" class="col-sm-3 control-label">表情Id:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="model_faceId" id="model_faceId">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addClanLevel" class="col-sm-3 control-label">可用贵族等级<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="addClanLevel" name="addClanLevel" class="input-sm">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="model_status" class="col-sm-3 control-label">是否在前端展示<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="status" id="model_status" class="form-control validate[required]">
|
||||
<option value=""></option>
|
||||
<option value="1">展示</option>
|
||||
<option value="2">不展示</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>
|
||||
|
||||
<div class="modal fade" id="updateClanModal" 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="updateModalLabel">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="updateForm">
|
||||
<input type="hidden" name="id" id="updateId" />
|
||||
|
||||
<div class="col-sm-8" hidden="hidden">
|
||||
<input hidden="hidden" type="text" class="form-control " name="updatemodule_itemId"
|
||||
id="updatemodule_itemId" placeholder="id">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="updatemodule_faceId" class="col-sm-3 control-label">表情Id:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="updatemodule_faceId" id="updatemodule_faceId">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="updateVipLevel" class="col-sm-3 control-label">可用贵族等级<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="updateVipLevel" name="updateVipLevel" class="input-sm">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="updatemodule_status" class="col-sm-3 control-label">是否在前端展示<font color="red">*
|
||||
</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="status" id="updatemodule_status" class="form-control validate[required]">
|
||||
<option value=""></option>
|
||||
<option value="1">展示</option>
|
||||
<option value="2">不展示</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="updateClan">确定</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
let tableLoaded = false;
|
||||
let currParams = {};
|
||||
export default {
|
||||
name: "VipFaceView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'itemId', title: 'id', align: 'center', width: '5%' },
|
||||
{ field: 'faceId', title: '表情id', align: 'center', width: '5%' },
|
||||
{ field: 'faceName', title: '表情名', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'level', title: '可用贵族等级', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
const vipName = getBySelectValue(val)
|
||||
console.log(vipName);
|
||||
return `${val}-${vipName}`;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '添加时间',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status', title: '是否在前端展示', align: 'center', valign: 'middle', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return '展示';
|
||||
} else {
|
||||
return '不展示';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
itemId: 'itemId',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
const itemId = row.itemId;
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" itemId=' + itemId + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
||||
'<button class="btn btn-sm btn-danger opt-remove" itemId=' + itemId +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
undefinedText: 0,
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100, 200, 300, 500],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
faceName: $('#faceName').val(),
|
||||
faceId: $('#faceId').val(),
|
||||
level: $("#queryClanLevel").val()
|
||||
};
|
||||
currParams = param;
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/vip/faceLlist.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
tableLoaded = true;
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
if (tableLoaded || currParams.pageNumber > 1) {
|
||||
TableHelper.doRefreshAndToPage1('#table');
|
||||
} else {
|
||||
TableHelper.doRefresh('#table');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//新建标签
|
||||
$("#addBtn").click(function () {
|
||||
$("#model_faceId").val(""),
|
||||
$("#modal_status").val("");
|
||||
$("#addClanModal").modal('show');
|
||||
});
|
||||
|
||||
//获取表情信息
|
||||
$('#table').on('click', '.opt-edit', function () {
|
||||
console.log(this)
|
||||
const itemId = $(this).attr('itemId');
|
||||
// var id = $(this).attr("data-id");
|
||||
console.log("itemId=======", itemId)
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/faceInfo.action",
|
||||
data: {
|
||||
id: itemId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
console.log(json.data)
|
||||
$("#updatemodule_itemId").val(json.data.itemId);
|
||||
$("#updatemodule_faceId").val(json.data.faceId);
|
||||
if (json.data.status == 1) {
|
||||
$("#updatemodule_status").val(1);
|
||||
} else {
|
||||
$("#updatemodule_status").val(2);
|
||||
}
|
||||
$("#updateVipLevel").val(json.data.level);
|
||||
} else {
|
||||
$("#tipMsg").text("获取表情信息失败." + json.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
$("#updateId").val(itemId);
|
||||
$("#updateClanModal").modal('show');
|
||||
});
|
||||
|
||||
|
||||
//删除表情
|
||||
$('#table').on('click', '.opt-remove', function () {
|
||||
const itemId = $(this).attr('itemId');
|
||||
console.log("itemId=======", itemId)
|
||||
if (confirm("你确认删除该表情吗?")) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/faceDel.action",
|
||||
data: {
|
||||
id: itemId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
console.log(json.data)
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除表情失败." + json.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 编辑
|
||||
$("#updateClan").click(function () {
|
||||
console.log("this", this);
|
||||
console.log("faceId", $("#updatemodule_faceId").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/faceSaveOrUpdate.action",
|
||||
data: {
|
||||
id: $("#updatemodule_itemId").val(),
|
||||
faceId: $("#updatemodule_faceId").val(),
|
||||
status: $("#updatemodule_status").val(),
|
||||
level: $("#updateVipLevel").val(),
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#btnSearch").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 新增
|
||||
$("#add").click(function () {
|
||||
console.log("this", this);
|
||||
console.log("faceId", $("#updatemodule_faceId").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/faceSaveOrUpdate.action",
|
||||
data: {
|
||||
faceId: $("#model_faceId").val(),
|
||||
status: $("#model_status").val(),
|
||||
level: $("#addClanLevel").val(),
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagEditModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/vipInfoList.action",
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
renderLevelSelector(json.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var options = [];
|
||||
options.push('<option name="vipselect" value="">全部</option>')
|
||||
var options2 = [];
|
||||
function renderLevelSelector(levelList) {
|
||||
levelList.forEach(item => {
|
||||
options.push(`<option name="vipselect" value="${item.vipLevel}">${item.vipName}</option>`)
|
||||
options2.push(`<option name="vipselect" value="${item.vipLevel}">${item.vipName}</option>`)
|
||||
});
|
||||
$('#queryClanLevel').html(options.join())
|
||||
$('#addClanLevel').html(options2.join())
|
||||
$('#updateVipLevel').html(options2.join())
|
||||
}
|
||||
function getBySelectValue(val) {
|
||||
var sel = document.getElementsByName('vipselect');
|
||||
let value;
|
||||
for (var i = 0, j = sel.length; i < j; ++i) {
|
||||
if (sel[i].value == val) {
|
||||
value = sel[i].text
|
||||
sel.selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
440
src/views/vip/VipGiftView.vue
Normal file
440
src/views/vip/VipGiftView.vue
Normal file
@@ -0,0 +1,440 @@
|
||||
<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="giftId" class="col-sm-2 control-label">礼物id:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="giftId"
|
||||
placeholder="请输入礼物id"></div>
|
||||
|
||||
<label for="giftName" class="col-sm-2 control-label">礼物名称:</label>
|
||||
<div class="col-sm-4"><input type="text" class="form-control" name="name" id="giftName"
|
||||
placeholder="请输入礼物名称"></div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<label for="queryClanLevel" class="col-sm-2 control-label">可用贵族等级</label>
|
||||
<div class="col-sm-4">
|
||||
<select id="queryClanLevel" name="queryClanLevel" class="input-sm">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
<button id="addBtn" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>添加
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal fade" id="addClanModal" 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="model_giftId" class="col-sm-3 control-label">礼物id:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="model_giftId" id="model_giftId">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="addClanLevel" class="col-sm-3 control-label">可用贵族等级<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="addClanLevel" name="addClanLevel" class="input-sm">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="model_status" class="col-sm-3 control-label">是否在前端展示<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="status" id="model_status" class="form-control validate[required]">
|
||||
<option value=""></option>
|
||||
<option value="1">展示</option>
|
||||
<option value="2">不展示</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>
|
||||
|
||||
<div class="modal fade" id="updateClanModal" 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="updateModalLabel">编辑</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="updateForm">
|
||||
<input type="hidden" name="id" id="updateId" />
|
||||
|
||||
<div class="col-sm-8" hidden="hidden">
|
||||
<input hidden="hidden" type="text" class="form-control " name="updatemodule_itemId"
|
||||
id="updatemodule_itemId" placeholder="id">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="updatemodule_giftId" class="col-sm-3 control-label">礼物id:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="updatemodule_giftId" id="updatemodule_giftId">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="updateVipLevel" class="col-sm-3 control-label">可用贵族等级<font color="red">*</font>
|
||||
:</label>
|
||||
<div class="col-sm-9">
|
||||
<select id="updateVipLevel" name="updateVipLevel" class="input-sm">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="updatemodule_status" class="col-sm-3 control-label">是否在前端展示<font color="red">*
|
||||
</font>:</label>
|
||||
<div class="col-sm-9">
|
||||
<select name="status" id="updatemodule_status" class="form-control validate[required]">
|
||||
<option value=""></option>
|
||||
<option value="1">展示</option>
|
||||
<option value="2">不展示</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="updateClan">确定</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
let tableLoaded = false;
|
||||
let currParams = {};
|
||||
export default {
|
||||
name: "VipGiftView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'itemId', title: 'id', align: 'center', width: '5%' },
|
||||
{ field: 'giftId', title: '礼物id', align: 'center', width: '5%' },
|
||||
{ field: 'giftName', title: '礼物名称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'giftUrl', 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: 'giftGold', title: '价格', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'level', title: '可用贵族等级', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
const vipName = getBySelectValue(val)
|
||||
console.log(vipName);
|
||||
return `${val}-${vipName}`;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '添加时间',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
valign: 'middle',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status', title: '是否在前端展示', align: 'center', valign: 'middle', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return '展示';
|
||||
} else {
|
||||
return '不展示';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
itemId: 'itemId',
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '10%',
|
||||
formatter: function (val, row, index) {
|
||||
const itemId = row.itemId;
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" itemId=' + itemId + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
|
||||
'<button class="btn btn-sm btn-danger opt-remove" itemId=' + itemId +
|
||||
'><i class="glyphicon glyphicon-remove"></i>删除</button>';
|
||||
}
|
||||
}
|
||||
],
|
||||
undefinedText: 0,
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [20, 50, 100, 200, 300, 500],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
giftName: $('#giftName').val(),
|
||||
giftId: $('#giftId').val(),
|
||||
level: $("#queryClanLevel").val()
|
||||
};
|
||||
currParams = param;
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/vip/giftLlist.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
tableLoaded = true;
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
if (tableLoaded || currParams.pageNumber > 1) {
|
||||
TableHelper.doRefreshAndToPage1('#table');
|
||||
} else {
|
||||
TableHelper.doRefresh('#table');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//新建标签
|
||||
$("#addBtn").click(function () {
|
||||
$("#model_giftId").val(""),
|
||||
$("#modal_status").val("");
|
||||
$("#addClanModal").modal('show');
|
||||
});
|
||||
|
||||
//获取表情信息
|
||||
$('#table').on('click', '.opt-edit', function () {
|
||||
console.log(this)
|
||||
const itemId = $(this).attr('itemId');
|
||||
// var id = $(this).attr("data-id");
|
||||
console.log("itemId=======", itemId)
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/giftInfo.action",
|
||||
data: {
|
||||
id: itemId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
console.log(json.data)
|
||||
$("#updatemodule_itemId").val(json.data.itemId);
|
||||
$("#updatemodule_giftId").val(json.data.giftId);
|
||||
if (json.data.status == 1) {
|
||||
$("#updatemodule_status").val(1);
|
||||
} else {
|
||||
$("#updatemodule_status").val(2);
|
||||
}
|
||||
$("#updateVipLevel").val(json.data.level);
|
||||
} else {
|
||||
$("#tipMsg").text("获取表情信息失败." + json.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
$("#updateId").val(itemId);
|
||||
$("#updateClanModal").modal('show');
|
||||
});
|
||||
|
||||
|
||||
//删除表情
|
||||
$('#table').on('click', '.opt-remove', function () {
|
||||
const itemId = $(this).attr('itemId');
|
||||
console.log("itemId=======", itemId)
|
||||
if (confirm("你确认删除该表情吗?")) {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/giftDel.action",
|
||||
data: {
|
||||
id: itemId,
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
console.log(json.data)
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("删除表情失败." + json.message);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 编辑
|
||||
$("#updateClan").click(function () {
|
||||
console.log("this", this);
|
||||
console.log("giftId", $("#updatemodule_giftId").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/giftSaveOrUpdate.action",
|
||||
data: {
|
||||
id: $("#updatemodule_itemId").val(),
|
||||
giftId: $("#updatemodule_giftId").val(),
|
||||
status: $("#updatemodule_status").val(),
|
||||
level: $("#updateVipLevel").val(),
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#btnSearch").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 新增
|
||||
$("#add").click(function () {
|
||||
console.log("this", this);
|
||||
console.log("giftId", $("#updatemodule_giftId").val());
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/giftSaveOrUpdate.action",
|
||||
data: {
|
||||
giftId: $("#model_giftId").val(),
|
||||
status: $("#model_status").val(),
|
||||
level: $("#addClanLevel").val(),
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
$("#roomTagEditModal").modal('hide');
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败." + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/vip/vipInfoList.action",
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.success) {
|
||||
renderLevelSelector(json.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var options = [];
|
||||
options.push('<option name="vipselect" value="">全部</option>')
|
||||
var options2 = [];
|
||||
function renderLevelSelector(levelList) {
|
||||
levelList.forEach(item => {
|
||||
options.push(`<option name="vipselect" value="${item.vipLevel}">${item.vipName}</option>`)
|
||||
options2.push(`<option name="vipselect" value="${item.vipLevel}">${item.vipName}</option>`)
|
||||
});
|
||||
$('#queryClanLevel').html(options.join())
|
||||
$('#addClanLevel').html(options2.join())
|
||||
$('#updateVipLevel').html(options2.join())
|
||||
}
|
||||
|
||||
function getBySelectValue(val) {
|
||||
var sel = document.getElementsByName('vipselect');
|
||||
let value;
|
||||
for (var i = 0, j = sel.length; i < j; ++i) {
|
||||
if (sel[i].value == val) {
|
||||
value = sel[i].text
|
||||
sel.selectedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
651
src/views/vip/VipManageView.vue
Normal file
651
src/views/vip/VipManageView.vue
Normal file
@@ -0,0 +1,651 @@
|
||||
<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>
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" style="width: 500px;">
|
||||
<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="vipLevel" id="vipLevel" />
|
||||
<div class="form-group">
|
||||
<label for="vipName" class="col-sm-4 control-label">名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="vipName" id="vipName"
|
||||
disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">贵族中心大图:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="file" id="logoUploadIconPic" name="uploadFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success upload fromBtn" name="vipLogo" type="button"
|
||||
id="logoUploadBtn">上传</button>
|
||||
<input type="text" id="vipLogo" name="vipLogo"
|
||||
class="form-control upload-input-vipLogo" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">贵族Icon:</label>
|
||||
<div class="col-sm-6">
|
||||
<img src="" id="iconPicUrl" name="vipIcon" style="height:44px;" alt="">
|
||||
<input type="file" id="iconUploadIconPic" name="uploadFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success upload fromBtn" name="vipIcon" type="button"
|
||||
id="iconUploadBtn">上传</button>
|
||||
<input type="hidden" id="vipIcon" name="vipIcon"
|
||||
class="form-control upload-input-vipIcon" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">贵族升级飘屏背景:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="file" id="floatUploadIconPic" name="uploadFile"
|
||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||
<button class="btn btn-success upload fromBtn" name="floatPic" type="button"
|
||||
id="floatUploadBtn">上传</button>
|
||||
<input type="text" id="floatPic" name="floatPic"
|
||||
class="form-control upload-input-floatPic" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="levelKeepScore" class="col-sm-4 control-label">保级值:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="levelKeepScore"
|
||||
id="levelKeepScore" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="levelUpScore" class="col-sm-4 control-label">升级值:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required]" name="name" id="levelUpScore"
|
||||
disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="comingSoon" class="col-sm-4 control-label">是否敬请期待:</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="comingSoon" id="comingSoon" data-btn-class="btn-warning"
|
||||
class="form-control" disabled="disabled">
|
||||
<option value="1">否</option>
|
||||
<option value="2">是</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!--权限-->
|
||||
<div id="authDiv">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="namePlateIds" value="1" />贵族铭牌
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-1"
|
||||
name="namePlateIds" id="namePlateIds" placeholder="请输入铭牌id,多个用,隔开">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="infoCardIds" value="5"
|
||||
data-refitemname="info-card" />贵族资料卡
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-5"
|
||||
name="infoCardIds" id="infoCardIds" placeholder="请输入资料卡id,多个用,隔开">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" class="authCheckBox" name="hasGift" style="margin-left: 80px"
|
||||
value="4" />贵族礼物
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="levelBuffValue"
|
||||
value="6" />财富值经验加成
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-6"
|
||||
name="levelBuffValue" id="levelBuffValue" placeholder="不可超过1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="checkbox" class="authCheckBox" name="hasFace" style="margin-left: 80px"
|
||||
value="7" />贵族表情
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="micCircleLogo" value="8"
|
||||
style="margin-left: 60px" />麦序光圈
|
||||
</label>
|
||||
<div class="col-sm-6 refBoxValue-8">
|
||||
<input type="file" id="micCircleUploadIconPic" name="uploadFile">
|
||||
<button class="btn btn-success upload fromBtn" name="micCircleLogo" type="button"
|
||||
id="micCircleUploadBtn">上传</button>
|
||||
<input type="text" id="micCircleLogo" name="micCircleLogo"
|
||||
class="form-control validate[required] upload-input-micCircleLogo" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="nickColorValue" value="9" />麦位昵称颜色
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-9"
|
||||
name="nickColorValue" id="nickColorValue">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="friendNickColorValue"
|
||||
value="10" />好友昵称颜色
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-10"
|
||||
name="friendNickColorValue" id="friendNickColorValue">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="chatBubbleValue" value="11" />聊天气泡
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-11"
|
||||
name="chatBubbleValue" id="chatBubbleValue">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="carValue" value="3" />座驾
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-3"
|
||||
name="carValue" id="carValue">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="roomHornValue"
|
||||
value="14" />房间小喇叭次数
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-14"
|
||||
name="roomHornValue" id="roomHornValue">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="enterRoomEffects"
|
||||
value="12" />进场特效
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control validate[required] refBoxValue-12"
|
||||
name="enterRoomEffects" id="enterRoomEffects">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="enterHide" value="13" />隐身进房
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">
|
||||
<input type="checkbox" class="authCheckBox" name="preventKick" value="15" />防被踢
|
||||
</label>
|
||||
</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="button-save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
let vipMap = {};
|
||||
let authItems = {};
|
||||
const VIP_AUTH_TYPE = {
|
||||
/**
|
||||
* 铭牌
|
||||
*/
|
||||
NAMEPLATE: 1,
|
||||
/**
|
||||
* 头饰
|
||||
*/
|
||||
HEADWEAR: 2,
|
||||
/**
|
||||
* 座驾
|
||||
*/
|
||||
CAR: 3,
|
||||
/**
|
||||
* 礼物
|
||||
*/
|
||||
GIFT: 4,
|
||||
/**
|
||||
* 用户资料卡
|
||||
*/
|
||||
USER_INFO_CARD: 5,
|
||||
/**
|
||||
* 财富等级提成
|
||||
*/
|
||||
LEVEL_EXP_BUFF: 6,
|
||||
/**
|
||||
* 表情
|
||||
*/
|
||||
FACE: 7,
|
||||
/**
|
||||
* 麦位光圈
|
||||
*/
|
||||
MIC_CIRCLE: 8,
|
||||
/**
|
||||
* 麦位昵称颜色
|
||||
*/
|
||||
MIC_NICK_COLOUR: 9,
|
||||
/**
|
||||
* 好友昵称颜色
|
||||
*/
|
||||
FRIEND_NICK_COLOUR: 10,
|
||||
/**
|
||||
* 聊天气泡
|
||||
*/
|
||||
ROOM_CHAT_BUBBLE: 11,
|
||||
/**
|
||||
* 进场特效
|
||||
*/
|
||||
IN_ROOM_SPECIAL_EFFECTS: 12,
|
||||
/**
|
||||
* 隐身进房
|
||||
*/
|
||||
INVISIBLE_IN_ROOM: 13,
|
||||
/**
|
||||
* 房间小喇叭
|
||||
*/
|
||||
ROOM_HORN: 14,
|
||||
/**
|
||||
* 防被踢
|
||||
*/
|
||||
PREVENT_KICK: 15,
|
||||
|
||||
}
|
||||
export default {
|
||||
name: "VipManageView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'vipLevel', title: '贵族等级', align: 'center', width: '5%' },
|
||||
{ field: 'vipName', title: '贵族名称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'vipIcon', title: '贵族icon', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
return "<img style='max-width: 40px;max-height: 40px' src='" + val + "'>";
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'levelKeepScore', title: '保级值', align: 'center', width: '5%' },
|
||||
{ field: 'levelUpScore', title: '所需升级值', align: 'center', width: '5%' },
|
||||
{ field: 'comingSoon', title: '是否敬请祈祷', visible: false, align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'authItems', title: '贵族特权', align: 'center', width: '5%',
|
||||
formatter: function (val, row) {
|
||||
if (row.comingSoon == 2) {
|
||||
return '敬请期待';
|
||||
} else {
|
||||
const desc = buildTableAuthField(row.vipLevel)
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'opt',
|
||||
title: '操作',
|
||||
align: 'middle',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + row.vipLevel + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i>编辑</button> ';
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 50, 100],
|
||||
uniqueId: "id",
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "-",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax: function (request) { //使用ajax请求
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/admin/vip/listByPage',
|
||||
contentType: 'application/json;charset=utf-8',
|
||||
dataType: 'json',
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
for (let i = 0; i < res.rows.length; i++) {
|
||||
const vip = res.rows[i];
|
||||
vipMap[vip.vipLevel] = vip;
|
||||
}
|
||||
console.log(vipMap);
|
||||
request.success({
|
||||
rows: res.rows,
|
||||
total: res.total
|
||||
});
|
||||
},
|
||||
error: function (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
// 编辑
|
||||
$("#table").on("click", '#btnEdit', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
const vip = vipMap[id];
|
||||
console.log(vip)
|
||||
initEditModal(vip);
|
||||
initVipAuth(vip);
|
||||
|
||||
$("#editModal").modal('show');
|
||||
});
|
||||
|
||||
function initEditModal(val) {
|
||||
$('#addForm').find('input[type=text],input[type=hidden],input[type=file]').each(function () {
|
||||
$(this).val('');
|
||||
})
|
||||
// 清除复选框的值
|
||||
$(".authCheckBox").attr("checked", false)
|
||||
$(".authCheckBox").attr("checked", false)
|
||||
// 赋值
|
||||
$("#addForm #vipLevel").val(val.vipLevel);
|
||||
$("#addForm #vipName").val(val.vipName);
|
||||
$('#logoPicUrl').attr("src", val.vipLogo);
|
||||
$("#addForm #vipLogo").val(val.vipLogo);
|
||||
$('#iconPicUrl').attr("src", val.vipIcon);
|
||||
$("#addForm #vipIcon").val(val.vipIcon);
|
||||
$('#floatPicUrl').attr("src", val.floatPic);
|
||||
$("#addForm #floatPic").val(val.floatPic);
|
||||
$("#addForm #levelKeepScore").val(val.levelKeepScore);
|
||||
$("#addForm #levelUpScore").val(val.levelUpScore);
|
||||
$("#addForm #comingSoon").val(val.comingSoon);
|
||||
if (val.comingSoon === 2) {
|
||||
document.getElementById("authDiv").style.display = "none";
|
||||
} else {
|
||||
document.getElementById("authDiv").style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
function initVipAuth(val) {
|
||||
authItems = val.authItems;
|
||||
var boxes = document.getElementsByClassName("authCheckBox");
|
||||
for (let i = 0; i < boxes.length; i++) {
|
||||
for (const authType in authItems) {
|
||||
let value = authItems[authType];
|
||||
if (boxes[i].value === authType) {
|
||||
boxes[i].checked = true;
|
||||
// 展示具体的值
|
||||
const name = boxes[i].name;
|
||||
$('#' + `${name}`).val(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < boxes.length; i++) {
|
||||
const value = boxes[i].value;
|
||||
console.log(value)
|
||||
if (boxes[i].checked) {
|
||||
$('.refBoxValue-' + `${value}`).show();
|
||||
} else {
|
||||
$('.refBoxValue-' + `${value}`).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 上传图片
|
||||
$('.fromBtn').on('click', function () {
|
||||
const name = $(this).attr('name');
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/upload/img',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.path) {
|
||||
$('.upload-input-' + `${name}`).val(json.path);
|
||||
$(`img[name=${name}]`).attr("src", json.path);
|
||||
}
|
||||
}
|
||||
};
|
||||
$("#addForm").ajaxSubmit(options);
|
||||
});
|
||||
|
||||
// 更改checkBox
|
||||
$('.authCheckBox').click(
|
||||
function () {
|
||||
const value = $(this).attr('value');
|
||||
if ($(this).prop("checked")) {
|
||||
$('.refBoxValue-' + `${value}`).show();
|
||||
} else {
|
||||
$('.refBoxValue-' + `${value}`).hide();
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// 保存
|
||||
$('#button-save').on('click', function () {
|
||||
let params = buildSaveParams();
|
||||
console.log(params)
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '/admin/vip/updateVip',
|
||||
data: params,
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.code == 200) {
|
||||
$('#packModal').modal('hide');
|
||||
$('#tipMsg').text('保存成功');
|
||||
$('#tipModal').modal('show');
|
||||
TableHelper.doRefresh('#table')
|
||||
} else {
|
||||
$('#tipMsg').text('保存失败,错误码:' + res.message);
|
||||
$('#tipModal').modal('show');
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function buildSaveParams() {
|
||||
let authMap = {};
|
||||
var boxes = document.getElementsByClassName("authCheckBox");
|
||||
for (let i = 0; i < boxes.length; i++) {
|
||||
const value = boxes[i].value;
|
||||
const name = boxes[i].name;
|
||||
if (boxes[i].checked) {
|
||||
if (value == 4 || value == 7 || value == 13 || value == 15) {
|
||||
authMap[value] = 'true';
|
||||
} else if (value == 8) {
|
||||
console.log('name', name)
|
||||
authMap[value] = $('#' + `${name}`).val();
|
||||
} else {
|
||||
authMap[value] = $('.refBoxValue-' + `${value}`).val();
|
||||
}
|
||||
}
|
||||
}
|
||||
const param = {
|
||||
vipLevel: $("#addForm #vipLevel").val(),
|
||||
vipLogo: $("#addForm #vipLogo").val(),
|
||||
vipIcon: $("#addForm #vipIcon").val(),
|
||||
floatPic: $("#addForm #floatPic").val(),
|
||||
authMap: authMap
|
||||
};
|
||||
return param;
|
||||
}
|
||||
|
||||
function buildTableAuthField(vipLevel) {
|
||||
const vipInfo = vipMap[vipLevel];
|
||||
const authItems = vipInfo.authItems;
|
||||
const options = [];
|
||||
for (const authType in authItems) {
|
||||
let value = authItems[authType];
|
||||
let desc = getDescByType(authType);
|
||||
|
||||
if (authType == VIP_AUTH_TYPE.NAMEPLATE || authType == VIP_AUTH_TYPE.USER_INFO_CARD || authType == VIP_AUTH_TYPE.CAR
|
||||
|| authType == VIP_AUTH_TYPE.ROOM_CHAT_BUBBLE) {
|
||||
value = authItems[authType];
|
||||
} else if (authType == VIP_AUTH_TYPE.LEVEL_EXP_BUFF) {
|
||||
value = value * 100 + '%';
|
||||
} else {
|
||||
value = '';
|
||||
}
|
||||
options.push('' + desc + ' ' + value + ' <br>');
|
||||
}
|
||||
console.log('options', options)
|
||||
return options;
|
||||
}
|
||||
|
||||
function getDescByType(authType) {
|
||||
if (authType == VIP_AUTH_TYPE.NAMEPLATE) {
|
||||
return '贵族铭牌'
|
||||
} else if (authType == VIP_AUTH_TYPE.USER_INFO_CARD) {
|
||||
return '贵族资料卡'
|
||||
} else if (authType == VIP_AUTH_TYPE.GIFT) {
|
||||
return '贵族礼物'
|
||||
} else if (authType == VIP_AUTH_TYPE.LEVEL_EXP_BUFF) {
|
||||
return '财富值经验加成'
|
||||
} else if (authType == VIP_AUTH_TYPE.FACE) {
|
||||
return '贵族表情'
|
||||
} else if (authType == VIP_AUTH_TYPE.MIC_CIRCLE) {
|
||||
return '麦序光圈'
|
||||
} else if (authType == VIP_AUTH_TYPE.MIC_NICK_COLOUR) {
|
||||
return '麦位昵称颜色'
|
||||
} else if (authType == VIP_AUTH_TYPE.FRIEND_NICK_COLOUR) {
|
||||
return '好友红名'
|
||||
} else if (authType == VIP_AUTH_TYPE.CAR) {
|
||||
return '座驾'
|
||||
} else if (authType == VIP_AUTH_TYPE.ROOM_CHAT_BUBBLE) {
|
||||
return '聊天气泡'
|
||||
} else if (authType == VIP_AUTH_TYPE.ROOM_HORN) {
|
||||
return '房内小喇叭'
|
||||
} else if (authType == VIP_AUTH_TYPE.IN_ROOM_SPECIAL_EFFECTS) {
|
||||
return '进场特效'
|
||||
} else if (authType == VIP_AUTH_TYPE.INVISIBLE_IN_ROOM) {
|
||||
return '隐身进房'
|
||||
} else if (authType == VIP_AUTH_TYPE.PREVENT_KICK) {
|
||||
return '防被踢'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#imgMask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#imgMask img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.control-span {
|
||||
padding-top: 7px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.ul-li {
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.ul-i {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.i-font {
|
||||
color: #00acd6;
|
||||
}
|
||||
|
||||
.ul-li label {
|
||||
color: #c9cccf;
|
||||
}
|
||||
|
||||
.fixed-table-body {
|
||||
height: auto !important;
|
||||
}
|
||||
</style>
|
250
src/views/vip/VipStatView.vue
Normal file
250
src/views/vip/VipStatView.vue
Normal file
@@ -0,0 +1,250 @@
|
||||
<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-2 control-label">用户ID:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" name="erbanNo" id="erbanNo" placeholder="">
|
||||
</div>
|
||||
<label for="cardId" class="col-sm-2 control-label">装扮ID:</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" name="cardId" id="cardId" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<button id="btnSearch" class="btn btn-default">
|
||||
<i class="glyphicon glyphicon-search"></i>查询
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- .content -->
|
||||
<div id="table"></div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
|
||||
export default {
|
||||
name: "VipStatView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'id', title: 'id', visible: false, align: 'center', width: '5%' },
|
||||
{ field: 'cardId', title: '装扮ID', align: 'center', width: '5%' },
|
||||
{ field: 'cardName', title: '装扮名称', align: 'center', width: '5%' },
|
||||
{ field: 'erbanNo', title: '获得用户ID', align: 'center', width: '5%' },
|
||||
{ field: 'nick', title: '用户昵称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'comeFrom', title: '获得来源', align: 'center', width: '5%',
|
||||
formatter: function (val) {
|
||||
if (val === 1) {
|
||||
return '获得贵族身份';
|
||||
} else if (val === 2) {
|
||||
return '后台手动发放';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime', title: '获得时间', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:00");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'days', title: '有效期(天)', align: 'center', width: '5%' },
|
||||
{ field: 'remake', title: '备注', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'status', title: '状态', align: 'center', width: '5%',
|
||||
formatter: function (val) {
|
||||
if (val === 1) {
|
||||
return '正常';
|
||||
} else if (val === 2) {
|
||||
return '已撤回';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'optTime', title: '撤回时间', align: 'center', width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:00");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'opt',
|
||||
title: '操作',
|
||||
align: 'middle',
|
||||
width: '5%',
|
||||
formatter: function (val, row, index) {
|
||||
let isRecoveryDisabled = false;
|
||||
let text = '撤回';
|
||||
if (row.comeFrom === 1 || row.status === 2) {
|
||||
isRecoveryDisabled = true;
|
||||
}
|
||||
if (row.status === 2) {
|
||||
text = '已撤回';
|
||||
}
|
||||
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id=' + row.id + " " + `${isRecoveryDisabled ? ' disabled ' : ''}` + '>' +
|
||||
'<i class="glyphicon glyphicon-edit"></i>' + `${text}` + '</button> ';
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 10,
|
||||
pagination: true,
|
||||
pageList: [10, 20, 50, 100],
|
||||
uniqueId: "id",
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "-",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
page: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
erbanNo: $('#erbanNo').val(),
|
||||
cardId: $('#cardId').val()
|
||||
};
|
||||
return param;
|
||||
},
|
||||
ajax: function (request) { //使用ajax请求
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '/admin/infocard/listRecordByPage',
|
||||
contentType: 'application/json;charset=utf-8',
|
||||
dataType: 'json',
|
||||
data: request.data,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
request.success({
|
||||
rows: res.rows,
|
||||
total: res.total
|
||||
});
|
||||
// $('#table-request').bootstrapTable('load', res.data.rows);
|
||||
},
|
||||
error: function (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
|
||||
// 查询刷新
|
||||
$('#btnSearch').on('click', function () {
|
||||
TableHelper.doRefresh('#table');
|
||||
});
|
||||
|
||||
// 撤回
|
||||
$("#table").on("click", '#btnEdit', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/infocard/recoveryInfoCard",
|
||||
data: { recordId: id },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.code === 200) {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败, " + json.message);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
TableHelper.doRefresh('#table');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#imgMask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 450px;
|
||||
height: 450px;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
z-index: 999;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#imgMask img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.control-span {
|
||||
padding-top: 7px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.ul-li {
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.ul-i {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.i-font {
|
||||
color: #00acd6;
|
||||
}
|
||||
|
||||
.ul-li label {
|
||||
color: #c9cccf;
|
||||
}
|
||||
|
||||
.fixed-table-body {
|
||||
height: auto !important;
|
||||
}</style>
|
532
src/views/voice/PiaDramaAdminView.vue
Normal file
532
src/views/voice/PiaDramaAdminView.vue
Normal file
@@ -0,0 +1,532 @@
|
||||
<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 -->
|
||||
<section class="content">
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
内容:<input type="text" class="input-sm" name="playBook" id="playBook_query" placeholder="输入关键字">
|
||||
状态:<select name="status" id="status_query">
|
||||
<option value="">全部</option>
|
||||
<option value="0">隐藏</option>
|
||||
<option value="1">正常</option>
|
||||
</select>
|
||||
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
||||
|
||||
<div class="col-sm-12">
|
||||
<button id="add" class="btn btn-sm btn-primary">
|
||||
<i class="glyphicon glyphicon-wrench"></i>新增
|
||||
</button>
|
||||
|
||||
<button id="resetToValid" class="btn btn-sm btn-primary">
|
||||
<i class="glyphicon glyphicon-wrench"></i>批量置为正常
|
||||
</button>
|
||||
|
||||
<button id="resetToInvalid" class="btn btn-sm btn-primary">
|
||||
<i class="glyphicon glyphicon-wrench"></i>批量置为隐藏
|
||||
</button>
|
||||
|
||||
<button id="batchImport" class="btn btn-sm btn-primary">
|
||||
<i class="glyphicon glyphicon-import"></i>批量导入
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section><!-- .content -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" style="width: 700px;">
|
||||
<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="piaForm">
|
||||
<input type="hidden" name="id" id="piaId" />
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="form_title" class="col-sm-2 control-label">标题:</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control validate[required]" name="title" id="form_title"
|
||||
onchange="checkLength(this,10)">
|
||||
<span class="tips-text">*标题限制10字符</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="form_playBook" class="col-sm-2 control-label">内容:</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="playBook" id="form_playBook" class="form-control validate[required]"
|
||||
rows="3"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="form_type" class="col-sm-2 control-label">类型:</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="type" id="form_type" class="form-control" data-btn-class="btn-warning">
|
||||
<option value="1">歌词</option>
|
||||
<option value="2">组CP</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="form_gender" class="col-sm-2 control-label">性别:</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="gender" id="form_gender" class="form-control" data-btn-class="btn-warning">
|
||||
<option value="0">不限</option>
|
||||
<option value="1">男</option>
|
||||
<option value="2">女</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="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="batchImportModel" tabindex="-1" role="dialog" aria-labelledby="gift-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="roomImportLabel">导入</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" id="batchImportForm">
|
||||
<div class="form-group">
|
||||
<label for="uploadFile" class="col-sm-3 control-label">上传文件:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
|
||||
application/vnd.ms-excel" class="form-control validate[required]" name="uploadFile"
|
||||
id="uploadFile" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">注意:</label>
|
||||
<div class="col-sm-9">
|
||||
<span>
|
||||
<font color="#dd4b39">1.上传文件仅支持.xls/.xlsx格式的文件<br>
|
||||
2.表格的第一行为列名,导入数据请从表格的第二行开始填写<br>
|
||||
3.导入各列数据分别为:标题、内容、类型(1.歌词,2.组CP)、性别(0.不限,1.男,2.女)总4列<br>
|
||||
</font>
|
||||
</span>
|
||||
</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="upload">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { showLoading, hideLoading } from '@/utils/maintainer';
|
||||
|
||||
var publishTimePicker = $('#publishTime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true,
|
||||
startDate: new Date()
|
||||
})
|
||||
//ComboboxHelper.build(null,'#status');
|
||||
export default {
|
||||
name: "PiaDramaAdminView",
|
||||
setup() {
|
||||
return {};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#platform').selectpicker({
|
||||
'selectedText': 'cat'
|
||||
})
|
||||
|
||||
$('#table').bootstrapTable('destroy');
|
||||
initTable();
|
||||
/**增加搜索功能*/
|
||||
$('#btnSearch').on('click', function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
initTable();
|
||||
});
|
||||
|
||||
//打开导入弹窗
|
||||
$("#batchImport").on('click', function () {
|
||||
$("#uploadFile").val('');
|
||||
$('#batchImportModel').modal('show');
|
||||
});
|
||||
|
||||
//确认导入
|
||||
$("#upload").on('click', function () {
|
||||
|
||||
var file = $("#uploadFile").val();
|
||||
if (file == null || file == undefined || file == '') {
|
||||
$("#tipMsg").text("上传文件不能为空.");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
showLoading();
|
||||
var option = ({
|
||||
type: "POST",
|
||||
url: "/admin/pia/import.action",
|
||||
cache: false,
|
||||
contentType: false, //不可缺
|
||||
processData: false, //不可缺
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
$("#batchImportModel").modal('hide');
|
||||
hideLoading();
|
||||
TableHelper.doRefresh("#table");
|
||||
if (json.code == 200) {
|
||||
$("#tipMsg").text("上传成功,记录数:" + json.data.successNum);
|
||||
$("#tipModal").modal('show');
|
||||
} else if (json.code == 300) {
|
||||
$("#tipMsg").text(json.message + ",记录数:" + json.data.successNum + ",导入失败的行:" + json.data.row + ",导入失败原因:" + json.data.reason);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
hideLoading();
|
||||
$("#tipMsg").text("上传失败.");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
});
|
||||
$("#batchImportForm").ajaxSubmit(option);
|
||||
});
|
||||
|
||||
$("#resetToValid").click(function () {
|
||||
var rows = $("#table").bootstrapTable("getSelections");
|
||||
if (rows.length == 0) {
|
||||
alert("请先选择要更新的记录");
|
||||
return;
|
||||
}
|
||||
var param = '';
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
param += "ids=" + rows[i]['id'] + "&";
|
||||
}
|
||||
param += "status=1";
|
||||
if (confirm("你确认重置所选记录的状态为[正常]吗?")) {
|
||||
changeStatus(param);
|
||||
}
|
||||
});
|
||||
|
||||
$("#resetToInvalid").click(function () {
|
||||
var rows = $("#table").bootstrapTable("getSelections");
|
||||
if (rows.length == 0) {
|
||||
alert("请先选择要更新的记录");
|
||||
return;
|
||||
}
|
||||
var param = '';
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
param += "ids=" + rows[i]['id'] + "&";
|
||||
}
|
||||
param += "status=0";
|
||||
if (confirm("你确认重置所选记录的状态为[隐藏]吗?")) {
|
||||
changeStatus(param);
|
||||
}
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-change-status', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
var status = $(this).attr("data-status");
|
||||
if (id == 'undefined' || status == 'undefined') {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
var tips = $(this).text();
|
||||
if (confirm("你确认【" + tips + "】该声音模板吗?")) {
|
||||
var targetStatus = Math.abs(status - 1);
|
||||
var params = "ids=" + id;
|
||||
params += "&status=" + targetStatus;
|
||||
changeStatus(params);
|
||||
}
|
||||
});
|
||||
|
||||
$("#add").click(function () {
|
||||
$("#piaId").val('');
|
||||
$("#form_title").val('');
|
||||
$("#form_playBook").val('');
|
||||
$("#modalLabel").text("新增");
|
||||
// 打开编辑弹窗
|
||||
$("#editModal").modal('show');
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-edit', function () {
|
||||
|
||||
var id = $(this).attr("data-id");
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "/admin/pia/get.action",
|
||||
data: { id: id },
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
if (json.entity) {
|
||||
$("#piaId").val(json.entity.id);
|
||||
$("#form_title").val(json.entity.title);
|
||||
$("#form_playBook").val(json.entity.playBook);
|
||||
$("#form_type").val(json.entity.type);
|
||||
$("#form_gender").val(json.entity.gender);
|
||||
$("#modalLabel").text("编辑");
|
||||
// 打开编辑弹窗
|
||||
$("#editModal").modal('show');
|
||||
} else {
|
||||
$("#tipMsg").text("获取模板信息出错");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#save").click(function () {
|
||||
if ($("#piaForm").validationEngine('validate')
|
||||
&& $("#form_title").val().length <= 10) {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/pia/save.action",
|
||||
data: $('#piaForm').serialize(),
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
hideLoading();
|
||||
if (json.success == 'true') {
|
||||
$("#editModal").modal('hide');
|
||||
$("#tipMsg").text("保存成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("保存失败,原因: " + json.msg);
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var picker1 = $("#beginDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
});
|
||||
var picker2 = $("#endDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
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);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function initTable() {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'tmp', title: 'ID', align: 'center', width: '5%', checkbox: true },
|
||||
{ field: 'id', title: 'id', align: 'center', width: '5%' },
|
||||
{ field: 'title', title: '标题', align: 'center', width: '10%' },
|
||||
{ field: 'playBook', title: '内容', align: 'center', width: '15%' },
|
||||
{
|
||||
field: 'type', title: '类型', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return '歌词';
|
||||
}
|
||||
else if (val == 2) {
|
||||
return '组CP';
|
||||
}
|
||||
else {
|
||||
return '-';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'gender', title: '性别', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
if (val == 0) {
|
||||
return '不限';
|
||||
}
|
||||
else if (val == 1) {
|
||||
return '男';
|
||||
}
|
||||
else if (val == 2) {
|
||||
return '女';
|
||||
}
|
||||
else {
|
||||
return '-';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'status', title: '状态', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
if (val == 0) {
|
||||
return '隐藏';
|
||||
}
|
||||
else if (val == 1) {
|
||||
return '正常';
|
||||
}
|
||||
else {
|
||||
return '-';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
width: '12%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'createdBy', title: '创建人', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间',
|
||||
align: 'center',
|
||||
width: '12%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'updatedBy', title: '更新人', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'id', title: '操作', align: 'center', width: '18%', formatter: function (val, row, index) {
|
||||
var ret = '<button class="btn btn-sm btn-primary opt-edit" data-id=' + val + '>' +
|
||||
'<i class="glyphicon glyphicon-ok"></i>编辑</button> '
|
||||
if (row.status == 0) {
|
||||
ret += '<button class="btn btn-sm btn-do opt-change-status" data-id=' + val +
|
||||
' data-status=' + row.status + '><i class="glyphicon glyphicon-arrow-up"></i>展示</button>';
|
||||
} else if (row.status == 1) {
|
||||
ret += '<button class="btn btn-sm btn-danger opt-change-status" data-id=' + val +
|
||||
' data-status=' + row.status + '><i class="glyphicon glyphicon-arrow-down"></i>隐藏</button>';
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [1, 20, 50, 100, 200],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
pageNumber: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
playBook: $("#playBook_query").val(),
|
||||
status: $("#status_query").val() != "" ? $("#status_query").val() : null,
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/pia/list.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function changeStatus(params) {
|
||||
showLoading();
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/pia/change/status.action",
|
||||
data: params,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
hideLoading();
|
||||
if (json.success == 'true') {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkLength(obj, len) {
|
||||
if ($(obj).val().length > len) {
|
||||
alert("字符长度超出限制");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>.btn-do {
|
||||
background-color: #f39c12;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-do:hover {
|
||||
background-color: #ec7e0b;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.tips-text {
|
||||
color: red;
|
||||
font-size: 13px;
|
||||
}</style>
|
384
src/views/voice/VoiceVerifyAdminView.vue
Normal file
384
src/views/voice/VoiceVerifyAdminView.vue
Normal file
@@ -0,0 +1,384 @@
|
||||
<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 -->
|
||||
<section class="content">
|
||||
<div id="table"></div>
|
||||
<div id="toolbar">
|
||||
<form action="/admin/voice/export.action" id="searchForm" method="POST">
|
||||
平台号:<input type="text" class="input-sm" name="erbanNo" id="erbanNo_query">
|
||||
昵称:<input type="text" class="input-sm" name="nick" id="nick_query">
|
||||
点赞数:<input type="text" class="input-sm" name="min" id="min_query">
|
||||
至:<input type="text" class="input-sm" name="max" id="max_query"><br>
|
||||
状态:<select name="status" id="status_query">
|
||||
<option value="">全部</option>
|
||||
<option value="0">待审核</option>
|
||||
<option value="1">审核通过</option>
|
||||
<option value="4">审核不通过</option>
|
||||
</select>
|
||||
开始时间:<input type="text" class="input-sm" name="beginDate" id="beginDate" placeholder="创建时间">
|
||||
结束时间:<input type="text" class="input-sm" name="endDate" id="endDate" placeholder="创建时间">
|
||||
</form>
|
||||
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
||||
<button id="exportBtn" class="btn btn-sm btn-primary">导出</button>
|
||||
<div class="col-sm-12">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section><!-- .content -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="notPassModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" style="width: 700px;">
|
||||
<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="notPassForm">
|
||||
<input type="hidden" name="id" id="voiceId" />
|
||||
<div class="form-group">
|
||||
<label for="reason" class="col-sm-2 control-label">快捷选择:</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="quick_reason" class="form-control" data-btn-class="btn-warning"
|
||||
onchange="setReason()">
|
||||
<option value="0">录制中没有人声</option>
|
||||
<option value="1">录音中包含违规内容</option>
|
||||
<option value="2">环境嘈杂过大,影响人声</option>
|
||||
<option value="3">其他</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="reason" class="col-sm-2 control-label">原因:</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="reason" id="reason" class="form-control" rows="3"></textarea>
|
||||
</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="not-pass-save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||
import { showLoading, hideLoading } from '@/utils/maintainer';
|
||||
|
||||
var publishTimePicker = $('#publishTime').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
autoclose: true,
|
||||
startDate: new Date()
|
||||
})
|
||||
//ComboboxHelper.build(null,'#status');
|
||||
export default {
|
||||
name: "VoiceVerifyAdminView",
|
||||
setup() {
|
||||
function setReason() {
|
||||
if ($("#quick_reason option:selected").val() != 3) {
|
||||
$("#reason").val($("#quick_reason option:selected").text());
|
||||
} else {
|
||||
$("#reason").val('');
|
||||
}
|
||||
}
|
||||
window.setReason = setReason;
|
||||
return {
|
||||
setReason
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(function () {
|
||||
this.initData();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
$(function () {
|
||||
$('#platform').selectpicker({
|
||||
'selectedText': 'cat'
|
||||
})
|
||||
|
||||
$('#table').bootstrapTable('destroy');
|
||||
initTable();
|
||||
/**增加搜索功能*/
|
||||
$('#btnSearch').on('click', function () {
|
||||
$('#table').bootstrapTable('destroy');
|
||||
initTable();
|
||||
});
|
||||
|
||||
$("#exportBtn").on('click', function () {
|
||||
$("#searchForm").submit();
|
||||
})
|
||||
|
||||
$("#table").on("click", '.opt-pass', function () {
|
||||
var id = $(this).attr("data-id");
|
||||
if (id == 'undefined') {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
if (confirm("你确认【通过】该声音吗?")) {
|
||||
showLoading();
|
||||
var params = "ids=" + id;
|
||||
params += "&status=1";
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/voice/change/status.action",
|
||||
data: params,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
hideLoading();
|
||||
if (json.success == 'true') {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#table").on("click", '.opt-not-pass', function () {
|
||||
|
||||
var id = $(this).attr("data-id");
|
||||
if (id == 'undefined') {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
$("#voiceId").val(id);
|
||||
// 打开编辑弹窗
|
||||
$("#notPassModal").modal('show');
|
||||
window.setReason();
|
||||
|
||||
});
|
||||
|
||||
$("#not-pass-save").click(function () {
|
||||
var id = $("#voiceId").val();
|
||||
if (id == 'undefined') {
|
||||
$("#tipMsg").text("id参数有误");
|
||||
$("#tipModal").modal('show');
|
||||
return;
|
||||
}
|
||||
var reason = $("#reason").val();
|
||||
if (reason.length <= 0) {
|
||||
alert("请输入原因!")
|
||||
return;
|
||||
}
|
||||
if (confirm("你确认【不通过】该声音吗?")) {
|
||||
showLoading();
|
||||
var params = "ids=" + id;
|
||||
params += "&status=4&reason=" + reason;
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "/admin/voice/change/status.action",
|
||||
data: params,
|
||||
dataType: "json",
|
||||
success: function (json) {
|
||||
hideLoading();
|
||||
$("#notPassModal").modal('hide');
|
||||
if (json.success == 'true') {
|
||||
$("#tipMsg").text("操作成功");
|
||||
$("#tipModal").modal('show');
|
||||
TableHelper.doRefresh("#table");
|
||||
} else {
|
||||
$("#tipMsg").text("操作失败");
|
||||
$("#tipModal").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
var picker1 = $("#beginDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
todayBtn: true,
|
||||
autoclose: true,
|
||||
});
|
||||
var picker2 = $("#endDate").datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii:00',
|
||||
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);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function initTable() {
|
||||
$('#table').bootstrapTable({
|
||||
columns: [
|
||||
{ field: 'tmp', title: 'ID', align: 'center', width: '5%', checkbox: true },
|
||||
{ field: 'id', title: 'id', align: 'center', width: '5%' },
|
||||
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
|
||||
{ field: 'nick', title: '昵称', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'gender', title: '性别', align: 'center', width: '5%', formatter: function (val, row, index) {
|
||||
if (val == 1) {
|
||||
return '男';
|
||||
}
|
||||
else if (val == 2) {
|
||||
return '女';
|
||||
}
|
||||
else {
|
||||
return '-';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'voiceUrl', title: '语音url', align: 'center', width: '18%', formatter: function (val, row, index) {
|
||||
return '<audio controls="controls"><source src="' + row.voiceUrl + '" type="audio/mpeg"></audio>';
|
||||
}
|
||||
},
|
||||
{ field: 'voiceLength', title: '语音时长(s)', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'status', title: '状态', align: 'center', width: '5%', 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: 'likeCount', title: '点赞数', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
width: '12%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'verifyBy', title: '审核人', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'verifyTime',
|
||||
title: '审核时间',
|
||||
align: 'center',
|
||||
width: '12%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'reason', title: '原因', align: 'center', width: '5%' },
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间',
|
||||
align: 'center',
|
||||
width: '12%',
|
||||
formatter: function (val, row, index) {
|
||||
if (val) {
|
||||
var date = new Date(val);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'id', title: '操作', align: 'center', width: '18%', formatter: function (val, row, index) {
|
||||
var ret = '';
|
||||
if (row.status == 0) {
|
||||
ret += '<button class="btn btn-sm btn-primary opt-pass" data-id=' + val + '>' +
|
||||
'<i class="glyphicon glyphicon-ok"></i>通 过</button> '
|
||||
ret += '<button class="btn btn-sm btn-danger opt-not-pass" data-id=' + val +
|
||||
'><i class="glyphicon glyphicon-remove"></i>不通过</button>';
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
cache: false,
|
||||
striped: true,
|
||||
showRefresh: false,
|
||||
pageSize: 20,
|
||||
pagination: true,
|
||||
pageList: [1, 20, 50, 100, 200],
|
||||
search: false,
|
||||
sidePagination: "server", //表示服务端请求
|
||||
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
||||
//设置为limit可以获取limit, offset, search, sort, order
|
||||
queryParamsType: "undefined",
|
||||
queryParams: function queryParams(params) { //设置查询参数
|
||||
var param = {
|
||||
pageNumber: params.pageNumber,
|
||||
pageSize: params.pageSize,
|
||||
erbanNo: $("#erbanNo_query").val(),
|
||||
nick: $("#nick_query").val(),
|
||||
status: $("#status_query").val() != "" ? $("#status_query").val() : null,
|
||||
min: $("#min_query").val(),
|
||||
max: $("#max_query").val(),
|
||||
beginDate: $('#beginDate').val(),
|
||||
endDate: $('#endDate').val(),
|
||||
};
|
||||
return param;
|
||||
},
|
||||
toolbar: '#toolbar',
|
||||
url: '/admin/voice/list.action',
|
||||
onLoadSuccess: function () { //加载成功时执行
|
||||
console.log("load success");
|
||||
},
|
||||
onLoadError: function () { //加载失败时执行
|
||||
console.log("load fail");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
Reference in New Issue
Block a user