151 lines
4.9 KiB
HTML
151 lines
4.9 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<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/common.css?__HTML_VERSION__=7">
|
||
</head>
|
||
<body class="color-dark">
|
||
<div class="container pt15" id="app" v-show="!isLoading" style="display: none">
|
||
|
||
<ul class="sales-info" v-if="salesInfo.salesid">
|
||
<li><img :src="salesInfo.avatar" alt="avatar" class="avatar"></li>
|
||
<li>
|
||
<div class="pd8">
|
||
<p>昵 称:{{salesInfo.name}}</p>
|
||
<p>代理ID:{{salesInfo.salesid}}</p>
|
||
</div>
|
||
</li>
|
||
<li>
|
||
<div>
|
||
<img :src="agentInfo.agentlogo" alt="logo" class="logo">
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
|
||
<div class="text-center circle-box" v-if="salesInfo.salesid">
|
||
<button class="btn btn-primary w60" @click="bindClub">确认加入</button>
|
||
</div>
|
||
|
||
<download-game></download-game>
|
||
</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/function.js?__HTML_VERSION__=18"></script>
|
||
<script src="./components/download-game.js?__HTML_VERSION__=4"></script>
|
||
<script>
|
||
new Vue(
|
||
{
|
||
el: "#app",
|
||
data: {
|
||
isLoading: true,
|
||
isWeiXin: false,
|
||
params: {},
|
||
agentInfo: {},
|
||
wxInfo: {}, // 用户的微信信息
|
||
userInfo: {}, // 用户本身的信息
|
||
salesInfo: {}, // url中salesid的用户信息
|
||
parentInfo: {}, // 实际绑定的代理信息
|
||
playerInfo: {} // 玩家信息
|
||
},
|
||
components: {
|
||
'download-game': downloadGame
|
||
},
|
||
computed: {
|
||
hasParentSales: function () {
|
||
if (!this.parentInfo.salesid && this.salesInfo.salesid)
|
||
return true
|
||
return false;
|
||
}
|
||
},
|
||
methods: {
|
||
bindClub: function () {
|
||
if (this.params.sale && this.playerInfo.play_playerid) {
|
||
var that = this;
|
||
$.confirm(function () {
|
||
$.api(
|
||
'agent.user.entryClub',
|
||
{
|
||
agentid: that.params.agentid,
|
||
channelid: that.params.channelid,
|
||
openid: that.wxInfo.openid,
|
||
unionid: that.wxInfo.unionid,
|
||
salesid: that.params.sale,
|
||
playerid: that.playerInfo.play_playerid
|
||
},
|
||
function (res) {
|
||
//that.parentInfo = res;
|
||
$.alert('绑定成功');
|
||
}, true
|
||
)
|
||
})
|
||
}
|
||
}
|
||
},
|
||
created: function () {
|
||
sessionStorage.clear();
|
||
try {
|
||
this.isWeiXin = $.isWeiXin();
|
||
var p = $.getQueryObj();
|
||
|
||
if (!p.agentid) throw '没有传入agentid';
|
||
if (!p.channelid) throw '没有传入channelid';
|
||
if (!p.sale) throw '没有传入salesid';
|
||
|
||
if (this.isWeiXin) {
|
||
this.params = p;
|
||
var that = this;
|
||
$.getAgentInfo(function (agentInfo) {
|
||
that.agentInfo = agentInfo;
|
||
$.getWxInfo(function (wxInfo) {
|
||
that.wxInfo = wxInfo;
|
||
$.getUserInfoFirst(function (userInfo) {
|
||
$.api(
|
||
'agent.user.getPlayer',
|
||
{
|
||
agentid: that.params.agentid,
|
||
channelid: that.params.channelid,
|
||
openid: that.wxInfo.openid,
|
||
unionid: that.wxInfo.unionid
|
||
},
|
||
function (playerInfo) {
|
||
if (playerInfo.play_playerid) {
|
||
that.playerInfo = playerInfo;
|
||
|
||
// 查询对应的代理信息
|
||
$.api(
|
||
'agent.agent.recommend',
|
||
{
|
||
agentid: that.params.agentid,
|
||
channelid: that.params.channelid,
|
||
salesid: that.params.sale
|
||
},
|
||
function (res) {
|
||
that.salesInfo = res;
|
||
that.isLoading = false;
|
||
}
|
||
)
|
||
} else
|
||
$.alert('你的玩家信息不存在');
|
||
}
|
||
)
|
||
})
|
||
})
|
||
})
|
||
} else {
|
||
window.location.href = './index.html?agentid=' + p.agentid + '&channelid=' + p.channelid+'&__HTML_VERSION__=3';
|
||
}
|
||
} catch (e) {
|
||
$.alert(e);
|
||
}
|
||
}
|
||
})
|
||
</script>
|
||
</body>
|
||
</html> |