修复绑定信息
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 306 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 175 B |
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 435 B |
@@ -36,6 +36,7 @@ let uid;
|
|||||||
let openId;
|
let openId;
|
||||||
var textLock = true;
|
var textLock = true;
|
||||||
var isRecommendArr = [];//记录是否推荐代充
|
var isRecommendArr = [];//记录是否推荐代充
|
||||||
|
var apply2NewLock = true;
|
||||||
$(function () {
|
$(function () {
|
||||||
if (EnvCheck() == 'test') {//degBug
|
if (EnvCheck() == 'test') {//degBug
|
||||||
new VConsole();
|
new VConsole();
|
||||||
@@ -45,8 +46,9 @@ $(function () {
|
|||||||
if (browser.app) {
|
if (browser.app) {
|
||||||
erbanNo = null;
|
erbanNo = null;
|
||||||
$('.bindingBox').hide();
|
$('.bindingBox').hide();
|
||||||
} else {
|
|
||||||
uid = pubInfo.uid;
|
uid = pubInfo.uid;
|
||||||
|
getSimpleUserByUid(uid);
|
||||||
|
} else {
|
||||||
}
|
}
|
||||||
channelType = getUrl.channelType;
|
channelType = getUrl.channelType;
|
||||||
getArea();
|
getArea();
|
||||||
@@ -169,15 +171,17 @@ $('.page1 .position').on('click', 'div', function () {
|
|||||||
})
|
})
|
||||||
// 充值接口
|
// 充值接口
|
||||||
function apply2New () {
|
function apply2New () {
|
||||||
|
apply2NewLock = false;
|
||||||
showLoading();
|
showLoading();
|
||||||
networkRequest({
|
networkRequest({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: urlPrefix + '/charge/apply2New',
|
url: urlPrefix + '/charge/apply2New',
|
||||||
data: { erbanNo, chargeProdId, countryCode, openId, payChannel, paymentType, successUrl, uid, deviceId: deviceId },
|
data: { erbanNo, chargeProdId, countryCode, openId, payChannel, paymentType, successUrl, deviceId: deviceId },
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
window.location.href = res.data.payInfo.mweb_url;
|
window.location.href = res.data.payInfo.mweb_url;
|
||||||
} else {
|
} else {
|
||||||
|
apply2NewLock = true;
|
||||||
toastMsg(res.message);
|
toastMsg(res.message);
|
||||||
}
|
}
|
||||||
hideLoading(layerIndex);
|
hideLoading(layerIndex);
|
||||||
@@ -185,6 +189,7 @@ function apply2New () {
|
|||||||
error (err) {
|
error (err) {
|
||||||
hideLoading(layerIndex);
|
hideLoading(layerIndex);
|
||||||
toastMsg('網絡錯誤');
|
toastMsg('網絡錯誤');
|
||||||
|
apply2NewLock = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -200,8 +205,8 @@ $('.rule p img').click(function () {
|
|||||||
})
|
})
|
||||||
// 确认充值按钮
|
// 确认充值按钮
|
||||||
$('.page1 .payBut').click(function () {
|
$('.page1 .payBut').click(function () {
|
||||||
if (!erbanNo && !browser.app) {
|
if (!erbanNo) {
|
||||||
toastMsg('請先綁定Piko ID')
|
toastMsg('請先確認綁定Piko ID')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!payChannel) {
|
if (!payChannel) {
|
||||||
@@ -216,8 +221,11 @@ $('.page1 .payBut').click(function () {
|
|||||||
toastMsg('請先勾選充值協議')
|
toastMsg('請先勾選充值協議')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (apply2NewLock) {
|
||||||
|
apply2New();
|
||||||
|
}
|
||||||
// if (browser.app) {
|
// if (browser.app) {
|
||||||
apply2New();
|
// apply2New();
|
||||||
// } else {
|
// } else {
|
||||||
// $('.sure .sure_in img').attr('src', $('.userinfo img').attr('src'));
|
// $('.sure .sure_in img').attr('src', $('.userinfo img').attr('src'));
|
||||||
// $('.sure .sure_in p').text($('.userinfo .name').text());
|
// $('.sure .sure_in p').text($('.userinfo .name').text());
|
||||||
@@ -232,11 +240,15 @@ $('.bindingBox .binding .but').click(function () {
|
|||||||
toastMsg('請輸入平台號');
|
toastMsg('請輸入平台號');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
getSimpleUser($('.bindingBox .binding input').val());
|
||||||
|
})
|
||||||
|
// 确认绑定接口
|
||||||
|
function getSimpleUser (erbanNo) {
|
||||||
showLoading();
|
showLoading();
|
||||||
networkRequest({
|
networkRequest({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: urlPrefix + '/user/h5/getSimpleUser',
|
url: urlPrefix + '/user/h5/getSimpleUser',
|
||||||
data: { erbanNo: $('.bindingBox .binding input').val(), },
|
data: { erbanNo },
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
$('.sure .sure_in img').attr('src', res.data.avatar);
|
$('.sure .sure_in img').attr('src', res.data.avatar);
|
||||||
@@ -258,7 +270,41 @@ $('.bindingBox .binding .but').click(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
// 自动绑定接口
|
||||||
|
function getSimpleUserByUid (uid) {
|
||||||
|
showLoading();
|
||||||
|
networkRequest({
|
||||||
|
type: 'GET',
|
||||||
|
url: urlPrefix + '/user/h5/getSimpleUserByUid',
|
||||||
|
data: { uid },
|
||||||
|
success: function (res) {
|
||||||
|
if (res.code == 200) {
|
||||||
|
$('.sure .sure_in img').attr('src', res.data.avatar);
|
||||||
|
$('.sure .sure_in p').text(res.data.nick);
|
||||||
|
$('.sure .sure_in b').html(`Piko ID: <i>${res.data.erbanNo}</i>`);
|
||||||
|
$('.bindingBox').hide();
|
||||||
|
$('.bindingBox .binding input').val('');
|
||||||
|
$('.userinfo img').attr('src', $('.sure .sure_in img').attr('src'));
|
||||||
|
$('.userinfo .name').text($('.sure .sure_in p').text());
|
||||||
|
$('.userinfo .id').text(`Piko ID: ${$('.sure .sure_in b i').text()}`);
|
||||||
|
$('.userinfo').show();
|
||||||
|
erbanNo = $('.sure .sure_in b i').text();
|
||||||
|
} else if (res.code == 1404) {
|
||||||
|
bodyScroolFun(true);
|
||||||
|
$('.userNull').show();
|
||||||
|
} else {
|
||||||
|
toastMsg(res.message);
|
||||||
|
}
|
||||||
|
hideLoading(layerIndex);
|
||||||
|
},
|
||||||
|
error (err) {
|
||||||
|
hideLoading(layerIndex);
|
||||||
|
toastMsg('網絡錯誤');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
// 切换地区
|
// 切换地区
|
||||||
$('.area .area_in').on('click', 'p', function () {
|
$('.area .area_in').on('click', 'p', function () {
|
||||||
countryCode = $(this).attr('areacode');
|
countryCode = $(this).attr('areacode');
|
||||||
@@ -279,6 +325,7 @@ $('.area .area_in').on('click', 'p', function () {
|
|||||||
// 切换id用户按钮
|
// 切换id用户按钮
|
||||||
$('.userinfo .but').click(function () {
|
$('.userinfo .but').click(function () {
|
||||||
erbanNo = null;
|
erbanNo = null;
|
||||||
|
uid = null;
|
||||||
$('.bindingBox').show();
|
$('.bindingBox').show();
|
||||||
$('.userinfo').hide();
|
$('.userinfo').hide();
|
||||||
})
|
})
|
||||||
|