diff --git a/view/peko/modules/pay/images/ddianicon.png b/view/peko/modules/pay/images/ddianicon.png index 286e5df..79583ac 100644 Binary files a/view/peko/modules/pay/images/ddianicon.png and b/view/peko/modules/pay/images/ddianicon.png differ diff --git a/view/peko/modules/pay/images/falseIcon.png b/view/peko/modules/pay/images/falseIcon.png index cef2702..88af859 100644 Binary files a/view/peko/modules/pay/images/falseIcon.png and b/view/peko/modules/pay/images/falseIcon.png differ diff --git a/view/peko/modules/pay/images/moreIcon.png b/view/peko/modules/pay/images/moreIcon.png index b7f4036..0f60c83 100644 Binary files a/view/peko/modules/pay/images/moreIcon.png and b/view/peko/modules/pay/images/moreIcon.png differ diff --git a/view/peko/modules/pay/images/trueIcon.png b/view/peko/modules/pay/images/trueIcon.png index cc79ec1..26c425b 100644 Binary files a/view/peko/modules/pay/images/trueIcon.png and b/view/peko/modules/pay/images/trueIcon.png differ diff --git a/view/peko/modules/pay/js/index.js b/view/peko/modules/pay/js/index.js index 1bb3160..32bd79c 100644 --- a/view/peko/modules/pay/js/index.js +++ b/view/peko/modules/pay/js/index.js @@ -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 (apply2NewLock) { + apply2New(); + } // if (browser.app) { - apply2New(); + // 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: ${res.data.erbanNo}`); + $('.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(); })