index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view style="background-color: #f2f2f6;padding-bottom: 0.01rpx;">
  3. <view style="background-color: #fff;position: fixed;top: 0;width: 100%;z-index: 8;"><u-tabs :list="list"
  4. :current="current" lineColor="#FD4B09" @click="sectionChange"></u-tabs>
  5. <view
  6. style="background-color: #fff;padding: 8rpx 0rpx;display: flex;justify-content: space-between;align-items: center;">
  7. <u-search placeholder="请输入订单号" v-model="form.sysNo" @custom="custom" @search="custom"></u-search>
  8. </view>
  9. </view>
  10. <view class="content" style="margin-top: 95px;">
  11. <view class="contentBox" v-for="(item,index) in dataList" :key="index" @click="choice(item,index)">
  12. <view style="width: 100%;margin: 0 auto;">
  13. <u-cell-group :border="false">
  14. <u-cell :border="false" center :title="`${item.salesCompanyName || ''}`" arrow-direction="down">
  15. <view slot="icon" style="width: 10rpx;height: 35rpx;background-color: #fd4b09;"></view>
  16. <view slot="value">
  17. <view
  18. style="padding: 0rpx 20rpx;border:1rpx solid #FD4B09;border-radius: 100rpx;color: #FD4B09;">
  19. {{item.xcxStatus || ''}}
  20. </view>
  21. </view>
  22. </u-cell>
  23. </u-cell-group>
  24. <view class="textBox">
  25. <view
  26. style="overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;">
  27. {{item.goodsNameJoin || ''}}
  28. </view>
  29. </view>
  30. <view class="textBox">
  31. <view>订单数量:</view>
  32. <view>{{~~item.goodsTotalNum || ''}}</view>
  33. </view>
  34. <view class="textBox">
  35. <view>订单金额:</view>
  36. <view>¥{{item.totalMoney || ''}}</view>
  37. </view>
  38. <view class="textBox">
  39. <view>订单日期:</view>
  40. <view>{{item.createTime || ''}}</view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <u-empty v-if="page.total == 0" style="position: absolute;top: 45%;left: 50%;transform:translate(-50%,-50%)"
  46. mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
  47. <u-loadmore v-if="page.total !== 0 && dataList.length != 0" :status="status" />
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. appStatusList
  53. } from '@/api/views/salesSlip/index.js'
  54. export default {
  55. data() {
  56. return {
  57. current: 0,
  58. list: [{
  59. name: '全部',
  60. status: '',
  61. badge: {
  62. value: 0
  63. }
  64. }
  65. // , {
  66. // name: '未付款',
  67. // status: '未付款',
  68. // badge: {
  69. // value: 0
  70. // }
  71. // }
  72. , {
  73. name: '待发货',
  74. status: '待发货',
  75. badge: {
  76. value: 0
  77. }
  78. }, {
  79. name: '待收货',
  80. status: '待收货',
  81. badge: {
  82. value: 0
  83. }
  84. }, {
  85. name: '已完成',
  86. status: '已完成',
  87. badge: {
  88. value: 0
  89. }
  90. }, {
  91. name: '退款售后',
  92. status: '退款售后',
  93. badge: {
  94. value: 0
  95. }
  96. }],
  97. dataList: [],
  98. search: {},
  99. page: {
  100. total: 0,
  101. size: 10,
  102. current: 1
  103. },
  104. status: 'loadmore',
  105. }
  106. },
  107. onLoad(onLoad) {
  108. for (let i in this.list) {
  109. if (onLoad.text == this.list[i].name) {
  110. this.current = i
  111. }
  112. }
  113. this.page = {
  114. total: 0,
  115. size: 10,
  116. current: 1
  117. }
  118. this.search = {
  119. xcxStatus: this.list[this.current].status
  120. }
  121. this.dataList = []
  122. this.onSearch()
  123. },
  124. onReachBottom() {
  125. this.status = 'loading'
  126. if (this.dataList.length < this.page.total) {
  127. this.page.current++
  128. this.onSearch()
  129. } else {
  130. this.status = 'nomore'
  131. }
  132. },
  133. methods: {
  134. sectionChange(item) {
  135. this.current = item.index;
  136. this.search = {
  137. xcxStatus: this.list[item.index].name == "全部" ? "" : this.list[item.index].name
  138. }
  139. this.page = {
  140. total: 0,
  141. size: 10,
  142. current: 1
  143. }
  144. this.dataList = []
  145. this.onSearch()
  146. },
  147. onSearch() {
  148. uni.showLoading({
  149. title: '加载中',
  150. mask: true
  151. });
  152. appStatusList({
  153. size: this.page.size,
  154. current: this.page.current,
  155. ...this.search
  156. }).then(res => {
  157. this.dataList = this.dataList.concat(res.data.records)
  158. this.page.total = res.data.total
  159. if (this.dataList.length == res.data.total) {
  160. this.status = 'nomore'
  161. }
  162. uni.hideLoading();
  163. }).catch(err => {
  164. uni.hideLoading();
  165. })
  166. },
  167. choice(item, index) {
  168. uni.$u.route('/pages/views/salesSlip/orderDetails', {
  169. id: item.id
  170. });
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss" scoped>
  176. .contentBox {
  177. width: 96%;
  178. margin: 20rpx auto;
  179. background-color: #FFFFFF;
  180. border-radius: 20rpx;
  181. /* box-shadow: 0 5rpx 14rpx 0 rgba(101, 176, 249, 0.42); */
  182. padding-top: 15rpx;
  183. padding-bottom: 10rpx;
  184. }
  185. .textBox {
  186. padding: 0 15px;
  187. display: flex;
  188. justify-content: space-between;
  189. font-size: 24rpx;
  190. margin-bottom: 10rpx;
  191. align-items: flex-end;
  192. }
  193. </style>