index.vue 840 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view>
  3. <view id="box">
  4. <web-view :src="link"></web-view>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import base64 from "@/library/vendor/base64.js";
  10. export default {
  11. data() {
  12. return {
  13. link: "",
  14. title : ""
  15. }
  16. },//encodeURIComponent
  17. onLoad(options) {
  18. var type = options.type || "";
  19. if(type == "base64") {
  20. this.link = base64.decode(decodeURIComponent(options.url));
  21. } else {
  22. this.link = decodeURIComponent(options.url);
  23. }
  24. //#// #ifdef H5
  25. if(type == "base64") {
  26. uni.switchTab({
  27. url:"/pages/index/index"
  28. });
  29. location.href = this.link;
  30. return;
  31. }
  32. // #endif
  33. this.title = options.title;
  34. uni.setNavigationBarTitle({
  35. title:options.title
  36. })
  37. },
  38. methods: {
  39. }
  40. }
  41. </script>
  42. <style>
  43. #box {
  44. padding-top: 90px;
  45. z-index: -1;
  46. }
  47. </style>