routerView.vue 827 B

1234567891011121314151617181920212223242526272829303132333435
  1. <template>
  2. <view class="blacklog-container">
  3. <web-view v-if="isShow" :src="webViewUrl"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default{
  8. data(){
  9. return{
  10. isShow:false,
  11. webViewUrl:''
  12. }
  13. },
  14. onLoad(option = {}) {
  15. let headers = {};
  16. const value = uni.getStorageSync("token"); //取存本地的token
  17. headers = {
  18. "content-type": "application/json",
  19. "zoomwin-token": value,
  20. Authorization: value,
  21. "zoomwin-sid": uni.getStorageSync("userInfo").sessionId,
  22. };
  23. setTimeout(()=>{
  24. const params = JSON.parse(option.params)
  25. let html = params.type =='add'? 'a.html':'c.html'
  26. this.webViewUrl = `/hybrid/html/${html}?params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
  27. this.isShow = true
  28. })
  29. },
  30. }
  31. </script>
  32. <style>
  33. </style>