OrderList.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <seller-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div container">
  3. <view class="div common-header-wrap">
  4. <view class="status-holder"></view>
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="分销业绩" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="scroll-view div" style="position:relative">
  14. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
  15. <view class="div settle-item mt-5" v-for="item in order_list" :key="item.orderinviter_id">
  16. <view class="div title">
  17. <text class="time">{{$moment.unix(item.orderinviter_addtime).format('YYYY年MM月DD日')}}</text>
  18. <text class="span membername">{{item.orderinviter_member_name}}</text>
  19. </view>
  20. <view class="div content">
  21. {{item.orderinviter_remark}}
  22. </view>
  23. <view class="div payment-account">
  24. <text class="span">{{item.orderinviter_money}}</text>
  25. <view class="btn div common-btn default ds-button-small" disabled>{{item.orderinviter_valid_text}}</view>
  26. </view>
  27. </view>
  28. </scroll-view>
  29. <empty-record v-if="order_list && !order_list.length"></empty-record>
  30. </view>
  31. </view>
  32. </seller-base>
  33. </template>
  34. <script>
  35. import {getFontSize} from '@/util/common'
  36. import TitleHeader from '../../TitleHeader'
  37. import SellerBase from '../SellerBase'
  38. import EmptyRecord from '../../EmptyRecord'
  39. import { getInviterOrderList } from '../../../api/sellerInviter'
  40. export default {
  41. name: 'OrderList',
  42. components:{
  43. TitleHeader,
  44. SellerBase,
  45. EmptyRecord
  46. },
  47. computed:{
  48. fontSize(){
  49. return getFontSize()
  50. },
  51. },
  52. data(){
  53. return {
  54. navHeight: 0,
  55. params: { 'page': 0, 'per_page': 10 },
  56. loading: false, // 是否加载更多
  57. isMore: true, // 是否有更多
  58. // 分销商品列表
  59. order_list: false
  60. }
  61. },
  62. created: function () {
  63. this.loadMore()
  64. //this.getOrderList()
  65. },
  66. mounted(){
  67. // #ifdef MP-WEIXIN
  68. this.navHeight = uni.getMenuButtonBoundingClientRect().height
  69. // #endif
  70. },
  71. methods:{
  72. goBack(){uni.navigateBack({delta:1})},
  73. getOrderList (ispush) {
  74. uni.showLoading({ title: '加载中' })
  75. let params = this.params
  76. getInviterOrderList(params).then(res => {
  77. uni.hideLoading()
  78. if (ispush && this.order_list) {
  79. this.order_list = this.order_list.concat(res.result.order_list)
  80. } else {
  81. this.order_list = res.result.order_list
  82. }
  83. if (res.result.hasmore) {
  84. this.isMore = true
  85. } else {
  86. this.isMore = false
  87. }
  88. }).catch(error=>{
  89. uni.hideLoading()
  90. uni.showToast({icon:'none',title: error.message})
  91. })
  92. },
  93. loadMore () {
  94. this.loading = true
  95. this.params.page = ++this.params.page
  96. if (this.isMore) {
  97. this.loading = false
  98. this.getOrderList(true)
  99. }
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .scroll-view-wrapper{display: flex;flex-direction: column;}
  106. .scroll-view{flex:1}
  107. .settle-item {
  108. background: #fff;
  109. padding: .5rem;
  110. box-sizing: border-box;
  111. border-radius: .5rem;
  112. .title {
  113. font-size: .7rem;
  114. color: #999;
  115. display: flex;
  116. align-items: center;
  117. .membername{
  118. margin-left: auto;
  119. color: $primaryColor;
  120. font-size: .8rem;
  121. }
  122. }
  123. .content {
  124. padding: .5rem 0;
  125. display: flex;
  126. line-height: 1.5;
  127. font-size:$subFontSize;
  128. .item {
  129. flex: 1;
  130. .mt {
  131. font-size:$fontSize;
  132. color: #999
  133. }
  134. .mc {
  135. font-size:$fontSize;
  136. color: #000;
  137. .strong {
  138. font-size:$subFontSize;
  139. }
  140. }
  141. .mc.income {
  142. color: #4caf50
  143. }
  144. .mc.outlay {
  145. color: #f31c47
  146. }
  147. }
  148. }
  149. .payment-account{font-size:.7rem;color:#333;padding:.5rem 0;border-top:1px dashed #DBDADF;display:flex;
  150. .span{flex:1;line-height:1.65rem;padding-right:.5rem;color: #fb2630;font-size: 1.2rem;font-weight: bold;}
  151. .btn{width:4rem;background-color: $primaryColor;color: #fff;font-size: .7rem;padding: .1rem .4rem;}
  152. }
  153. }
  154. </style>