t-o-news - 模块切换.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view>
  3. <!-- tab -->
  4. <view class="tab">
  5. <view class="item" @click="change_active(1)">
  6. <view class="icon">
  7. <image v-if="active != 1" src="./icon/icon_1.png" mode=""></image>
  8. <image v-if="active == 1" src="./icon/icon_1_active.png" style="width: 115rpx;height: 80rpx;"
  9. mode=""></image>
  10. </view>
  11. <view class="title">
  12. <view class="text" :style="active==1?'color:#009FE8;font-weight:700;':'' ">闭环管理</view>
  13. <view class="tip" :style="active==1?'color:#3a3a3a;':'' ">PDCA循环管理</view>
  14. </view>
  15. </view>
  16. <!-- <view class="item" @click="change_active(2)">
  17. <view class="icon">
  18. <image v-if="active != 2" src="./icon/icon_2.png" mode=""></image>
  19. <image v-if="active == 2" src="./icon/icon_2_active.png" style="width: 115rpx;height: 80rpx;"
  20. mode=""></image>
  21. </view>
  22. <view class="title">
  23. <view class="text" :style="active==2?'color:#009FE8;font-weight:700;':'' ">记录管理</view>
  24. <view class="tip" :style="active==2?'color:#3a3a3a;':'' ">全部消息一览</view>
  25. </view>
  26. </view> -->
  27. <!-- 矿区圈 -->
  28. <view class="item" @click="change_active(2)">
  29. <view class="icon">
  30. <image v-if="active != 2" src="./icon/kqq.png" mode=""></image>
  31. <image v-if="active == 2" src="./icon/kqq_active.png" style="width: 115rpx;height: 80rpx;"
  32. mode=""></image>
  33. </view>
  34. <view class="title">
  35. <view class="text" :style="active==2?'color:#009FE8;font-weight:700;':'' ">矿区圈</view>
  36. <view class="tip" :style="active==2?'color:#3a3a3a;':'' ">日常记录实时查看</view>
  37. </view>
  38. </view>
  39. <view class="item" @click="change_active(3)">
  40. <view class="icon">
  41. <image v-if="active != 3" src="./icon/icon_3.png" mode=""></image>
  42. <image v-if="active == 3" src="./icon/icon_3_active.png" style="width: 115rpx;height: 80rpx;"
  43. mode=""></image>
  44. </view>
  45. <view class="title">
  46. <view class="text" :style="active==3?'color:#009FE8;font-weight:700;':'' ">宣传展板</view>
  47. <view class="tip" :style="active==3?'color:#3a3a3a;':'' ">企业文化宣传展示</view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- content -->
  52. <view class="content">
  53. <view v-if="active == 1">
  54. <t-o-news-tab-1></t-o-news-tab-1>
  55. </view>
  56. <view v-if="active == 2">
  57. <t-o-news-tab-2 ref="tab_2"></t-o-news-tab-2>
  58. </view>
  59. <view v-if="active == 3">
  60. <t-o-news-tab-3></t-o-news-tab-3>
  61. </view>
  62. </view>
  63. <view class="go_top" @click="go_top">
  64. <uni-icons type="top" size="22"></uni-icons>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. name: "t-o-news",
  71. data() {
  72. return {
  73. active: 1
  74. };
  75. },
  76. methods: {
  77. change_active(item) {
  78. this.active = item
  79. },
  80. tab_2_onReachBottom(){
  81. if(this.active == 2){
  82. this.$refs.tab_2.nextPage();
  83. }
  84. },
  85. go_top(){
  86. uni.pageScrollTo({
  87. scrollTop: 0,
  88. duration: 200
  89. });
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. page {
  96. background-color: #F2FAF7;
  97. }
  98. .tab {
  99. background-color: #FFFFFF;
  100. box-sizing: border-box;
  101. padding: 25rpx 50rpx;
  102. display: flex;
  103. justify-content: space-between;
  104. align-items: center;
  105. .item {
  106. text-align: center;
  107. .icon {
  108. height: 80rpx;
  109. image {
  110. width: 95rpx;
  111. height: 66rpx;
  112. }
  113. }
  114. .title {
  115. margin-top: 10rpx;
  116. .text {
  117. font-size: 30rpx;
  118. color: #727272;
  119. }
  120. .tip {
  121. margin-top: 5rpx;
  122. font-size: 24rpx;
  123. color: #979797;
  124. }
  125. }
  126. }
  127. }
  128. .content{
  129. margin-top: 20rpx;
  130. }
  131. .go_top{
  132. z-index: 999;
  133. position: fixed;
  134. bottom: 150rpx;
  135. right: 50rpx;
  136. width: 100rpx;
  137. height: 100rpx;
  138. line-height: 100rpx;
  139. text-align: center;
  140. // background-color: #FFFFFF;
  141. background-color: #EEEEEE;
  142. border-radius: 50%;
  143. font-weight: 700;
  144. }
  145. </style>