index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <web-view class="web-view" :webview-styles="webviewStyles" :src="url" :style="{width: windowW + 'px', height: windowH + 'px'}"></web-view>
  3. </template>
  4. <script>
  5. // +----------------------------------------------------------------------
  6. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  7. // +----------------------------------------------------------------------
  8. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  9. // +----------------------------------------------------------------------
  10. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  11. // +----------------------------------------------------------------------
  12. // | Author: CRMEB Team <admin@crmeb.com>
  13. // +----------------------------------------------------------------------
  14. import {
  15. mapGetters
  16. } from "vuex";
  17. export default {
  18. data() {
  19. return {
  20. windowH: 0,
  21. windowW: 0,
  22. webviewStyles: {
  23. progress: {
  24. color: 'transparent'
  25. }
  26. },
  27. url: ''
  28. }
  29. },
  30. onLoad(option) {
  31. if(option.webUel) this.url = decodeURIComponent(option.webUel);
  32. // 蚂蚁智能客服场景参数
  33. if(option.scene) this.url += `&scene=${option.scene}`;
  34. uni.setNavigationBarTitle({
  35. title: option.title
  36. })
  37. try {
  38. const res = uni.getSystemInfoSync();
  39. this.windowW = res.windowWidth;
  40. this.windowH = res.windowHeight;
  41. } catch (e) {
  42. // error
  43. }
  44. }
  45. }
  46. </script>