修改完成
This commit is contained in:
+4
-59
@@ -114,21 +114,6 @@
|
||||
<button class="action-card-btn btn-apply-dist" id="fzlj" type="button">复制链接</button>
|
||||
<button class="action-card-btn btn-apply-expert" id="tgewm" type="button">推广二维码</button>
|
||||
</div>
|
||||
<div class="action-card">
|
||||
<div class="action-card-title">
|
||||
<i class="layui-icon layui-icon-group"></i> 申请分销
|
||||
</div>
|
||||
<div class="action-card-desc">
|
||||
成为分销商,推广赚佣金。邀请好友注册即可获得分销收益,多级返佣,轻松赚钱。
|
||||
</div>
|
||||
<button
|
||||
class="action-card-btn btn-apply-dist"
|
||||
id="btnApplyDist"
|
||||
onclick="applyDistribution()"
|
||||
>
|
||||
申请分销
|
||||
</button>
|
||||
</div>
|
||||
<div class="action-card">
|
||||
<div class="action-card-title">
|
||||
<i class="layui-icon layui-icon-star"></i> 申请专家
|
||||
@@ -277,15 +262,12 @@
|
||||
: $("#backTop").removeClass("is-visible");
|
||||
});
|
||||
|
||||
function getApiBaseUrl() {
|
||||
return (ApiClient.baseUrl || (window.CONFIG && CONFIG.API_BASE_URL) || window.location.origin || "").replace(/\/$/, "");
|
||||
}
|
||||
|
||||
function normalizeShareLink(data) {
|
||||
var affUrl = (data && (data.affUrl || data.shareUrl || data.inviteUrl || data.url)) || "";
|
||||
if (!affUrl) return "";
|
||||
if (/^https?:\/\//i.test(affUrl)) return affUrl;
|
||||
return getApiBaseUrl() + "/html/reg.html?affUrl=" + String(affUrl).replace(/^\//, "");
|
||||
return NavigationUtil.referralRegisterUrl(
|
||||
String(affUrl).trim(),
|
||||
data && data.inviteCode,
|
||||
);
|
||||
}
|
||||
|
||||
function getAffInfo() {
|
||||
@@ -333,9 +315,6 @@
|
||||
.then(function (res) {
|
||||
if (res.code !== 0 || !res.data) throw new Error(res.msg || "获取推广信息失败");
|
||||
var shareLink = normalizeShareLink(res.data);
|
||||
if (res.data.affCodeUrl && res.data.affUrl) {
|
||||
shareLink = String(res.data.affCodeUrl).replace(/\/$/, "") + "/" + String(res.data.affUrl).replace(/^\//, "");
|
||||
}
|
||||
if (!shareLink) throw new Error("接口未返回推广二维码链接");
|
||||
createCustomModal(shareLink);
|
||||
})
|
||||
@@ -431,40 +410,6 @@
|
||||
);
|
||||
}
|
||||
|
||||
// Apply for distribution
|
||||
window.applyDistribution = function () {
|
||||
CommonUtil.requireAuth(function () {
|
||||
layer.confirm(
|
||||
"确定要申请成为分销商吗?",
|
||||
{
|
||||
title: "申请分销",
|
||||
btn: ["确定申请", "取消"],
|
||||
btnAlign: "c",
|
||||
},
|
||||
function (index) {
|
||||
layer.close(index);
|
||||
ApiClient.post(ApiClient.API.referralBind, {}, { headers: CommonUtil.authHeaders() })
|
||||
.then(function (res) {
|
||||
if (res.code === 0) {
|
||||
layer.msg(
|
||||
"申请成功!",
|
||||
{ icon: 1, time: 2000 },
|
||||
function () {
|
||||
loadUserDetail();
|
||||
},
|
||||
);
|
||||
} else {
|
||||
layer.msg(res.msg || "申请失败", { icon: 2 });
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
layer.msg("网络错误,请稍后重试", { icon: 2 });
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
// Apply for expert
|
||||
window.applyExpert = function () {
|
||||
CommonUtil.requireAuth(function () {
|
||||
|
||||
Reference in New Issue
Block a user