routerView.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="blacklog-container">
  3. <!-- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" @clickLeft="back">
  4. </uni-nav-bar> -->
  5. <!-- <div style="height: 88rpx;width: 100%;"></div> -->
  6. <web-view style="margin-top: 88rpx;" v-if="isShow" :src="webViewUrl"></web-view>
  7. </view>
  8. </template>
  9. <script>
  10. import Vue from "vue";
  11. import {
  12. getParentIdListByDeptId
  13. } from '@/api/common.js'
  14. export default{
  15. data(){
  16. return{
  17. isShow:false,
  18. webViewUrl:'',
  19. title:'申请'
  20. }
  21. },
  22. async onLoad(option = {}) {
  23. let headers = {};
  24. const value = uni.getStorageSync("token"); //取存本地的token
  25. // const apiInfo = uni.getStorageSync("apiInfo"); //取存本地的token
  26. console.log(Vue.prototype.apiUrl,'apiInfo')
  27. headers = {
  28. "content-type": "application/json",
  29. "zoomwin-token": value,
  30. Authorization: value,
  31. "zoomwin-sid": uni.getStorageSync("userInfo").sessionId,
  32. serverInfo : Vue.prototype.apiUrl||'',
  33. };
  34. //http://192.168.1.105:18086
  35. const params = JSON.parse(option.params)
  36. params.userInfo = uni.getStorageSync("userInfo")
  37. let html = params.type =='add'? 'a.html':'c.html'
  38. this.title= params.type =='add'? '申请':'审批'
  39. try{
  40. params.userInfo.groupIdList = await getParentIdListByDeptId(params.userInfo.groupId)
  41. }catch{
  42. params.userInfo.groupIdList = []
  43. }
  44. console.log(params.userInfo.groupIdList)
  45. setTimeout(()=>{
  46. this.webViewUrl = `/hybrid/html/${html}?params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
  47. this.isShow = true
  48. })
  49. },
  50. }
  51. </script>
  52. <style>
  53. </style>