var content = { cn: { item1: "忘记密码", btn: "确定", item2: "密码格式错误", item3: "请输入新密码", item4: "请确认新密码", item5: "两次输入密码不一致!", success: "成功", }, en: { item1: "Forget the password", btn: "Confirm", item2: "Wrong password format", item3: "Please enter a new password", item4: "Please confirm the new password", item5: "The two input passwords are inconsistent!", success: "success", }, }; let config = { Pattern: { Password: /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/, }, }; let vm = new Vue({ el: "#pay", data() { return { imgUrl: "", ho: "", //多语言 langList: { en: "ENGLISH", cn: "中文简体", }, language: "cn", lang: {}, CLABE: "", CONCEPTO: "", BENEFICIARIO: "", MONTO: "", CENTROCOSTO: "", successUrl: "", ho: '', }; }, computed: { // AccessToken(){ // return{ // 'Access-Token': window.location.search.split('?token=')[1] // } // } }, methods: { // 语言切换函数 chooseLang(key) { this.lang = content[key]; this.language = key; }, // 复制分享链接 CopyShareLink(link) { let linkEle = document.getElementById(link); linkEle.select(); document.execCommand("Copy"); }, //成功跳转页面 Pay() { window.location.href = window.location.protocol + "//" + "pay." + this.ho + ".com/" + this.successUrl; }, //取消关闭页面 Cancle() { if (navigator.userAgent.indexOf("MSIE") > 0) { // close IE if (navigator.userAgent.indexOf("MSIE 6.0") > 0) { window.opener = null; window.close(); } else { window.open("", "_top", ""); window.top.close(); } } else { // close chrome;It is effective when it is only one. window.opener = null; window.open("", "_self", ""); window.close(); } }, getQueryStringRegExp(name){ var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i"); if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " ")); return ""; }, getCodeQuery(){ this.CLABE = this.getQueryStringRegExp('CLABE') this.CONCEPTO = this.getQueryStringRegExp('CONCEPTO') this.BENEFICIARIO = this.getQueryStringRegExp('BENEFICIARIO') this.MONTO = this.getQueryStringRegExp('MONTO') + " " + this.getQueryStringRegExp('Currency') this.CENTROCOSTO = this.getQueryStringRegExp('CENTROCOSTO') this.successUrl = this.getQueryStringRegExp('successUrl') // switch (this.getQueryStringRegExp('mmF')) { // case "F0": // this.params.comPoint = 0; // break; // case "F1": // this.params.comPoint = 10; // break; // case "F2": // this.params.comPoint = 20; // break; // case "F3": // this.params.comPoint = 30; // break; // } // switch (this.getQueryStringRegExp('mmB')) { // case "B0": // this.params.ibInvalid = 0; // break; // case "B1": // this.params.ibInvalid = 1; // break; // } }, }, mounted() { // this.addresses = window.location.search // .split("?addresses=")[1] // .split("&successUrl=")[0]; // this.successUrl = window.location.search.split("&successUrl=")[1].split('&amount=')[0]; // this.amount = window.location.search.split("&amount=")[1].split('¤cy=')[0]; // this.currency = window.location.search.split("¤cy=")[1]; // console.log(this.addresses,this.successUrl,this.amount,this.currency); // jQuery('#qrcode').qrcode({width: 250,height: 250,correctLevel:0,text: this.addresses}); this.getCodeQuery(); this.ho = window.location.host.split('.')[1]; // var jsSrc =(navigator.language || navigator.browserLanguage).toLowerCase(); // if(jsSrc.indexOf('zh') >= 0){ // this.language = 'cn' // this.lang = content['cn']; // }else{ // this.language = 'en' // this.lang = content['en']; // } this.language = 'en' this.lang = content['en']; }, });