index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view class="h100vh page-bg-color">
  3. <u-navbar :customBack="handleBackHome" :title="typeLabel[currentType]"></u-navbar>
  4. <view class="workflow-page" :style="{height: `calc(100vh - ${diStatusBarHeight}px - 48px)`}">
  5. <view class="workflow-main">
  6. <start-workflow v-if="currentType === 'start'"></start-workflow>
  7. <approve-center v-else :type='currentType'></approve-center>
  8. </view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import startWorkflow from './startWorkflow/startWorkflow'
  14. import approveCenter from './approveCenter/index'
  15. import constant from '@/utils/constant.js'
  16. export default {
  17. data() {
  18. return {
  19. currentType: 'start',
  20. typeLabel: {
  21. start: '发起申请',
  22. myLaunch: '我发起的',
  23. todo: '我的待办',
  24. done: '我的已办',
  25. cc: '抄送我的',
  26. manager: '流程干预',
  27. },
  28. diStatusBarHeight: 0
  29. };
  30. },
  31. onLoad(options) {
  32. this.diStatusBarHeight = uni.getSystemInfoSync().statusBarHeight
  33. this.currentType = options.type
  34. console.log('类型',options.type)
  35. },
  36. components: {
  37. startWorkflow,
  38. approveCenter
  39. },
  40. methods: {
  41. handleBackHome() {
  42. console.log('000000')
  43. let url=constant.host()
  44. window.parent.postMessage('/pages/index/index',url+'/mobile/pages/flow/flow')
  45. uni.webView.postMessage({
  46. data: {
  47. action: '/pages/index/index'
  48. }
  49. });
  50. // uni.switchTab({
  51. // url: '/pages/home/home'
  52. // })
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. .h100vh {
  59. height: 100vh;
  60. }
  61. .workflow-page {
  62. .workflow-main {
  63. height: 100%;
  64. overflow: hidden;
  65. }
  66. }
  67. </style>