336 lines
13 KiB
HTML
336 lines
13 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" type="text/css" href="css/style.css?__HTML_VERSION__=6">
|
|
</head>
|
|
<body class="bg_hui">
|
|
<section id="app" v-show="!isLoading" style="display: none">
|
|
<div class="count_full">
|
|
|
|
<sales-info></sales-info>
|
|
|
|
<section class="buju">
|
|
<!-- tabs -->
|
|
<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=='home'}" @click="shareLinkPlayer">
|
|
<a href="javascript:;" id="home-tab">玩家邀请码</a>
|
|
</li>
|
|
|
|
<li v-if="isSales" :class="{'active':selType=='profile'}" @click="shareLinkSales">
|
|
<a href="javascript:;" id="profile-tab">代理邀请码</a>
|
|
</li>
|
|
|
|
<li :class="{'active':selType=='club'}" @click="shareLinkClub" v-if="false">
|
|
<a href="javascript:;">俱乐部邀请码</a>
|
|
</li>
|
|
|
|
<li :class="{'active':selType=='nextwj'}" @click="selType='nextwj'">
|
|
<a href="javascript:;" id="nextwj-tab">下级玩家</a>
|
|
<span class="shuzhi">{{playerList.length}}</span>
|
|
</li>
|
|
<li v-if="isSales" :class="{'active':selType=='zidaili'}" @click="selType='zidaili'">
|
|
<a href="javascript:;" id="zidaili-tab">子代理</a>
|
|
<span class="shuzhi">{{salesList.length}}</span>
|
|
</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>
|
|
<!-- /tabs -->
|
|
|
|
<div id="myTabContent" class="tab-content">
|
|
|
|
<div class="tab-pane fade" :class="{'active':selType=='home','in':selType=='home'}" id="home">
|
|
<div class="yaqingma text-center">
|
|
<h4>邀请码:<span class="red">{{userInfo.salesid}}</span></h4>
|
|
<p class="red">分享你的邀请码,邀请好友一起来玩</p>
|
|
<button class="btn btn-primary w60" @click="shareInviteCode" v-if="isWxLogin">微信分享邀请码</button>
|
|
<p class="text-primary">建议优先使用二维码分享的方式<br>(长按二维码选择发送给朋友)</p>
|
|
</div>
|
|
<div id="invitePlayer" class="wanjia"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" :class="{'active':selType=='profile','in':selType=='profile'}" id="profile">
|
|
<div class="yaqingma text-center">
|
|
<h4>邀请码:<span class="red">{{userInfo.salesid}}</span></h4>
|
|
<p class="red">分享你的邀请码,发展子代理</p>
|
|
<button class="btn btn-primary w60" @click="shareInviteCode" v-if="isWxLogin">微信分享邀请码</button>
|
|
<p class="text-primary">建议优先使用二维码分享的方式<br>(长按二维码选择发送给朋友)</p>
|
|
</div>
|
|
<div id="inviteSales" class="wanjia"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" :class="{'active':selType=='club','in':selType=='club'}" id="club" v-if="false">
|
|
<div class="yaqingma text-center">
|
|
<h4>邀请码:<span class="red">{{userInfo.salesid}}</span></h4>
|
|
<p class="red">分享你的邀请码,邀请好友加入俱乐部</p>
|
|
<button class="btn btn-primary w60" @click="shareInviteCode" v-if="isWxLogin">微信分享邀请码</button>
|
|
<p class="text-primary">建议优先使用二维码分享的方式<br>(长按二维码选择发送给朋友)</p>
|
|
</div>
|
|
<div id="inviteClub" class="wanjia"></div>
|
|
</div>
|
|
|
|
<!-- playerList -->
|
|
<div class="tab-pane fade" :class="{'active':selType=='nextwj','in':selType=='nextwj'}" id="nextwj">
|
|
<table class="ckjr_table">
|
|
<tbody>
|
|
<tr v-for="(v, i) in playerList" :key="i">
|
|
<td class="text-center">
|
|
<img :src="v.avatar" class="header">
|
|
</td>
|
|
<td>
|
|
<p>{{v.playerid}}</p>
|
|
<p>{{v.nickname}}</p>
|
|
</td>
|
|
<td class="text-center">
|
|
<button class="btn btn-primary" @click="goldRecord(v.playerid)">流水记录</button>
|
|
<p>本周充值金额:<span>{{v.money}}</span></p>
|
|
</td>
|
|
</tr>
|
|
<tr v-show="!playerList[0]"><td colspan="3" class="text-center">暂无下级玩家</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- /playerList -->
|
|
|
|
<!-- 子代理-->
|
|
<div class="tab-pane fade" :class="{'active':selType=='zidaili','in':selType=='zidaili'}" id="zidaili">
|
|
<table class="ckjr_table">
|
|
<tbody>
|
|
<tr v-for="(v, i) in salesList" :key="i">
|
|
<td class="text-center">
|
|
<img :src="v.avatar" class="header">
|
|
</td>
|
|
<td>
|
|
<p>{{v.salesid}}</p>
|
|
<p>{{v.nickname}}</p>
|
|
</td>
|
|
<td class="text-center">
|
|
<p>玩家数量:<span>{{v.playercount}}</span></p>
|
|
<p>代理数量:<span>{{v.salesmancount}}</span></p>
|
|
</td>
|
|
</tr>
|
|
<tr v-show="!salesList[0]"><td colspan="3" class="text-center">暂无子代理</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- 子代理-->
|
|
</div>
|
|
|
|
</section>
|
|
</div>
|
|
|
|
<manage-nav></manage-nav>
|
|
</section>
|
|
|
|
<div class="panel-img" style="position:fixed;top:0;left:0;bottom:0;right:0;z-index: 999;display: none" onclick="this.style.display='none';">
|
|
<img src="./images/share.png" style="width:100%;height: 100%;">
|
|
</div>
|
|
|
|
<script src="./libs/jquery.min.js?__HTML_VERSION__=3"></script>
|
|
<script src="./libs/bootstrap/bootstrap.min.js?__HTML_VERSION__=3"></script>
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js?__HTML_VERSION__=3"></script>
|
|
<script src="./libs/vue.min.js?__HTML_VERSION__=3"></script>
|
|
<script src="./js/function.js?__HTML_VERSION__=18"></script>
|
|
<script src="./libs/layer_mobile/layer.js?__HTML_VERSION__=3"></script>
|
|
<script src="./js/jquery.qrcode.min.js?__HTML_VERSION__=3"></script>
|
|
<script src="./components/home-nav.js?__HTML_VERSION__=12"></script>
|
|
<script src="./lang/lang.js?__HTML_VERSION__=14"></script>
|
|
<script src="./components/sales-info.js?__HTML_VERSION__=11"></script>
|
|
|
|
<script>
|
|
new Vue(
|
|
{
|
|
el: '#app',
|
|
components: {
|
|
'sales-info': salesInfo,
|
|
'manage-nav': homeNav
|
|
},
|
|
data: {
|
|
isLoading: true,
|
|
sidscode: {},
|
|
params: {},
|
|
agentInfo: {},
|
|
wxInfo: {},
|
|
userInfo: {},
|
|
isGetPlayerList: false,
|
|
playerList: [],
|
|
isGetSalesList: false,
|
|
salesList: [],
|
|
wxSignature: {},
|
|
selType: 'home',
|
|
},
|
|
computed: {
|
|
isSales: function () {
|
|
return false;
|
|
},
|
|
isWxLogin: function () {
|
|
var type = parseInt(this.userInfo.logintype);
|
|
if(type === 1)
|
|
return false;
|
|
return true;
|
|
},
|
|
filePath: function () {
|
|
var pageName = $.getPageName();
|
|
var filePath = window.location.origin + window.location.pathname.replace(pageName, '');
|
|
return filePath;
|
|
},
|
|
invitePlayerUrl: function () {
|
|
var url = this.filePath + 'invite_target.html?t=bind_player&aid=' + this.agentInfo.id + '&sid=' + this.userInfo.salesid;
|
|
return url;
|
|
},
|
|
inviteSalesUrl: function () {
|
|
var url = this.filePath + 'invite_target.html?t=bind_sales&aid=' + this.agentInfo.id + '&sid=' + this.userInfo.salesid;
|
|
return url;
|
|
},
|
|
inviteClubUrl: function () {
|
|
var url = this.filePath + 'invite_target.html?t=bind_club&aid=' + this.agentInfo.id + '&sid=' + this.userInfo.salesid;
|
|
return url;
|
|
},
|
|
shareParams: function () {
|
|
// 获取微信签名参数
|
|
var that = this;
|
|
var shareParams = $.extend({}, that.sidScode, {
|
|
appid: that.agentInfo.youle_appid,
|
|
devkey: that.agentInfo.youle_devkey
|
|
});
|
|
return shareParams;
|
|
}
|
|
},
|
|
methods: {
|
|
goldRecord: function (playerid) {
|
|
window.location.href='record_gold.html?agentid='+this.params.agentid+'&channelid='+this.params.channelid+'&playerid='+playerid;
|
|
},
|
|
shareInviteCode: function () { $(".panel-img").show(); },
|
|
getPlayerList: function () {
|
|
if(!this.isGetPlayerList && this.userInfo.unionid) {
|
|
var that = this;
|
|
$.api(
|
|
'agent.agent.myPlayer',
|
|
{
|
|
agentid: that.params.agentid,
|
|
channelid: that.params.channelid,
|
|
openid: that.wxInfo.openid,
|
|
unionid: that.wxInfo.unionid
|
|
},
|
|
function (playerList) {
|
|
that.isGetPlayerList = true;
|
|
that.playerList = playerList.list;
|
|
}
|
|
)
|
|
}
|
|
},
|
|
getSalesList: function () {
|
|
if(!this.isGetSalesList && this.userInfo.unionid) {
|
|
var that = this;
|
|
$.api(
|
|
'agent.agent.mySales',
|
|
{
|
|
agentid: that.params.agentid,
|
|
channelid: that.params.channelid,
|
|
openid: that.wxInfo.openid,
|
|
unionid: that.wxInfo.unionid
|
|
},
|
|
function (salesList) {
|
|
that.isGetSalesList = true;
|
|
that.salesList = salesList.list;
|
|
}
|
|
)
|
|
}
|
|
},
|
|
shareLinkPlayer: function () {
|
|
this.selType="home";
|
|
if( this.isWxLogin ) {
|
|
var that = this;
|
|
var param = {
|
|
title: (this.agentInfo.share_title || '百万代理'),
|
|
desc: (this.agentInfo.share_desc || '全民推广,社群比赛营销第一品牌'),
|
|
link: this.invitePlayerUrl,
|
|
imgUrl: (this.agentInfo.share_img || this.agentInfo.agentlogo)
|
|
};
|
|
$.setShareLink(that.wxSignature, param);
|
|
}
|
|
},
|
|
shareLinkSales: function () {
|
|
this.selType="profile";
|
|
if( this.isWxLogin ) {
|
|
var that = this;
|
|
var param = {
|
|
title: (this.agentInfo.share_title || '代理绑定链接'),
|
|
desc: (this.agentInfo.share_desc || this.agentInfo.agentname),
|
|
link: this.inviteSalesUrl,
|
|
imgUrl: (this.agentInfo.share_img || this.agentInfo.agentlogo)
|
|
};
|
|
$.setShareLink(that.wxSignature, param);
|
|
}
|
|
},
|
|
shareLinkClub: function () {
|
|
this.selType="club";
|
|
if( this.isWxLogin ) {
|
|
var that = this;
|
|
var param = {
|
|
title: (this.agentInfo.share_title || '俱乐部邀请链接'),
|
|
desc: (this.agentInfo.share_desc || "棋牌竞技"),
|
|
link: this.inviteClubUrl,
|
|
imgUrl: (this.agentInfo.share_img || this.agentInfo.agentlogo)
|
|
};
|
|
$.setShareLink(that.wxSignature, param);
|
|
}
|
|
}
|
|
},
|
|
created: function () {
|
|
var p = $.getQueryObj();
|
|
this.params = p;
|
|
var that = this;
|
|
$.getAgentInfo(function (agentInfo) {
|
|
that.agentInfo = agentInfo;
|
|
$.getSidScode(function (sidScode) {
|
|
that.sidScode = sidScode;
|
|
$.getWxInfo(function (wxInfo) {
|
|
that.wxInfo = wxInfo;
|
|
$.getUserInfo(function (userInfo) {
|
|
that.userInfo = userInfo;
|
|
|
|
that.getPlayerList();
|
|
|
|
if(that.isSales)
|
|
that.getSalesList();
|
|
|
|
that.isLoading = false;
|
|
|
|
$.invite('invitePlayer', that.invitePlayerUrl);
|
|
$.invite('inviteSales', that.inviteSalesUrl);
|
|
//$.invite('inviteClub', that.inviteClubUrl);
|
|
console.log(that.invitePlayerUrl)
|
|
|
|
if(that.isWxLogin) {
|
|
$.shareLink(that.shareParams, function (data) {
|
|
that.wxSignature = data;
|
|
that.shareLinkPlayer();
|
|
})
|
|
}
|
|
})
|
|
});
|
|
})
|
|
})
|
|
}
|
|
}
|
|
)
|
|
</script>
|
|
<!--<script src="js/public-z.js?__HTML_VERSION__=3" type="text/javascript"></script>-->
|
|
</body>
|
|
</html> |