userPayMoney.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div>
  3. <div style="margin: 10px" v-if="$i18n.locale == 'zh'">
  4. 支付验证成功,即将关闭当前页面......
  5. </div>
  6. <div style="margin: 10px" v-else>
  7. Payment verification succeeded. The current page will be closed soon...
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. name: 'userPayMoney',
  14. data() {
  15. return {
  16. userPay: '',
  17. }
  18. },
  19. mounted() {
  20. this.init()
  21. },
  22. methods: {
  23. init() {
  24. setTimeout(() => {
  25. var userAgent = navigator.userAgent
  26. if (userAgent.indexOf('MSIE') > 0) {
  27. if (userAgent.indexOf('MSIE 6.0') > 0) {
  28. window.opener = null
  29. window.close()
  30. } else {
  31. window.open('', '_top')
  32. window.top.close()
  33. }
  34. } else if (
  35. userAgent.indexOf('Firefox') != -1 ||
  36. userAgent.indexOf('Chrome') != -1
  37. ) {
  38. window.location.href = 'about:blank ' //火狐默认状态非window.open的页面window.close是无效的
  39. //window.history.go(-2);
  40. } else {
  41. window.opener = null
  42. window.open(',', '_self').close()
  43. }
  44. // window.close()
  45. }, 5000)
  46. },
  47. },
  48. }
  49. </script>
  50. <style lang="less" scoped>
  51. * {
  52. padding: 0;
  53. margin: 0;
  54. font-size: 20px;
  55. color: #010101;
  56. background-color: #fff;
  57. }
  58. </style>