InviterOrder.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div inviter-order-list">
  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" v-if="orderList && orderList.length">
  16. <view class="div inviter-item" v-for="(v,k) in orderList" :key="v.orderinviter_id">
  17. <view class="div" :class="{invalid:!v.orderinviter_valid}">
  18. <view class="div detail">{{v.orderinviter_remark}}</view>
  19. <view class="div money add">+{{v.orderinviter_money}}</view>
  20. <time class="date">
  21. <text :class="v.orderinviter_valid==1?'green':'gray'">{{v.orderinviter_valid_text}}</text>
  22. </time>
  23. </view>
  24. </view>
  25. </view>
  26. <empty-record v-else-if="orderList && !orderList.length"></empty-record>
  27. </scroll-view>
  28. </view>
  29. </view></member-base>
  30. </template>
  31. <script>
  32. import {getFontSize} from '@/util/common'
  33. import TitleHeader from '../../TitleHeader'
  34. import MemberBase from '../MemberBase'
  35. import { getInviterOrder } from '../../../api/memberInviter'
  36. import EmptyRecord from '../../EmptyRecord'
  37. export default {
  38. name:'MemberInviterOrder',
  39. components:{
  40. TitleHeader,
  41. MemberBase,
  42. EmptyRecord
  43. },
  44. computed:{
  45. fontSize(){
  46. return getFontSize()
  47. },
  48. },
  49. data(){
  50. return {
  51. navHeight: 0,
  52. params: { 'page': 0, 'per_page': 10 },
  53. loading: false, // 是否加载更多
  54. isMore: true, // 是否有更多
  55. orderList: false
  56. }
  57. },
  58. created () {
  59. this.loadMore()
  60. },
  61. mounted(){
  62. // #ifdef MP-WEIXIN
  63. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  64. // #endif
  65. },
  66. methods:{
  67. goBack(){uni.navigateBack({delta:1})},
  68. getOrderList (ispush) {
  69. uni.showLoading({ title: '加载中' })
  70. let params = this.params
  71. getInviterOrder(params).then(res => {
  72. uni.hideLoading()
  73. if (res) {
  74. if (ispush && this.orderList) {
  75. this.orderList = this.orderList.concat(res.result.list)
  76. } else {
  77. this.orderList = res.result.list
  78. }
  79. if (res.result.hasmore) {
  80. this.isMore = true
  81. } else {
  82. this.isMore = false
  83. }
  84. }
  85. })
  86. },
  87. loadMore () {
  88. this.loading = true
  89. this.params.page = ++this.params.page
  90. if (this.isMore) {
  91. this.loading = false
  92. this.getOrderList(true)
  93. }
  94. }
  95. }
  96. }
  97. </script>
  98. <style scoped lang="scss">
  99. .scroll-view-wrapper{display: flex;flex-direction: column;}
  100. .scroll-view{flex:1}
  101. .inviter-order-list {}
  102. .inviter-order-list .inviter-item { background-color: #FFF;position: relative; z-index: 1; display: block; padding: 0.5rem 0; border-bottom: solid 0.05rem #EEE;}
  103. .inviter-order-list .inviter-item .detail { min-height: 1.8rem; margin: 0 5rem 0 0; font-size:$h6; word-wrap:break-word; line-height: 0.9rem; color: #555;padding-left:.5rem}
  104. .inviter-order-list .inviter-item .money { position: absolute; z-index: 1; top: 0.5rem; right: 0.5rem; height: 0.9rem; line-height: 0.9rem;}
  105. .inviter-order-list .inviter-item .money.add { color: #f23030;}
  106. .inviter-order-list .inviter-item .money.reduce { color: #36BC9B;}
  107. .inviter-order-list .inviter-item .date { position: absolute; z-index: 1; bottom: 0.4rem; right: 0.5rem; height: 0.9rem; font-size:$h6; line-height: 0.9rem; color: #999;}
  108. .inviter-order-list .inviter-item .date .green{color:green}
  109. .inviter-order-list .inviter-item .invalid .money.add {color: gray;}
  110. </style>