index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-12 11:57:48
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-01-16 13:56:57
  6. * @Description: file content
  7. * @FilePath: \opms\pages\schedule\index.vue
  8. -->
  9. <template>
  10. <view class="home">
  11. <view class="nav">
  12. <view :style="{ paddingTop }">
  13. <view class="title" :style="[{ height }, { lineHeight: height }]">
  14. <view class="back" v-if="showBack" @click="$refs.manage.back()">
  15. <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
  16. </view>
  17. <text>日程</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="main">
  22. <view class="tabs">
  23. <u-tabs
  24. @change="changeTabs"
  25. lineWidth="8"
  26. :current="curTabIndex"
  27. lineHeight="8"
  28. :scrollable="false"
  29. :list="list"
  30. :lineColor="`url(${lineBg}) 100% 100%`"
  31. :activeStyle="{
  32. color: '#3E7EF8',
  33. fontWeight: 'bold',
  34. }"
  35. :inactiveStyle="{
  36. color: '#969696',
  37. }"
  38. itemStyle="height: 90rpx;"></u-tabs>
  39. </view>
  40. <view class="content">
  41. <manage v-if="curTabIndex === 0" ref="manage" @setBackVisible="initBack()" />
  42. <supervise v-if="curTabIndex === 1" ref="supervise" />
  43. <log v-if="curTabIndex === 2" ref="log" />
  44. </view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import manage from './components/manage'
  50. import supervise from './components/supervise'
  51. import log from './components/log'
  52. export default {
  53. name: 'opsIndex',
  54. components: { manage, supervise, log },
  55. data() {
  56. return {
  57. lineBg: require('../../static/images/up.png'),
  58. showBack: false,
  59. height: '',
  60. paddingTop: '',
  61. curTabIndex: 0,
  62. list: [
  63. {
  64. name: '日程管理',
  65. index: 0,
  66. },
  67. {
  68. name: '督办事项',
  69. index: 1,
  70. },
  71. {
  72. name: '工作日志',
  73. index: 2,
  74. },
  75. ],
  76. }
  77. },
  78. created() {
  79. const navData = uni.getMenuButtonBoundingClientRect()
  80. this.height = navData.height + 'px'
  81. this.paddingTop = navData.top + 'px'
  82. },
  83. mounted() {},
  84. methods: {
  85. // 显示返回
  86. initBack(visible) {
  87. this.showBack = visible
  88. },
  89. // 改变tab
  90. changeTabs(data) {
  91. // console.log(data)
  92. this.curTabIndex = data.index
  93. },
  94. },
  95. }
  96. </script>
  97. <style>
  98. page {
  99. background: #f2f3f5;
  100. }
  101. </style>
  102. <style lang="scss" scoped>
  103. .home {
  104. padding-top: 188rpx;
  105. .nav {
  106. position: absolute;
  107. left: 0;
  108. top: 0;
  109. width: 100%;
  110. height: 284rpx;
  111. background: #3e7ef8;
  112. .title {
  113. position: relative;
  114. text-align: center;
  115. font-size: 32rpx;
  116. font-weight: bold;
  117. color: #ffffff;
  118. .back {
  119. position: absolute;
  120. top: 0;
  121. bottom: 0;
  122. margin: auto;
  123. left: 70rpx;
  124. display: flex;
  125. }
  126. }
  127. }
  128. .main {
  129. position: absolute;
  130. width: 100%;
  131. height: calc(100vh - 188rpx);
  132. background: #ffffff;
  133. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  134. border-radius: 31rpx 31rpx 0 0;
  135. padding: 0 32rpx;
  136. overflow: auto;
  137. padding-bottom: 64rpx;
  138. .tabs {
  139. border-bottom: 1px solid #cdcdcd;
  140. padding-bottom: 4rpx;
  141. }
  142. }
  143. }
  144. </style>