Compare commits

..

76 Commits

Author SHA1 Message Date
liaozetao
613482ee59 修改窗口长度滚动 2024-01-23 16:28:56 +08:00
liaozetao
77f44c5632 修改loading尺寸 2024-01-23 16:16:06 +08:00
liaozetao
79ba685d1c 修改高度 2024-01-23 16:08:39 +08:00
liaozetao
6bceeba4ed 修改大小 2024-01-23 15:50:05 +08:00
liaozetao
bfdcd11f1e 补充 2024-01-23 15:34:56 +08:00
liaozetao
4461999ab2 新增loading图 2024-01-23 15:33:40 +08:00
liaozetao
d7a50984d8 修改时间长度 2024-01-23 15:12:36 +08:00
liaozetao
548bb814f5 去除添加功能 2024-01-23 15:06:09 +08:00
liaozetao
f8a7b6ee2d 修復鏈接回線問題 2024-01-19 16:13:52 +08:00
liaozetao
a366e4485c 修改鏈接展示邏輯 2024-01-19 16:10:05 +08:00
liaozetao
5f7d0edd0d 修改上傳按鈕邏輯 2024-01-19 16:04:13 +08:00
liaozetao
687f0f84b6 修改刪除按鈕邏輯 2024-01-19 15:58:29 +08:00
liaozetao
a91b5c062f 打印日誌 2024-01-19 15:52:43 +08:00
liaozetao
451de44db2 清空鏈接處理 2024-01-19 15:47:35 +08:00
liaozetao
c7273dce2b 修復編輯回線 2024-01-19 15:42:57 +08:00
liaozetao
d32dfcb627 修復查詢問題 2024-01-19 15:36:27 +08:00
liaozetao
be5f65d0d8 修改上傳組件按鈕 2024-01-19 15:24:05 +08:00
liaozetao
ae0bbcb43e 刪除多餘代碼 2024-01-19 15:19:03 +08:00
liaozetao
5d1b39e53c 修改上傳組件 2024-01-19 15:14:23 +08:00
liaozetao
13fa7433c6 修復view name問題 2024-01-19 14:50:43 +08:00
liaozetao
356175e2ab 修复报错 2024-01-19 10:12:54 +08:00
liaozetao
4a6c6d5b1c 新增官网配置页面 2024-01-18 15:53:16 +08:00
liaozetao
fc705cbc01 新增公会名称字段 2024-01-15 15:24:00 +08:00
liaozetao
7072376da6 新增平台号搜索 2024-01-15 14:23:52 +08:00
liaozetao
368550d4b8 修改时间格式化 2024-01-12 15:13:52 +08:00
liaozetao
60f349060d 新增修改事件 2024-01-12 12:03:13 +08:00
liaozetao
a5b21a28e0 修复事件失效问题 2024-01-11 19:04:31 +08:00
liaozetao
0b3aa136f9 补充5 2024-01-11 19:00:19 +08:00
liaozetao
c46de130c6 修复奖品设置 2024-01-11 18:55:56 +08:00
liaozetao
c184753083 补充4 2024-01-11 18:48:23 +08:00
liaozetao
6a55b37490 补充3 2024-01-11 18:21:14 +08:00
liaozetao
4b4185f71d 修改事件加载问题 2024-01-11 18:11:03 +08:00
liaozetao
7371a1654a 将事件迁移 2024-01-11 17:53:53 +08:00
liaozetao
e3bb745a92 补充 2024-01-11 17:33:31 +08:00
liaozetao
eb2920b62b 修复报错 2024-01-11 17:28:33 +08:00
liaozetao
270ef2e0e1 修复字段报错 2024-01-11 17:14:45 +08:00
Dragon
b7cc65001f 访问白名单新增操作人字段 2024-01-10 15:34:44 +08:00
liaozetao
dbf84bf7c8 修复时间问题 2024-01-10 15:00:58 +08:00
khalil
9d98c1afd8 寻爱之旅-后台-去掉废弃接口 2024-01-09 18:02:36 +08:00
liaozetao
f6845854a1 修复vgg问题 2024-01-09 15:56:44 +08:00
liaozetao
dbb193c7e9 补充2 2024-01-09 15:51:32 +08:00
liaozetao
71e44300a4 补充 2024-01-09 15:48:42 +08:00
liaozetao
39f1ad026c 修改上传代码 2024-01-09 15:48:27 +08:00
liaozetao
fdc01127e2 修补选择组件 2024-01-09 12:11:42 +08:00
liaozetao
faf0250aae 补充 2024-01-08 17:30:11 +08:00
liaozetao
1526875c7f 修复工具类问题 2024-01-08 17:08:31 +08:00
liaozetao
56df854368 优化私聊查询 2024-01-04 19:02:10 +08:00
liaozetao
7f15427638 超过高度滚动 2024-01-02 18:32:18 +08:00
liaozetao
0586ef3e55 修改mp4 2024-01-02 18:29:34 +08:00
liaozetao
d65e4eb701 修改视图展示 2024-01-02 18:23:17 +08:00
liaozetao
c050d4a338 添加遮罩层 2024-01-02 18:11:11 +08:00
liaozetao
11f0ca3dbd 添加遮罩层 2024-01-02 16:03:17 +08:00
liaozetao
f40a401b2b 超出换行 2023-12-28 18:49:43 +08:00
liaozetao
25ed55eac6 补充2 2023-12-28 18:42:21 +08:00
liaozetao
789d71d7c2 补充 2023-12-28 18:31:57 +08:00
liaozetao
51fa966457 修复超管展示问题 2023-12-28 18:19:45 +08:00
liaozetao
b2334b4e5f 新用户送礼流水 2023-12-28 11:47:17 +08:00
liaozetao
bf909cfa0f 渠道展示颜色 2023-12-27 17:40:38 +08:00
liaozetao
1f7dc304fd 修复置顶问题 2023-12-27 17:31:53 +08:00
liaozetao
b5d8eeebfe 新增合作方字段 2023-12-26 18:55:31 +08:00
liaozetao
2940c9dc0a 去除提示 2023-12-21 20:13:53 +08:00
Dragon
e2c34e5863 修复房间流水筛选bug 2023-12-20 14:50:49 +08:00
liaozetao
ac415d1bcb 修复查询逻辑 2023-12-18 16:52:32 +08:00
liaozetao
61f9575255 窗口未关闭问题 2023-12-18 16:44:04 +08:00
liaozetao
ef4e04286b 增加人气礼物类型 2023-12-15 10:21:16 +08:00
liaozetao
32ad54e4e3 补充 2023-12-13 17:45:10 +08:00
liaozetao
6ff8e23e59 修改礼物类型组件 2023-12-13 17:23:31 +08:00
liaozetao
c60c28efa2 调整样式 2023-12-11 12:37:00 +08:00
liaozetao
86e62d8d40 添加忽视版本和渠道字段 2023-12-11 10:47:26 +08:00
liaozetao
b25b59615e 修改默认选中 2023-12-11 10:28:00 +08:00
liaozetao
ff6bd4a91f 修改礼物默认类型 2023-12-11 10:14:18 +08:00
liaozetao
d20a59e843 补充 2023-12-08 15:37:19 +08:00
liaozetao
94dbb140fb 修改礼物类型默认值 2023-12-08 15:16:13 +08:00
liaozetao
864687bdab 修改礼物管理默认值 2023-12-08 15:13:04 +08:00
liaozetao
e11bf2a439 修改铭牌配置为动态获取 2023-12-06 15:31:26 +08:00
liaozetao
053be766c9 修复按钮问题 2023-12-05 11:51:10 +08:00
27 changed files with 2387 additions and 1697 deletions

View File

@@ -1,3 +1,4 @@
import request from "@/utils/request";
import '@/utils/ajaxfileupload';
export const uploadFile = id => {
@@ -20,4 +21,52 @@ export const uploadFile = id => {
}
});
});
};
export const uploadQiNiuFile = (file) => {
console.log(file);
let formData = new FormData();
formData.append('file', file);
return new Promise((resolve, reject) => {
request.post('/admin/qiniu/upload/file', formData).then(res => {
resolve(res);
}).catch(e => {
reject(e);
});
});
};
export const uploadTencentFile = id => {
return new Promise((resolve, reject) => {
$.ajaxFileUpload({
fileElementId: id,
url: '/admin/upload/tencent/file',
type: 'post',
dataType: 'json',
secureuri: false,
async: true,
submitType: 'ajax',
success: function (res) {
resolve(res);
},
error: function (res, status, e) {
console.error(res);
console.error(status);
reject(e);
}
});
});
};
export const uploadGift = (file) => {
let formData = new FormData();
console.log(file);
formData.append('file', file);
return new Promise((resolve, reject) => {
request.post('/admin/gift/upload', formData).then(res => {
resolve(res);
}).catch(e => {
reject(e);
});
});
};

View File

@@ -0,0 +1,18 @@
import request from '@/utils/request';
export const getOfficialConfigList = query => {
return request({
url: '/admin/official/config/list',
method: 'get',
params: query
});
};
export const saveOfficialConfig = data => {
return request({
url: '/admin/official/config/save',
headers:{"Content-Type": 'application/x-www-form-urlencoded'},
method: 'post',
data: data
});
}

View File

@@ -0,0 +1,9 @@
import request from '@/utils/request';
export const browseFor30Days = query => {
return request({
url: '/admin/official/browse/record/browseFor30Days',
method: 'get',
params: query
});
};

View File

@@ -5,4 +5,12 @@ export function getSysConfList() {
url: '/admin/sysConf/getList',
method: 'get'
});
}
export const getConfigValueByKey = query => {
return request({
url: '/admin/sysConf/key',
method: 'get',
params: query,
});
}

View File

