index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <v-page>
  3. <view class="app-nav"></view>
  4. <view class="flex-fill boxs">
  5. <web-view
  6. :webview-styles="webviewStyle"
  7. class="iframe"
  8. :src="`${mobileBase}static/service.html`"
  9. frameborder="0"
  10. ></web-view>
  11. </view>
  12. <view class="back" @click.stop="$back(2)"></view>
  13. </v-page>
  14. </template>
  15. <script>
  16. import app from "app.js";
  17. export default {
  18. name: "service",
  19. data() {
  20. return {
  21. webviewStyle: {
  22. height: "300px",
  23. },
  24. };
  25. },
  26. mounted() {
  27. // #ifdef APP-PLUS
  28. var currentWebview = this.$scope.$getAppWebview(); //获取当前web-view
  29. var wv = currentWebview.children()[0];
  30. wv.setStyle({
  31. top: uni.getSystemInfoSync().statusBarHeight, //此处是距离顶部的高度,应该是你页面的头部
  32. zindex: 1,
  33. scalable: false, //webview的页面是否可以缩放,双指放大缩小
  34. });
  35. // #endif
  36. },
  37. computed: {
  38. mobileBase() {
  39. // #ifdef APP-PLUS
  40. return app.mobile+'/';
  41. // #endif
  42. // #ifdef H5
  43. return '/';
  44. // #endif
  45. },
  46. },
  47. methods: {
  48. },
  49. };
  50. </script>
  51. <style lang="scss" scoped>
  52. .iframe {
  53. width: 100%;
  54. }
  55. </style>