index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. try {
  46. uni.webView.postMessage({
  47. data: {
  48. action: '/pages/index/index'
  49. }
  50. });
  51. } catch (error) {
  52. console.warn('unipostMessage',error)
  53. }
  54. // uni.switchTab({
  55. // url: '/pages/home/home'
  56. // })
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .h100vh {
  63. height: 100vh;
  64. }
  65. .workflow-page {
  66. .workflow-main {
  67. height: 100%;
  68. overflow: hidden;
  69. }
  70. }
  71. </style>