Files
youlegames/codes/agent/game/dlweb/api/web2/power_fawan.html
2026-03-15 01:27:05 +08:00

175 lines
6.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<title>权限管理-扣罚玩家</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Cache" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<link rel="stylesheet" type="text/css" href="css/style.css?__HTML_VERSION__=6">
<link rel="stylesheet" href="./libs/bootstrap/bootstrap.min.css?__HTML_VERSION__=3">
</head>
<body class="bg_hui">
<div class="count_full" id="app" v-show="!isLoading" style="display: none">
<header class="header header-pos-fix">
<div onclick="history.back(-1)">
<img src="img/fahui.png" class="img">
<span class="text_wen">返回</span>
</div>
</header>
<div style="width: 100%;height: 45px;display: block;"></div>
<section class="buju">
<div class="chongka" id="fengwan">
<div class="rowh he">
<span class="name">玩 家 ID</span>
<input type="number" placeholder="请输入玩家ID" class="input" autofocus v-model="queryInfo.queryID">
<a href="javascript:;" class="btn btn-blue chaxun" @click="queryPlayer()">查询</a>
</div>
<div class="rowh he">
<span class="name">玩家昵称:</span>
<input type="text" placeholder="空" class="input" v-bind:value="queryInfo.queryName">
</div>
<div class="rowh he">
<span class="name">房卡数:</span>
<input type="text" placeholder="空" class="input" v-bind:value="queryInfo.queryRoomCard">
</div>
<div class="rowh he">
<span class="name">{{lang.starName}}数:</span>
<input type="text" placeholder="空" class="input" v-bind:value="queryInfo.queryStar">
</div>
<div class="rowh he checkbox margin-left-30">
<label for="thrid">
<input id="thrid" type="radio" name="player_type" value="0" checked="" v-model="queryInfo.deductType"> 减房卡
</label>
<label for="fouth">
<input id="fouth" type="radio" name="player_type" value="1" v-model="queryInfo.deductType"> 减{{lang.starName}}
</label>
</div>
<div class="rowh he">
<span class="name">数量:</span>
<input type="text" class="input" v-model="queryInfo.deductNum">
</div>
<div class="rowh text-center conkabtn">
<a href="javascript:;" class="btn btn-danger closes" @click="submitDeduct()">确定</a>
</div>
</div>
</section>
</div>
<script src="./libs/jquery.min.js?__HTML_VERSION__=3"></script>
<script src="./libs/vue.min.js?__HTML_VERSION__=3"></script>
<script src="./libs/layer_mobile/layer.js?__HTML_VERSION__=3"></script>
<script src="./lang/lang.js?__HTML_VERSION__=14"></script>
<script src="./js/function.js?__HTML_VERSION__=18"></script>
<script src="./components/home-nav.js?__HTML_VERSION__=12"></script>
<script>
var vm = new Vue(
{
el: "#app",
data: {
isLoading: true,
lang: {},
myInfo: {},
urlParam: {},
queryInfo: {
queryID: '',
queryName: '',
queryRoomCard: 0,
queryStar: 0,
deductType: 0, //0、房卡1、星星
deductNum: 0 //扣除数量
}
},
components: {
'home-nav': homeNav
},
methods: {
goHome: function () {
window.location.href = 'index.html?' + 'agentid=' + this.urlParam.agentid + '&channelid=' + this.urlParam.channelid+'&__HTML_VERSION__=3';
},
queryPlayer: function () {
if (this.queryInfo.queryID === null || this.queryInfo.queryID === '') {
$.alert("请输入正确的玩家id!");
return;
}
$.api(
'agent.user.getUser',
{
agentid: this.urlParam.agentid,
channelid: this.urlParam.channelid,
playerid: this.queryInfo.queryID
},
function (res) {
this.queryInfo.queryName = res.nickname;
this.queryInfo.queryRoomCard = res.roomcard;
this.queryInfo.queryStar = res.bean;
}.bind(this), 1
);
},
submitDeduct: function () {
if (this.queryInfo.queryID === null || this.queryInfo.queryID === '') {
$.alert("请输入正确的玩家id!");
return;
}
var amount = parseInt(this.queryInfo.deductNum);
if (amount <= 0) {
$.alert('请输入正确的数量');
return;
}
$.api(
'agent.agent.deductPlayer',
{
agentid: this.urlParam.agentid,
channelid: this.urlParam.channelid,
salesid: this.myInfo.salesid,
deductid: this.queryInfo.queryID,
amount: this.queryInfo.deductNum,
type: this.queryInfo.deductType
},
function () {
if (this.queryInfo.deductType === 0) {
this.queryInfo.queryRoomCard = this.queryInfo.queryRoomCard - amount;
if (this.queryInfo.queryRoomCard < 0) {
this.queryInfo.queryRoomCard = 0;
}
}
else if (this.queryInfo.deductType === 1) {
this.queryInfo.queryStar = this.queryInfo.queryStar - amount;
if (this.queryInfo.queryStar < 0) {
this.queryInfo.queryStar = 0;
}
}
$.alert("扣除成功!");
}.bind(this), 1
);
}
},
created: function () {
this.urlParam = $.getQueryObj();
this.lang = lang[this.urlParam.agentid] ? lang[this.urlParam.agentid] : lang.default;
$.getUserInfo(function (r) {
this.myInfo = r;
this.isLoading = false;
}.bind(this));
}
})
</script>
</body>
</html>