acitvityAudit.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="container">
  3. <view class="tabs flex flex-direction">
  4. <scroll-view scroll-x class="bg-white nav">
  5. <view class="flex text-center">
  6. <view class="cu-item flex-sub" :class="index==current?'text-base cur text-xl text-bold ':'text-lg'"
  7. v-for="(item,index) in tabs" :key="index" @tap="tabChange(index)">
  8. {{item.name}}
  9. </view>
  10. </view>
  11. </scroll-view>
  12. </view>
  13. <view style="height: 100%;">
  14. <swiper style="height: 100%;" :current="current" @change="swiperChange" @animationfinish="animationfinish">
  15. <swiper-item v-for="(item, index) in tabs" :key="index">
  16. <scroll-view scroll-y style="height: 100%;">
  17. <item @showOpinion="showOpinion" ref="mescrollItem"
  18. :refresh="refresh"
  19. :i="index" :item="item"
  20. :type="current"></item>
  21. </scroll-view>
  22. </swiper-item>
  23. </swiper>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import item from "./comps/item.vue"
  29. export default {
  30. components: {
  31. item
  32. },
  33. data() {
  34. return {
  35. current: 0,
  36. swiperCurrent: 0,
  37. tabs: [
  38. {
  39. name: '待审核',
  40. value: 0
  41. },
  42. {
  43. name: '已审核',
  44. value: 4
  45. }
  46. ],
  47. refresh:false
  48. }
  49. },
  50. onShow() {
  51. let page= this.$util.getPageCtx()
  52. if (page.data.reload) {
  53. this.refresh=!this.refresh
  54. }
  55. },
  56. methods: {
  57. tabChange(index) {
  58. this.current = index
  59. },
  60. swiperChange(e) {
  61. uni.pageScrollTo({
  62. scrollTop: 0,
  63. duration: 0
  64. });
  65. this.current = e.detail.current
  66. },
  67. animationfinish({
  68. detail: {
  69. current
  70. }
  71. }) {
  72. this.swiperCurrent = current;
  73. this.current = current;
  74. },
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .container {
  80. height: calc(100vh);
  81. background-color: #F6F6F6;
  82. padding: 78rpx 0rpx 0rpx;
  83. .tabs {
  84. position: fixed;
  85. top: -10rpx;
  86. left: 0;
  87. width: 100%;
  88. background-color: #FFFFFF;
  89. box-sizing: border-box;
  90. z-index: 3;
  91. }
  92. }
  93. </style>