You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
892 B

3 months ago
  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. import {
  6. mapGetters
  7. } from "vuex";
  8. export default {
  9. //computed: mapGetters(['chatUrl']),
  10. data() {
  11. return {
  12. windowH: 0,
  13. windowW: 0,
  14. webviewStyles: {
  15. progress: {
  16. color: 'transparent'
  17. }
  18. },
  19. url: ''
  20. }
  21. },
  22. onLoad(option) {
  23. if(option.webUel) this.url = option.webUel;
  24. // 蚂蚁智能客服场景参数
  25. if(option.tntInstId) this.url += `?tntInstId=${option.tntInstId}`;
  26. if(option.scene) this.url += `&scene=${option.scene}`;
  27. uni.setNavigationBarTitle({
  28. title: option.title
  29. })
  30. try {
  31. const res = uni.getSystemInfoSync();
  32. this.windowW = res.windowWidth;
  33. this.windowH = res.windowHeight;
  34. } catch (e) {
  35. // error
  36. }
  37. }
  38. }
  39. </script>