game_site.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view>
  3. <web-view src="https://api.9idudu.com/sdkweb/?appId=LIU_DA"/>
  4. </view>
  5. </template>
  6. <script>
  7. import _hook from '../../common/_hook';
  8. export default {
  9. components: {
  10. },
  11. data() {
  12. return {
  13. url: 'https://api.9idudu.com/sdkweb/?appId=LIU_DA',
  14. agent_user_id:0
  15. }
  16. },
  17. onShow(){
  18. _hook.routeTabBarHook();
  19. },
  20. onReady() {
  21. setTimeout(function () {
  22. uni.hideLoading();
  23. },1000)
  24. },
  25. onLoad(option) {
  26. uni.showLoading({
  27. title:null,
  28. })
  29. if('url' in option){
  30. option.url = decodeURIComponent(option.url);
  31. if(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/.test(option.url)){
  32. if(!/^http/.test(option.url)){
  33. option.url = 'http://' + option.url;
  34. }
  35. this.url = option.url;
  36. }
  37. }
  38. // if('title' in option){
  39. // uni.setNavigationBarTitle({
  40. // title: option.title,
  41. // });
  42. // }
  43. if('agent_user_id' in option){
  44. this.agent_user_id = option.agent_user_id;
  45. }
  46. },
  47. computed: {
  48. },
  49. methods: {
  50. },
  51. onNavigationBarButtonTap(e) {
  52. console.log(e.index)
  53. // #ifdef APP-PLUS
  54. let currentWebview = this.$mp.page.$getAppWebview().children()[0]; //获取当前页面的webview对象
  55. // #endif
  56. switch (e.index){
  57. case 0:
  58. // #ifdef APP-PLUS
  59. currentWebview.reload();
  60. // #endif
  61. // #ifdef H5
  62. location.reload();
  63. // #endif
  64. break;
  65. case 1:
  66. // #ifdef APP-PLUS
  67. currentWebview.reload();
  68. // #endif
  69. // #ifdef H5
  70. location.reload();
  71. // #endif
  72. break;
  73. case 2:
  74. uni.switchTab({
  75. url: '../push/game',
  76. });
  77. break;
  78. case 3:
  79. uni.navigateBack();
  80. break;
  81. default:
  82. break;
  83. }
  84. },
  85. }
  86. </script>
  87. <style>
  88. </style>