夺宝精灵奖池信息展示
This commit is contained in:
@@ -9,10 +9,20 @@ export const savePoolItem = query => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//发布
|
||||||
export const deployPoolItem = query => {
|
export const deployPoolItem = query => {
|
||||||
return request({
|
return request({
|
||||||
url: '/admin/seize-treasure/pool/item/deploy',
|
url: '/admin/seize-treasure/pool/item/deploy',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//已发布奖池
|
||||||
|
export const deployedPoolItem = query => {
|
||||||
|
return request({
|
||||||
|
url: '/admin/seize-treasure/pool/item/deployed',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
};
|
};
|
@@ -27,6 +27,9 @@
|
|||||||
<button id="btnDeploy" class="btn btn-default" @click="btnDeploy">
|
<button id="btnDeploy" class="btn btn-default" @click="btnDeploy">
|
||||||
<i class="glyphicon glyphicon-plus-sign"></i>发布
|
<i class="glyphicon glyphicon-plus-sign"></i>发布
|
||||||
</button>
|
</button>
|
||||||
|
<button id="btnDeployed" class="btn btn-default" @click="btnDeployed">
|
||||||
|
<i class="glyphicon glyphicon-plus-sign"></i>发布
|
||||||
|
</button>
|
||||||
<button id="btnSearch" class="btn btn-default" @click="btnSearch">
|
<button id="btnSearch" class="btn btn-default" @click="btnSearch">
|
||||||
<i class="glyphicon glyphicon-search"></i>查询
|
<i class="glyphicon glyphicon-search"></i>查询
|
||||||
</button>
|
</button>
|
||||||
@@ -105,13 +108,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="modal fade" id="deployedModal" 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">
|
||||||
|
<div>奖池长度:<span id="deployedTotalSize"></span> | 高级奖池长度:<span id="deployedSeniorSize"></span> |
|
||||||
|
普通奖池长度:<span id="deployedNormalSize"></span></div>
|
||||||
|
<div>高级奖池:<span id="deployedSeniorItems"></span></div>
|
||||||
|
<div>普通奖池:<span id="deployedNormalItems"></span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TableHelper from '@/utils/bootstrap-table-helper';
|
import TableHelper from '@/utils/bootstrap-table-helper';
|
||||||
import { apiResult } from '@/utils/maintainer';
|
import { apiResult } from '@/utils/maintainer';
|
||||||
import { getRewardList } from '@/api/treasure/reward';
|
import { getRewardList } from '@/api/treasure/reward';
|
||||||
import { savePoolItem, deployPoolItem } from '@/api/treasure/poolItem';
|
import { savePoolItem, deployPoolItem, deployedPoolItem } from '@/api/treasure/poolItem';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "SeizeTreasurePoolItemView",
|
name: "SeizeTreasurePoolItemView",
|
||||||
@@ -305,6 +323,28 @@ export default {
|
|||||||
apiResult(res);
|
apiResult(res);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
btnDeployed() {
|
||||||
|
deployedPoolItem({
|
||||||
|
poolType: 1
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
const data = res.data;
|
||||||
|
const seniorSize = data.seniorPoolItems.map(i => i.num).reduce((prev, cur) => prev + cur);
|
||||||
|
const normalSize = data.normalPoolItems.map(i => i.num).reduce((prev, cur) => prev + cur);
|
||||||
|
$('#deployedSeniorSize').html(seniorSize);
|
||||||
|
$('#deployedNormalSize').html(normalSize);
|
||||||
|
$('#deployedTotalSize').html(seniorSize + seniorSize * normalSize);
|
||||||
|
const seniorItems = data.seniorPoolItems.sort((a, b) => b.num - a.num).map(i => {
|
||||||
|
return `${i.rewardRefId}-${i.rewardName} x ${i.poolNum}`
|
||||||
|
}).join(",");
|
||||||
|
const normalItems = data.normalPoolItems.sort((a, b) => b.num - a.num).map(i => {
|
||||||
|
return `${i.rewardRefId}-${i.rewardName} x ${i.poolNum}`
|
||||||
|
}).join(",");
|
||||||
|
$('#deployedSeniorItems').html(seniorItems);
|
||||||
|
$('#deployedNormalItems').html(normalItems);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
optEdit() {
|
optEdit() {
|
||||||
$('#table').on('click', '.opt-edit', function () {
|
$('#table').on('click', '.opt-edit', function () {
|
||||||
const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
|
const currentData = $('#table').bootstrapTable('getData')[$(this).data('index')];
|
||||||
|
Reference in New Issue
Block a user