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

555 lines
20 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">
<link rel="stylesheet" href="./libs/bootstrap/bootstrap.min.css?__HTML_VERSION__=3">
<link rel="stylesheet" href="js/datetimepicker/bootstrap-datetimepicker.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">
<sales-info></sales-info>
<section class="buju">
<div class="bs-example bs-example-tabs">
<div class="nav-h" id="vuenum">
<div class="nav-h-x">
<div class="nav-h-x-a">
<ul id="myTabs" class="nav nav-tabs" role="tablist">
<li id="li_home" :class="{ 'active': selType=='home'}" @click="selType='home'">
<a href="javascript:;" id="home-tab">玩家赠{{lang.singStarName}}</a>
</li>
<li id="li_profile" :class="{'active':selType=='profile'}" @click="selType='profile'">
<a href="javascript:;" id="profile-tab">赠{{lang.singStarName}}记录</a>
</li>
<li v-if="lang.openRequestStar" :class="{'active':selType=='requestStar'}" @click="selType='requestStar'">
<a href="javascript:;">索{{lang.singStarName}}订单</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="myTabContent" class="tab-content">
<!-- 玩家赠 -->
<div class="tab-pane fade" id="wcxing" :class="{'active':selType=='home','in':selType=='home'}">
<div class="chongka">
<div class="rowh he">
<span class="name">赠送类型:</span>
<label style="padding: 5px;"><input type="radio" value="1" v-model="rechargeType"> 玩家ID</label>
<label style="margin-left: 50px"><input type="radio" value="2" v-model="rechargeType"> 账号</label>
</div>
<div class="rowh he">
<span class="name">{{labelName}}</span>
<input type="number" :placeholder="placeholderName" class="input" v-model="queryInfo.queryStarID">
<a href="javascript:;" class="btn btn-blue chaxun" @click="queryStarHander()">查询</a>
</div>
<div class="rowh he">
<span class="name">玩家昵称:</span>
<input type="text" placeholder="空" class="input" v-model="queryInfo.starName" readonly>
</div>
<div class="rowh he">
<span class="name">当前{{lang.starName}}</span>
<input type="number" class="input" v-model="queryInfo.starNum" readonly>
</div>
<div class="rowh he">
<span class="name">赠{{lang.singStarName}}数量:</span>
<input type="number" placeholder="请输入赠送数量" class="input" v-model="queryInfo.starAmount">
</div>
<div class="rowh text-center conkabtn">
<a href="javascript:;" class="btn btn-warning closes" @click="rechargeStarHander()">赠{{lang.singStarName}}</a>
</div>
</div>
</div>
<!-- /玩家赠 -->
<!-- 赠记录 -->
<div class="tab-pane fade" id="cxingjl" :class="{'active':selType=='profile','in':selType=='profile'}">
<div class="ck_jiru">
<div class="cha_time">
<input type="text" id="starTimeStart" class="form_datetime_start shijian_input" placeholder="选择开始时间" readonly><br>
<input type="text" id="starTimeEnd" class="form_datetime_end shijian_input" placeholder="选择截止时间" readonly>
<button class="btn btn-blue time_c" @click="queryRechargeStarListHander()">查询</button>
<div>
<span>赠{{lang.singStarName}}类型:</span>
<label style="padding: 5px;"><input type="radio" value="1" v-model="rechargeListType"> 玩家ID</label>
<label style="margin-left: 50px"><input type="radio" value="2" v-model="rechargeListType"> 账号</label>
</div>
<table class="ckjr_table">
<tbody>
<!-- 给玩家转星星记录 -->
<tr v-for="item in chargeStarList.list">
<td class="text-center">
<img :src="item.avatar" class="header">
</td>
<td>
<p>{{item.playerid}}</p>
<p>{{item.name}}</p>
<p>{{item.time.substr(5,11)}}</p>
</td>
<td class="text-center">
<p>{{item.amount}}个</p>
<a href="javascript:;" class="btn btn-blue" @click="reChargeStarPlayer(item.playerid)">再次赠{{lang.singStarName}}</a>
</td>
</tr>
<!-- /给玩家转星星记录 -->
<!-- 给代理转星星记录 -->
<tr v-for="item in chargeStarListSales.detail">
<td class="text-center">
<img :src="item.saus_avatar" class="header">
</td>
<td>
<p>{{item.get_id}}</p>
<p>{{item.saus_nickname}}</p>
<p>{{item.time.substr(5,11)}}</p>
</td>
<td class="text-center">
<p>{{item.amount}}个</p>
<a href="javascript:;" class="btn btn-blue" @click="reChargeStarSales(item.get_id)">再次赠{{lang.singStarName}}</a>
</td>
</tr>
<!-- /给代理转星星记录 -->
</tbody>
<tfoot v-show="(chargeStarList.list && chargeStarList.list.length > 9) || (chargeStarListSales.detail && chargeStarListSales.detail.length > 9)">
<tr class="text-center">
<td colspan="3"><a :href=" 'record.html'+searchParams" class="btn btn-link">查看更多</a></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<!-- /赠记录 -->
<!-- 索星星记录 -->
<div v-if="lang.openRequestStar" class="tab-pane fade" :class="{'active':selType=='requestStar','in':selType=='requestStar'}">
<div class="skjiru">
<table class="ckjr_table">
<tbody>
<tr v-for="item in askStarList">
<td class="text-center">
<img :src="item.avatar" class="header">
</td>
<td>
<p>{{item.askid}}</p>
<p>{{item.nickname}}</p>
<p>{{item.asktime.substr(5,11)}}</p>
</td>
<td v-if="item.state == 1" class="text-center">
<p class="red">数量:{{item.amount}}</p>
<p>已发放</p>
<p>{{item.saab_dealtime.substr(5,11)}}</p>
</td>
<td v-else-if="item.state == 2" class="text-center">
<p class="red">数量:{{item.amount}}</p>
<p>已取消</p>
</td>
<td v-else-if="item.state == 3" class="text-center">
<p class="red">数量:{{item.amount}}</p>
<p>已忽略</p>
<p>{{item.saab_dealtime.substr(5,11)}}</p>
</td>
<td v-else-if="item.state == 0" class="text-center">
<p class="red">数量:{{item.amount}}</p>
<a href="javascript:;" class="btn btn-primary" @click="sureSendStar(item.idx, 1)">确认发放</a>
<a href="javascript:;" class="btn btn-default" @click="sureSendStar(item.idx, 3)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
</td>
<td v-else class="text-center">
<p>error</p>
</td>
</tr>
<tr v-show="!askStarList[0]" class="text-center">
<td colspan="3">暂无请求</td>
</tr>
</tbody>
</table>
</div><!--索卡记录-->
</div>
<!-- /索星星记录 -->
</div>
</section>
<home-nav></home-nav>
</div>
<script src="./libs/jquery.min.js?__HTML_VERSION__=3"></script>
<script src="./libs/bootstrap/bootstrap.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/datetimepicker/bootstrap-datetimepicker.min.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/home-nav.js?__HTML_VERSION__=12"></script>
<script src="./components/sales-info.js?__HTML_VERSION__=11"></script>
<script>
var vm = new Vue(
{
el: "#app",
components: {
'sales-info': salesInfo,
'home-nav': homeNav
},
data: {
isLoading: true,
rechargeType: 1, // 1-玩家 2-sales
rechargeListType: 1, // 1-玩家 2-sales
labelName: '玩家ID',
placeholderName: '请输入玩家ID',
lang: {},
agentInfo: {},
myInfo: {},
urlParam: {},
selType: "home",
queryInfo: {
queryStarID: '',
starName: '',
starNum: '',
starAmount: '',
starBegTime: '',
starEndTime: ''
},
chargePlayerList: {},
chargeSalesList: {},
askStarList: {},
chargeStarList: {},
chargeStarListSales: {}
},
watch: {
rechargeType: function (newValue, oldValue) {
if(newValue == 1) {
this.labelName='玩家ID';
this.placeholderName='请输入玩家ID';
} else if (newValue == 2) {
this.labelName='账号';
this.placeholderName='请输入账号';
}
}
},
computed: {
searchParams: function () {
return '?agentid=' + this.urlParam.agentid + '&channelid=' + this.urlParam.channelid;
},
agentMode: function () {
var mode = parseInt(this.agentInfo.agentmode);
if(mode === 2)
return true;
return false;
},
/**
* 是否开启给sales转卡的功能
*/
isRechargeRoomcardToSales:function () {
if(this.agentInfo.recharge_roomcard_to_sales && this.agentInfo.recharge_roomcard_to_sales == 1) {
return true;
}
return false;
}
},
methods: {
/**
* 查星星,根据类型判断
*/
queryStarHander: function () {
this.queryInfo.starName = '';
this.queryInfo.starNum = '';
if(this.rechargeType == 1) {
this.queryStarPlayer();
} else if (this.rechargeType == 2) {
this.queryStarSales();
}
},
/**
* 查询玩家星星数
*/
queryStarPlayer: function () {
if (!$.isRightId(this.queryInfo.queryStarID)) {
$.alert("请输入正确的玩家id!");
return;
}
$.api(
'agent.user.getUser',
{
agentid: this.urlParam.agentid,
channelid: this.urlParam.channelid,
playerid: this.queryInfo.queryStarID
},
function (res) {
this.queryInfo.starName = res.nickname;
this.queryInfo.starNum = res.bean;
}.bind(this), 1
);
},
/**
* 查询sales星星数
*/
queryStarSales: function () {
if (!$.isRightId(this.queryInfo.queryStarID)) {
$.alert("请输入正确的账号");
return false;
}
$.api(
'agent.agent.findAgent',
{agentid: this.urlParam.agentid, channelid: this.urlParam.channelid, salesid: this.queryInfo.queryStarID},
function (res) {
this.queryInfo.starName = res.salesname;
this.queryInfo.starNum = res.been;
}.bind(this), 1
);
},
/**
* 赠卡,根据类型判断
*/
rechargeStarHander: function () {
if(this.rechargeType == 1) {
this.rechargeStarPlayer();
} else if (this.rechargeType == 2) {
this.rechargeStarSales();
}
},
/**
* 给玩家赠星星
*/
rechargeStarPlayer: function () {
try {
if (!$.isRightId(this.queryInfo.queryStarID)) throw '请输入正确的玩家id';
this.queryInfo.starAmount = parseInt(this.queryInfo.starAmount);
if (this.queryInfo.starAmount < 1) throw '请输入正确的赠送数量';
var that = this;
$.confirm(function () {
$.api(
'agent.demand.addStar',
{
agentid: that.urlParam.agentid,
channelid: that.urlParam.channelid,
openid: that.myInfo.openid,
fromsales: that.myInfo.salesid,
playerid: that.queryInfo.queryStarID,
amount: that.queryInfo.starAmount
},
function (res) {
that.myInfo.bean = res.salesbean;
that.queryInfo.queryStarID = '';
that.queryInfo.starAmount = '';
that.queryInfo.starNum = '';
that.queryInfo.starName = '';
$.alert("赠送成功!");
}, 1
);
})
} catch (e) {
$.alert(e);
}
},
/**
* 给sales赠星星
*/
rechargeStarSales: function () {
try {
if (!$.isRightId(this.queryInfo.queryStarID)) throw "请输入正确的账号";
if (this.queryInfo.starAmount < 1) throw "请输入正确赠送数量";
var that = this;
$.confirm(function () {
$.api(
'agent.demand.transStar',
{
agentid: that.urlParam.agentid,
channelid: that.urlParam.channelid,
openid: that.myInfo.openid,
unionid: that.myInfo.unionid,
fromsales: that.myInfo.salesid,
salesid: that.queryInfo.queryStarID,
tosales: that.queryInfo.queryStarID,
amount: that.queryInfo.starAmount
},
function (res) {
that.myInfo.roomcard = res.roomcard;
that.queryInfo.queryStarID = '';
that.queryInfo.starAmount = '';
that.queryInfo.starNum = '';
that.queryInfo.starName = '';
$.alert("赠送成功!");
}, 1
);
})
} catch(e) {
$.alert(e);
}
},
/**
* 赠星星记录,根据类型判断
*/
queryRechargeStarListHander: function () {
this.chargeStarList = {};
this.chargeStarListSales = {};
if(this.rechargeListType == 1) {
this.queryRechargeStarPlayerList();
} else if (this.rechargeListType == 2) {
this.queryRechargeStarSalesList();
}
},
queryAskStarList: function (isAsync) {
if(isAsync) $.loading();
$.api(
'agent.demand.askCardList',
{
agentid: this.urlParam.agentid,
billtype: 2,
salesid: this.myInfo.salesid
},
function (res) {
this.askStarList = res.list;
}.bind(this), isAsync
);
},
/**
* 索卡请求
*/
sureSendStar: function (id, flag) {
var that = this;
$.confirm(function () {
$.api(
'agent.demand.dealOrder',
{
channelid: that.urlParam.channelid,
idx: id,
dealid: that.myInfo.salesid,
dealstate: flag
},
function (res) {
that.queryAskStarList(true);
$.alert("操作成功!");
}, true
);
})
},
/**
* 给玩家星星记录
*/
queryRechargeStarPlayerList: function () {
var starTimeStart = $('#starTimeStart').val();
var starTimeEnd = $('#starTimeEnd').val();
$.api(
'agent.demand.addStarRecord',
{
'agentid': this.urlParam.agentid,
'channelid': this.urlParam.channelid,
'openid': this.myInfo.openid,
'salesid': this.myInfo.salesid,
'userid': this.myInfo.user_id,
'begintime': starTimeStart,
'endtime': starTimeEnd,
page_index: 1
},
function (res) {
if(res.list.length > 0)
this.chargeStarList = res;
else
$.alert('暂无记录')
}.bind(this), 1
);
},
/**
* 给代理星星记录
*/
queryRechargeStarSalesList: function () {
var starTimeStart = $('#starTimeStart').val();
var starTimeEnd = $('#starTimeEnd').val();
$.api(
'agent.demand.transStarRecord',
{
agentid: this.urlParam.agentid,
channelid: this.urlParam.channelid,
salesid: this.myInfo.salesid,
unionid: this.myInfo.unionid,
user_id: this.myInfo.user_id,
begintime: starTimeStart,
endtime: starTimeEnd,
page_index: 1
},
function (res) {
if(res.detail.length > 0)
this.chargeStarListSales = res;
else
$.alert('暂无记录')
}.bind(this), 1
);
},
reChargeStarPlayer: function (r) {
this.rechargeType = 1;
this.selType = 'home';
this.queryInfo.queryStarID = r;
},
reChargeStarSales: function (r) {
this.rechargeType = 2;
this.selType = 'home';
this.queryInfo.queryStarID = r;
}
},
created: function () {
this.urlParam = $.getQueryObj();
this.lang = lang[this.urlParam.agentid] ? lang[this.urlParam.agentid] : lang.default;
var that = this;
$.getAgentInfo(function (agentInfo) {
that.agentInfo = agentInfo;
$.getUserInfo(function (r) {
that.myInfo = r;
that.isLoading = false;
});
});
}
});
$("#starTimeStart").datetimepicker({
format: 'yyyy-mm-dd',
weekStart: 1,
autoclose: true,
startView: 2,
minView: 2,
forceParse: false,
language: 'zh-CN',
todayBtn: true
});
$("#starTimeEnd").datetimepicker({
format: 'yyyy-mm-dd',
weekStart: 1,
autoclose: true,
startView: 2,
minView: 2,
forceParse: false,
language: 'zh-CN',
todayBtn: true
})
</script>
<!--<script src="js/public-z.js?__HTML_VERSION__=3"></script>-->
</body>
</html>