Commit 7bee0d9c by Chao Sun

购买獴哥添加渠道

parent bb9e5847
...@@ -26,6 +26,27 @@ $(function () { ...@@ -26,6 +26,27 @@ $(function () {
$("#phone,#name,#code").blur(function () { $("#phone,#name,#code").blur(function () {
window.scrollTo(0, 0); window.scrollTo(0, 0);
}) })
$(".right").click(function () {
if (getQueryString('source')) {
$('.modalBox').hide();
goTopay()
} else {
$("#phone").val('')
$("#code").val('')
$("#name").val('')
$('.modalBox').show();
}
})
$('.closeModal').click(function () {
$('.modalBox').hide();
})
if (getQueryString('hmsr') || getQueryString('hmpl') || getQueryString('hmkw') || getQueryString('hmci')) {
window.localStorage.setItem('hmsr', getQueryString('hmsr'))
window.localStorage.setItem('hmpl', getQueryString('hmpl'))
window.localStorage.setItem('hmkw', getQueryString('hmkw'))
window.localStorage.setItem('hmci', getQueryString('hmci'))
}
function getToken() { function getToken() {
$.ajax({ $.ajax({
type: "POST", type: "POST",
...@@ -43,6 +64,33 @@ $(function () { ...@@ -43,6 +64,33 @@ $(function () {
} }
var token = getToken(); var token = getToken();
//解密来源
getChannel()
function getChannel() {
if (getQueryString('source')) {
$.ajax({
type: "POST",
url: api + '/api/activity/getActivityOrderInfo',
contentType: "application/json",
data: JSON.stringify({ encryptData: getQueryString('source') }),
async: false,
headers: { "X-Authorization": token },
success: function (res) {
if (res['success']) {
res = res['data'];
window.localStorage.setItem('hmsr', res['channelLaunchAD']['hmsr'])
window.localStorage.setItem('hmpl', res['channelLaunchAD']['hmpl'])
window.localStorage.setItem('hmkw', res['channelLaunchAD']['hmkw'])
window.localStorage.setItem('hmci', res['channelLaunchAD']['hmci'])
param.name = res['name'];
param.phone = res['mobileNo'];
param.customerId = res['customerId'];
}
}
})
}
}
function checkDeviceType() { function checkDeviceType() {
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) { if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
...@@ -55,7 +103,6 @@ $(function () { ...@@ -55,7 +103,6 @@ $(function () {
} }
return deviceType; return deviceType;
} }
var deviceType = checkDeviceType(); var deviceType = checkDeviceType();
param.deviceType = deviceType; param.deviceType = deviceType;
//获取产品价格 //获取产品价格
...@@ -65,13 +112,9 @@ $(function () { ...@@ -65,13 +112,9 @@ $(function () {
type: "POST", type: "POST",
url: api + '/api/voucherInfoQuery', url: api + '/api/voucherInfoQuery',
contentType: "application/json", contentType: "application/json",
data: JSON.stringify({ data: JSON.stringify({ planId: 424 }),
planId: 424
}),
async: false, async: false,
headers: { headers: { "X-Authorization": token },
"X-Authorization": token
},
success: function (res) { success: function (res) {
if (res['data']) { if (res['data']) {
$(".nowPrice").html(res['data']['voucherSalePrice']) $(".nowPrice").html(res['data']['voucherSalePrice'])
...@@ -82,29 +125,6 @@ $(function () { ...@@ -82,29 +125,6 @@ $(function () {
}) })
return nowPrice return nowPrice
} }
$(".right").click(function () {
if (getQueryString('name') && getQueryString('customerId') && getQueryString('mobileNo')) {
$('.modalBox').hide();
goTopay()
} else {
$("#phone").val('')
$("#code").val('')
$("#name").val('')
$('.modalBox').show();
}
})
$('.closeModal').click(function () {
$('.modalBox').hide();
})
if (getQueryString('hmsr') || getQueryString('hmpl') || getQueryString('hmkw') || getQueryString('hmci')) {
window.localStorage.setItem('hmsr', getQueryString('hmsr'))
window.localStorage.setItem('hmpl', getQueryString('hmpl'))
window.localStorage.setItem('hmkw', getQueryString('hmkw'))
window.localStorage.setItem('hmci', getQueryString('hmci'))
}
function getQueryString(name) { function getQueryString(name) {
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
const r = decodeURIComponent(gitUrlParam).substr(1).match(reg); const r = decodeURIComponent(gitUrlParam).substr(1).match(reg);
...@@ -298,10 +318,7 @@ $(function () { ...@@ -298,10 +318,7 @@ $(function () {
} }
function goTopay() { function goTopay() {
if (getQueryString('name') && getQueryString('customerId') && getQueryString('mobileNo')) { if (getQueryString('source')) {
param.customerId = getQueryString('customerId');
param.name = getQueryString('name');
param.phone = getQueryString('mobileNo');
param.verificationCodeValider = true; param.verificationCodeValider = true;
} else { } else {
param.name = $("#name").val(); param.name = $("#name").val();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment