routerView.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. let params = JSON.parse(option.params)
  36. let userInfo = uni.getStorageSync("userInfo")
  37. params.userInfo={
  38. userId:userInfo.userId,
  39. groupId:userInfo.groupId
  40. }
  41. let html = params.type =='add'? 'a.html':'c.html'
  42. this.title= params.type =='add'? '申请':'审批'
  43. try{
  44. params.userInfo.groupIdList = await getParentIdListByDeptId(params.userInfo.groupId)
  45. }catch{
  46. params.userInfo.groupIdList = []
  47. }
  48. console.log(params)
  49. setTimeout(()=>{
  50. this.webViewUrl = `/hybrid/html/${html}?params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
  51. this.isShow = true
  52. })
  53. },
  54. }
  55. </script>
  56. <style>
  57. </style>