You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

204 lines
5.3 KiB

3 months ago
  1. <template>
  2. <view :data-theme="theme">
  3. <view class="promoter-order">
  4. <view class='promoterHeader'>
  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 pad30' 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 borRadius14'>
  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'>返佣<text class='font-color'>{{child.number}}</text></view>
  31. <!-- <view class='money' v-if="child.type == 'brokerage'">返佣<text class='font-color'>{{child.number}}</text></view>
  32. <view class='money' v-else>暂未返佣<text class='font-color'>{{child.number}}</text></view> -->
  33. </view>
  34. <view class='bottom'>
  35. <view><text class='name'>订单编号</text>{{child.orderId}}</view>
  36. <view><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. </view>
  49. </template>
  50. <script>
  51. import {spreadOrder} from '@/api/user.js';
  52. import {toLogin} from '@/libs/login.js';
  53. import {mapGetters} from "vuex";
  54. import emptyPage from '@/components/emptyPage.vue'
  55. import {setThemeColor} from '@/utils/setTheme.js'
  56. const app = getApp();
  57. export default {
  58. components: {
  59. emptyPage
  60. },
  61. data() {
  62. return {
  63. page: 1,
  64. limit: 20,
  65. status: false,
  66. recordList: [],
  67. recordCount: 0,
  68. time: 0,
  69. theme:app.globalData.theme,
  70. bgColor:'#e93323'
  71. };
  72. },
  73. computed: mapGetters(['isLogin']),
  74. onLoad() {
  75. if (this.isLogin) {
  76. this.getRecordOrderList();
  77. } else {
  78. toLogin();
  79. }
  80. let that = this;
  81. that.bgColor = setThemeColor();
  82. uni.setNavigationBarColor({
  83. frontColor: '#ffffff',
  84. backgroundColor:that.bgColor,
  85. });
  86. },
  87. methods: {
  88. stringToDate : function(data){
  89. let str = data.replace(/-/g,'/');
  90. let date = new Date(str);
  91. return data;
  92. },
  93. getRecordOrderList: function() {
  94. let that = this;
  95. let page = that.page;
  96. let limit = that.limit;
  97. let status = that.status;
  98. let recordList = that.recordList;
  99. let newList = [];
  100. if (status == true) return;
  101. spreadOrder({
  102. page: page,
  103. limit: limit
  104. }).then(res => {
  105. let recordListData = res.data.list ? res.data.list : [];
  106. // 每页返回的总条数;
  107. let len = 0;
  108. for(let i = 0;i<recordListData.length;i++) {
  109. len = len + recordListData[i].child.length;
  110. let str = recordListData[i].time.replace(/-/g,'/');
  111. let date = new Date(str).getTime();
  112. if(that.time === date){
  113. that.$set(that.recordList[i],'child',that.recordList[i].child.concat(recordListData[i].child));
  114. }else{
  115. recordListData.forEach((item,index)=>{
  116. if(recordListData[i]==item){
  117. newList.push(item);
  118. }
  119. })
  120. that.$set(that, 'recordList', recordList.concat(newList));
  121. }
  122. that.time = date;
  123. };
  124. that.recordCount = res.data.count || 0;
  125. that.status = limit > len;
  126. that.page = page + 1;
  127. });
  128. }
  129. },
  130. onReachBottom() {
  131. this.getRecordOrderList()
  132. }
  133. }
  134. </script>
  135. <style scoped lang="scss">
  136. .promoter-order .list .item .title {
  137. height: 133rpx;
  138. font-size: 26rpx;
  139. color: #999;
  140. }
  141. .promoterHeader{
  142. @include main_bg_color(theme);
  143. }
  144. .promoter-order .list .item .title .data {
  145. font-size: 28rpx;
  146. color: #282828;
  147. margin-bottom: 5rpx;
  148. }
  149. .promoter-order .list .item .listn .itenm {
  150. background-color: #fff;
  151. }
  152. .promoter-order .list .item .listn .itenm~.itenm {
  153. margin-top: 20rpx;
  154. }
  155. .promoter-order .list .item .listn .itenm .top {
  156. padding: 0 24rpx;
  157. border-bottom: 1rpx solid #eee;
  158. height: 100rpx;
  159. }
  160. .promoter-order .list .item .listn .itenm .top .pictxt {
  161. width: 320rpx;
  162. }
  163. .promoter-order .list .item .listn .itenm .top .pictxt .text {
  164. width: 230rpx;
  165. font-size: 30rpx;
  166. color: #282828;
  167. }
  168. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue {
  169. width: 66rpx;
  170. height: 66rpx;
  171. }
  172. .promoter-order .list .item .listn .itenm .top .pictxt .pictrue image {
  173. width: 100%;
  174. height: 100%;
  175. border-radius: 50%;
  176. border: 3rpx solid #fff;
  177. box-sizing: border-box;
  178. box-shadow: 0 0 15rpx #aaa;
  179. }
  180. .promoter-order .list .item .listn .itenm .top .money {
  181. font-size: 28rpx;
  182. }
  183. .promoter-order .list .item .listn .itenm .bottom {
  184. padding: 20rpx 24rpx;
  185. font-size: 28rpx;
  186. color: #666;
  187. line-height: 1.6;
  188. }
  189. .promoter-order .list .item .listn .itenm .bottom .name {
  190. color: #999;
  191. }
  192. </style>