index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view>
  3. <view class="promoter-order">
  4. <view class='promoterHeader bg-color'>
  5. <view class='headerCon acea-row row-between-wrapper'>
  6. <view>
  7. <view class='name'>累积推广订单</view>
  8. <view><text class='num'>{{recordCount || 0}}</text>单</view>
  9. </view>
  10. <view class='iconfont icon-2'></view>
  11. </view>
  12. </view>
  13. <view class='list' v-if="recordList.length>0">
  14. <block v-for="(item,index) in recordList" :key="index">
  15. <view class='item'>
  16. <view class='title acea-row row-column row-center'>
  17. <view class='data'>{{item.time}}</view>
  18. <view>本月累计推广订单:{{item.count || 0}}单</view>
  19. </view>
  20. <view class='listn'>
  21. <block v-for="(child,indexn) in item.child" :key="indexn">
  22. <view class='itenm'>
  23. <view class='top acea-row row-between-wrapper'>
  24. <view class='pictxt acea-row row-between-wrapper'>
  25. <view class='pictrue'>
  26. <image :src='child.avatar'></image>
  27. </view>
  28. <view class='text line1'>{{child.nickname}}</view>
  29. </view>
  30. <view class='money' v-if="child.type == 'brokerage'">返佣:<text class='font-color'>¥{{child.number}}</text></view>
  31. <view class='money' v-else>暂未返佣:<text class='font-color'>¥{{child.number}}</text></view>
  32. </view>
  33. <view class='bottom'>
  34. <view><text class='name'>订单编号:</text>{{child.order_id}}</view>
  35. <view v-if="child.type == 'brokerage'"><text class='name'>返佣时间:</text>{{child.time}}</view>
  36. <view v-else><text class='name' >下单时间:</text>{{child.time}}</view>
  37. </view>
  38. </view>
  39. </block>
  40. </view>
  41. </view>
  42. </block>
  43. </view>
  44. <view v-if="recordList.length == 0">
  45. <emptyPage title="暂无推广订单~"></emptyPage>
  46. </view>
  47. </view>
  48. <!-- #ifdef MP -->
  49. <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
  50. <!-- #endif -->
  51. <home></home>
  52. </view>
  53. </template>
  54. <script>
  55. import {
  56. spreadOrder
  57. } from '@/api/user.js';
  58. import {
  59. toLogin
  60. } from '@/libs/login.js';
  61. import {
  62. mapGetters
  63. } from "vuex";
  64. // #ifdef MP
  65. import authorize from '@/components/Authorize';
  66. // #endif
  67. import emptyPage from '@/components/emptyPage.vue'
  68. import home from '@/components/home';
  69. export default {
  70. components: {
  71. // #ifdef MP
  72. authorize,
  73. // #endif
  74. emptyPage,
  75. home
  76. },
  77. data() {
  78. return {
  79. page: 0,
  80. limit: 8,
  81. status: false,
  82. recordList: [],
  83. recordCount: 0,
  84. isAuto: false, //没有授权的不会自动授权
  85. isShowAuth: false //是否隐藏授权
  86. };
  87. },
  88. computed: mapGetters(['isLogin']),
  89. onLoad() {
  90. if (this.isLogin) {
  91. this.getRecordOrderList();
  92. } else {
  93. toLogin();
  94. }
  95. },
  96. methods: {
  97. onLoadFun() {
  98. this.getRecordOrderList();
  99. },
  100. // 授权关闭
  101. authColse: function(e) {
  102. this.isShowAuth = e
  103. },
  104. getRecordOrderList: function() {
  105. let that = this;
  106. let page = that.page;
  107. let limit = that.limit;
  108. let status = that.status;
  109. let recordList = that.recordList;
  110. let recordListNew = [];
  111. if (status == true) return;
  112. spreadOrder({
  113. page: page,
  114. limit: limit
  115. }).then(res => {
  116. let len = res.data.list ? res.data.list.length : 0;
  117. let recordListData = res.data.list;
  118. recordListNew = recordList.concat(recordListData);
  119. that.recordCount = res.data.count || 0;
  120. that.status = limit > len;
  121. that.page = limit + page;
  122. that.$set(that, 'recordList', recordListNew);
  123. });
  124. }
  125. }
  126. }
  127. </script>
  128. <style scoped lang="scss">
  129. .promoter-order .list .item .title {
  130. height: 133rpx;
  131. padding: 0 30rpx;
  132. font-size: 26rpx;
  133. color: #999;
  134. }
  135. .promoter-order .list .item .title .data {
  136. font-size: 28rpx;
  137. color: #282828;
  138. margin-bottom: 5rpx;
  139. }
  140. .promoter-order .list .item .listn .itenm {
  141. background-color: #fff;
  142. }
  143. .promoter-order .list .item .listn .itenm~.itenm {
  144. margin-top: 12rpx;
  145. }
  146. .promoter-order .list .item .listn .itenm .top {
  147. margin-left: 30rpx;
  148. padding-right: 30rpx;
  149. border-bottom: 1rpx solid #eee;
  150. height: 100rpx;
  151. }
  152. .promoter-order .list .item .listn .itenm .top .pictxt {
  153. width: 320rpx;
  154. }
  155. .promoter-order .list .item .listn .itenm .top .pictxt .text {
  156. width: 230rpx;
  157. font-size: 30rpx;
  158. color: #282828;
  159. }
  160. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue {
  161. width: 66rpx;
  162. height: 66rpx;
  163. }
  164. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue image {
  165. width: 100%;
  166. height: 100%;
  167. border-radius: 50%;
  168. border: 3rpx solid #fff;
  169. box-sizing: border-box;
  170. box-shadow: 0 0 15rpx #aaa;
  171. }
  172. .promoter-order .list .item .listn .itenm .top .money {
  173. font-size: 28rpx;
  174. }
  175. .promoter-order .list .item .listn .itenm .bottom {
  176. padding: 20rpx 30rpx;
  177. font-size: 28rpx;
  178. color: #666;
  179. line-height: 1.6;
  180. }
  181. .promoter-order .list .item .listn .itenm .bottom .name {
  182. color: #999;
  183. }
  184. </style>