order.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view>
  3. <view class="header">
  4. <view class="header-tabs">
  5. <view @click="checkType(0)" :class="tabType==0?'tab-item active':'tab-item'">全部</view>
  6. <view @click="checkType(1)" :class="tabType==1?'tab-item active':'tab-item'">已核销</view>
  7. <view @click="checkType(2)" :class="tabType==2?'tab-item active':'tab-item'">已撤销</view>
  8. <view @click="checkType(3)" :class="tabType==3?'tab-item active':'tab-item'">已完成</view>
  9. </view>
  10. </view>
  11. <view class="order-body">
  12. <view class="empty-data" v-if="dataList.length == 0">
  13. <image src="/static/image/order_none.png" mode="widthFix"></image>
  14. <view class="name">还没有订单</view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. var app;
  21. import * as Api from "@/static/api/order.js";
  22. export default {
  23. data() {
  24. return {
  25. formData:{},
  26. tabType:0,
  27. dataList:[]
  28. }
  29. },
  30. onLoad() {
  31. app = this;
  32. },
  33. methods: {
  34. checkType(type){
  35. app.tabType = type;
  36. app.queryList(1,10);
  37. },
  38. queryList(pageNo, pageSize){
  39. var formData = {};
  40. formData.page = pageNo;
  41. formData.size = pageSize;
  42. formData.status = app.tabType;
  43. Api.order(formData).then((res)=>{
  44. uni.hideLoading();
  45. if (res.code !== 1) {
  46. this.$refs.paging.complete(false);
  47. return false;
  48. }
  49. this.$refs.paging.complete(res.data.rows);
  50. })
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. page{
  57. background-color: #f8f8f8;
  58. }
  59. .order-body{
  60. height: calc(100vh - 100upx);
  61. }
  62. .empty-data{
  63. display: flex;
  64. height: 100%;
  65. align-items: center;
  66. justify-content: center;
  67. flex-direction: column;
  68. font-size: 28upx;
  69. color: #666;
  70. image{
  71. width: 50%;
  72. }
  73. }
  74. .header{
  75. background-color: #fff;
  76. padding: 20upx 20upx 0 20upx;
  77. .header-tabs{
  78. display: flex;
  79. align-items: center;
  80. height: 80upx;
  81. line-height: 80upx;
  82. .tab-item{
  83. width: 33.333%;
  84. text-align: center;
  85. font-size: 30upx;
  86. color: #333;
  87. position: relative;
  88. &.active{
  89. color: #005BAC;
  90. font-weight: bold;
  91. &::after{
  92. content: "";
  93. position: absolute;
  94. width: 40%;
  95. height: 8upx;
  96. border-radius: 4upx;
  97. left: 30%;
  98. bottom: 0;
  99. background-color: #005BAC;
  100. }
  101. }
  102. }
  103. }
  104. }
  105. </style>