t-o-news.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. <view class="item" @click="change_active(3)">
  28. <view class="icon">
  29. <image v-if="active != 3" src="./icon/icon_3.png" mode=""></image>
  30. <image v-if="active == 3" src="./icon/icon_3_active.png" style="width: 115rpx;height: 80rpx;"
  31. mode=""></image>
  32. </view>
  33. <view class="title">
  34. <view class="text" :style="active==3?'color:#009FE8;font-weight:700;':'' ">宣传展板</view>
  35. <view class="tip" :style="active==3?'color:#3a3a3a;':'' ">企业文化宣传展示</view>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- content -->
  40. <view class="content">
  41. <view v-if="active == 1">
  42. <t-o-news-tab-1></t-o-news-tab-1>
  43. </view>
  44. <view v-if="active == 2">
  45. <t-o-news-tab-2 ref="tab_2"></t-o-news-tab-2>
  46. </view>
  47. <view v-if="active == 3">
  48. <t-o-news-tab-3></t-o-news-tab-3>
  49. </view>
  50. </view>
  51. <view class="go_top" @click="go_top">
  52. <uni-icons type="top" size="22"></uni-icons>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. name: "t-o-news",
  59. data() {
  60. return {
  61. active: 1
  62. };
  63. },
  64. methods: {
  65. change_active(item) {
  66. this.active = item
  67. },
  68. tab_2_onReachBottom(){
  69. console.log('tab_2_onReachBottom')
  70. if(this.active == 2){
  71. this.$refs.tab_2.nextPage();
  72. }
  73. },
  74. go_top(){
  75. uni.pageScrollTo({
  76. scrollTop: 0,
  77. duration: 200
  78. });
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss">
  84. page {
  85. background-color: #F2FAF7;
  86. }
  87. .tab {
  88. background-color: #FFFFFF;
  89. box-sizing: border-box;
  90. padding: 25rpx 50rpx;
  91. display: flex;
  92. justify-content: space-between;
  93. align-items: center;
  94. .item {
  95. text-align: center;
  96. .icon {
  97. height: 80rpx;
  98. image {
  99. width: 95rpx;
  100. height: 66rpx;
  101. }
  102. }
  103. .title {
  104. margin-top: 10rpx;
  105. .text {
  106. font-size: 30rpx;
  107. color: #727272;
  108. }
  109. .tip {
  110. margin-top: 5rpx;
  111. font-size: 24rpx;
  112. color: #979797;
  113. }
  114. }
  115. }
  116. }
  117. .content{
  118. margin-top: 20rpx;
  119. }
  120. .go_top{
  121. z-index: 999;
  122. position: fixed;
  123. bottom: 150rpx;
  124. right: 50rpx;
  125. width: 100rpx;
  126. height: 100rpx;
  127. line-height: 100rpx;
  128. text-align: center;
  129. // background-color: #FFFFFF;
  130. background-color: #EEEEEE;
  131. border-radius: 50%;
  132. font-weight: 700;
  133. }
  134. </style>