@@ -99,14 +99,13 @@
</div>
<div class="modal fade loading" style="background: #00000040;" tabindex="-1" role="dialog"
aria-labelledby="loadingModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
<div class="loadingGif" style="position: fixed;"><img :src="loading"></div>
<div class="loadingGif" style="position: fixed; left:50%; top:50%;"><img src="https://img.zcool.cn/community/0111345d94b0b8a801211d53cbd04d.gif" style="width: 10%;"></div>
</div>
</template>
<script>
import store from '@/store';
import { getStore } from '@/utils/store';
import loading from '@/assets/images/loading.gif';
export default {
name: 'MaintainerView',

View File

@@ -1,42 +1,50 @@
export default {
idstr: null,
// 是否有且只选择了一项
isSelectOne: function (idstr) {
if ($(idstr).bootstrapTable('getSelections').length == 1) {
isSelectOne: function (id) {
if ($(id).bootstrapTable('getSelections').length == 1) {
return true;
}
return false;
},
//是否选择了至少一项
hasSelectAny: function (idstr) {
if ($(idstr).bootstrapTable('getSelections').length > 0) {
hasSelectAny: function (id) {
if ($(id).bootstrapTable('getSelections').length > 0) {
return true;
}
return false;
},
// 获取选择的一项
getOneSelectItem: function (idstr) {
return $(idstr).bootstrapTable('getSelections')[0];
getOneSelectItem: function (id) {
return $(id).bootstrapTable('getSelections')[0];
},
// 已经选择的记录
getAllSelectItems: function (idstr) {
return $(idstr).bootstrapTable('getSelections');
getAllSelectItems: function (id) {
return $(id).bootstrapTable('getSelections');
},
getRowByUniqueId: function (idstr, id) {
return $(idstr).bootstrapTable('getRowByUniqueId', id);
getRowByUniqueId: function (id, recordId) {
return $(id).bootstrapTable('getRowByUniqueId', recordId);
},
// 已选择的项数量
selectLength: function (idstr) {
return $(idstr).bootstrapTable('getSelections').length;
selectLength: function (id) {
return $(id).bootstrapTable('getSelections').length;
},
// 刷新
doRefresh: function (idstr) {
$(idstr).bootstrapTable('refresh');
doRefresh: function (id) {
$(id).bootstrapTable('refresh');
},
unCheckAll: function (idstr) {
$(idstr).bootstrapTable('uncheckAll');
unCheckAll: function (id) {
$(id).bootstrapTable('uncheckAll');
},
doRefreshAndToPage1: function (idstr) {
$(idstr).bootstrapTable('selectPage', 1);
doRefreshAndToPage1: function (id) {
$(id).bootstrapTable('selectPage', 1);
},
getData: function(id) {
return $(id).bootstrapTable('getData');
},
destroy: function(id) {
$(id).bootstrapTable('destroy');
},
load: function(id, data) {
$(id).bootstrapTable('load', data);
}
}

View File

@@ -57,7 +57,8 @@
}}
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="400">
<el-table-column prop="adminName" align="center" label="操作" />
<el-table-column align="center" label="操作" width="300">
<template v-slot="scope">
<el-button
@click="delWhite(scope.row)"

View File

@@ -288,7 +288,7 @@ export default {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#updateItemModal").modal('hide');
$("#updateCapModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
@@ -334,6 +334,7 @@ export default {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#addCapModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');

View File

@@ -341,7 +341,7 @@ export default {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#updateItemModal").modal('hide');
$("#updateJoinHandModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');
@@ -387,6 +387,7 @@ export default {
$("#tipMsg").text("保存成功");
$("#tipModal").modal('show');
TableHelper.doRefresh("#table");
$("#addJoinHandModal").modal('hide');
} else {
$("#tipMsg").text("保存失败." + json.message);
$("#tipModal").modal('show');

View File

@@ -307,7 +307,24 @@ export default {
$('#channelTable').bootstrapTable('destroy');
$('#channelTable').bootstrapTable({
columns: [
{ field: 'desc', title: '渠道名称', align: 'center', width: '5%' },
{ field: 'payChannel', title: '合作方', align: 'center', width: '5%' },
{
field: 'desc',
title: '渠道名称',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
let color = 'black';
if (val == 'Mycard點數卡' || val == 'MyCard會員點數' || val == 'MyCard Paypal' || val == 'MyCard信用卡' || val == '悠遊付' || val == 'ezPay 簡單付' || val == '台灣Pay' || val == 'icash Pay' || val == 'Pi 拍錢包' || val == '全支付') {
color = 'green';
} else if (val == '電子支付' || val == 'Mycard銀行轉賬') {
color = 'blue';
} else if (val == '電話賬單') {
color = 'orange';
}
return '<span style="color:' + color + ';">' + val + '</span>';
}
},
{
field: 'logo',
title: '图标',

View File

@@ -284,7 +284,17 @@ let currParams = {};
export default {
name: "ClanAdminView",
setup() {
return {};
function showText(obj) {
let text = unescape($(obj).prop('title'));
let $div = $("#tipMsg");
$div.attr('style', 'word-wrap: break-word;');
$div.text(text);
$("#tipModal").modal('show');
}
window.showText = showText;
return {
showText
};
},
created() {
this.$nextTick(function () {
@@ -446,7 +456,7 @@ export default {
<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;"><div style="text-align: center; width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title="${escape(res.manageRoomErbanNoList)}" onclick="showText(this);">${res.manageRoomErbanNoList}</div></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>

View File

@@ -85,7 +85,7 @@
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { cleanArray } from '@/utils/maintainer';
import { cleanArray, apiResult } from '@/utils/maintainer';
export default {
name: "UserChatMsgRecordView",
@@ -107,23 +107,6 @@ export default {
{ field: 'fromNick', title: '搜索人昵称', align: 'center', width: '5%' },
{ field: 'toErBanNo', title: '聊天对象ID', align: 'center', width: '5%' },
{ field: 'toNick', title: '聊天对象昵称', align: 'center', width: '5%' },
{ field: 'firstTouchTime', title: '首次接触时间', align: 'center', width: '5%' },
{
field: 'isInitiative',
title: '首次接触情况',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
var value = '';
if (val == 0) {
value = '被动回复';
} else if (val == 1) {
value = '主动发起';
}
return value;
}
},
{ field: 'chatMsgNum', title: '聊天条目数', align: 'center', width: '5%' },
{
field: 'handle',
title: '查看详情',
@@ -204,11 +187,32 @@ export default {
const toErBanNo = currentData.toErBanNo;
const toNick = currentData.toNick;
$("#detailModal").modal('show');
$('#modalLabel').html(fromNick + '(' + fromErBanNo + ')与' + toNick + '(' + toErBanNo + ')的聊天记录');
var fromUid = currentData.fromUid;
var toUid = currentData.toUid;
$('#fromUid').val(fromUid);
$('#toUid').val(toUid);
$('#modalLabel').html(fromNick + '(' + fromErBanNo + ')与' + toNick + '(' + toErBanNo + ')的聊天记录 首次接触时间: 首次接触情况: 聊天条目数0');
$.ajax({
type: "get",
url: "/admin/userChatMsgRecord/getDetail",
dataType: "json",
data: {
fromUid: fromUid,
toUid: toUid,
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
},
success: function (json) {
apiResult(json);
let data = json.data;
if (data) {
let firstTouchTime = data.firstTouchTime;
let isInitiative = data.isInitiative;
let chatMsgNum = data.chatMsgNum;
$('#modalLabel').html(fromNick + '(' + fromErBanNo + ')与' + toNick + '(' + toErBanNo + ')的聊天记录 首次接触时间:' + firstTouchTime + ' 首次接触情况:' + (isInitiative ? '被动回复' : '主动发起') + ' 聊天条目数:' + chatMsgNum);
}
}
});
$('#detailTable').bootstrapTable('destroy');
$('#detailTable').bootstrapTable({
columns: [

View File

@@ -179,6 +179,7 @@
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { getConfigValueByKey } from '@/api/system/sysconf';
export default {
name: "NameplateInfoView",
@@ -603,20 +604,34 @@ function setStatusSelectOption() {
}
function setStyleTypeSelectOption() {
var rows = {
"1": '3344~8887送出',
"2": '3344~8887收到',
"3": '8887+送出',
"4": '8887+收到',
"5": 'CP铭牌审核送出',
"6": '粉丝团铭牌送出',
"7": '贵族等级铭牌送出'
};
console.log(rows);
for (var key in rows) {
$('#type').append('<option value="' + key + '">' + rows[key] + '</option>');
$('#type1').append('<option value="' + key + '">' + rows[key] + '</option>');
}
getConfigValueByKey({
'configId': 'heartbeat_nameplate',
}).then(res => {
let sysConf = res.data;
if (sysConf && sysConf.configValue) {
let data = JSON.parse(sysConf.configValue);
let floor = 52000;
let upper = 131400;
if (data.length == 2) {
floor = data[0];
upper = data[1];
}
var rows = {
'1': floor + '~' + (upper - 1) + '送出',
'2': floor + '~' + (upper - 1) + '收到',
'3': upper + '+送出',
'4': upper + '+收到',
'5': 'CP铭牌审核送出',
'6': '粉丝团铭牌送出',
'7': '贵族等级铭牌送出'
};
console.log(rows);
for (var key in rows) {
$('#type').append('<option value="' + key + '">' + rows[key] + '</option>');
$('#type1').append('<option value="' + key + '">' + rows[key] + '</option>');
}
}
});
}
function setTypeSelectOption() {

View File

@@ -0,0 +1,488 @@
<template>
<section class="content">
<div class="box box-danger">
<div class="box-body">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="configTable"></div>
</section><!-- .content -->
</div>
<div class="box-body" style="height:150%;">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1 id="browseTitle">官网访问数据-最近30天</h1>
</section>
<!-- .content -->
<div id="browseTable"></div>
</div>
</div>
</section>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" style="height: 100%; overflow: hidden; overflow: scroll;">
<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">&times;</span>
</button>
<h4 class="modal-title" id="modalLabel">H5官网配置</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<input type="hidden" name="id" v-model="officialConfig.id" />
<div class="form-group">
<label class="col-sm-3 control-label">iOS下载配置</label>
<div class="col-sm-8">
</div>
</div>
<div class="form-group">
<label for="iosVersion" class="col-sm-3 control-label">iOS版本号:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="categoryCode" id="categoryCode"
v-model="officialConfig.iosVersion" />
</div>
</div>
<div class="form-group">
<label for="iosSkipType" class="col-sm-3 control-label">iOS跳转类型:</label>
<div class="col-sm-8">
<select name="iosSkipType" id="iosSkipType" class="form-control" data-btn-class="btn-warning" v-model="officialConfig.iosSkipType">
<option value="0">AppStore</option>
<option value="1">其它H5链接</option>
</select>
</div>
</div>
<div class="form-group">
<label for="iosSkipUrl" class="col-sm-3 control-label">iOS跳转链接:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="iosSkipUrl" id="iosSkipUrl"
v-model="officialConfig.iosSkipUrl" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Android下载配置</label>
<div class="col-sm-8">
</div>
</div>
<div class="form-group">
<label for="androidVersion" class="col-sm-3 control-label">Android版本号:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="androidVersion" id="androidVersion"
v-model="officialConfig.androidVersion" />
</div>
</div>
<div class="form-group">
<label for="androidSkipType" class="col-sm-3 control-label">Android跳转类型:</label>
<div class="col-sm-8">
<select name="androidSkipType" id="androidSkipType" class="form-control" data-btn-class="btn-warning" v-model="officialConfig.androidSkipType">
<option value="0">GooglePlay</option>
<option value="1">直接下载Apk</option>
</select>
</div>
</div>
<div class="form-group" v-if="officialConfig.androidSkipType == 0">
<label for="androidSkipUrl" class="col-sm-3 control-label">Android跳转链接:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="androidSkipUrl" id="androidSkipUrl"
v-model="officialConfig.androidSkipUrl" />
</div>
</div>
<div class="form-group">
<label for="androidNormalUrl" class="col-sm-3 control-label">Android常规包:</label>
<div class="col-sm-8">
<input type="file" id="normalFile" name="uploadFile" @change="changeFile($event)" v-if="officialConfig.androidNormalUrl == ''"/>
<span class="btn col-sm-4" id="normalUploadInfo" style="color:red;">{{ officialConfig.androidNormalUrl }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<button class="btn btn-default col-sm-4" type="button" id="normalUploadBtn" @click="uploadNormal" v-if="officialConfig.androidNormalUrl == ''">上传</button>
<button class="btn btn-danger col-sm-4" type="button" id="normalDelBtn" @click="delNormal" v-if="officialConfig.androidNormalUrl != ''">删除</button>
</div>
</div>
<div class="form-group">
<label for="androidReserveUrl" class="col-sm-3 control-label">Android备用包:</label>
<div class="col-sm-8">
<input type="file" id="reserveFile" name="uploadFile" v-if="officialConfig.androidReserveUrl == ''"/>
<span class="btn col-sm-4" id="reserveUploadInfo" style="color:red;">{{ officialConfig.androidReserveUrl }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-8">
<button class="btn btn-default col-sm-4" type="button" id="reserveUploadBtn" @click="uploadReserve" v-if="officialConfig.androidReserveUrl == ''">上传</button>
<button class="btn btn-danger col-sm-4" type="button" id="reserveDelBtn" @click="delReserve" v-if="officialConfig.androidReserveUrl != ''">删除</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系方式配置</label>
<div class="col-sm-8">
</div>
</div>
<div class="form-group">
<label for="contact0" class="col-sm-3 control-label">Wechat:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="contact0" id="contact0"
v-model="officialConfig.contact0" />
</div>
</div>
<div class="form-group">
<label for="contact1" class="col-sm-3 control-label">Line:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="contact1" id="contact1"
v-model="officialConfig.contact1" />
</div>
</div>
<div class="form-group">
<label for="contact2" class="col-sm-3 control-label">Email:</label>
<div class="col-sm-8">
<input type="text" class="form-control validate[required]" name="contact2" id="contact2"
v-model="officialConfig.contact2" />
</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';
import { getOfficialConfigList, saveOfficialConfig } from '@/api/official/officialConfig';
import { browseFor30Days } from '@/api/official/officialRecord';
import { uploadQiNiuFile, uploadTencentFile } from '@/api/common/upload';
import { showLoading, hideLoading, apiResult, formatTime } from '@/utils/maintainer';
export default {
name: 'OfficialConfigView',
data() {
return {
files: {},
configColumns: [
{ field: 'iosVersion', title: 'iOS版本号', align: 'center', width: '15%' },
{
field: 'iosSkipType',
title: 'iOS跳转类型',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
let value = '';
if (val == 0) {
value = 'AppStore';
} else {
value = '其它H5链接';
}
return value;
}
},
{ field: 'iosSkipUrl', title: 'iOS跳转链接', align: 'center', width: '15%' },
{ field: 'androidVersion', title: 'Android版本号', align: 'center', width: '15%' },
{
field: 'androidSkipType',
title: 'Android跳转类型',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
let value = '';
if (val == 0) {
value = 'GooglePlay';
} else if (val == 1) {
value = '直接下载Apk';
}
return value;
}
},
{
field: 'android',
title: 'Android跳转链接',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
let value = 'GooglePlay';
if (row.androidSkipUrl) {
value += row.androidSkipUrl;
} else {
value += '无';
}
value += '<br/>';
value += '常规包:';
if (row.androidNormalUrl) {
value += row.androidNormalUrl;
} else {
value += '无';
}
value += '<br/>';
value += '备用包:';
if (row.androidReserveUrl) {
value += row.androidReserveUrl;
} else {
value += '无';
}
value += '<br/>';
return value;
}
},
{
field: 'contact',
title: '联系方式',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
let value = '';
value += 'Wechat';
if (row.contact0) {
value += row.contact0;
} else {
value += '无';
}
value += '<br/>';
value += 'Line';
if (row.contact1) {
value += row.contact1;
} else {
value += '无';
}
value += '<br/>';
value += 'Email';
if (row.contact2) {
value += row.contact2;
} else {
value += '无';
}
return value;
}
},
{
field: 'id',
title: '操作',
align: 'center',
width: '15%',
formatter: function (val, row, index) {
$('#itemTitle').html('<label class="col-sm-6 control-label">上次更新时间:' + formatTime(row.updateTime) + '</label>');
let value = '<button class="btn btn-sm btn-success opt-edit" data-id="' + val + '" data-index="' + index + '">编辑</button>';
return value;
}
}
],
browseColumns: [
{ field: 'dateTime', title: '日期', align: 'center', width: '15%' },
{ field: 'clientUv', title: '无线官网UV', align: 'center', width: '15%' },
{ field: 'clientPv', title: '无线官网PV', align: 'center', width: '15%' },
{ field: 'iosDownloadPv', title: '无线 iOS下载点击次数', align: 'center', width: '15%' },
{ field: 'androidDownloadPv', title: '无线 安卓下载点击次数', align: 'center', width: '15%' },
{ field: 'pcUv', title: 'PC官网UV', align: 'center', width: '15%' },
{ field: 'pcPv', title: 'PC官网PV', align: 'center', width: '15%' },
{ field: 'pcIosDownloadPv', title: 'PC iOS下载点击次数', align: 'center', width: '15%' },
{ field: 'pcAndroidDownloadPv', title: 'PC 安卓下载点击次数', align: 'center', width: '15%' },
],
officialConfig: {
id: 0,
iosVersion: '',
iosSkipType: 0,
iosSkipUrl: '',
androidVersion: '',
androidSkipType: 0,
androidSkipUrl: '',
androidNormalUrl: '',
androidReserveUrl: '',
contact0: '',
contact1: '',
contact2: '',
},
};
},
created() {
this.init();
this.getBrowse();
},
methods: {
changeFile(event) {
console.log(event);
let target = event.target;
let id = target.id;
this.files[id] = target.files[0];
},
uploadNormal() {
let $this = this;
showLoading();
uploadQiNiuFile($this.files['normalFile']).then(res => {
let path = res.data;
console.log(path);
if (path) {
$this.officialConfig.androidNormalUrl = path;
}
hideLoading();
}).catch(e => {
console.error(e);
hideLoading();
});
},
uploadReserve() {
let $this = this;
let file = $('#reserveFile').val();
if (file && file.length > 0) {
showLoading();
uploadTencentFile('reserveFile').then(res => {
let path = res.data;
if (path) {
$this.officialConfig.androidReserveUrl = path;
}
}).finally(() => {
hideLoading();
});
}
},
init() {
this.$nextTick(function () {
let $this = this;
$this.initTable();
$('#addBtn').click(function () {
$this.add();
});
$('#configTable').on('click', '.opt-edit', function () {
$this.edit(this);
});
$('#save').click(function () {
$this.save();
});
});
},
initTable() {
let $this = this;
TableHelper.destroy('#configTable');
$('#configTable').bootstrapTable({
columns: $this.configColumns,
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [1, 10, 20, 30, 50],
search: false,
sidePagination: 'server',
queryParamsType: 'undefined',
queryParams: function queryParams(params) {
var param = {
pageNum: params.pageNumber,
pageSize: params.pageSize,
};
return param;
},
ajax:function(request){
getOfficialConfigList(request.data).then(res => {
let data = res.data;
request.success({
'rows': data,
'total': data.length,
});
});
},
toolbar: '#toolbar',
});
TableHelper.destroy('#browseTable');
$('#browseTable').bootstrapTable({
columns: $this.browseColumns,
cache: false,
striped: true,
showRefresh: false,
search: false,
pageSize: 10,
pagination: true,
pageList: [1, 10, 20, 30, 50],
sidePagination: "client",
queryParamsType: "undefined",
});
},
getBrowse() {
browseFor30Days().then(res => {
let data = res.data;
TableHelper.load('#browseTable', data);
});
},
delNormal() {
this.officialConfig.androidNormalUrl = '';
},
delReserve() {
this.officialConfig.androidReserveUrl = '';
},
add() {
this.officialConfig.id = 0;
this.officialConfig.iosVersion = '';
this.officialConfig.iosSkipType = 0;
this.officialConfig.iosSkipUrl = '';
this.officialConfig.androidVersion = '';
this.officialConfig.androidSkipType = 0;
this.officialConfig.androidSkipUrl = '';
this.officialConfig.androidNormalUrl = '';
this.officialConfig.androidReserveUrl = '';
this.officialConfig.contact0 = '';
this.officialConfig.contact1 = '';
this.officialConfig.contact2 = '';
this.show();
},
edit(obj) {
const index = $(obj).data('index');
const record = TableHelper.getData('#configTable')[index];
this.officialConfig.id = record.id;
this.officialConfig.iosVersion = record.iosVersion;
this.officialConfig.iosSkipType = record.iosSkipType;
this.officialConfig.iosSkipUrl = record.iosSkipUrl;
this.officialConfig.androidVersion = record.androidVersion;
this.officialConfig.androidSkipType = record.androidSkipType;
this.officialConfig.androidSkipUrl = record.androidSkipUrl;
this.officialConfig.androidNormalUrl = record.androidNormalUrl;
this.officialConfig.androidReserveUrl = record.androidReserveUrl;
this.officialConfig.contact0 = record.contact0;
this.officialConfig.contact1 = record.contact1;
this.officialConfig.contact2 = record.contact2;
this.show();
},
show() {
$('#normalFile').attr('src', '');
$('#reserveFile').attr('src', '');
$('#editModal').modal('show');
},
save() {
let data = {
id: new Number(this.officialConfig.id),
iosVersion: this.officialConfig.iosVersion,
iosSkipType: new Number(this.officialConfig.iosSkipType),
iosSkipUrl: this.officialConfig.iosSkipUrl,
androidVersion: this.officialConfig.androidVersion,
androidSkipType: new Number(this.officialConfig.androidSkipType),
androidSkipUrl: this.officialConfig.androidSkipUrl,
androidNormalUrl: this.officialConfig.androidNormalUrl,
androidReserveUrl: this.officialConfig.androidReserveUrl,
contact0: this.officialConfig.contact0,
contact1: this.officialConfig.contact1,
contact2: this.officialConfig.contact2,
};
if (data.id == 0) {
data.id = null;
}
if (!(data.androidNormalUrl != '') && !(data.androidReserveUrl != '')) {
$("#tipMsg").text("android未配置apk包");
$("#tipModal").modal('show');
return;
}
saveOfficialConfig(data).then(res => {
console.log(res);
apiResult(res);
TableHelper.doRefresh('#configTable');
TableHelper.doRefresh('#browseTable');
$('#editModal').modal('hide');
});
},
},
}
</script>
<style scoped></style>

View File

@@ -243,22 +243,15 @@ export default {
};
},
created() {
this.$nextTick(function () {
this.initData();
});
this.initData();
},
methods: {
initData() {
$(function () {
this.$nextTick(function () {
// 定义线上礼物数据、装扮类型、具体装扮数据数组盒用于ajax请求获取到的数据存储
var onlineGift = [], dress = [], car = [], background = [];
var giftID = null;
var param = {
id: '',
prizeType: '',
@@ -271,8 +264,6 @@ export default {
actualValue: ''
}
var main = {
init: function () {
this.eventRegister();
@@ -280,432 +271,6 @@ export default {
},
eventRegister: function () {
// 搜索按钮点击事件
$('#searchBtn').click(function () {
TableHelper.doRefresh('#table');
});
// $('#table').on('click',function() {
// TableHelper.doRefresh('#table');
// });
// 编辑按钮点击事件
$('#table').on('click', '.opt-edit', function () {
clearModal();
$('#awardModal').modal('show');
var id = parseInt($(this).data('id'))
isEdit = true;
if (id == 'undefined' || !id) {
return;
}
$('#addModalLabel').hide();
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
var $prizeId;
switch (data.prizeType) {
case 1:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.awardAvatar').find('#imgUrl').attr('src', data.prizeImgUrl);
break;
case 2:
$('#awardModal').find('.awardChoose').show();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('#awardChoose').combobox();
var $prizeName = $('#awardChoose').find('option[value=' + data.referenceId + ']').text();
$('.awardChoose').find('input[type=text]').val($prizeName);
break;
case 3:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.headwearGift').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.carGift').show();
$('.headwearGift').hide();
$('.backgroundGift').hide();
$('#dressType option[value=' + data.prizeType + ']').attr('selected', true).siblings().attr('selected', false);
$('.carContent').find('option[value=' + data.referenceId + ']').attr('selected', true).siblings().attr('selected', false);
$prizeId = $('.carContent').find('option[value=' + data.referenceId + ']').text();
$('.carGift').find('input[type=text]').val($prizeId);
break;
case 4:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.headwearGift').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.carGift').hide();
$('.headwearGift').show();
$('.backgroundGift').hide();
$('#dressType').val(data.prizeType);
$('.headwearContent').find('option[value=' + data.referenceId + ']').attr('selected', true).siblings().attr('selected', false);
$prizeId = $('.headwearContent').find('option[value=' + data.referenceId + ']').text();
$('.headwearGift').find('input[type=text]').val($prizeId);
break;
case 5:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.headwearGift').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.carGift').hide();
$('.headwearGift').hide();
$('.backgroundGift').show();
$('#dressType option[value=' + data.prizeType + ']').attr('selected', true).siblings().attr('selected', false);
$('.backgroundContent').find('option[value=' + data.referenceId + ']').attr('selected', true).siblings().attr('selected', false);
$prizeId = $('.backgroundContent').find('option[value=' + data.referenceId + ']').text();
$('.backgroundGift').find('input[type=text]').val($prizeId);
break;
case 6:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.awardAvatar').find('#imgUrl').attr('src', data.priceImgUrl);
break;
case 7:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.realDressType').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').show();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
// $('.validity');
break;
}
$('.giftName').find('#giftName').val(data.prizeName);
$('.platformPrice').find('#platformPrice').val(data.platformValue);
$('.realPrice').find('#realPrice').val(data.actualValue);
console.log(data.prizeLevel);
$('.awardLevel').find('select').val(data.prizeLevel);
$('#imgUrl').attr('src', data.prizeImgUrl);
$('#creator').val(data.creator);
$('#addForm').data('wpId', data.id);
$('#addForm').data('wpType', data.prizeType);
$('#addForm').data('referenceID', data.referenceId);
});
// 添加事件
$('#add').on('click', function () {
isEdit = false;
clearModal();
$('#awardChoose').combobox();
// $('.carContent').combobox();
// $('.headwearContent').combobox();
// $('.backgroundContent').combobox();
$('#addType').find('option[value=budGold]').attr('selected', true).siblings().attr('selected', false);
$('#addModalLabel').show();
$('#awardModal').modal('show');
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('#awardModal').find('.awardLevel select option[value=1]').attr('selected', true).siblings().attr('selected', false);
});
// select框监听事件
$('#addModalLabel').on('change', 'select', function () {
// var budGold = budGold();
// console.log(budGold);
clearModal();
switch ($(this).val()) {
case 'budGold':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
case 'onlineGift':
$('#awardModal').find('.awardChoose').show();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
case 'dress':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.headwearGift').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.carGift').hide();
$('.backgroundGift').hide();
break;
case 'entityGift':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
case 'virtualCurrency':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
case 'beautiful':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.realDressType').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').show();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
}
});
$('#dressType').on('change', function () {
switch ($(this).val()) {
case '3':
$('.carGift').show();
$('.headwearGift').hide();
$('.backgroundGift').hide();
$('#carContent').val('');
break;
case '4':
$('.carGift').hide();
$('.headwearGift').show();
$('.backgroundGift').hide();
$('#headwearContent').val('');
break;
case '5':
$('.carGift').hide();
$('.headwearGift').hide();
$('.backgroundGift').show();
$('#backgroundContent').val('');
break;
}
});
$('.realDressType').find('.carContent').on('change', function () {
giftID = $('.carContent').val();
console.log(giftID);
});
$('.realDressType').find('.headwearContent').on('change', function () {
giftID = $('.headwearContent').val();
console.log(giftID);
});
$('.realDressType').find('.backgroundContent').on('change', function () {
giftID = $('.backgroundContent').val();
console.log(giftID);
});
// 上传图片
$('#uploadBtn').on('click', function () {
if ($('#uploadFile').val() == '') {
$('#tipMsg').text('上传图片为空');
$('#tipModal').modal('show');
return;
}
var options = {
type: 'post',
url: '/admin/upload/img',
dataType: 'json',
success: function (res) {
if (res.path) {
$('#alertWinPic').val(res.path);
$('#imgUrl').attr('src', res.path);
console.log(res.path);
} else {
$('#tipMsg').text(res.msg);
$('#tipModal').modal('show');
}
}
}
$('#addForm').ajaxSubmit(options);
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var $referenceId;
var $prizeType = null;
if ($('#addModalLabel').css('display') == 'block') {
switch ($('#addType').val()) {
case 'budGold':
$prizeType = '1';
$referenceId = 0;
break;
case 'onlineGift':
$prizeType = '2';
$referenceId = parseInt($('#awardChoose').siblings('.combobox-container').find('input:hidden').val())
break;
case 'dress':
$prizeType = $('#dressType').val();
// $referenceId = parseInt($('#realDressType').siblings('.combobox-container').find('input:hidden').val())
if ($prizeType == '3') {
$referenceId = parseInt($('.carGift').find('select').val())
} else if ($prizeType == '4') {
$referenceId = parseInt($('.headwearGift').find('select').val());
} else if ($prizeType == '5') {
$referenceId = parseInt($('.backgroundGift').find('select').val());
}
// $referenceId = $('#realDressType').val();
break;
case 'entityGift':
$prizeType = '6';
$referenceId = 0;
break;
case 'virtualCurrency':
$prizeType = '15';
$referenceId = 0;
break;
}
param.prizeType = $prizeType;
param.referenceId = $referenceId;
// giftID = $('#realDressType').find('option').attr('selected',true).val();
// console.log(giftID,$('#realDressType').val());
} else {
param.prizeType = $('#addForm').data('wpType');
param.referenceId = $('#addForm').data('referenceID');
param.id = $('#addForm').data('wpId');
}
param.prizeImgUrl = $('#imgUrl').attr('src');
param.prizeLevel = $('#awardLevel').val();
param.creator = $('#creator').val();
param.prizeName = $('#giftName').val();
param.platformValue = $('#platformPrice').val();
param.actualValue = $('#realPrice').val();
if (param.prizeLevel == '' || param.prizeLevel == 'undefined' || param.creator == '' || param.creator == 'undefined') {
$('#tipMsg').text('等级选择栏不能为空')
$('#tipModal').modal('show');
}
$.ajax({
type: 'post',
url: '/admin/prize/save',
data: {
id: param.id,
prizeType: param.prizeType,
prizeName: param.prizeName,
prizeImgUrl: param.prizeImgUrl,
referenceId: param.referenceId,
prizeLevel: param.prizeLevel,
creator: param.creator,
platFormValue: param.platformValue,
actualValue: param.actualValue
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#awardModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,错误码:' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
},
@@ -776,9 +341,7 @@ export default {
}
};
main.init();
var isEdit = false;
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
@@ -795,35 +358,35 @@ export default {
switch (val) {
case 1:
return '<p>金币</p>';
case 2:
return '<p>在线礼物</p>';
case 3:
return '<p>座驾</p>';
case 4:
return '<p>头饰</p>';
case 5:
return '<p>背景</p>';
case 6:
return '<p>实物</p>';
case 7:
return '<p>靓号</p>';
case 15:
return '<p>虚拟货币</p>';
}
}
},
@@ -887,9 +450,6 @@ export default {
}
});
function clearModal() {
$('#addForm').find('input[type=text],select,input[type=hidden]').each(function () {
$(this).val('');
@@ -900,8 +460,433 @@ export default {
}
// 搜索按钮点击事件
})
$('#searchBtn').click(function () {
TableHelper.doRefresh('#table');
});
// $('#table').on('click',function() {
// TableHelper.doRefresh('#table');
// });
// 编辑按钮点击事件
$('#table').on('click', '.opt-edit', function () {
clearModal();
$('#awardModal').modal('show');
var id = parseInt($(this).data('id'))
isEdit = true;
if (id == 'undefined' || !id) {
return;
}
$('#addModalLabel').hide();
var data = $('#table').bootstrapTable('getRowByUniqueId', id);
var $prizeId;
switch (data.prizeType) {
case 1:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.awardAvatar').find('#imgUrl').attr('src', data.prizeImgUrl);
break;
case 2:
$('#awardModal').find('.awardChoose').show();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('#awardChoose').combobox();
var $prizeName = $('#awardChoose').find('option[value=' + data.referenceId + ']').text();
$('.awardChoose').find('input[type=text]').val($prizeName);
break;
case 3:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.headwearGift').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.carGift').show();
$('.headwearGift').hide();
$('.backgroundGift').hide();
$('#dressType option[value=' + data.prizeType + ']').attr('selected', true).siblings().attr('selected', false);
$('.carContent').find('option[value=' + data.referenceId + ']').attr('selected', true).siblings().attr('selected', false);
$prizeId = $('.carContent').find('option[value=' + data.referenceId + ']').text();
$('.carGift').find('input[type=text]').val($prizeId);
break;
case 4:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.headwearGift').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.carGift').hide();
$('.headwearGift').show();
$('.backgroundGift').hide();
$('#dressType').val(data.prizeType);
$('.headwearContent').find('option[value=' + data.referenceId + ']').attr('selected', true).siblings().attr('selected', false);
$prizeId = $('.headwearContent').find('option[value=' + data.referenceId + ']').text();
$('.headwearGift').find('input[type=text]').val($prizeId);
break;
case 5:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.headwearGift').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.carGift').hide();
$('.headwearGift').hide();
$('.backgroundGift').show();
$('#dressType option[value=' + data.prizeType + ']').attr('selected', true).siblings().attr('selected', false);
$('.backgroundContent').find('option[value=' + data.referenceId + ']').attr('selected', true).siblings().attr('selected', false);
$prizeId = $('.backgroundContent').find('option[value=' + data.referenceId + ']').text();
$('.backgroundGift').find('input[type=text]').val($prizeId);
break;
case 6:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.awardAvatar').find('#imgUrl').attr('src', data.priceImgUrl);
break;
case 7:
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.realDressType').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').show();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
// $('.validity');
break;
}
$('.giftName').find('#giftName').val(data.prizeName);
$('.platformPrice').find('#platformPrice').val(data.platformValue);
$('.realPrice').find('#realPrice').val(data.actualValue);
console.log(data.prizeLevel);
$('.awardLevel').find('select').val(data.prizeLevel);
$('#imgUrl').attr('src', data.prizeImgUrl);
$('#creator').val(data.creator);
$('#addForm').data('wpId', data.id);
$('#addForm').data('wpType', data.prizeType);
$('#addForm').data('referenceID', data.referenceId);
});
// 添加事件
$('#add').on('click', function () {
isEdit = false;
clearModal();
$('#awardChoose').combobox();
// $('.carContent').combobox();
// $('.headwearContent').combobox();
// $('.backgroundContent').combobox();
$('#addType').find('option[value=budGold]').attr('selected', true).siblings().attr('selected', false);
$('#addModalLabel').show();
$('#awardModal').modal('show');
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('#awardModal').find('.awardLevel select option[value=1]').attr('selected', true).siblings().attr('selected', false);
});
// select框监听事件
$('#addModalLabel').on('change', 'select', function () {
// var budGold = budGold();
// console.log(budGold);
clearModal();
switch ($(this).val()) {
case 'budGold':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
case 'onlineGift':
$('#awardModal').find('.awardChoose').show();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
case 'dress':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.headwearGift').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
$('.carGift').hide();
$('.backgroundGift').hide();
break;
case 'entityGift':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
case 'virtualCurrency':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').hide();//装扮类型
$('#awardModal').find('.realDressType').hide();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').hide();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
case 'beautiful':
$('#awardModal').find('.awardChoose').hide();//选择礼物
$('#awardModal').find('.dressType').show();//装扮类型
$('#awardModal').find('.realDressType').show();//具体装扮
$('#awardModal').find('.giftName').show();//礼物名称
$('#awardModal').find('.awardAvatar').show();//礼物图片
$('#awardModal').find('.validity').show();//靓号有效期
$('#awardModal').find('.platformPrice').show();//平台价值
$('#awardModal').find('.realPrice').show();//实际价值
$('#awardModal').find('.awardLevel').show();//礼物等级
break;
}
});
$('#dressType').on('change', function () {
switch ($(this).val()) {
case '3':
$('.carGift').show();
$('.headwearGift').hide();
$('.backgroundGift').hide();
$('#carContent').val('');
break;
case '4':
$('.carGift').hide();
$('.headwearGift').show();
$('.backgroundGift').hide();
$('#headwearContent').val('');
break;
case '5':
$('.carGift').hide();
$('.headwearGift').hide();
$('.backgroundGift').show();
$('#backgroundContent').val('');
break;
}
});
$('.realDressType').find('.carContent').on('change', function () {
giftID = $('.carContent').val();
console.log(giftID);
});
$('.realDressType').find('.headwearContent').on('change', function () {
giftID = $('.headwearContent').val();
console.log(giftID);
});
$('.realDressType').find('.backgroundContent').on('change', function () {
giftID = $('.backgroundContent').val();
console.log(giftID);
});
// 上传图片
$('#uploadBtn').on('click', function () {
if ($('#uploadFile').val() == '') {
$('#tipMsg').text('上传图片为空');
$('#tipModal').modal('show');
return;
}
var options = {
type: 'post',
url: '/admin/upload/img',
dataType: 'json',
success: function (res) {
if (res.path) {
$('#alertWinPic').val(res.path);
$('#imgUrl').attr('src', res.path);
console.log(res.path);
} else {
$('#tipMsg').text(res.msg);
$('#tipModal').modal('show');
}
}
}
$('#addForm').ajaxSubmit(options);
});
// 保存
$('#save').on('click', function () {
if ($('#addForm').validationEngine('validate')) {
var $referenceId;
var $prizeType = null;
if ($('#addModalLabel').css('display') == 'block') {
switch ($('#addType').val()) {
case 'budGold':
$prizeType = '1';
$referenceId = 0;
break;
case 'onlineGift':
$prizeType = '2';
$referenceId = parseInt($('#awardChoose').siblings('.combobox-container').find('input:hidden').val())
break;
case 'dress':
$prizeType = $('#dressType').val();
// $referenceId = parseInt($('#realDressType').siblings('.combobox-container').find('input:hidden').val())
if ($prizeType == '3') {
$referenceId = parseInt($('.carGift').find('select').val())
} else if ($prizeType == '4') {
$referenceId = parseInt($('.headwearGift').find('select').val());
} else if ($prizeType == '5') {
$referenceId = parseInt($('.backgroundGift').find('select').val());
}
// $referenceId = $('#realDressType').val();
break;
case 'entityGift':
$prizeType = '6';
$referenceId = 0;
break;
case 'virtualCurrency':
$prizeType = '15';
$referenceId = 0;
break;
}
param.prizeType = $prizeType;
param.referenceId = $referenceId;
// giftID = $('#realDressType').find('option').attr('selected',true).val();
// console.log(giftID,$('#realDressType').val());
} else {
param.prizeType = $('#addForm').data('wpType');
param.referenceId = $('#addForm').data('referenceID');
param.id = $('#addForm').data('wpId');
}
param.prizeImgUrl = $('#imgUrl').attr('src');
param.prizeLevel = $('#awardLevel').val();
param.creator = $('#creator').val();
param.prizeName = $('#giftName').val();
param.platformValue = $('#platformPrice').val();
param.actualValue = $('#realPrice').val();
if (param.prizeLevel == '' || param.prizeLevel == 'undefined' || param.creator == '' || param.creator == 'undefined') {
$('#tipMsg').text('等级选择栏不能为空')
$('#tipModal').modal('show');
}
$.ajax({
type: 'post',
url: '/admin/prize/save',
data: {
id: param.id,
prizeType: param.prizeType,
prizeName: param.prizeName,
prizeImgUrl: param.prizeImgUrl,
referenceId: param.referenceId,
prizeLevel: param.prizeLevel,
creator: param.creator,
platFormValue: param.platformValue,
actualValue: param.actualValue
},
dataType: 'json',
success: function (res) {
if (res.code == 200) {
$('#awardModal').modal('hide');
$('#tipMsg').text('保存成功');
$('#tipModal').modal('show');
TableHelper.doRefresh('#table')
} else {
$('#tipMsg').text('保存失败,错误码:' + res.message);
$('#tipModal').modal('show');
}
}
})
}
});
});
}
},

File diff suppressed because it is too large Load Diff

View File

@@ -65,14 +65,7 @@ export default {
},
eventRegister: function () {
// 筛选按钮点击事件
$('#searchBtn').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#exportBtn").on('click', function () {
$("#searchForm").submit();
})
},
getDataFromBack: function () {
@@ -170,6 +163,14 @@ export default {
console.log('load fail');
}
});
// 筛选按钮点击事件
$('#searchBtn').on('click', function () {
TableHelper.doRefresh('#table');
});
$("#exportBtn").on('click', function () {
$("#searchForm").submit();
})
})
}
},

View File

@@ -51,9 +51,9 @@
<label for="qChannel">app渠道</label>
<input type="text" class="form-control" name="appChannel" id="qAppChannel">
</div>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnExport" class="btn btn-sm btn-primary">导出</button>
</form>
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnExport" class="btn btn-sm btn-primary">导出</button>
</div>
<!-- .content -->
<div class="content" id="table"></div>

View File

@@ -62,7 +62,7 @@
<div class="modal-body">
<form id="roomType" class="form-horizontal">
房间类型:
<select id="permitType" name="permitType" data-btn-class="btn-warning">
<select id="permitType" name="permitType" class="form-control" data-btn-class="btn-warning">
<option value="1">牌照房</option>
<option value="2">普通房</option>
<option value="3">新秀房</option>
@@ -268,7 +268,6 @@ export default {
},
methods: {
initData() {
ComboboxHelper.build(null, '#permitType');
$(function () {
//选择select时触发
$("#sendDays").change(function () {
@@ -502,7 +501,7 @@ export default {
}
var data = $('#table').bootstrapTable('getRowByUniqueId', erbanNo);
$("#roomTypeUid").val(data.room.uid);
ComboboxHelper.setDef("#permitType", data.room.isPermitRoom);
$('#permitType').val(data.room.isPermitRoom);
$("#roomTypeModal").modal('show');
});
@@ -587,7 +586,7 @@ export default {
dataType: 'json',
data: {
uid: $('#roomTypeUid').val(),
permitType: ComboboxHelper.getSelected("#permitType")
permitType: $('#permitType').val(),
},
success: function (res) {
if (res.code == 200) {

View File

@@ -1,311 +1,352 @@
<template>
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div class="col-sm-12">
<div class="big-tips">
数据量过大不再默认加载所有的数据请先选择时间后再点查询按钮
</div>
<form id="searchForm" action="/admin/roomSerial/export.action" method="POST">
房主平台号(多个查询以英文逗号分隔): <input type="text" name="erbanNos" id="erbanNos" class="input-sm">
选择时间: <input type="text" name="startTime" id="startTime" class="input-sm">
<input type="text" id="endTime" name="endTime" class="input-sm">
房间类型:
<select name="isPermit" id="isPermit" data-btn-class="btn-warning">
<option value="0">全部</option>
<option value="1">牌照房</option>
<option value="3">新秀房</option>
<!--<option value="4">个播房</option>-->
<option value="4">个播房</option>
</select>
</form>
</div>
<div class="col-sm-8">
<button id="room-serial-refresh" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
<button id="room-serial-export" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>导出
</button>
</div>
</div>
</section><!-- .content -->
<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>
<section class="content-header">
<h1 id="itemTitle"></h1>
</section>
<!-- .content -->
<section class="content">
<div id="table"></div>
<div id="toolbar">
<div class="col-sm-12">
<div class="big-tips">
数据量过大不再默认加载所有的数据请先选择时间后再点查询按钮
</div>
<form id="searchForm" action="/admin/roomSerial/export.action" method="POST">
房主平台号(多个查询以英文逗号分隔):
<input type="text" name="erbanNos" id="erbanNos" class="input-sm" style="margin-right: 40px;display: inline-block;"/> 选择时间:
<input type="text" name="startTime" id="startTime" class="input-sm" />
<input type="text" id="endTime" name="endTime" class="input-sm" />
<br />
<div style="width: 60%">
房间类型:
<select name="isPermit" id="isPermit" class="input-sm" style="width: 30%;display: inline-block;">
<option value="0">全部</option>
<option value="1">牌照房</option>
<option value="3">新秀房</option>
<!--<option value="4">个播房</option>-->
<option value="4">个播房</option>
</select>
</div>
</form>
</div>
<div class="col-sm-8">
<button id="room-serial-refresh" class="btn btn-default">
<i class="glyphicon glyphicon-wrench"></i>查询
</button>
<button id="room-serial-export" class="btn btn-default">
<i class="glyphicon glyphicon-plus"></i>导出
</button>
</div>
</div>
</section>
<!-- .content -->
<div class="modal fade" id="roomGiftSerialDetailModal" 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">&times;</span>
</button>
<h4 class="modal-title" id="roomGiftSerialDetailModalTitle">房间明细</h4>
</div>
<div class="modal-body">
<div class="summary col-sm-12">
<div class="col-sm-6">
<span>房间ID</span>
<span id="roomId"></span>
</div>
<div class="col-sm-6">
<span>房间昵称</span>
<span id="roomTitle"></span>
</div>
<div class="col-sm-6">
<span>收礼总钻石</span>
<span id="totalDiamonds"></span>
</div>
<div class="col-sm-6">
<span>房间抽成钻石数</span>
<span id="cutDiamonds"></span>
</div>
</div>
<div id="roomGiftSerialDetailTable"></div>
</div>
<div class="modal-footer">
<h4 id="roundDetailModalFooter"></h4>
<button type="button" class="btn btn-default" data-dismiss="modal">确定</button>
</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>
<div
class="modal fade"
id="roomGiftSerialDetailModal"
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">&times;</span>
</button>
<h4 class="modal-title" id="roomGiftSerialDetailModalTitle">房间明细</h4>
</div>
<div class="modal-body">
<div class="summary col-sm-12">
<div class="col-sm-6">
<span>房间ID</span>
<span id="roomId"></span>
</div>
<div class="col-sm-6">
<span>房间昵称</span>
<span id="roomTitle"></span>
</div>
<div class="col-sm-6">
<span>收礼总钻石</span>
<span id="totalDiamonds"></span>
</div>
<div class="col-sm-6">
<span>房间抽成钻石数</span>
<span id="cutDiamonds"></span>
</div>
</div>
<div id="roomGiftSerialDetailTable"></div>
</div>
<div class="modal-footer">
<h4 id="roundDetailModalFooter"></h4>
<button type="button" class="btn btn-default" data-dismiss="modal">确定</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';
import { serverError } from '@/utils/maintainer';
import TableHelper from "@/utils/bootstrap-table-helper";
import ComboboxHelper from "@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper";
import { serverError } from "@/utils/maintainer";
export default {
name: "RoomSerialView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
name: "RoomSerialView",
setup() {
return {};
},
created() {
this.$nextTick(function () {
this.initData();
});
},
methods: {
initData() {
// ComboboxHelper.build(null, '#isPermit');
$(function () {
$("#table").bootstrapTable("destroy");
$("#table").bootstrapTable({
columns: [
{ field: "userNick", title: "用户名称", align: "center", width: "20%" },
{ field: "userErbanNo", title: "房主平台号", align: "center", width: "15%" },
{ field: "totalGold", title: "总流水", align: "center", width: "10%" },
{
field: "normalTotalGold",
title: "普通礼物流水",
align: "center",
width: "10%",
},
{
field: "backpackTotalGold",
title: "背包礼物流水",
align: "center",
width: "10%",
},
{ field: "totalRadish", title: "萝卜流水", align: "center", width: "10%" },
{ field: "roomTitle", title: "房间标题", align: "center", width: "10%" },
{ field: "clanName", title: "公会名称", align: "center", width: "10%" },
{ field: "executionTime", title: "统计时间", align: "center", width: "15%" },
{ field: "executionTime", title: "统计时间", align: "center", width: "15%" },
{
field: "id",
title: "操作",
align: "center",
width: "10%",
formatter: function (val, row, index) {
const roomUid = row.roomUid;
console.log("roomUid", roomUid);
return (
'<button id="btnDetail" name="btnDetail" class="btn btn-sm btn-info opt-detail" roomUid=' +
roomUid +
">" +
'<i class="glyphicon glyphicon-file"></i> 查看明细</button>' +
'<button id="btnExport" name="btnExport" class="btn btn-sm btn-success opt-export" roomUid=' +
roomUid +
'><i class="glyphicon glyphicon-export"></i>导出明细</button>'
);
},
},
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [1, 10, 20, 30, 50],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) {
//设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText,
erbanNos: $("#erbanNos").val(),
startTime: $("#startTime").val(),
endTime: $("#endTime").val(),
isPermit: ComboboxHelper.getSelected("#isPermit"),
};
return param;
},
toolbar: "#toolbar",
url: "",
onLoadSuccess: function () {
//加载成功时执行
console.log("load success");
enableRefreshBtn();
},
onLoadError: function () {
//加载失败时执行
console.log("load fail");
},
});
},
methods: {
initData() {
ComboboxHelper.build(null, '#isPermit');
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
{ field: 'userNick', title: '用户名称', align: 'center', width: '20%' },
{ field: 'userErbanNo', title: '房主平台号', align: 'center', width: '15%' },
{ field: 'totalGold', title: '总流水', align: 'center', width: '10%' },
{ field: 'normalTotalGold', title: '普通礼物流水', align: 'center', width: '10%' },
{ field: 'backpackTotalGold', title: '背包礼物流水', align: 'center', width: '10%' },
{ field: 'totalRadish', title: '萝卜流水', align: 'center', width: '10%' },
{ field: 'roomTitle', title: '房间标题', align: 'center', width: '10%' },
{ field: 'executionTime', title: '统计时间', align: 'center', width: '15%' },
{ field: 'executionTime', title: '统计时间', align: 'center', width: '15%' },
{
field: 'id',
title: '操作',
align: 'center',
width: '10%',
formatter: function (val, row, index) {
const roomUid = row.roomUid;
console.log("roomUid", roomUid)
return '<button id="btnDetail" name="btnDetail" class="btn btn-sm btn-info opt-detail" roomUid=' + roomUid + '>' +
'<i class="glyphicon glyphicon-file"></i> 查看明细</button>' +
'<button id="btnExport" name="btnExport" class="btn btn-sm btn-success opt-export" roomUid=' + roomUid +
'><i class="glyphicon glyphicon-export"></i>导出明细</button>';
}
}
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 10,
pagination: true,
pageList: [1, 10, 20, 30, 50],
search: false,
sidePagination: "server", //表示服务端请求
//设置为undefined可以获取pageNumberpageSizesearchTextsortNamesortOrder
//设置为limit可以获取limit, offset, search, sort, order
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
pageNumber: params.pageNumber,
pageSize: params.pageSize,
searchText: params.searchText,
erbanNos: $("#erbanNos").val(),
startTime: $("#startTime").val(),
endTime: $("#endTime").val(),
isPermit: ComboboxHelper.getSelected("#isPermit")
};
return param;
},
toolbar: '#toolbar',
url: '',
onLoadSuccess: function () { //加载成功时执行
console.log("load success");
enableRefreshBtn();
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
$('#startTime').datetimepicker({
todayBtn: true,
format: 'yyyy-mm-dd hh:ii:00',
language: 'zh-CN',
autoclose: true
})
$("#startTime").datetimepicker({
todayBtn: true,
format: "yyyy-mm-dd hh:ii:00",
language: "zh-CN",
autoclose: true,
});
$("#endTime").datetimepicker({
todayBtn: true,
format: 'yyyy-mm-dd hh:ii:00',
language: 'zh-CN',
autoclose: true
});
$("#endTime").datetimepicker({
todayBtn: true,
format: "yyyy-mm-dd hh:ii:00",
language: "zh-CN",
autoclose: true,
});
$("#room-serial-refresh").click(function () {
disableRefreshBtn();
$("#table").bootstrapTable('refresh', { url: '/admin/roomSerial/listByPage' });
})
$("#room-serial-refresh").click(function () {
disableRefreshBtn();
$("#table").bootstrapTable("refresh", { url: "/admin/roomSerial/listByPage" });
});
$("#room-serial-export").click(function () {
$("#searchForm").submit();
})
$("#room-serial-export").click(function () {
$("#searchForm").submit();
});
$("#erbanNos").change(function () {
ComboboxHelper.setDef("#isPermit", '0');
if ($(this).val() == '') {
$("#isPermit").btComboBox('enable');
} else {
$("#isPermit").btComboBox('disable');
}
})
$("#erbanNos").change(function () {
ComboboxHelper.setDef("#isPermit", "0");
if ($(this).val() == "") {
$("#isPermit").btComboBox("enable");
} else {
$("#isPermit").btComboBox("disable");
}
});
function disableRefreshBtn() {
$('#room-serial-refresh').attr("disabled", "true");
}
function enableRefreshBtn() {
$('#room-serial-refresh').removeAttr("disabled");
}
// 导出房间流水明细
$('#table').on('click', '.opt-export', function () {
const roomUid = $(this).attr("roomUid");
const start = $('#startTime').val();
const end = $('#endTime').val();
console.log("--------roomUid", roomUid, start, end);
window.location.href = `/admin/roomSerial/exportRoomRevenueDetail?roomUid=${roomUid}&start=${start}&end=${end}`
});
$('#table').on('click', '.opt-detail', function () {
const roomUid = $(this).attr("roomUid");
const start = $('#startTime').val();
const end = $('#endTime').val();
$('#roomGiftSerialDetailTable').bootstrapTable('destroy');
$('#roomGiftSerialDetailTable').bootstrapTable({
columns: [
{ field: 'num', title: '序号', align: 'center', width: '5%' },
{ field: 'erbanNo', title: '平台号', align: 'center', width: '5%' },
{ field: 'nick', title: '昵称', align: 'center', width: '5%' },
{ field: 'amount', title: '收礼总钻石', align: 'center', width: '5%' },
{ field: 'cutDiamonds', title: '房间抽成钻石', align: 'center', width: '5%' },
{ field: 'bigAmount', title: '大光礼物价值', align: 'center', width: '5%', },
{ field: 'bigNum', title: '大光礼物数量', align: 'center', width: '5%', }
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) { //设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
start: start,
end: end,
roomUid: roomUid,
};
return param;
},
ajax: function (request) { //使用ajax请求
$.ajax({
type: "GET",
url: '/admin/roomSerial/listRoomRevenueDetail.action',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: request.data,
success: function (res) {
console.log('res-------', res)
apiResult(res);
request.success({
rows: res.data.rows,
total: res.data.total,
});
$("#roomId").html(res.data.roomId);
$("#roomTitle").html(res.data.roomTitle);
$("#totalDiamonds").html(res.data.totalDiamonds);
$("#cutDiamonds").html(res.data.cutDiamonds);
$("#roomGiftSerialDetailModal").modal('show');
},
error: function (req) {
serverError(req);
}
})
},
onLoadSuccess: function (res) { //加载成功时执行
console.log("load success");
},
onLoadError: function () { //加载失败时执行
console.log("load fail");
}
});
});
function apiResult(json) {
if (json.code == 200 && json.message == 'success') {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal('show');
return false;
}
});
function disableRefreshBtn() {
$("#room-serial-refresh").attr("disabled", "true");
}
},
function enableRefreshBtn() {
$("#room-serial-refresh").removeAttr("disabled");
}
// 导出房间流水明细
$("#table").on("click", ".opt-export", function () {
const roomUid = $(this).attr("roomUid");
const start = $("#startTime").val();
const end = $("#endTime").val();
console.log("--------roomUid", roomUid, start, end);
window.location.href = `/admin/roomSerial/exportRoomRevenueDetail?roomUid=${roomUid}&start=${start}&end=${end}`;
});
$("#table").on("click", ".opt-detail", function () {
const roomUid = $(this).attr("roomUid");
const start = $("#startTime").val();
const end = $("#endTime").val();
$("#roomGiftSerialDetailTable").bootstrapTable("destroy");
$("#roomGiftSerialDetailTable").bootstrapTable({
columns: [
{ field: "num", title: "序号", align: "center", width: "5%" },
{ field: "erbanNo", title: "平台号", align: "center", width: "5%" },
{ field: "nick", title: "昵称", align: "center", width: "5%" },
{ field: "amount", title: "收礼总钻石", align: "center", width: "5%" },
{
field: "cutDiamonds",
title: "房间抽成钻石",
align: "center",
width: "5%",
},
{ field: "bigAmount", title: "大光礼物价值", align: "center", width: "5%" },
{ field: "bigNum", title: "大光礼物数量", align: "center", width: "5%" },
],
undefinedText: 0,
cache: false,
striped: true,
showRefresh: false,
pageSize: 20,
pagination: true,
pageList: [20, 50, 100, 200],
search: false,
sidePagination: "server", //表示服务端请求
queryParamsType: "undefined",
queryParams: function queryParams(params) {
//设置查询参数
var param = {
page: params.pageNumber,
pageSize: params.pageSize,
start: start,
end: end,
roomUid: roomUid,
};
return param;
},
ajax: function (request) {
//使用ajax请求
$.ajax({
type: "GET",
url: "/admin/roomSerial/listRoomRevenueDetail.action",
contentType: "application/json;charset=utf-8",
dataType: "json",
data: request.data,
success: function (res) {
console.log("res-------", res);
apiResult(res);
request.success({
rows: res.data.rows,
total: res.data.total,
});
$("#roomId").html(res.data.roomId);
$("#roomTitle").html(res.data.roomTitle);
$("#totalDiamonds").html(res.data.totalDiamonds);
$("#cutDiamonds").html(res.data.cutDiamonds);
$("#roomGiftSerialDetailModal").modal("show");
},
error: function (req) {
serverError(req);
},
});
},
onLoadSuccess: function (res) {
//加载成功时执行
console.log("load success");
},
onLoadError: function () {
//加载失败时执行
console.log("load fail");
},
});
});
function apiResult(json) {
if (json.code == 200 && json.message == "success") {
return true;
}
$("#tipMsg").text("请求失败,错误信息:" + json.message);
$("#tipModal").modal("show");
return false;
}
});
},
},
};
</script>
<style scoped>
.big-tips {
color: red;
font-size: larger;
font-weight: bold;
color: red;
font-size: larger;
font-weight: bold;
}
</style>
</style>

View File

@@ -49,6 +49,7 @@
<div class="modal-body">
<form class="form-horizontal" id="addForm">
<input type="hidden" name="id" id="id" />
<input type="hidden" name="roomUid" id="roomUid" />
<div class="form-group">
<label for="modal_isTop" class="col-sm-3 control-label">是否置顶<font color="red">*</font></label>
<div class="col-sm-9">
@@ -158,10 +159,10 @@ export default {
align: 'center',
width: '10%',
formatter: function (val, row, index) {
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id="' + val + '" >' +
return '<button id="btnEdit" name="btnEdit" class="btn btn-sm btn-success opt-edit" data-id="' + val + '" data-index="' + index + '">' +
'<i class="glyphicon glyphicon-edit"></i> 编辑</button>' +
'&nbsp;&nbsp;<button class="btn btn-sm btn-danger opt-remove" data-id="' + val +
'"><i class="glyphicon glyphicon-remove"></i>删除</button>';
'" data-index="' + index + '"><i class="glyphicon glyphicon-remove"></i>删除</button>';
}
}
],
@@ -226,6 +227,7 @@ export default {
// 编辑或者新增
$("#btnConfirm").click(function () {
var id = $("#id").val();
var roomUid = $('#roomUid').val();
var seq = $("#modal_seq").val();
var isTop = $("#modal_isTop").val();
var iconContent = $("#modal_iconContent").val();
@@ -238,6 +240,7 @@ export default {
url: "/admin/roomTabHome/save.action",
data: {
id: id,
roomUid: roomUid,
seq: seq,
isTop: isTop,
iconContent: iconContent,
@@ -266,6 +269,9 @@ export default {
// 获取信息
$("#table").on("click", '.opt-edit', function () {
var id = $(this).attr("data-id");
const index = $(this).data('index');
const record = TableHelper.getData('#table')[index];
$('#roomUid').val(record.roomUid);
if (id && id != 'null') {
$.ajax({
type: "get",

View File

@@ -20,7 +20,6 @@
厅号<input type="text" class="input-sm" name="erbanNo" id="qErbanNo">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="btnExport" class="btn btn-sm btn-primary">导出</button>
<div class="tips">因数据量庞大时间范围尽量不要太长搜索公会数量尽量不要太多查询时间较长时请耐心等待</div>
</div>
</div>
@@ -119,6 +118,7 @@ export default {
},
{ field: 'newUserInRoom', title: '新用户进房人数', align: 'center', width: '5%' },
{ field: 'newUserSendGift', title: '新用户送礼人数', align: 'center', width: '5%' },
{ field: 'newUserSendGiftAmount', title: '新用户送礼流水', align: 'center', width: '5%' },
],
undefinedText: "-",
cache: false,
@@ -144,9 +144,9 @@ export default {
data: request.data,
success: function (res) {
apiResult(res);
console.log("res.data", res.data);
console.log("res.data.length()", res.data.length);
if (res.data == null || res.data.length > 0) {
console.log("res.data", res.data);
console.log("res.data.length()", res.data.length);
$("#btnSearch").attr("disabled", false);
if (getCacheDataTimer) {
clearInterval(getCacheDataTimer);

View File

@@ -180,26 +180,6 @@
import TableHelper from '@/utils/bootstrap-table-helper';
import { showLoading, hideLoading } from '@/utils/maintainer';
var picker1 = $('#startTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
endDate: new Date()
});
var picker2 = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#startTime').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endTime').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
export default {
name: "GenAccountView",
setup() {
@@ -212,8 +192,27 @@ export default {
},
methods: {
initData() {
$(function () {
var picker1 = $('#startTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
endDate: new Date()
});
var picker2 = $('#endTime').datetimepicker({
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true
});
picker1.on('changeDate', function () {
var date = $('#startTime').datetimepicker('getDate');
picker2.datetimepicker('setStartDate', date);
});
picker2.on('changeDate', function () {
var date = $('#endTime').datetimepicker('getDate');
picker1.datetimepicker('setEndDate', date);
});
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [

View File

@@ -56,10 +56,13 @@
<option value="2">普通面板礼物</option>
<option value="3">福袋礼物</option>
<option value="5">福袋奖池礼物</option>
<option value="1">轻聊或者竞拍房</option>
<option value="4">卡片</option>
<option value="7">贵族礼物</option>
<option value="8">周星榜礼物</option>
<option value="9">合成礼物</option>
<option value="10">涂鸦礼物</option>
<option value="11">个播人气礼物</option>
<option value="15">线性福袋礼物</option>
</select>
</div>
@@ -125,7 +128,8 @@
</div>
</div>
</div>
<div class="modal fade" id="giftModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel">
<div class="modal fade" id="giftModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel"
style="height: 100%; overflow: hidden; overflow: scroll;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -164,8 +168,8 @@
<div class="form-group">
<label for="giftType" class="col-sm-2 control-label">礼物类型</label>
<div class="col-sm-10">
<select name="giftType" id="giftType" data-btn-class="btn-warning">
<option value="2">普通面板礼物</option>
<select name="giftType" id="giftType" class="form-control" data-btn-class="btn-warning">
<option value="2" selected>普通面板礼物</option>
<option value="3">福袋礼物</option>
<option value="5">福袋奖池礼物</option>
<option value="1">轻聊或者竞拍房</option>
@@ -174,6 +178,7 @@
<option value="8">周星榜礼物</option>
<option value="9">合成礼物</option>
<option value="10">涂鸦礼物</option>
<option value="11">个播人气礼物</option>
<option value="15">线性福袋礼物</option>
</select>
</div>
@@ -283,7 +288,7 @@
<label class="col-sm-2 control-label">礼物图片:</label>
<div class="col-sm-10">
<img src="" id="picImage" style="width:250px;height:90px;" alt="">
<input type="file" id="picUploadFile" name="file">
<input type="file" id="picUploadFile" name="file" @change="changeFile($event)">
<button class="btn btn-success" type="button" id="picUploadBtn">上传</button>
<input type="hidden" id="picUrl" name="picUrl" class="form-control validate[required]" />
<span id="picImgInfo" style="color:red;"></span>
@@ -293,7 +298,7 @@
<label class="col-sm-2 control-label">vgg图片:</label>
<div class="col-sm-10">
<img src="" id="vggImage" style="width:250px;height:90px;" alt="">
<input type="file" id="vggUploadFile" name="file">
<input type="file" id="vggUploadFile" name="file" @change="changeFile($event)">
<button class="btn btn-success" type="button" id="vggUploadBtn">上传</button>
<input type="hidden" id="vggUrl" name="vggUrl" class="form-control validate[required]" />
<span id="vggImgInfo" style="color:red;"></span>
@@ -302,7 +307,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">svga文件:</label>
<div class="col-sm-10">
<input type="file" id="svgaUploadFile" name="file">
<input type="file" id="svgaUploadFile" name="file" @change="changeFile($event)">
<button class="btn btn-success" type="button" id="svgaUploadBtn">上传</button>
<span>这里只适用于福袋svga动效上传</span>
<input type="hidden" id="luckyGiftSvgaUrl" name="luckyGiftSvgaUrl"
@@ -324,8 +329,8 @@
<div class="form-group">
<label class="col-sm-2 control-label">其他视图文件:</label>
<div class="col-sm-10">
<img src="" id="viewFile" style="width:250px;height:90px;" alt="">
<input type="file" id="viewUploadFile" name="file">
<video src="" id="viewFile" style="width:50%;height:50%;" alt="" autoplay="true"></video>
<input type="file" id="viewUploadFile" name="file" @change="changeFile($event)">
<button class="btn btn-success" type="button" id="viewFileUploadBtn">上传</button>
<span>如果上面已经上传svga素材此处不要再上传</span>
<input type="hidden" id="viewUrl" name="viewUrl" class="form-control validate[required]" />
@@ -546,13 +551,16 @@
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
import { formatTime, showLoading, hideLoading } from '@/utils/maintainer';
import { formatTime, showLoading, hideLoading, apiResult } from '@/utils/maintainer';
import { uploadGift } from '@/api/common/upload';
//ComboboxHelper.build(null, '#giftType');
//ComboboxHelper.build(null, '#condition_type');
//ComboboxHelper.build(null, '#nobleId');
export default {
name: "GiftManageView",
data() {
return {
files: {},
};
},
setup() {
function selectConsumeChange(obj) {
var val = $('#consumeType').val();
@@ -562,7 +570,7 @@ export default {
$('.noble').removeClass("hidden");
}
if (val == 3) {
ComboboxHelper.setDef("#giftType", 2);
$('#giftType').val(2);
$("#giftType").attr('readonly', true);
$('#roomFreeGift').removeClass("hidden");
} else {
@@ -592,9 +600,15 @@ export default {
});
},
methods: {
changeFile(event) {
console.log(event);
let target = event.target;
let id = target.id;
this.files[id] = target.files[0];
},
initData() {
let $this = this;
$(function () {
$('#table').bootstrapTable('destroy');
$('#table').bootstrapTable({
columns: [
@@ -817,6 +831,7 @@ export default {
$("#gift-add").click(function () {
// 打开编辑弹窗
$("#giftModal").modal('show');
$this.files = {};
$("#giftForm")[0].reset();
$('#picUrl').val('');
@@ -849,10 +864,10 @@ export default {
// $("#goldPrice").attr('readonly', false);
$("#nobleId").btComboBox('disable');
ComboboxHelper.setDef("#nobleId", '0');
ComboboxHelper.setDef("#giftType", '2');
$('#giftType').val(2);
$("input:radio[name='giftStatus']")[1].checked = true;
$("input:radio[name='hasEffect']")[0].checked = true;
$("input:radio[name='hasVggPic']")[0].checked = true;
$("input:radio[name='hasEffect']")[1].checked = true;
$("input:radio[name='hasVggPic']")[1].checked = true;
$("input:radio[name='hasSvga']")[0].checked = true;
$("input:radio[name='isLatest']")[1].checked = true;
$("input:radio[name='isTimeLimit']")[1].checked = true;
@@ -884,7 +899,7 @@ export default {
}
});
}
})
$("#nobleId").on('change', function () {
@@ -976,111 +991,79 @@ export default {
});
$('#picUploadBtn').on('click', function () {
$.ajaxFileUpload({
fileElementId: 'picUploadFile', //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/gift/upload', //后台方法的路径
type: 'post', //当要提交自定义参数时这个参数要设置成post
dataType: 'json', //服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。
secureuri: false, //是否启用安全提交默认为false。
async: true, //是否是异步
success: function (json) { //提交成功后自动执行的处理函数参数data就是服务器返回的数据。
if (json.path) {
$('#picUrl').val(json.path);
$('#picImage').attr("src", json.path);
if (json.path != '') {
$("#picImgInfo").html('已上传成功');
} else {
$("#picImgInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数。
console.error(e);
showLoading();
uploadGift($this.files['picUploadFile']).then(res => {
let path = res.path;
console.log(path);
$('#picUrl').val(path);
$('#picImage').attr("src", path);
if (path != '') {
$("#picImgInfo").html('已上传成功');
} else {
$("#picImgInfo").html('未上传成功');
}
hideLoading();
}).catch(e => {
console.error(e);
hideLoading();
});
})
});
$('#vggUploadBtn').on('click', function () {
$.ajaxFileUpload({
url: '/admin/gift/upload',//后台请求地址
type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post
secureuri: false,//是否启用安全提交默认为false。
fileElementId: 'vggUploadFile',// 需要上传的文件域的ID即<input type="file">的ID。
dataType: 'json',//服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。如果json返回的带pre,这里修改为json即可解决。
success: function (json, status) {//提交成功后自动执行的处理函数参数data就是服务器返回的数据。
console.log(json);
if (json.path) {
$('#vggUrl').val(json.path);
$('#vggImage').attr("src", json.path);
if (json.path != '') {
$("#vggImgInfo").html('已上传成功');
} else {
$("#vggImgInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
showLoading();
uploadGift($this.files['vggUploadFile']).then(res => {
let path = res.path;
console.log(path);
$('#vggUrl').val(path);
$('#vggImage').attr("src", path);
if (path != '') {
$("#vggImgInfo").html('已上传成功');
} else {
$("#vggImgInfo").html('未上传成功');
}
});
})
hideLoading();
}).catch(e => {
console.error(e);
hideLoading();
});
});
$('#svgaUploadBtn').on('click', function () {
$.ajaxFileUpload({
url: '/admin/gift/upload',//后台请求地址
type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post
secureuri: false,//是否启用安全提交默认为false。
fileElementId: 'svgaUploadFile',// 需要上传的文件域的ID即<input type="file">的ID。
dataType: 'json',//服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。如果json返回的带pre,这里修改为json即可解决。
success: function (json, status) {//提交成功后自动执行的处理函数参数data就是服务器返回的数据。
console.log(json);
if (json.path) {
$('#luckyGiftSvgaUrl').val(json.path);
if (json.path != '') {
$("#svgaImgInfo").html('已上传成功');
} else {
$("#svgaImgInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
showLoading();
uploadGift($this.files['svgaUploadFile']).then(res => {
let path = res.path;
console.log(path);
$('#luckyGiftSvgaUrl').val(path);
if (path != '') {
$("#svgaImgInfo").html('已上传成功');
} else {
$("#svgaImgInfo").html('未上传成功');
}
});
})
hideLoading();
}).catch(e => {
console.error(e);
hideLoading();
});
});
$('#viewFileUploadBtn').on('click', function () {
$.ajaxFileUpload({
url: '/admin/gift/upload',//后台请求地址
type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post
secureuri: false,//是否启用安全提交默认为false。
fileElementId: 'viewUploadFile',// 需要上传的文件域的ID即<input type="file">的ID。
dataType: 'json',//服务器返回的数据类型。可以为xml,script,json,html。如果不填写jQuery会自动判断。如果json返回的带pre,这里修改为json即可解决。
success: function (json, status) {//提交成功后自动执行的处理函数参数data就是服务器返回的数据。
console.log(json);
if (json.path) {
$('#viewUrl').val(json.path);
$('#viewFile').attr("src", json.path);
if (json.path != '') {
$("#viewFileInfo").html('已上传成功');
} else {
$("#viewFileInfo").html('未上传成功');
}
console.log(json.path);
} else {
$("#tipMsg").text(json.msg);
$("#tipModal").modal('show');
}
showLoading();
uploadGift($this.files['viewUploadFile']).then(res => {
let path = res.path;
console.log(path);
$('#viewUrl').val(path);
$('#viewFile').attr("src", path);
if (path != '') {
$("#viewFileInfo").html('已上传成功');
} else {
$("#viewFileInfo").html('未上传成功');
}
hideLoading();
}).catch(e => {
console.error(e);
hideLoading();
});
})
});
$("#cancel").click(function () {
TableHelper.unCheckAll("#table");
@@ -1103,6 +1086,7 @@ export default {
$("#table").on("click", '.opt-edit', function () {
console.log("btnEdit");
var id = $(this).attr("data-id");
$this.files = {};
$.ajax({
type: "get",
url: "/admin/gift/get.action",
@@ -1131,7 +1115,6 @@ export default {
$("#consumeType").val(consumeType);
$("#consumeType").attr("disabled", true);
ComboboxHelper.setDef("#giftType", json.entity.giftType);
$('#giftType').val(json.entity.giftType);
if (consumeType == 1) {
ComboboxHelper.setDef("#nobleId", '0');
@@ -1551,13 +1534,13 @@ function roomGiftTableInit() {
switch (val) {
case 1:
return '牌照房';
case 2:
return '非牌照房';
case 3:
return '新秀房';
}
}
},

View File

@@ -7,20 +7,29 @@
</section>
<section class="content">
<div id="table"></div>
<div id="toolbar">消息类型:<select name="msgType" id="type" class="input-m">
<option value="0">文本</option>
<option value="1">图片</option>
<option value="100">图文</option>
</select>
<div id="toolbar">
<label for="erbanNum" class="col-sm-2 control-label">消息类型:</label>
<div class="col-sm-3">
<span>
<select name="msgType" id="type" class="form-control input-m">
<option value="0">文本</option>
<option value="1">图片</option>
<option value="100">图文</option>
</select>
</span>
</div>
<label for="erbanNum" class="col-sm-2 control-label">平台号:</label>
<div class="col-sm-3">
<span><input type="text" class="form-control validate[required]" name="erbanNo"
id="erbanNum"></span>
<span>
<input type="text" class="form-control validate[required]" name="erbanNo" id="erbanNum">
</span>
</div>
<div class="col-sm-12">
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
<button id="add" class="btn btn-sm btn-default">
<i class="glyphicon glyphicon-plus"></i>增加
</button>
</div>
<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>
@@ -40,7 +49,7 @@
<div class="form-group">
<label for="receiver" class="col-sm-3 control-label">接收者</label>
<div class="col-sm-8">
<select name="receivers" id="receiver" class="col-sm-3">
<select name="receivers" id="receiver" class="col-sm-3 form-control">
<option value=1>所有用户</option>
<option value=0>指定用户</option>
</select>
@@ -50,7 +59,7 @@
<div class="form-group" id="appIdDiv">
<label for="appId" class="col-sm-3 control-label">渠道</label>
<div class="col-sm-8">
<select name="appId" id="appId" class="col-sm-3">
<select name="appId" id="appId" class="col-sm-3 form-control">
<option value="">全部</option>
<option value="official">安卓官方包</option>
<option value="google">安卓谷歌包</option>
@@ -63,7 +72,7 @@
<div class="form-group">
<label for="msgType" class="col-sm-3 control-label">消息类型</label>
<div class="col-sm-8">
<select name="msgTypeList" id="msgType" class="col-sm-3">
<select name="msgTypeList" id="msgType" class="col-sm-3 form-control">
<option value="0">文本</option>
<option value="1">图片</option>
<option value="100">图文</option>
@@ -74,13 +83,14 @@
<div class="form-group" id="skipUrlDiv">
<label for="skip" class="col-sm-3 control-label">跳转来源</label>
<div class="col-sm-8">
<select name="skip" id="skip" class="col-sm-3">
<select name="skip" id="skip" class="col-sm-3 form-control">
<option value=""></option>
<option value="2">跳H5页面</option>
<option value="1" id="skipRoomType">跳转房间</option>
</select>
</div>
<div class="col-sm-6">
<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>
@@ -125,13 +135,24 @@
class="form-control validate[required]" />
</div>
</div>
<div class="form-group">
<label for="pushTime" class="col-sm-3 control-label">推送时间(非必填)</label>
<div class="col-sm-9">
<div class="col-sm-8">
<input type="text" class="input-sm form-control datetime" name="pushTime" id="pushTime">
</div>
</div>
<div class="form-group">
<label for="ignoreVersion" class="col-sm-3 control-label">不接收用户版本(非必填)</label>
<div class="col-sm-8">
<input type="text" class="input-sm form-control" name="ignoreVersion" id="ignoreVersion">
</div>
</div>
<div class="form-group">
<label for="ignoreChannel" class="col-sm-3 control-label">不接收用户渠道(非必填)</label>
<div class="col-sm-8">
<input type="text" class="input-sm form-control" name="ignoreChannel" id="ignoreChannel">
</div>
</div>
</form>
</div>
<div class="modal-footer">
@@ -367,7 +388,9 @@ export default {
skipType: $('#skip').val(),
skipContent: $('#skipUrlContent').val(),
appId: $("#appId").val(),
pushTime: $("#pushTime").val()
pushTime: $("#pushTime").val(),
ignoreVersion: $('#ignoreVersion').val(),
ignoreChannel: $('#ignoreChannel').val(),
},
dataType: 'json',
success: function (data) {

View File

@@ -8,6 +8,7 @@
<section class="content">
<div id="table"></div>
<div id="toolbar">
平台号<input type="text" name="erBanNoStr" id="erBanNoStr" class="input-sm" />
身份证号<input type="text" name="idCardNum" id="idCardNum" class="input-sm" />
状态
<select id="bindStatus" name="bindStatus" class="input-sm">
@@ -106,6 +107,7 @@ export default {
var param = {
pageSize: params.pageSize,
pageNumber: params.pageNumber,
erBanNoStr: $('#erBanNoStr').val(),
bindStatus: $('#bindStatus').val(),
idCardNum: $('#idCardNum').val()
};

View File

@@ -279,6 +279,7 @@
<script>
import TableHelper from '@/utils/bootstrap-table-helper';
import { formatTime } from '@/utils/maintainer';
export default {
name: "WithdrawUserView",
@@ -314,6 +315,15 @@ export default {
return value;
}
},
{
field: 'updateTime',
title: '修改时间',
align: 'center',
width: '5%',
formatter: function (val, row, index) {
return formatTime(val);
}
},
],
cache: false,
striped: true,