Orders.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="container">
  3. <view class="top">
  4. <view class="tabs">
  5. <view class="tab" :class="{ active: item === active }" v-for="(item, index) in tabs2" :key="index" @click="change(item)">
  6. {{ item }}
  7. <div class="slip" :class="{ active: item === active }"></div>
  8. </view>
  9. </view>
  10. <view class="tabnav">
  11. <u-tabs :current="tab" active-color="#ffffff" inactive-color="#ffffffcc" :list="tabs" :bg-color="$colors.prim" :is-scroll="false" @change="changeTab"></u-tabs>
  12. </view>
  13. </view>
  14. <view class="list"><order-info :status='status'></order-info></view>
  15. </view>
  16. </template>
  17. <script>
  18. import OrderInfo from '../components/OrderInfo.vue';
  19. export default {
  20. data() {
  21. return {
  22. tab: 0,
  23. tabs2: ['外送订单', '用户自取'],
  24. active: '外送订单',
  25. tabs: [
  26. {
  27. name: '全部订单'
  28. },
  29. {
  30. name: '待接单'
  31. },
  32. {
  33. name: '配送中'
  34. },
  35. {
  36. name: '带退款'
  37. },
  38. {
  39. name: '待发货'
  40. },
  41. {
  42. name: '已完成'
  43. }
  44. ]
  45. };
  46. },
  47. computed:{
  48. status(){
  49. if(this.active == '用户自取') {
  50. return true
  51. }else {
  52. return false
  53. }
  54. }
  55. },
  56. methods: {
  57. changeTab(index) {
  58. this.tab = index;
  59. },
  60. change(e) {
  61. this.active = e;
  62. }
  63. },
  64. components: {
  65. OrderInfo
  66. }
  67. };
  68. </script>
  69. <style lang="scss" scoped>
  70. .container {
  71. background-color: #f2f4f5;
  72. }
  73. /deep/ .u-tab-item{
  74. font-size: 14px !important;
  75. }
  76. .top {
  77. padding: 10px 0;
  78. background-color: $u-type-primary;
  79. position: sticky;
  80. top: 43px;
  81. .tabnav{
  82. padding: 0 18px;
  83. }
  84. .tabs {
  85. padding: 13px 80px 0;
  86. color: #a7beff;
  87. display: flex;
  88. font-size: 18px;
  89. justify-content: space-between;
  90. .tab {
  91. &.active {
  92. color: #ffffff;
  93. font-weight: bold;
  94. }
  95. .slip {
  96. width: 30px;
  97. margin: 0 auto;
  98. &.active {
  99. border-bottom: 2px solid #ffffff;
  100. border-radius: 2px;
  101. margin-top: 12px;
  102. }
  103. }
  104. }
  105. margin-bottom: 16px;
  106. }
  107. }
  108. .list {
  109. padding: 12px;
  110. }
  111. </style>