routerView.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. const apiInfo = uni.getStorageSync("apiInfo"); //取存本地的token
  18. console.log(apiInfo,'=====')
  19. headers = {
  20. "content-type": "application/json",
  21. "zoomwin-token": value,
  22. Authorization: value,
  23. "zoomwin-sid": uni.getStorageSync("userInfo").sessionId,
  24. serverInfo : apiInfo.protocal+ apiInfo.hostname+':'+apiInfo.port+'/api',
  25. };
  26. //http://192.168.1.105:18086
  27. setTimeout(()=>{
  28. const params = JSON.parse(option.params)
  29. let html = params.type =='add'? 'a.html':'c.html'
  30. this.webViewUrl = `/hybrid/html/${html}?params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
  31. this.isShow = true
  32. })
  33. },
  34. }
  35. </script>
  36. <style>
  37. </style>