h5.vue 900 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view>
  3. <web-view :src="href"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. href: ""
  11. };
  12. },
  13. onLoad(option) {
  14. // #ifndef APP-NVUE
  15. const eventChannel = this.getOpenerEventChannel();
  16. // #endif
  17. // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
  18. eventChannel.on('acceptDataFromOpenerPage', (data) => {
  19. console.log(data)
  20. uni.setNavigationBarTitle({
  21. title: data.title
  22. })
  23. let url = escape(data.url)
  24. console.log(url)
  25. console.log(unescape(url))
  26. let title = escape(data.title)
  27. console.log(url)
  28. console.log(unescape(title))
  29. this.href = "http://oa_system.nxjiewei.com:8011/oa_login?staff_num=" + uni.getStorageSync('user')
  30. .staff_num + "&url=" + url + "&title=" + title
  31. })
  32. }
  33. }
  34. </script>
  35. <style lang="scss">
  36. </style>