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

182 lines
4.8 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="zh-CN">
<head>
<title>提成绑定</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="./libs/bootstrap/bootstrap.min.css?__HTML_VERSION__=3">
<link rel="stylesheet" href="css/style.css?__HTML_VERSION__=6">
</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">
<p style="padding: 10px 8px;">
<b>功能描述:</b><br><span style="color: red;">可将指定的账号和玩家关系对应起来(一对多),适用于同一个人的账号身份和玩家身份</span>
</p>
</section>
<div class="buju" style="padding-top: 30px;">
<div class="chongka">
<div class="rowh he">
<span class="name">账号:</span>
<input type="number" id="salesid" placeholder="请输入账号" class="input" autofocus="" v-model="salesid">
<button @click="getRelationship" class="btn btn-blue chaxun">查询</button>
</div>
<div class="rowh he">
<span class="name">玩家ID</span>
<input type="number" placeholder="请输入玩家ID" class="input" v-model="playerid">
</div>
<div class="rowh text-center conkabtn">
<a href="javascript:;" class="btn btn-primary closes" @click="addRelationship">绑定</a>
</div>
</div>
<table class="table table-striped" v-show="playerList[0]">
<caption style="padding-left: 8px;">玩家列表</caption>
<thead>
<tr>
<th>#</th>
<th>指定账号对应的玩家信息</th>
<th class="text-right">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="(v, i) in playerList" :key="i">
<th>{{i+1}}</th>
<td>
<p>&ensp;ID&ensp;{{v.play_playerid}}</p>
<p>昵称:{{v.play_nickname}}</p>
</td>
<td class="text-right">
<button class="btn btn-warning btn-sm" @click="delRelationship(i, v.id)">删除</button>
</td>
</tr>
</tbody>
</table>
</div>
</div><!--count_full-->
<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="./js/function.js?__HTML_VERSION__=18"></script>
<script src="./lang/lang.js?__HTML_VERSION__=14"></script>
<script src="./components/sales-info.js?__HTML_VERSION__=11"></script>
<script src="./components/home-nav.js?__HTML_VERSION__=12"></script>
<script>
new Vue(
{
el: "#app",
components: {
'sales-info': salesInfo,
'home-nav': homeNav
},
data: {
isLoading: true,
salesid: '',
playerid: '',
params: {},
userInfo: {},
lang: {},
playerList: []
},
methods: {
addRelationship: function () {
try {
var el = this;
if (!$.isRightId(this.salesid)) throw '请输入正确的账号';
if (!$.isRightId(this.playerid)) throw '请输入正确的玩家ID';
$.api(
'agent.agent.addAgentPlayer',
{
agentid: el.params.agentid,
channelid: el.params.channelid,
salesid: el.salesid,
playerid: el.playerid
},
function (res) {
el.getRelationship();
el.playerid = '';
$.alert("添加成功");
}, 1
);
} catch (e) {
$.alert(e);
}
},
getRelationship: function () {
try {
var el = this;
el.playerList = [];
el.playerid = '';
if (!$.isRightId(this.salesid)) throw '请输入正确的账号';
$.api(
'agent.agent.getAgentPlayer',
{
agentid: el.params.agentid,
channelid: el.params.channelid,
salesid: el.salesid
},
function (res) {
if (res.length && res.length > 0)
el.playerList = res;
else
$.alert('暂无记录');
}, 1
);
} catch (e) {
$.alert(e);
}
},
delRelationship: function (index, id) {
try {
var el = this;
if (!id) throw '请输入正确的ID';
$.api(
'agent.agent.delAgentPlayer',
{
agentid: el.params.agentid,
channelid: el.params.channelid,
id: id
},
function (result) {
el.playerList.splice(index, 1);
$.alert('删除成功');
}, 1
);
} catch (e) {
$.alert(e);
}
}
},
created: function () {
this.params = $.getQueryObj();
this.lang = lang[this.params.agentid] ? lang[this.params.agentid] : lang.default;
var that = this;
$.getUserInfo(function (userInfo) {
that.userInfo = userInfo;
that.isLoading = false;
})
}
})
</script>
</body>
</html>