order.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <div class="app-main app-content">
  3. <app-tabs :tabs="tabs" :isFixed="true" :currentTab="tabIndex" :height="100" @change="change" itemWidth="20%" />
  4. <div class="list-wrap">
  5. <block v-if="!$util.isEmpty(list.data)">
  6. <div class="list" v-for="(item, index) in list.data" :key="index" @click="$util.pageTo({
  7. url: '/pages/order/admin/detail',
  8. query: {
  9. id: item.id
  10. }
  11. })">
  12. <div class="list-top flex-center-between">
  13. <div class="app-color-3">订单编号:{{ item.sendNum }}</div>
  14. <div class="app-price">{{ item.status | constantfilter('ORDER_STATUS') }}</div>
  15. </div>
  16. <div class="list-blo">
  17. <list-module v-for="(item, subIndex) in 2" :key="subIndex" />
  18. </div>
  19. <div class="list-bottom">
  20. <div>
  21. <span class="freight-text">运费:¥{{ item.sendCost }}</span>
  22. <span>应付金额:</span>
  23. <span class="app-size-30 app-bold">¥{{ item.actPrice }}</span>
  24. </div>
  25. <div class="list-button">
  26. <!-- 待配送 -->
  27. <div v-if="item.status == 2" class="admin-button-com">免发货</div>
  28. <div v-if="item.status == 2" class="admin-button-com">发货</div>
  29. <!-- 配送中 -->
  30. <div v-if="item.status == 2" class="admin-button-com">继续</div>
  31. <!-- 已完成 -->
  32. <div v-if="item.status == 5" class="admin-button-com default">查看快递</div>
  33. </div>
  34. </div>
  35. </div>
  36. </block>
  37. <block v-else>
  38. <app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
  39. </block>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import AppTabs from '@/components/plugin/tabs'
  45. import ListModule from '@/components/module/app-order-list'
  46. import AppWrapperEmpty from '@/components/app-wrapper-empty'
  47. import { list } from '@/mixins'
  48. // api
  49. import { getListB } from '@/api/order'
  50. export default {
  51. name: 'order-list',
  52. components: {
  53. ListModule,
  54. AppTabs,
  55. AppWrapperEmpty
  56. },
  57. mixins: [list],
  58. data() {
  59. return {
  60. tabIndex: 0,
  61. tabs: [
  62. {
  63. name: '全部',
  64. value: 0
  65. },
  66. {
  67. name: '待付款',
  68. value: 0
  69. },
  70. {
  71. name: '待配送',
  72. value: 0
  73. },
  74. {
  75. name: '配送中',
  76. value: 0
  77. },
  78. {
  79. name: '已完结',
  80. value: 0
  81. }
  82. ]
  83. }
  84. },
  85. onPullDownRefresh() {
  86. console.log('fasdfasdf')
  87. },
  88. // 加载更多
  89. onReachBottom() {
  90. console.log('5151')
  91. },
  92. onLoad: function() {
  93. this.init()
  94. },
  95. methods: {
  96. async init() {
  97. this._list()
  98. },
  99. _list() {
  100. let status = JSON.parse(JSON.stringify(this.tabIndex))
  101. status = status == 4 ? 5 : status - 1
  102. return getListB({
  103. status: status,
  104. search: '',
  105. page: this.list.page
  106. }).then(res => {
  107. this.completes(res)
  108. if (this.$util.isEmpty(res.data)) return false
  109. this.tabs[0].value = res.data.asset.totalOrder
  110. this.tabs[1].value = res.data.asset.unPayOrder
  111. this.tabs[2].value = res.data.asset.unSendOrder
  112. this.tabs[3].value = res.data.asset.sendingOrder
  113. this.tabs[4].value = res.data.asset.finishOrder
  114. })
  115. },
  116. change(e) {
  117. if (this.tabIndex == e.index) {
  118. return false
  119. } else {
  120. this.tabIndex = e.index
  121. this.resetList()
  122. this._list()
  123. }
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. </style>
  130. <style lang="scss" scoped>
  131. .app-content {
  132. padding-top: 120px;
  133. padding-bottom: 1px;
  134. .list-wrap {
  135. .list {
  136. padding: 0 30px;
  137. background-color: #fff;
  138. margin-bottom: 20px;
  139. .list-top,
  140. .list-bottom {
  141. padding: 26px 0;
  142. border-bottom: 1px solid $borderColor;
  143. color: $fontColor3;
  144. .app-bold {
  145. color: #333;
  146. }
  147. .freight-text {
  148. margin-right: 60px;
  149. }
  150. }
  151. .list-bottom {
  152. & > div {
  153. @include disFlex(center, flex-end);
  154. }
  155. .list-button {
  156. margin-top: 26px;
  157. .admin-button-com {
  158. margin-left: 20px;
  159. }
  160. }
  161. }
  162. }
  163. }
  164. }
  165. </style>