324 lines
15 KiB
Vue
324 lines
15 KiB
Vue
<template>
|
|
<section class="content">
|
|
<div class="box box-primary">
|
|
<div class="box-body">
|
|
<section class="content-header">
|
|
<h1 id="itemTitle"></h1>
|
|
</section>
|
|
<form id="form" action="" method="post" target="_blank">
|
|
<input type="hidden" name="flowChannelType" id="exportFlowChannelType">
|
|
<input type="hidden" name="erbanNo" id="exportErbanNo">
|
|
<input type="hidden" name="phone" id="exportPhone">
|
|
<input type="hidden" name="startDate" id="exportStartDate">
|
|
<input type="hidden" name="endDate" id="exportEndDate">
|
|
<input type="hidden" name="partitionId" id="exportPartitionId">
|
|
<input type="hidden" name="loginType" id="exportLoginType">
|
|
<input type="hidden" name="isCharge" id="exportIsCharge">
|
|
<input type="hidden" name="firstRoomErBanNo" id="exportFirstRoomErBanNo">
|
|
</form>
|
|
<div id="toolbar">
|
|
<div class="col-lg-12">
|
|
<div class="col-sm-3">
|
|
<label htmlFor="flowChannelType" class="col-sm-4 control-label">流量渠道:</label>
|
|
<div class="col-sm-8">
|
|
<select name="flowChannelType" id="flowChannelType" class="form-control"
|
|
data-btn-class="btn-warning">
|
|
<option value="0">全部</option>
|
|
<option value="1">流量团队</option>
|
|
<option value="2">直播导流</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label htmlFor="erbanNo" class="col-sm-4 control-label">平台号:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm form-control" name="erbanNo" id="erbanNo">
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label htmlFor="phone" class="col-sm-4 control-label">手机号:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm form-control" name="phone" id="phone">
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label class="col-sm-4 control-label">开始时间:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm datetime form-control" name="startDate" id="startDate">
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label class="col-sm-4 control-label">结束时间:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm datetime form-control" name="endDate" id="endDate">
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-sm-12">
|
|
<div class="col-sm-3">
|
|
<label for="partitionId" class="col-sm-4 control-label">地区:</label>
|
|
<div class="col-sm-8">
|
|
<select name="partitionId" id="partitionId" class="form-control">
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label for="loginType" class="col-sm-4 control-label">注册类型:</label>
|
|
<div class="col-sm-8">
|
|
<select name="loginType" id="loginType" class="form-control">
|
|
<option value="">全部</option>
|
|
<option value="3">手机号注册</option>
|
|
<option value="5">APPLE注册</option>
|
|
<option value="8">GOOGLE注册</option>
|
|
<option value="9">LINE注册</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label for="isCharge" class="col-sm-4 control-label">是否充值:</label>
|
|
<div class="col-sm-8">
|
|
<select name="isCharge" id="isCharge" class="form-control">
|
|
<option value="">全部</option>
|
|
<option value="1">是</option>
|
|
<option value="0">否</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-3">
|
|
<label for="firstRoomErBanNo" class="col-sm-4 control-label">首进房ID:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="input-sm form-control" name="firstRoomErBanNo" id="firstRoomErBanNo">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-sm-12">
|
|
<button id="btnSearch" class="btn btn-default">
|
|
<i class="glyphicon glyphicon-search"></i>查询
|
|
</button>
|
|
<button id="btnExport" class="btn btn-default">
|
|
<i class="glyphicon glyphicon-export"></i>导出
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- .content -->
|
|
<div id="table"></div>
|
|
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
<script>
|
|
import TableHelper from '@/utils/bootstrap-table-helper';
|
|
import { getPartitionInfoList } from '@/api/partition/partitionInfo';
|
|
import { buildSelectOption } from '@/utils/system-helper';
|
|
|
|
export default {
|
|
name: "UserDetailAdminView",
|
|
setup() {
|
|
return {};
|
|
},
|
|
created() {
|
|
this.$nextTick(function () {
|
|
this.initPartition();
|
|
this.initData();
|
|
});
|
|
},
|
|
methods: {
|
|
initData() {
|
|
$(function () {
|
|
$('.datetime').datetimepicker({
|
|
format: 'yyyy-mm-dd hh:ii:00',
|
|
autoclose: true
|
|
});
|
|
|
|
$("#startDate").datetimepicker({
|
|
minView: "month",
|
|
language: 'zh-CN',
|
|
todayBtn: 1,
|
|
autoclose: 1
|
|
}).on("changeDate", function (event) {
|
|
$("#endDate").datetimepicker('setStartDate', event.date);
|
|
});
|
|
|
|
$("#endDate").datetimepicker({
|
|
minView: "month",
|
|
language: 'zh-CN',
|
|
todayBtn: 1,
|
|
autoclose: 1,
|
|
useCurrent: false
|
|
}).on("changeDate", function (event) {
|
|
$("#startDate").datetimepicker('setEndDate', event.date);
|
|
});
|
|
|
|
initDefaultDate();
|
|
|
|
|
|
function initDefaultDate() {
|
|
var today = new Date();
|
|
today.setHours(0);
|
|
today.setMinutes(0);
|
|
today.setSeconds(0);
|
|
today.setMilliseconds(0);
|
|
|
|
var oneDay = 1000 * 24 * 60 * 60;
|
|
|
|
var startDate = new Date(today.getTime() - (30 * oneDay));
|
|
var endDate = new Date(today.getTime() + oneDay);
|
|
$('#startDate').val(startDate.format("yyyy-MM-dd hh:mm:ss"));
|
|
$('#endDate').val(endDate.format("yyyy-MM-dd hh:mm:ss"));
|
|
}
|
|
|
|
buildTable();
|
|
|
|
// 列表设置
|
|
function buildTable() {
|
|
$('#table').bootstrapTable('destroy');
|
|
$('#table').bootstrapTable({
|
|
cache: false,
|
|
striped: true,
|
|
showRefresh: false,
|
|
pageSize: 10,
|
|
pagination: true,
|
|
pageList: [10, 20, 30, 50],
|
|
sidePagination: "server", //表示服务端请求
|
|
queryParamsType: "undefined",
|
|
queryParams: function queryParams(params) {
|
|
var param = {
|
|
pageNumber: params.pageNumber,
|
|
pageSize: params.pageSize,
|
|
flowChannelType: $('#flowChannelType').val(),
|
|
erbanNo: $('#erbanNo').val(),
|
|
phone: $('#phone').val(),
|
|
startDate: $('#startDate').val(),
|
|
endDate: $('#endDate').val(),
|
|
partitionId: $('#partitionId').val(),
|
|
loginType: $('#loginType').val(),
|
|
isCharge: $('#isCharge').val(),
|
|
firstRoomErBanNo: $('#firstRoomErBanNo').val(),
|
|
};
|
|
return param;
|
|
},
|
|
uniqueId: 'id',
|
|
toolbar: '#toolbar',
|
|
url: '/admin/stats/userDetail/list',
|
|
onLoadSuccess: function () { //加载成功时执行
|
|
console.log("load success");
|
|
},
|
|
onLoadError: function () { //加载失败时执行
|
|
console.log("load fail");
|
|
},
|
|
columns: [
|
|
{ field: 'uid', title: 'uid', align: 'center', valign: 'middle' },
|
|
{ field: 'partitionDesc', title: '分区', align: 'center', valign: '15%' },
|
|
{ field: 'lastLoginRegion', title: '国家', align: 'center', valign: '15%' },
|
|
{ field: 'erbanNo', title: '平台号', align: 'center', valign: '10%' },
|
|
{ field: 'nick', title: '昵称', align: 'center', valign: '15%' },
|
|
{
|
|
field: 'createTime',
|
|
title: '新增时间',
|
|
align: 'center',
|
|
valign: 'middle',
|
|
width: '10%',
|
|
formatter: function (val, row, index) {
|
|
var date = new Date(val);
|
|
return date.format("yyyy-MM-dd hh:mm:ss");
|
|
}
|
|
},
|
|
{ field: 'inviteCodeinfo', title: '邀请码信息', align: 'center', valign: '15%' },
|
|
{ field: 'flowChannel', title: '流量渠道', align: 'center', valign: '15%' },
|
|
{ field: 'channel', title: '新增渠道', align: 'center', valign: '10%' },
|
|
{ field: 'model', title: '设备信息', align: 'center', valign: '10%' },
|
|
{
|
|
field: 'newDevice',
|
|
title: '是否有同设备',
|
|
align: 'center',
|
|
valign: 'middle',
|
|
width: '5%',
|
|
formatter: function (val) {
|
|
if (val == null || val == undefined) return '-';
|
|
if (val == false) {
|
|
return '是';
|
|
} else {
|
|
return '否';
|
|
}
|
|
}
|
|
},
|
|
{ field: 'registerIp', title: 'IP', align: 'center', valign: '10%' },
|
|
{ field: 'isChargeStr', title: '是否充值', align: 'center', valign: '10%' },
|
|
{ field: 'chargeAmount', title: '充值金额', align: 'center', valign: '10%' },
|
|
{ field: 'firstRoomErBanNo', title: '首进房ID', align: 'center', valign: '10%' },
|
|
{ field: 'loginTypeStr', title: '注册类型', align: 'center', valign: '10%' },
|
|
{ field: 'genderStr', title: '性别', align: 'center', valign: '10%' },
|
|
]
|
|
});
|
|
}
|
|
|
|
|
|
// 查询刷新
|
|
$('#btnSearch').on('click', function () {
|
|
TableHelper.doRefresh('#table');
|
|
});
|
|
|
|
// 导出excel
|
|
$('#btnExport').on('click', function () {
|
|
var form = $("#form");
|
|
form.attr("action", "/admin/stats/userDetail/export");
|
|
$('#exportFlowChannelType').val($('#flowChannelType').val());
|
|
$('#exportErbanNo').val($('#erbanNo').val());
|
|
$('#exportPhone').val($('#phone').val());
|
|
$('#exportStartDate').val($('#startDate').val());
|
|
$('#exportEndDate').val($('#endDate').val());
|
|
$('#exportPartitionId').val($('#partitionId').val());
|
|
$('#exportLoginType').val($('#loginType').val());
|
|
$('#exportIsCharge').val($('#isCharge').val());
|
|
$('#exportFirstRoomErBanNo').val($('#firstRoomErBanNo').val());
|
|
form.submit();
|
|
});
|
|
});
|
|
},
|
|
initPartition() {
|
|
getPartitionInfoList().then(res => {
|
|
let data = res.data;
|
|
buildSelectOption(
|
|
"#partitionId",
|
|
null,
|
|
[{
|
|
value: '',
|
|
text: '全部'
|
|
}].concat(data.map((v) => {
|
|
return {
|
|
value: v.id,
|
|
text: v.desc,
|
|
};
|
|
}))
|
|
);
|
|
});
|
|
},
|
|
},
|
|
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
.operateBtn {
|
|
margin-right: 5px;
|
|
}
|
|
|
|
.control-label {
|
|
padding-right: 0;
|
|
margin-right: 0;
|
|
}
|
|
|
|
.col-sm-3 {
|
|
padding-right: 0;
|
|
padding-left: 0;
|
|
}
|
|
|
|
.col-sm-8 {
|
|
padding-right: 0;
|
|
padding-left: 0;
|
|
}</style> |