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

197 lines
6.7 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, 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="hasParentSales">
<li><img :src="salesInfo.avatar" alt="avatar" class="avatar"></li>
<li>
<div class="pd8">
<p>&emsp;称:{{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="hasParentSales">
<button class="btn btn-primary w60" @click="bindSales">确认邀请</button>
</div>
<section v-if="parentInfo.parentid || parentInfo.salesid">
<h4 class="text-center">你已绑定用户,用户信息如下</h4>
<ul class="sales-info">
<li><img :src="parentInfo.avatar" alt="avatar" class="avatar"></li>
<li>
<div class="pd8">
<p>&emsp;称:{{parentInfo.name || parentInfo.nickname}}</p>
<p>用户ID{{parentInfo.parentid || parentInfo.salesid}}</p>
</div>
</li>
<li>
<div>
<img :src="agentInfo.agentlogo" alt="logo" class="logo">
</div>
</li>
</ul>
</section>
<download-game></download-game>
<!--<section v-html="agentInfo.share_text"></section>-->
</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: {} // 实际绑定的用户信息
},
components: {
'download-game': downloadGame
},
computed: {
hasParentSales: function () {
if (!this.parentInfo.salesid && this.salesInfo.salesid)
return true;
return false;
}
},
methods: {
bindSales: function () {
if (this.params.sale) {
var that = this;
$.confirm(function () {
$.apiv2(
'agent.agent.bindRecommend',
{
agentid: that.params.agentid,
channelid: that.params.channelid,
openid: that.wxInfo.openid,
unionid: that.wxInfo.unionid,
salesid: that.params.sale
},
function (res) {
that.parentInfo = res;
$.alert('绑定成功');
},
function (code, info) {
if(parseInt(code) === 5) {
layer.open(
{
content: '你还不是用户,请先注册成为用户。',
btn: ['确定', '取消'],
yes: function (i) {
var target_url;
if(that.agentInfo.html_applysales && parseInt(that.agentInfo.html_applysales) === 2)
target_url = './become_sales_free.html?agentid=' + that.params.agentid + '&channelid=' + that.params.channelid+'&__HTML_VERSION__=3';
else
target_url = './become_sales.html?agentid=' + that.params.agentid + '&channelid=' + that.params.channelid+'&__HTML_VERSION__=3';
window.location.href = target_url;
},
no: function () { layer.closeAll() }
}
);
} else
$.alert(info);
},
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) {
that.userInfo = userInfo;
// 我绑定的上级用户信息
$.api(
'agent.agent.myRecommend',
{
agentid: that.params.agentid,
channelid: that.params.channelid,
openid: wxInfo.openid,
unionid: wxInfo.unionid,
salesid: that.userInfo.salesid,
type: 0
},
function (parentInfo) {
that.parentInfo = parentInfo;
if (!parentInfo.parentid) {
// 查询对应的用户信息
$.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
that.isLoading = false;
}
)
})
})
})
} else {
window.location.href = './index.html?agentid=' + p.agentid + '&channelid=' + p.channelid+'&__HTML_VERSION__=3';
}
} catch (e) {
$.alert(e);
}
}
})
</script>
</body>
</html>