899 lines
33 KiB
HTML
899 lines
33 KiB
HTML
<!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">
|
||
<style>
|
||
.chongka .rowh {
|
||
position: static;
|
||
}
|
||
</style>
|
||
</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 :class="{'active':selType=='gonggao'}" @click="selType='gonggao'" v-if="noticeInfo">
|
||
<a href="javascript:;" id="home-gonggao">公 告</a>
|
||
</li>
|
||
<li id="li_home" :class="{ 'active': selType=='home'}" @click="selType='home'">
|
||
<a href="javascript:;" id="home-tab">玩家赠卡</a>
|
||
</li>
|
||
<li id="li_profile" :class="{'active':selType=='profile'}" @click="selType='profile'">
|
||
<a href="javascript:;" id="profile-tab">赠卡记录</a>
|
||
</li>
|
||
<li v-if="agentMode" :class="{'active':selType=='suoka'}" @click="selType='suoka'">
|
||
<a href="javascript:;" id="suoka-tab">索卡订单</a>
|
||
</li>
|
||
<li v-if="false && lang.openRequestStar" :class="{'active':selType=='requestStar'}" @click="selType='requestStar'">
|
||
<a href="javascript:;">索{{lang.singStarName}}订单</a>
|
||
</li>
|
||
<li v-if="myInfo.salestype == 11" id="li_wcxing" :class="{'active':selType=='wcxing'}" @click="selType='wcxing'">
|
||
<a href="javascript:;" id="wcxing-tab">玩家赠{{lang.singStarName}}</a>
|
||
</li>
|
||
<li v-if="myInfo.salestype == 11" id="li_cxingjl" :class="{'active':selType=='cxingjl'}" @click="selType='cxingjl'">
|
||
<a href="javascript:;" id="cxingjl-tab">赠{{lang.singStarName}}记录</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
|
||
<!--<div class="huad-left">
|
||
<img src="img/jiantou.png" width="50">
|
||
<img src="img/shoushi.png" class="shouzhi" height="35">
|
||
</div>-->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div id="myTabContent" class="tab-content">
|
||
|
||
<!-- 公告 -->
|
||
<div class="tab-pane fade" id="gonggao" :class="{active: (!!noticeInfo && selType=='gonggao'), in: (!!noticeInfo && selType=='gonggao')}">
|
||
<div class="dlxuzhi hui animated fadeInRight" v-html="noticeInfo"></div>
|
||
</div>
|
||
<!-- /公告 -->
|
||
|
||
<!-- 给玩家赠卡 -->
|
||
<div class="tab-pane fade" id="home" :class="{active: selType=='home', in: selType=='home'}">
|
||
<div class="chongka">
|
||
<div class="rowh he" v-if="isRechargeRoomcardToSales">
|
||
<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.queryCardID">
|
||
<a href="javascript:;" class="btn btn-blue chaxun" @click="queryCardHander()">查询</a>
|
||
</div>
|
||
<div class="rowh he">
|
||
<span class="name">玩家昵称:</span>
|
||
<input type="text" placeholder="空" class="input" v-model="queryInfo.cardName" readonly>
|
||
</div>
|
||
<div class="rowh he">
|
||
<span class="name">当前可用房卡:</span>
|
||
<input type="text" placeholder="0" class="input" v-model="queryInfo.cardPlayerNum" readonly>
|
||
</div>
|
||
<div class="rowh he">
|
||
<span class="name">赠卡数量:</span>
|
||
<input type="number" placeholder="请输入赠卡数量" class="input" v-model="queryInfo.cardAmount">
|
||
</div>
|
||
<div class="rowh text-center conkabtn">
|
||
<a href="javascript:;" class="btn btn-warning closes" @click="rechargeCardHander()">赠卡</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- 给玩家赠卡 -->
|
||
|
||
<!-- 赠卡记录 -->
|
||
<div class="tab-pane fade" id="profile" :class="{'active':selType=='profile','in':selType=='profile'}">
|
||
<div class="ck_jiru">
|
||
<div class="cha_time">
|
||
<input type="text" id="cardTimeStart" class="form_datetime_start shijian_input" placeholder="选择开始时间" readonly
|
||
v-model="queryInfo.cardBegTime"><br>
|
||
<input type="text" id="cardTimeEnd" class="form_datetime_end shijian_input" placeholder="选择截止时间" readonly
|
||
v-model="queryInfo.cardEndTime">
|
||
<a href="javascript:;" class="btn btn-blue time_c" @click="queryRechargeCardListHander()">查询</a>
|
||
|
||
<div v-if="isRechargeRoomcardToSales">
|
||
<span>赠卡类型:</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 chargePlayerList.detail">
|
||
<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="reChargeCardPlayer(item.playerid)">再次赠卡</a>
|
||
</td>
|
||
</tr>
|
||
<tr v-for="item in chargeSalesList.detail">
|
||
<td class="text-center">
|
||
<img :src="item.avatar" class="header">
|
||
</td>
|
||
<td>
|
||
<p>{{item.salesid}}</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="reChargeCardSales(item.salesid)">再次赠卡</a>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
<tfoot v-show="(chargePlayerList.detail && chargePlayerList.detail.length > 9) || (chargeSalesList.detail && chargeSalesList.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="agentMode" id="suoka" class="tab-pane fade" :class="{'active':selType=='suoka','in':selType=='suoka'}">
|
||
<div class="skjiru">
|
||
<table class="ckjr_table">
|
||
<tbody>
|
||
<tr v-for="item in askCardList">
|
||
<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="sureSendCard(item.idx, 1)">确认赠卡</a>
|
||
<a href="javascript:;" class="btn btn-default" @click="sureSendCard(item.idx, 3)">忽 略</a>
|
||
</td>
|
||
<td v-else class="text-center">
|
||
<p>error</p>
|
||
</td>
|
||
</tr>
|
||
<tr v-show="!askCardList[0]" class="text-center">
|
||
<td colspan="3">暂无索卡请求</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</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)">忽 略</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 class="tab-pane fade" id="wcxing" :class="{'active':selType=='wcxing','in':selType=='wcxing'}">
|
||
<div class="chongka">
|
||
<div class="rowh he">
|
||
<span class="name">玩家ID:</span>
|
||
<input type="number" placeholder="请输入玩家ID" class="input" v-model="queryInfo.queryStarID">
|
||
<a href="javascript:;" class="btn btn-blue chaxun" @click="queryStarInfo()">查询</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" placeholder="0" 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="chargeStar()">赠{{lang.singStarName}}</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- /玩家赠 -->
|
||
|
||
<!-- 赠记录 -->
|
||
<div class="tab-pane fade" id="cxingjl" :class="{'active':selType=='cxingjl','in':selType=='cxingjl'}">
|
||
<div class="ck_jiru">
|
||
<div class="cha_time">
|
||
<input type="text" id="starTimeStart" class="form_datetime_start shijian_input" placeholder="选择开始时间" readonly
|
||
v-model="queryInfo.starBegTime"><br>
|
||
<input type="text" id="starTimeEnd" class="form_datetime_end shijian_input" placeholder="选择截止时间" readonly
|
||
v-model="queryInfo.starEndTime">
|
||
<button class="btn btn-blue time_c" @click="queryStarList()">查询</button>
|
||
|
||
<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="reChargeStar(item.playerid)">再次赠{{lang.singStarName}}</a>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
<tfoot v-show="chargeStarList.list && chargeStarList.list.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>
|
||
</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: {},
|
||
noticeInfo: '',
|
||
selType: "gonggao",
|
||
queryInfo: {
|
||
queryCardID: '',
|
||
cardName: '',
|
||
cardPlayerNum: '',
|
||
cardAmount: '',
|
||
cardBegTime: '',
|
||
cardEndTime: '',
|
||
queryStarID: '',
|
||
starName: '',
|
||
starNum: '',
|
||
starAmount: '',
|
||
starBegTime: '',
|
||
starEndTime: ''
|
||
},
|
||
chargePlayerList: {},
|
||
chargeSalesList: {},
|
||
askCardList: {},
|
||
askStarList: {},
|
||
chargeStarList: {},
|
||
giftAmount: '',
|
||
giftList: []
|
||
},
|
||
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 + '&__HTML_VERSION__=3';
|
||
},
|
||
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: {
|
||
pack: function () {
|
||
var that = this;
|
||
try {
|
||
if (this.giftAmount < 1) throw "请输入正确数量";
|
||
|
||
$.api(
|
||
'agent.gift.newgift',
|
||
{
|
||
agentid: that.urlParam.agentid,
|
||
channelid: that.urlParam.channelid,
|
||
salesid: that.myInfo.salesid,
|
||
type: 1,
|
||
amount: that.giftAmount
|
||
},
|
||
function (res) {
|
||
$.alert('礼包打包成功');
|
||
}, 1
|
||
);
|
||
} catch (e) {
|
||
$.alert(e);
|
||
}
|
||
},
|
||
/**
|
||
* 查房卡,根据类型判断
|
||
*/
|
||
queryCardHander: function () {
|
||
if(this.rechargeType == 1) {
|
||
this.queryCardPlayer();
|
||
} else if (this.rechargeType == 2) {
|
||
this.queryCardSales();
|
||
}
|
||
},
|
||
/**
|
||
* 查询玩家房卡数
|
||
*/
|
||
queryCardPlayer: function () {
|
||
try {
|
||
if (!$.isRightId(this.queryInfo.queryCardID)) throw '请输入正确的玩家id!';
|
||
|
||
$.api(
|
||
'agent.user.getUser',
|
||
{
|
||
agentid: this.urlParam.agentid,
|
||
channelid: this.urlParam.channelid,
|
||
salesid: this.myInfo.salesid,
|
||
playerid: this.queryInfo.queryCardID
|
||
},
|
||
function (res) {
|
||
this.queryInfo.cardName = res.nickname;
|
||
this.queryInfo.cardPlayerNum = res.roomcard;
|
||
}.bind(this), 1
|
||
);
|
||
} catch (e) {
|
||
$.alert(e);
|
||
}
|
||
},
|
||
/**
|
||
* 查询sales房卡数
|
||
*/
|
||
queryCardSales: function () {
|
||
if (!$.isRightId(this.queryInfo.queryCardID)) {
|
||
$.alert("请输入正确的账号");
|
||
return false;
|
||
}
|
||
|
||
$.api(
|
||
'agent.agent.findAgent',
|
||
{agentid: this.urlParam.agentid, channelid: this.urlParam.channelid, operateid: this.myInfo.salesid,salesid: this.queryInfo.queryCardID},
|
||
function (res) {
|
||
this.queryInfo.cardName = res.salesname;
|
||
this.queryInfo.cardPlayerNum = res.roomcard;
|
||
}.bind(this), 1
|
||
);
|
||
|
||
},
|
||
|
||
/**
|
||
* 赠卡,根据类型判断
|
||
*/
|
||
rechargeCardHander: function () {
|
||
if(this.rechargeType == 1) {
|
||
this.rechargeCardPlayer();
|
||
} else if (this.rechargeType == 2) {
|
||
this.rechargeCardSales();
|
||
}
|
||
},
|
||
/**
|
||
* 给玩家赠卡
|
||
*/
|
||
rechargeCardPlayer: function () {
|
||
try {
|
||
if (!$.isRightId(this.queryInfo.queryCardID)) throw "请输入正确的玩家id!";
|
||
|
||
if (this.queryInfo.cardAmount < 1) throw "请输入正确赠送数量";
|
||
|
||
var that = this;
|
||
$.confirm(function () {
|
||
$.api(
|
||
'agent.card.addCard',
|
||
{
|
||
agentid: that.urlParam.agentid,
|
||
channelid: that.urlParam.channelid,
|
||
openid: that.myInfo.openid,
|
||
fromsales: that.myInfo.salesid,
|
||
playerid: that.queryInfo.queryCardID,
|
||
amount: that.queryInfo.cardAmount
|
||
},
|
||
function (res) {
|
||
//that.queryInfo.cardPlayerNum = parseInt(that.queryInfo.cardPlayerNum) + parseInt(that.queryInfo.cardAmount);
|
||
that.myInfo.roomcard = res.roomcard;
|
||
that.queryInfo.queryCardID = '';
|
||
that.queryInfo.cardAmount = '';
|
||
that.queryInfo.cardName = '';
|
||
that.queryInfo.cardPlayerNum = '';
|
||
$.alert("赠卡成功!");
|
||
}, true
|
||
);
|
||
})
|
||
} catch(e) {
|
||
$.alert(e);
|
||
}
|
||
},
|
||
/**
|
||
* 给sales赠卡
|
||
*/
|
||
rechargeCardSales: function () {
|
||
try {
|
||
if (!$.isRightId(this.queryInfo.queryCardID)) throw "请输入正确的账号";
|
||
|
||
if (this.queryInfo.cardAmount < 1) throw "请输入正确赠送数量";
|
||
|
||
var that = this;
|
||
$.confirm(function () {
|
||
$.api(
|
||
'agent.card.transCard',
|
||
{
|
||
agentid: that.urlParam.agentid,
|
||
channelid: that.urlParam.channelid,
|
||
openid: that.myInfo.openid,
|
||
fromsales: that.myInfo.salesid,
|
||
salesid: that.queryInfo.queryCardID,
|
||
amount: that.queryInfo.cardAmount
|
||
},
|
||
function (res) {
|
||
that.myInfo.roomcard = res.roomcard;
|
||
that.queryInfo.queryCardID = '';
|
||
that.queryInfo.cardAmount = '';
|
||
that.queryInfo.cardName = '';
|
||
that.queryInfo.cardPlayerNum = '';
|
||
$.alert("赠卡成功!");
|
||
}, true
|
||
);
|
||
})
|
||
} catch(e) {
|
||
$.alert(e);
|
||
}
|
||
|
||
},
|
||
|
||
/**
|
||
* 赠卡记录,根据类型判断
|
||
*/
|
||
queryRechargeCardListHander: function () {
|
||
this.chargePlayerList = {};
|
||
this.chargeSalesList = {};
|
||
if(this.rechargeListType == 1) {
|
||
this.queryRechargeCardPlayerList();
|
||
} else if (this.rechargeListType == 2) {
|
||
this.queryRechargeCardSalesList();
|
||
}
|
||
},
|
||
/**
|
||
* 给玩家赠卡记录
|
||
*/
|
||
queryRechargeCardPlayerList: function () {
|
||
var cardTimeStart = $('#cardTimeStart').val();
|
||
var cardTimeEnd = $('#cardTimeEnd').val();
|
||
|
||
$.api(
|
||
'agent.card.addRecord',
|
||
{
|
||
agentid: this.urlParam.agentid,
|
||
channelid: this.urlParam.channelid,
|
||
openid: this.myInfo.openid,
|
||
salesid: this.myInfo.salesid,
|
||
userid: this.myInfo.user_id,
|
||
begintime: cardTimeStart,
|
||
endtime: cardTimeEnd,
|
||
page_index: 1
|
||
},
|
||
function (res) {
|
||
if(res.detail.length > 0)
|
||
this.chargePlayerList = res;
|
||
else
|
||
$.alert('暂无记录');
|
||
}.bind(this), 1
|
||
);
|
||
|
||
},
|
||
/**
|
||
* 给sales赠卡记录
|
||
*/
|
||
queryRechargeCardSalesList: function () {
|
||
var cardTimeStart = $('#cardTimeStart').val();
|
||
var cardTimeEnd = $('#cardTimeEnd').val();
|
||
|
||
$.api(
|
||
'agent.card.transRecord',
|
||
{
|
||
agentid: this.urlParam.agentid,
|
||
channelid: this.urlParam.channelid,
|
||
openid: this.myInfo.openid,
|
||
salesid: this.myInfo.salesid,
|
||
fromsales: this.myInfo.salesid,
|
||
userid: this.myInfo.user_id,
|
||
begintime: cardTimeStart,
|
||
endtime: cardTimeEnd,
|
||
page_index: 1
|
||
},
|
||
function (res) {
|
||
if(res.detail.length && res.detail.length > 0)
|
||
this.chargeSalesList = res;
|
||
else
|
||
$.alert('暂无记录');
|
||
}.bind(this), 1
|
||
);
|
||
|
||
},
|
||
|
||
reChargeCardPlayer: function (r) {
|
||
this.rechargeType = 1;
|
||
this.selType="home";
|
||
this.queryInfo.queryCardID = r;
|
||
},
|
||
reChargeCardSales: function (r) {
|
||
this.rechargeType = 2;
|
||
this.selType="home";
|
||
this.queryInfo.queryCardID = r;
|
||
},
|
||
queryAskCardList: function (isAsync) {
|
||
|
||
if(isAsync) $.loading();
|
||
$.api(
|
||
'agent.demand.askCardList',
|
||
{
|
||
agentid: this.urlParam.agentid,
|
||
billtype: 0,
|
||
salesid: this.myInfo.salesid
|
||
},
|
||
function (res) {
|
||
this.askCardList = res.list;
|
||
}.bind(this), isAsync
|
||
|
||
);
|
||
},
|
||
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
|
||
|
||
);
|
||
},
|
||
sureSendCard: 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.queryAskCardList(true);
|
||
$.alert("操作成功!");
|
||
}, true
|
||
);
|
||
})
|
||
|
||
},
|
||
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
|
||
);
|
||
})
|
||
|
||
},
|
||
queryStarInfo: function () {
|
||
if (this.queryInfo.queryStarID === null || 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
|
||
);
|
||
},
|
||
chargeStar: 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("赠送成功!");
|
||
}, true
|
||
);
|
||
})
|
||
} catch (e) {
|
||
$.alert(e);
|
||
}
|
||
},
|
||
queryStarList: function () {
|
||
|
||
$.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': this.queryInfo.cardBegTime,
|
||
'endtime': this.queryInfo.cardEndTime,
|
||
page_index: 1
|
||
},
|
||
function (res) {
|
||
if(res.list.length > 0)
|
||
this.chargeStarList = res;
|
||
else
|
||
$.alert('暂无记录')
|
||
}.bind(this), 1
|
||
);
|
||
},
|
||
reChargeStar: function (r) {
|
||
this.selType = 'wcxing';
|
||
this.queryInfo.queryStarID = r;
|
||
},
|
||
getgiftList: function () {
|
||
var that = this;
|
||
$.api(
|
||
'agent.gift.query',
|
||
{
|
||
agentid: that.urlParam.agentid,
|
||
channelid: that.urlParam.channelid,
|
||
salesid: that.myInfo.salesid
|
||
},
|
||
function (res) {
|
||
if(res.list.length > 0)
|
||
that.giftList = res.list;
|
||
else
|
||
$.alert('暂无记录')
|
||
}
|
||
);
|
||
}
|
||
},
|
||
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;
|
||
|
||
if(agentInfo.is_check_phone == 1 && r.is_bind == 0) {
|
||
window.location.href="./bind_phone.html"+that.searchParams;
|
||
return;
|
||
}
|
||
|
||
|
||
$.api(
|
||
'agent.agent.getNotice',
|
||
{agentid: that.urlParam.agentid, channelid: that.urlParam.channelid, type: 2},
|
||
function (res) {
|
||
that.noticeInfo = res.notice_info;
|
||
|
||
if (that.agentMode) {
|
||
that.queryAskCardList();
|
||
if (that.lang.openRequestStar)
|
||
that.queryAskStarList();
|
||
}
|
||
|
||
that.isLoading = false;
|
||
}
|
||
)
|
||
});
|
||
});
|
||
|
||
if(that.noticeInfo === undefined || that.noticeInfo === null || that.noticeInfo === ''){
|
||
that.selType = "home";
|
||
}
|
||
|
||
}
|
||
});
|
||
|
||
|
||
$("#cardTimeStart").datetimepicker({
|
||
format: 'yyyy-mm-dd',
|
||
weekStart: 1,
|
||
autoclose: true,
|
||
startView: 2,
|
||
minView: 2,
|
||
forceParse: false,
|
||
language: 'zh-CN',
|
||
todayBtn: true
|
||
});
|
||
|
||
$("#cardTimeEnd").datetimepicker({
|
||
format: 'yyyy-mm-dd',
|
||
weekStart: 1,
|
||
autoclose: true,
|
||
startView: 2,
|
||
minView: 2,
|
||
forceParse: false,
|
||
language: 'zh-CN',
|
||
todayBtn: true
|
||
});
|
||
|
||
$("#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> |