index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. },
  26. diStatusBarHeight: 0
  27. };
  28. },
  29. onLoad(options) {
  30. this.diStatusBarHeight = uni.getSystemInfoSync().statusBarHeight
  31. this.currentType = options.type
  32. console.log('类型',options.type)
  33. },
  34. components: {
  35. startWorkflow,
  36. approveCenter
  37. },
  38. methods: {
  39. handleBackHome() {
  40. console.log('000000')
  41. let url=constant.host()
  42. window.parent.postMessage('/pages/index/index',url+'/mobile/pages/flow/flow')
  43. // uni.switchTab({
  44. // url: '/pages/home/home'
  45. // })
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss">
  51. .h100vh {
  52. height: 100vh;
  53. }
  54. .workflow-page {
  55. .workflow-main {
  56. height: 100%;
  57. overflow: hidden;
  58. }
  59. }
  60. </style>