historyOrder.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="order-content">
  3. <view class="total">
  4. 总计:{{totalWeight}}kg,{{totalMoney}}元
  5. </view>
  6. <scroll-view scroll-y class="list" @scrolltolower="onreachBottom">
  7. <view class="list-item" v-for="item in list" :key="item.id" @click="intoDetail(item)">
  8. <view class="cont title flex align_center justify_between">
  9. <text>{{item.createDate}}</text>
  10. <view class="flex align_center">
  11. <text>查看详情</text>
  12. <u-icon class="arrow-right" name="arrow-right" color="#999999" size="32"></u-icon>
  13. </view>
  14. </view>
  15. <view class="cont">
  16. <view class="cont-top flex align_center justify_between">
  17. <text>{{item.contactName||'--'}}</text>
  18. <text>{{item.payAmount?'¥'+item.payAmount:'--'}}</text>
  19. </view>
  20. <view class="cont-bot flex align_center justify_between">
  21. <view class="flex align_center">
  22. <view class="t-icon phone t-icon-icon_phone"></view>
  23. <text>{{item.contactMobile}}</text>
  24. </view>
  25. <text>{{item.payTypeDictValue||'--'}}</text>
  26. </view>
  27. </view>
  28. </view>
  29. <u-empty style="padding-top: 10vh;height: auto;" src="/static/img/def_result.png" :text="noDataText" img-width="252" img-height="176" v-if="list.length==0 && status!='loading'"
  30. mode="list"></u-empty>
  31. <view v-if="index==current" style="padding: 20upx;">
  32. <u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
  33. </view>
  34. </scroll-view>
  35. </view>
  36. </template>
  37. <script>
  38. import { historyOrderQuery, historyOrderTotal } from '@/api/order.js'
  39. export default {
  40. data() {
  41. return {
  42. list: [], // 列表数据
  43. pageNo: 1, // 当前页码
  44. pageSize: 10, // 每页条数
  45. total: 0, // 数据总条数
  46. noDataText: '暂无数据', // 列表请求状态提示语
  47. status: 'loadmore', // 加载中状态
  48. totalWeight: 0, // 总重量
  49. totalMoney: 0, //总金额
  50. }
  51. },
  52. onLoad() {
  53. this.pageInit()
  54. // 开启分享
  55. uni.showShareMenu({
  56. withShareTicket: true,
  57. menus: ['shareAppMessage', 'shareTimeline']
  58. })
  59. },
  60. methods: {
  61. pageInit() {
  62. this.pageNo = 1
  63. this.pageSize = 10
  64. this.total = 0
  65. this.totalWeight = 0
  66. this.totalMoney = 0
  67. this.list = []
  68. this.getRow(1)
  69. this.getTotalData()
  70. },
  71. // 进入详情
  72. intoDetail(item) {
  73. uni.navigateTo({
  74. url: '/pages/order/hisOrderDetail?orderNo='+item.orderReserveNo
  75. })
  76. },
  77. // scroll-view到底部加载更多
  78. onreachBottom() {
  79. this.action = 'onreachBottom'
  80. if (this.list.length < this.total) {
  81. this.pageNo += 1
  82. this.getRow()
  83. } else {
  84. if(this.list.length) {
  85. uni.showToast({
  86. title: '已经到底了',
  87. icon: 'none'
  88. });
  89. }
  90. this.status = "nomore"
  91. }
  92. },
  93. // 查询列表
  94. getRow(pageNo) {
  95. this.status = "loadmore"
  96. if (pageNo) {
  97. this.pageNo = pageNo
  98. }
  99. let params = {
  100. pageNo: this.pageNo,
  101. pageSize: this.pageSize,
  102. }
  103. this.noDataText = '暂无数据'
  104. this.status = "loading"
  105. historyOrderQuery(params).then(res => {
  106. if (res.status == 200) {
  107. if (this.pageNo > 1) {
  108. this.list = this.list.concat(res.data.list || [])
  109. } else {
  110. this.list = res.data.list || []
  111. }
  112. this.total = res.data.count || 0
  113. } else {
  114. this.list = []
  115. this.total = 0
  116. this.noDataText = res.message
  117. }
  118. this.status = "loadmore"
  119. })
  120. },
  121. // 总计查询
  122. getTotalData() {
  123. historyOrderTotal({}).then(res=>{
  124. if(res.status == 200) {
  125. this.totalWeight = res.data.totalAllWeight/1000
  126. this.totalMoney = res.data.originalAllAmount
  127. }
  128. })
  129. },
  130. }
  131. }
  132. </script>
  133. <style lang="scss">
  134. page{
  135. height: 100%;
  136. width: 100%;
  137. }
  138. .order-content{
  139. width: 100%;
  140. height: 100%;
  141. background-color: #F5F5F5;
  142. display: flex;
  143. flex-direction: column;
  144. .total{
  145. width: 100%;
  146. height: 80rpx;
  147. background: rgba(255, 209, 0, 0.4);
  148. opacity: 1;
  149. padding-left: 32rpx;
  150. line-height: 80rpx;
  151. font-size: 30rpx;
  152. color: #191919;
  153. }
  154. .list{
  155. flex: 1;
  156. width: 100%;
  157. overflow: auto;
  158. padding: 0 26rpx;
  159. box-sizing: border-box;
  160. .list-item{
  161. width: 100%;
  162. border-radius: 24rpx;
  163. margin-top: 20rpx;
  164. background-color: #fff;
  165. .cont{
  166. padding: 24rpx 32rpx;
  167. }
  168. .title{
  169. text{
  170. color: #666E75;
  171. font-size: 28rpx;
  172. }
  173. view{
  174. color: #999999;
  175. font-size: 32rpx;
  176. .arrow-right{
  177. margin-left: 10rpx;
  178. }
  179. }
  180. }
  181. .cont-top{
  182. text:first-child{
  183. font-size: 36rpx;
  184. color: #222222;
  185. font-weight: 600;
  186. }
  187. text:last-child{
  188. font-size: 32rpx;
  189. color: #222222;
  190. }
  191. }
  192. .cont-bot{
  193. font-size: 28rpx;
  194. color: #4C4C4C;
  195. margin-top: 20rpx;
  196. .phone{
  197. width: 28rpx;
  198. height: 28rpx;
  199. margin-right: 10rpx;
  200. }
  201. text:last-child{
  202. font-size: 24rpx;
  203. color: #666E75;
  204. }
  205. }
  206. }
  207. }
  208. }
  209. </style>