order.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="container" :style="vuex_skin">
  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" :i="index" :item="item" :type="current">
  18. </item>
  19. </scroll-view>
  20. </swiper-item>
  21. </swiper>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import item from "./comps/item.vue"
  27. export default {
  28. components: {
  29. item
  30. },
  31. data() {
  32. return {
  33. current: 0,
  34. swiperCurrent: 0,
  35. tabs: [{
  36. name: '全部',
  37. value: '全部'
  38. }, {
  39. name: '待付款',
  40. value: '待付款'
  41. },
  42. {
  43. name: '待发货',
  44. value: '待发货'
  45. },
  46. {
  47. name: '待收货',
  48. value: '待收货'
  49. },
  50. {
  51. name: '已完成',
  52. value: '已完成'
  53. }
  54. ],
  55. }
  56. },
  57. methods: {
  58. tabChange(index) {
  59. this.current = index
  60. },
  61. swiperChange(e) {
  62. uni.pageScrollTo({
  63. scrollTop: 0,
  64. duration: 0
  65. });
  66. this.current = e.detail.current
  67. },
  68. animationfinish({
  69. detail: {
  70. current
  71. }
  72. }) {
  73. this.swiperCurrent = current;
  74. this.current = current;
  75. },
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .container {
  81. height: calc(100vh);
  82. background-color: #F6F6F6;
  83. padding: 80rpx 0rpx 0rpx;
  84. .tabs {
  85. position: fixed;
  86. top: -10rpx;
  87. left: 0;
  88. width: 100%;
  89. background-color: #FFFFFF;
  90. box-sizing: border-box;
  91. z-index: 3;
  92. }
  93. }
  94. </style>