171 lines
6.3 KiB
Vue
171 lines
6.3 KiB
Vue
<template>
|
|
<section class='content'>
|
|
<div class="box box-primary">
|
|
<div class="box-body">
|
|
<section class="content-header">
|
|
<h1 id="itemTitle"></h1>
|
|
</section>
|
|
|
|
<section class="content">
|
|
<div id="toolbar">
|
|
平台号: <input type="text" id='erbanNo' placeholder='必填'>
|
|
抽奖类型: <select name="lottoType" id="lottoType">
|
|
<option value="0">全部</option>
|
|
<option value="1">充值抽奖</option>
|
|
<option value="2">分享抽奖</option>
|
|
<option value="3">打怪兽抽奖</option>
|
|
</select>
|
|
|
|
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
|
<div class="userMessage">
|
|
<div class="avatar">
|
|
<img src="" alt="">
|
|
</div>
|
|
<div class="nick"></div>
|
|
<div class="erbanNo"></div>
|
|
</div>
|
|
</div>
|
|
<div id="table"></div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
name: "UserDrawRecordAdminView",
|
|
setup() {
|
|
return {};
|
|
},
|
|
created() {
|
|
this.$nextTick(function () {
|
|
this.initData();
|
|
});
|
|
},
|
|
methods: {
|
|
initData() {
|
|
|
|
$(function () {
|
|
|
|
|
|
$('#btnSearch').on('click', function () {
|
|
// console.log($('#lottoType').val());
|
|
// TableHelper.doRefresh('#table');
|
|
|
|
$('#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 (params) {
|
|
var param = {
|
|
pageSize: params.pageSize,
|
|
pageNumber: params.pageNumber,
|
|
drawType: parseInt($('#lottoType').val()),
|
|
erbanNo: $('#erbanNo').val()
|
|
};
|
|
return param;
|
|
},
|
|
uniqueId: 'erbanNo',
|
|
toolbar: '#toolbar',
|
|
url: '/admin/userdraw/list',
|
|
onLoadSuccess: function (res) {
|
|
console.log('load success');
|
|
if (res.users) {
|
|
var $user = $('.userMessage');
|
|
$user.css('display', 'flex');
|
|
$user.find('.avatar img').attr('src', res.users.avatar)
|
|
$user.find('.nick').html('昵称:' + res.users.nick);
|
|
$user.find('.erbanNo').html('平台号:' + res.users.erbanNo);
|
|
}
|
|
},
|
|
onLoadError: function () {
|
|
console.log('load fail');
|
|
},
|
|
columns: [
|
|
// {field:'userName',title:'用户昵称',align:'center',valign:'middle',width:'15%'},
|
|
{ field: 'uid', title: 'Uid', align: 'center', valign: 'middle', width: '15%' },
|
|
{ field: 'drawPrizeName', title: '礼物名称', align: 'center', valign: 'middle', width: '15%' },
|
|
{
|
|
field: 'createTime', title: '获得机会时间', align: 'center', valign: 'middle', width: '15%',
|
|
formatter: function (val, row, index) {
|
|
if (val) {
|
|
var date = new Date(val);
|
|
return date.format("yyyy-MM-dd hh:mm:ss");
|
|
} else {
|
|
return '-';
|
|
}
|
|
}
|
|
},
|
|
{
|
|
field: 'updateTime', title: '抽奖时间', align: 'center', valign: 'middle', width: '15%',
|
|
formatter: function (val, row, index) {
|
|
if (val) {
|
|
var date = new Date(val);
|
|
return date.format('yyyy-MM-dd hh:mm:ss');
|
|
} else {
|
|
return '-';
|
|
}
|
|
}
|
|
},
|
|
{
|
|
field: 'type', title: '抽奖类型', align: 'center', valign: 'middle', width: '15%',
|
|
formatter: function (val, row, index) {
|
|
switch (val) {
|
|
case 1:
|
|
return '充值抽奖';
|
|
|
|
case 2:
|
|
return '分享抽奖';
|
|
|
|
case 3:
|
|
return '打怪兽抽奖';
|
|
|
|
}
|
|
}
|
|
}
|
|
]
|
|
});
|
|
|
|
})
|
|
})
|
|
}
|
|
},
|
|
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
#erbanNo {
|
|
height: 25px;
|
|
}
|
|
|
|
.userMessage {
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
display: none;
|
|
margin-top: 10px;
|
|
}
|
|
|
|
.avatar {
|
|
width: 50px;
|
|
height: 50px;
|
|
}
|
|
|
|
.avatar img {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
.userMessage div {
|
|
margin-right: 30px;
|
|
}
|
|
</style> |