添加后台代理代码

This commit is contained in:
2026-03-15 01:27:05 +08:00
parent 11f9ac4dc1
commit ea08c9366a
5254 changed files with 721042 additions and 0 deletions

View File

@@ -0,0 +1,172 @@
<!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="./libs/font-awesome.min.css?__HTML_VERSION__=3">
<link rel="stylesheet" href="./css/common.css?__HTML_VERSION__=7">
</head>
<body>
<div class="container" id="app">
<beta-header></beta-header>
<user-info></user-info>
<product-list :type="1" :ptype="1" @update:change-product-id="changeProductInfo"></product-list>
<p class="money">金额:<span class="red" v-html="money"></span></p>
<div class="form-horizontal">
<div class="form-group">
<label for="wechat" class="col-xs-3 control-label">微信号</label>
<div class="col-xs-9">
<input id="wechat" class="form-control" type="text" placeholder="请输入微信号" v-model="wechat">
</div>
</div>
<div class="form-group">
<label for="tel" class="col-xs-3 control-label">手机号</label>
<div class="col-xs-9">
<input id="tel" class="form-control" type="number" placeholder="请输入手机号" v-model="tel">
</div>
</div>
<div class="form-group">
<label for="password" class="col-xs-3 control-label">密码</label>
<div class="col-xs-9">
<input id="password" class="form-control" type="password" placeholder="请输入密码" v-model="password">
</div>
</div>
<div class="form-group">
<label for="password2" class="col-xs-3 control-label">重复密码</label>
<div class="col-xs-9">
<input id="password2" class="form-control" type="password" placeholder="请再次输入密码" v-model="password2">
</div>
</div>
</div>
<button @click="createBill" class="btn btn-success center-block w60">支付</button>
<agent-nav></agent-nav>
<dl class="dl-horizontal pt8">
<dt v-if="serverInfo.wechat">官方微信</dt>
<dd v-html="serverInfo.wechat"></dd>
<dt v-if="serverInfo.qq">官方QQ</dt>
<dd v-html="serverInfo.qq"></dd>
<dt v-if="serverInfo.tel">官方电话</dt>
<dd v-html="serverInfo.tel"></dd>
</dl>
</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="./js/function.js?__HTML_VERSION__=18"></script>
<script src="./components/agent-nav.js?__HTML_VERSION__=8"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="./components/product-list.js?__HTML_VERSION__=4"></script>
<script src="./components/user-info.js?__HTML_VERSION__=4"></script>
<script src="./libs/layer_mobile/layer.js?__HTML_VERSION__=3"></script>
<script src="./components/beta-header.js?__HTML_VERSION__=3"></script>
<script>
new Vue(
{
el: "#app",
components: {
'agent-nav': agentNav,
'product-list': productList,
'user-info': userInfo,
'beta-header': betaHeader
},
data: {
isLoading: true,
checkedProductId: '',
params: {},
billInfo: {},
serverInfo: {},
agentInfo: {},
wxInfo: {},
userInfo: {},
index: 'card', // productList 返回的产品类型
money: 0,
wechat: '',
password: '',
password2: '',
tel: ''
},
methods: {
changeProductInfo: function (v) {
this.checkedProductId = v.productid;
this.index = v.index;
this.money = v.money;
},
createBill: function () {
try {
var that = this;
if (!this.checkedProductId) throw '请选择一个商品';
if (!this.wechat) throw '请输入微信号';
if (!that.tel) throw '请输入手机号';
if (!$.isMobile(that.tel)) throw '请输入正确的手机号';
if (!this.password) throw '请输入密码';
if (!this.password2) throw '请再次输入密码';
if (this.password !== this.password2) throw '两次输入的密码不相同';
//if(!that.userInfo.salesid) throw '没有获取到用户id请联系管理员';
$.loading();
$.api(
'agent.order.createOrder',
{
agentid: that.params.agentid,
channelid: that.params.channelid,
openid: that.wxInfo.openid,
unionid: that.wxInfo.unionid,
billtype: 1,
productid: that.checkedProductId,
tel: that.tel,
password: that.password,
password2: that.password2,
wechat: that.wechat
},
function (r) {
$.loading();
this.billInfo = r;
$.toPay(that.params, that.agentInfo, that.wxInfo, r, that.index, that.userInfo.salesid, 'become');
}, true)
} catch (e) {
$.alert(e);
}
}
},
created: function () {
var that = this;
this.params = $.getQueryObj();
$.getAgentInfo(function (agentInfo) {
that.agentInfo = agentInfo;
$.getWxInfo(function (wxInfo) {
that.wxInfo = wxInfo;
$.getUserInfoFirst(function (userInfo) {
that.userInfo = userInfo;
$.api(
'agent.agent.contactWay', {agentid: that.params.agentid},
function (res) {
that.serverInfo = res;
that.isLoading = false;
}
);
})
})
})
}
}
);
</script>
</body>
</html>