index.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="flex-common-css iPhone-bottom flex-common-css box-border-box">
  3. <Nav :leftShow='false' title="订单" leftIconColor="#333" titleColor="#333"></Nav>
  4. <view class="nav-box box-border-box bgc-f display-flex">
  5. <view class="nav-item" :class="type == item.id?'fs-36 fw-600':'fs-34 fw-400'"
  6. v-for="(item,i) in navList" :key="i" @click="selectType(item.id)">
  7. {{item.name}}
  8. <view v-if="type == item.id" class="nav-item-x"></view>
  9. </view>
  10. </view>
  11. <view v-if="list.length == 0" class="scroll-view-css">
  12. <EnBlank :customSrc='true'>
  13. <template v-slot:blankImg>
  14. <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
  15. </template>
  16. </EnBlank>
  17. </view>
  18. <scroll-view v-else :scroll-y="true" class="scroll-view-css" @scrolltolower="scrolltolower">
  19. </scroll-view>
  20. </view>
  21. </template>
  22. <script>
  23. import tools from '@/service/tools';
  24. import EnBlank from "@/components/en-utils/en-blank/en-blank";
  25. export default {
  26. components: {EnBlank},
  27. data() {
  28. return {
  29. type:1,
  30. navList:[
  31. {name:'外卖',id:1},
  32. {name:'代取',id:2},
  33. {name:'团购',id:3},
  34. {name:'票务',id:4},
  35. {name:'干洗',id:5},
  36. ],
  37. page:1,
  38. list:[],
  39. total:0,
  40. };
  41. },
  42. onShow() {
  43. this.resetList();
  44. },
  45. methods: {
  46. getList(){
  47. if(this.type === 1){
  48. }else if(this.type === 2){
  49. }else if(this.type === 3){
  50. }else if(this.type === 4){
  51. }else if(this.type === 5){
  52. }
  53. },
  54. resetList(){
  55. this.page = 1;
  56. this.list = [];
  57. this.getList();
  58. },
  59. selectType(type){
  60. if(type != this.type){
  61. this.type = type;
  62. this.resetList();
  63. }
  64. },
  65. scrolltolower() {
  66. console.log('触底');
  67. },
  68. },
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .nav-box{
  73. padding: 26rpx 44rpx;
  74. overflow-x: scroll;
  75. .nav-item{
  76. margin-right: 76rpx;
  77. white-space: nowrap;
  78. position: relative;
  79. .nav-item-x{
  80. position: absolute;
  81. width: 48rpx;
  82. height: 6rpx;
  83. border-radius: 20rpx;
  84. background-color: #41ABF5;
  85. left: 12rpx;
  86. bottom: -10rpx;
  87. }
  88. }
  89. }
  90. </style>