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