index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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="cname" @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. cname:"",
  59. list: [{
  60. name: '全部',
  61. status: '',
  62. badge: {
  63. value: 0
  64. }
  65. }
  66. // , {
  67. // name: '未付款',
  68. // status: '未付款',
  69. // badge: {
  70. // value: 0
  71. // }
  72. // }
  73. , {
  74. name: '待发货',
  75. status: '待发货',
  76. badge: {
  77. value: 0
  78. }
  79. }, {
  80. name: '待收货',
  81. status: '待收货',
  82. badge: {
  83. value: 0
  84. }
  85. }, {
  86. name: '已收货',
  87. status: '已收货',
  88. badge: {
  89. value: 0
  90. }
  91. }, {
  92. name: '退款售后',
  93. status: '退款请核,退款中,已取消',
  94. badge: {
  95. value: 0
  96. }
  97. }],
  98. dataList: [],
  99. search: {},
  100. page: {
  101. total: 0,
  102. size: 10,
  103. current: 1
  104. },
  105. status: 'loadmore',
  106. }
  107. },
  108. onLoad(onLoad) {
  109. for (let i in this.list) {
  110. if (onLoad.text == this.list[i].name) {
  111. this.current = i
  112. }
  113. }
  114. this.page = {
  115. total: 0,
  116. size: 10,
  117. current: 1
  118. }
  119. this.search = {
  120. xcxStatus: this.list[this.current].status
  121. }
  122. this.dataList = []
  123. this.onSearch()
  124. },
  125. onReachBottom() {
  126. this.status = 'loading'
  127. if (this.dataList.length < this.page.total) {
  128. this.page.current++
  129. this.onSearch()
  130. } else {
  131. this.status = 'nomore'
  132. }
  133. },
  134. methods: {
  135. sectionChange(item) {
  136. this.current = item.index;
  137. this.search = {
  138. xcxStatus: this.list[item.index].name == "全部" ? "" : this.list[item.index].status
  139. }
  140. this.page = {
  141. total: 0,
  142. size: 10,
  143. current: 1
  144. }
  145. this.dataList = []
  146. this.onSearch()
  147. },
  148. onSearch() {
  149. uni.showLoading({
  150. title: '加载中',
  151. mask: true
  152. });
  153. appStatusList({
  154. size: this.page.size,
  155. current: this.page.current,
  156. ...this.search
  157. }).then(res => {
  158. this.dataList = this.dataList.concat(res.data.records)
  159. this.page.total = res.data.total
  160. if (this.dataList.length == res.data.total) {
  161. this.status = 'nomore'
  162. }
  163. uni.hideLoading();
  164. }).catch(err => {
  165. uni.hideLoading();
  166. })
  167. },
  168. //搜索
  169. custom(){
  170. this.page = {
  171. total: 0,
  172. size: 10,
  173. current: 1
  174. }
  175. this.search = {
  176. retrieval:this.cname
  177. }
  178. this.onSearch()
  179. },
  180. choice(item, index) {
  181. uni.$u.route('/pages/views/salesSlip/orderDetails', {
  182. id: item.id
  183. });
  184. }
  185. }
  186. }
  187. </script>
  188. <style lang="scss" scoped>
  189. .contentBox {
  190. width: 96%;
  191. margin: 20rpx auto;
  192. background-color: #FFFFFF;
  193. border-radius: 20rpx;
  194. /* box-shadow: 0 5rpx 14rpx 0 rgba(101, 176, 249, 0.42); */
  195. padding-top: 15rpx;
  196. padding-bottom: 10rpx;
  197. }
  198. .textBox {
  199. padding: 0 15px;
  200. display: flex;
  201. justify-content: space-between;
  202. font-size: 24rpx;
  203. margin-bottom: 10rpx;
  204. align-items: flex-end;
  205. }
  206. </style>