瀏覽代碼

接口联调

bayi 1 年之前
父節點
當前提交
4b2889699a

+ 4 - 1
api/sale.js

@@ -11,5 +11,8 @@ module.exports = {
     getSaleRule: data => request('/v3/sale/level', 'get', data),
     // 获取分销邀请用户列表
     getSaleInvite: data => request('/v3/sale/user/inviteList', 'get', data),
-
+    // 获取分销订单列表
+    getSaleOrder: data => request('/v3/sale/order', 'get', data),
+    // 获取收益明细列表
+    getIncomeList: data => request('/v3/sale/income/list', 'get', data),
 }

+ 4 - 6
salesperson/pages/history/index.js

@@ -7,17 +7,15 @@ Page({
     data: {
         dateTime: '2023-09',
     },
-    /**
-     * 生命周期函数--监听页面加载
-     */
     onLoad(options) {
         this.resetData();
     },
-    bindDateChange: function (e) {
-        console.log('picker发送选择改变,携带值为', e.detail.value)
+    bindDateChange(e) {
+        console.log('携带值为', e.detail.value)
         this.setData({
-            date: e.detail.value
+            dateTime: e.detail.value
         })
+        this.resetData()
     },
     openInvite() {
         this.selectComponent("#InvitePop").openInvite()

+ 2 - 1
salesperson/pages/history/index.less

@@ -29,8 +29,9 @@
         left: 0;
         height: 100vh;
         padding-top: 250rpx;
-        padding-bottom:130rpx;
+        padding-bottom: 130rpx;
         box-sizing: border-box;
+        z-index: -1;
 
         .user {
             display: flex;

+ 4 - 4
salesperson/pages/history/index.wxml

@@ -6,18 +6,18 @@
             <picker mode="date" value="{{dateTime}}" fields="month" start="2023-09" end="2100-09"
                 bindchange="bindDateChange">
                 <view class="picker">
-                    {{date}} >
+                    {{dateTime}} >
                 </view>
             </picker>
         </view>
         <view class="box">
             <view class="label">成功邀请</view>
-            <view>10人</view>
+            <view>{{totalSize}}人</view>
         </view>
     </view>
     <scroll-view class="historyList" scroll-y="true" enhanced show-scrollbar="{{false}}" scroll-top="{{scrollTop}}"
-        bindscrolltolower='loadMore'>
-        <view class="user" wx:for="{{20}}" wx:key='{{index}}'>
+        bindscrolltolower='loadMore'  wx:if="{{!nullList}}">
+        <view class="user" wx:for="{{list}}" wx:key='index'>
             <image src="https://reader-wx.ai160.com/reader/resource/20230215/1676472360368723.jpg" class="avatar" />
             <view class="info">
                 <view class="nickName">刘聪{{index}}</view>

+ 1 - 0
salesperson/pages/history/index.wxss

@@ -28,6 +28,7 @@
   padding-top: 250rpx;
   padding-bottom: 130rpx;
   box-sizing: border-box;
+  z-index: -1;
 }
 .container .historyList .user {
   display: flex;

+ 16 - 4
salesperson/pages/lxDetail/index.js

@@ -1,5 +1,8 @@
+import {
+    getSaleData,
+    getIncomeList
+} from '~/api/sale'
 Page({
-
     data: {
         currentIndex: 1,
         categoryList: [{
@@ -17,11 +20,20 @@ Page({
         }, {
             id: 5,
             title: '半年'
-        }]
+        }],
+        allIncome: {},
+        orderList: []
     },
-    onLoad(options) {
-
+    async onShow() {
+        let allIncome = await getSaleData()
+        let orderList = await getIncomeList()
+        console.log(allIncome,orderList);
+        this.setData({
+            allIncome,
+            orderList
+        })
     },
+
     setClass({
         currentTarget
     }) {

+ 8 - 6
salesperson/pages/lxDetail/index.wxml

@@ -1,31 +1,33 @@
+<wxs src="../../../utils/filter.wxs" module="filters" />
+
 <view class="container">
     <view class="statistics">
         <view class="col">
             <view class="row">
                 <view class="label">累计收益(元)</view>
-                <view class="money">3400.00</view>
+                <view class="money">{{filters.twoDecimal(allIncome.income)}}</view>
             </view>
             <view class="row">
                 <view class="label">累计销售(元)</view>
-                <view class="money">3400.00</view>
+                <view class="money">{{filters.twoDecimal(allIncome.saleCount)}}</view>
             </view>
             <view class="row">
                 <view class="label">累计订单(笔)</view>
-                <view class="money">3400</view>
+                <view class="money">{{allIncome.orderCount}}</view>
             </view>
         </view>
         <view class="col col2">
             <view class="row">
                 <view class="label">可提现(元)</view>
-                <view class="money">3400.00</view>
+                <view class="money">{{filters.twoDecimal(allIncome.withdraw)}}</view>
             </view>
             <view class="row">
                 <view class="label">待结算(元)</view>
-                <view class="money">3400.00</view>
+                <view class="money">{{filters.twoDecimal(allIncome.waitSettlement)}}</view>
             </view>
             <view class="row">
                 <view class="label">累计邀请(人)</view>
-                <view class="money">3400</view>
+                <view class="money">{{allIncome.inviteCount}}</view>
             </view>
         </view>
     </view>

+ 7 - 5
salesperson/pages/management/index.js

@@ -1,4 +1,7 @@
 import reachBottom from '~/mixins/reachBottom';
+import {
+    getSaleOrder
+} from '~/api/sale'
 Page({
     behaviors: [reachBottom],
     data: {
@@ -16,12 +19,11 @@ Page({
     },
 
     onLoad(options) {
-
+        this.resetData();
     },
     loadMore() {
-        /*  this.getData(getCategoryWorks, {
-             columnId
-         }); */
+        this.getData(getSaleOrder, {
+        });
     },
     setClass({
         currentTarget
@@ -29,6 +31,6 @@ Page({
         this.setData({
             currentIndex: currentTarget.dataset.index,
         });
-        // this.resetData();
+        this.resetData();
     },
 })

+ 2 - 2
salesperson/pages/saleOffice/index.wxml

@@ -6,7 +6,7 @@
             <image class='avatar' src='{{ userInfo.avatar}}'></image>
             <view class="identity">
                 <view class="nickName">{{ userInfo.nickName}}</view>
-                <view class="tag">初级团长</view>
+                <view class="tag">{{allIncome.level}}</view>
             </view>
         </view>
         <view class="right" bindtap="jump" data-url="commission">查看分销规则</view>
@@ -29,7 +29,7 @@
             </view>
             <view class="box">
                 <view class="label rtext">累计收益(元)</view>
-                <view class="money rtext" style="padding-right:20rpx;">{{filters.twoDecimal(allIncome.income    )}}</view>
+                <view class="money rtext" style="padding-right:20rpx;">{{filters.twoDecimal(allIncome.income)}}</view>
             </view>
         </view>
     </view>