paypaga.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. var content = {
  2. cn: {
  3. item1: "忘记密码",
  4. btn: "确定",
  5. item2: "密码格式错误",
  6. item3: "请输入新密码",
  7. item4: "请确认新密码",
  8. item5: "两次输入密码不一致!",
  9. success: "成功",
  10. },
  11. en: {
  12. item1: "Forget the password",
  13. btn: "Confirm",
  14. item2: "Wrong password format",
  15. item3: "Please enter a new password",
  16. item4: "Please confirm the new password",
  17. item5: "The two input passwords are inconsistent!",
  18. success: "success",
  19. },
  20. };
  21. let config = {
  22. Pattern: {
  23. Password:
  24. /^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*([~!@&%$^\\(\\)#_]).*\\1.*\\1.*\\1)[A-Za-z0-9~!@&%$^\\(\\)#_]{8,16}$/,
  25. },
  26. };
  27. let vm = new Vue({
  28. el: "#pay",
  29. data() {
  30. return {
  31. imgUrl: "",
  32. ho: "",
  33. //多语言
  34. langList: {
  35. en: "ENGLISH",
  36. cn: "中文简体",
  37. },
  38. language: "cn",
  39. lang: {},
  40. CLABE: "",
  41. CONCEPTO: "",
  42. BENEFICIARIO: "",
  43. MONTO: "",
  44. CENTROCOSTO: "",
  45. successUrl: "",
  46. ho: '',
  47. };
  48. },
  49. computed: {
  50. // AccessToken(){
  51. // return{
  52. // 'Access-Token': window.location.search.split('?token=')[1]
  53. // }
  54. // }
  55. },
  56. methods: {
  57. // 语言切换函数
  58. chooseLang(key) {
  59. this.lang = content[key];
  60. this.language = key;
  61. },
  62. // 复制分享链接
  63. CopyShareLink(link) {
  64. let linkEle = document.getElementById(link);
  65. linkEle.select();
  66. document.execCommand("Copy");
  67. },
  68. //成功跳转页面
  69. Pay() {
  70. window.location.href = window.location.protocol + "//" + "pay." + this.ho + ".com/" + this.successUrl;
  71. },
  72. //取消关闭页面
  73. Cancle() {
  74. if (navigator.userAgent.indexOf("MSIE") > 0) {
  75. // close IE
  76. if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
  77. window.opener = null;
  78. window.close();
  79. } else {
  80. window.open("", "_top", "");
  81. window.top.close();
  82. }
  83. } else {
  84. // close chrome;It is effective when it is only one.
  85. window.opener = null;
  86. window.open("", "_self", "");
  87. window.close();
  88. }
  89. },
  90. getQueryStringRegExp(name){
  91. var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
  92. if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " ")); return "";
  93. },
  94. getCodeQuery(){
  95. this.CLABE = this.getQueryStringRegExp('CLABE')
  96. this.CONCEPTO = this.getQueryStringRegExp('CONCEPTO')
  97. this.BENEFICIARIO = this.getQueryStringRegExp('BENEFICIARIO')
  98. this.MONTO = this.getQueryStringRegExp('MONTO') + " " + this.getQueryStringRegExp('Currency')
  99. this.CENTROCOSTO = this.getQueryStringRegExp('CENTROCOSTO')
  100. this.successUrl = this.getQueryStringRegExp('successUrl')
  101. // switch (this.getQueryStringRegExp('mmF')) {
  102. // case "F0":
  103. // this.params.comPoint = 0;
  104. // break;
  105. // case "F1":
  106. // this.params.comPoint = 10;
  107. // break;
  108. // case "F2":
  109. // this.params.comPoint = 20;
  110. // break;
  111. // case "F3":
  112. // this.params.comPoint = 30;
  113. // break;
  114. // }
  115. // switch (this.getQueryStringRegExp('mmB')) {
  116. // case "B0":
  117. // this.params.ibInvalid = 0;
  118. // break;
  119. // case "B1":
  120. // this.params.ibInvalid = 1;
  121. // break;
  122. // }
  123. },
  124. },
  125. mounted() {
  126. // this.addresses = window.location.search
  127. // .split("?addresses=")[1]
  128. // .split("&successUrl=")[0];
  129. // this.successUrl = window.location.search.split("&successUrl=")[1].split('&amount=')[0];
  130. // this.amount = window.location.search.split("&amount=")[1].split('&currency=')[0];
  131. // this.currency = window.location.search.split("&currency=")[1];
  132. // console.log(this.addresses,this.successUrl,this.amount,this.currency);
  133. // jQuery('#qrcode').qrcode({width: 250,height: 250,correctLevel:0,text: this.addresses});
  134. this.getCodeQuery();
  135. this.ho = window.location.host.split('.')[1];
  136. // var jsSrc =(navigator.language || navigator.browserLanguage).toLowerCase();
  137. // if(jsSrc.indexOf('zh') >= 0){
  138. // this.language = 'cn'
  139. // this.lang = content['cn'];
  140. // }else{
  141. // this.language = 'en'
  142. // this.lang = content['en'];
  143. // }
  144. this.language = 'en'
  145. this.lang = content['en'];
  146. },
  147. });