IntegralOrder.vue 4.7 KB

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