order.vue 3.9 KB

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