order1.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="content">
  3. <view class="navbar">
  4. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  5. :class="{ current: tabCurrentIndex === index }" @click="navTo(index)">{{ item.text }}</view>
  6. </view>
  7. <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :class="{current:tabCurrentIndex===0}">
  8. <swiper-item v-for="(item,index) in navList">
  9. <view class="swiper-item">1111</view>
  10. </swiper-item>
  11. </swiper>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. tabCurrentIndex: 0, //当前选择
  19. navList: [{
  20. state: 0,
  21. text: '待付款',
  22. loadingType: 'more',
  23. orderList: [],
  24. page: 1, //当前页数
  25. limit: 10 //每次信息条数
  26. },
  27. {
  28. state: 1,
  29. text: '待发货',
  30. loadingType: 'more',
  31. orderList: [],
  32. page: 1, //当前页数
  33. limit: 10 //每次信息条数
  34. },
  35. {
  36. state: 2,
  37. text: '待收货',
  38. loadingType: 'more',
  39. orderList: [],
  40. page: 1, //当前页数
  41. limit: 10 //每次信息条数
  42. },
  43. {
  44. state: 3,
  45. text: '待评价',
  46. loadingType: 'more',
  47. orderList: [],
  48. page: 1, //当前页数
  49. limit: 10 //每次信息条数
  50. },
  51. {
  52. state: 4,
  53. text: '已完成',
  54. loadingType: 'more',
  55. orderList: [],
  56. page: 1, //当前页数
  57. limit: 10 //每次信息条数
  58. }
  59. ]
  60. }
  61. },
  62. methods: {
  63. navTo(index){
  64. this.tabCurrentIndex = index
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. .content {
  71. background: $page-color-base;
  72. height: 100%;
  73. }
  74. .navbar{
  75. display: flex;
  76. padding: 0 5px;
  77. height: 40px;
  78. background-color: #FFFFFF;
  79. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  80. position: relative;
  81. z-index: 100;
  82. .nav-item{
  83. flex: 1;
  84. display: flex;
  85. text-align: center;
  86. justify-content: center;
  87. font-size: 15px;
  88. height: 100%;
  89. position: relative;
  90. &.current{
  91. border-bottom: 2rpx solid #F0AD4E;
  92. color:#F0AD4E ;
  93. }
  94. }
  95. }
  96. </style>