diff --git a/view/peko/modules/pay/js/index.js b/view/peko/modules/pay/js/index.js index 20d46e4..fb4121e 100644 --- a/view/peko/modules/pay/js/index.js +++ b/view/peko/modules/pay/js/index.js @@ -1,5 +1,6 @@ var browser = checkVersion(); const urlPrefix = getUrlPrefix(); +var getUrl = getQueryString(); const urlTest = "https://api.pekolive.com"; const urlProduct = "https://beta.api.pekolive.com"; let arr = []; @@ -27,7 +28,7 @@ $(function () { listChargeAreaInfo(); if (browser.app) { erbanNo == null; - $('body .pay_method, html .pay_method').css('margin','-4.5rem auto 0'); + $('body .pay_method, html .pay_method').css('margin', '-4.5rem auto 0'); $('body .header .user, html .header .user').hide(); $('.but1').hide(); $('.but2').show(); @@ -133,7 +134,7 @@ $(function () { console.log(res) $('.logingActive').text("請稍等");//"" $('.logingActive').show(); - window.location.replace(res.data.payInfo.mweb_url); + window.location.href = res.data.payInfo.mweb_url; } else { logingFun(res.message) } @@ -155,14 +156,26 @@ $(function () { success: function (res) { if (res.code == 200) { var str = ``; - res.data.forEach(res => { + var countryCodeIndexs = 0; + res.data.forEach((res, i) => { str += `
${res.areaName}
` + if (getUrl.countryCode && res.areaCode == getUrl.countryCode) { + countryCodeIndexs = i; + } }) - $('.header_top_right b').text(res.data[0].areaName); + if (getUrl.countryCode) { + $('.header_top_right b').text(res.data[countryCodeIndexs].areaName); + countryCode = res.data[countryCodeIndexs].areaCode; + } else { + $('.header_top_right b').text(res.data[0].areaName); + countryCode = res.data[0].areaCode + } $('.pop_up_in').append(str) - getChargePageInfoForH5(res.data[0].areaCode); + getChargePageInfoForH5(countryCode); + successUrl = updateQueryStringParameter(window.location.href, "countryCode", countryCode) + console.log(successUrl); $('.pop_up_in p').click(function () { $('.header_top_right b').text($(this).text()); countryCode = $(this).attr("countryCode"); @@ -180,6 +193,8 @@ $(function () { // } else { // window.location.href = urlPrefix + '/peko/modules/pay/index.html?countryCodeURL=' + countryCode; // } + successUrl = updateQueryStringParameter(window.location.href, "countryCode", countryCode) + console.log(successUrl); getChargePageInfoForH5(countryCode); }) } else { @@ -188,6 +203,7 @@ $(function () { } }); } + $('.header_top_right').click(function () { $('.pop_up').show(); }); @@ -262,4 +278,17 @@ $(function () { if (!envChecks) return undefined; return envChecks === 'live' ? urlProduct : urlTest; } -}) \ No newline at end of file +}) +function updateQueryStringParameter (uri, key, value) { + if (!value) { + return uri; + } + var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); + var separator = uri.indexOf('?') !== -1 ? "&" : "?"; + if (uri.match(re)) { + return uri.replace(re, '$1' + key + "=" + value + '$2'); + } + else { + return uri + separator + key + "=" + value; + } +} \ No newline at end of file diff --git a/view/peko/modules/rank/index.html b/view/peko/modules/rank/index.html index b88b6b9..7eece05 100644 --- a/view/peko/modules/rank/index.html +++ b/view/peko/modules/rank/index.html @@ -1 +1 @@ -{{content}}'},function(e,t,n){var i,a,o;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,a=[t,n(3),n(25)],void 0===(o="function"==typeof(i=function(n,i,a){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=0;n
{{postData}}\n
{{response || \'\'}}\n
{{ index + 4 }}
-{{ @@ -176,6 +176,7 @@ import { Swiper, SwiperSlide, directive } from "vue-awesome-swiper"; import { rankList, clanList } from "@/api/rank.js"; import { checkVersion } from "@/utils/browser.js"; +import Vconsole from 'vconsole' import "swiper/css/swiper.css"; export default { components: { @@ -190,6 +191,7 @@ export default { setTimeout(() => { this.getList(); }, 50); + // new Vconsole(); }, data() { return { @@ -303,19 +305,19 @@ export default { if (num >= 10000) return (num / 10000).toFixed(1) + "W"; return num; }, - // openPerson(erbanUid) { + openPerson(erbanUid) { // if(this.tabType == 0 || this.tabType == 1) { - // if (checkVersion().app) { - // if (checkVersion().ios) { - // window.webkit.messageHandlers.openPersonPage.postMessage(erbanUid); - // } else if (checkVersion().android) { - // if (androidJsObj && typeof androidJsObj === "object") { - // window.androidJsObj.openPersonPage(erbanUid); - // } - // } - // } + if (checkVersion().app) { + if (checkVersion().ios) { + window.webkit.messageHandlers.openPersonPage.postMessage(erbanUid); + } else if (checkVersion().android) { + if (androidJsObj && typeof androidJsObj === "object") { + window.androidJsObj.openPersonPage(erbanUid); + } + } + } // } - // }, + }, }, // 适配手机屏幕 mounted() {