订单统计接口对接

This commit is contained in:
donqi 2022-07-13 21:38:54 +08:00
parent 1c611fe3c3
commit 7c7867be05
3 changed files with 49 additions and 21 deletions

View File

@ -524,5 +524,13 @@ export default {
data: params
})
return res[1].data;
},
async orderStatistics(params = {}) {
let res = await uni.request({
url: '/order/app/statistics',
method: 'POST',
data: params
})
return res[1].data;
}
}

View File

@ -21,11 +21,11 @@
<!-- 未预约未派单上门超时 -->
<view class="cu-list grid no-border col-3 margin-top-sm" style="background-color: inherit;">
<view class="cu-item">
<view class="margin-bottom-xs text-xxl">0</view>
<view>未预约</view>
<view class="margin-bottom-xs text-xxl">{{orderStatistics.newOrderNum}}</view>
<view>新订单</view>
</view>
<view class="cu-item">
<view class="margin-bottom-xs text-xxl">0</view>
<view class="margin-bottom-xs text-xxl">{{orderStatistics.planOrderNum}}</view>
<view>未排单</view>
</view>
<view class="cu-item">
@ -49,23 +49,26 @@
<text>即将上门订单</text>
<text class="cuIcon-right"></text>
</view>
</view>
<!-- 轮播 -->
<swiper v-if="curUserInfo && curUserInfo.workerId" class="screen-swiper" :autoplay="true" :circular="true">
<swiper-item v-for="(item,index) in waitServOrderToday" :key="index">
<view class="padding-sm">
<view class="flex justify-between align-center margin-bottom-xs">
<view class="text-lg">{{item.goodsName}}</view>
</view>
<view v-if="!curUserInfo || !curUserInfo.workerId" class="screen-swiper padding text-center">
未登录
</view>
<!-- 轮播 -->
<swiper v-else-if="waitServOrderToday && waitServOrderToday.length" class="screen-swiper" :autoplay="true" :circular="true">
<swiper-item v-for="(item,index) in waitServOrderToday" :key="index">
<view class="padding-sm">
<view class="flex justify-between align-center margin-bottom-xs">
<view class="text-lg">{{item.goodsName}}</view>
</view>
<view>
时间<text class="text-red">{{item.expectTimeStart + ' - ' + item.expectTimeEnd}}</text>
</view>
<view>地址{{item.address}}</view>
</view>
</swiper-item>
</view>
<view>地址{{item.address}}</view>
</view>
</swiper-item>
</swiper>
<view v-else class="screen-swiper padding text-center">
未登录
<view v-else class="screen-swiper padding text-center text-gray">
今日无待上门订单
</view>
</view>
<!-- 每周公告 -->
@ -152,7 +155,8 @@
}],
curUserInfo: {},
myInfo: {},
waitServOrderToday: [],
waitServOrderToday: [],
orderStatistics: {},
isShowSteer: false,
isAuthWxLoginModal: false,
isAuthWxPhoneModal: false,
@ -207,7 +211,9 @@
}
this.servModules = newServModules;
//
this.loadTodayWaitServOrder();
this.loadTodayWaitServOrder();
//
this.loadOrderStatistics();
},
async loadTodayWaitServOrder() {
let date = new Date();
@ -217,6 +223,10 @@
expectTimeEnd: date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + " 23:59:59"
});
this.waitServOrderToday = waitServRes.rows;
},
async loadOrderStatistics() {
let res = await this.$request.orderStatistics();
this.orderStatistics = res.data;
},
async chooseEntryType(typeCode) {
let status = 1;

View File

@ -39,7 +39,8 @@
<view class="cu-list grid no-border col-5 padding-top-sm bg-white">
<view class="cu-item" :class="index==stateCur?'bg-main-color light cur':''" v-for="(item,index) in stateList" :key="index" :data-id="index" @tap="statusSelect">
<view class="margin-bottom-xs">{{item.name}}</view>
<view>(0)</view>
<view v-if="item.code === 0">({{orderStatistics.newOrderNum}})</view>
<view v-else>(0)</view>
</view>
<!-- <view class="cu-item" :class="stateCur === 0 ? 'bg-main-color light' : ''" :data-id="0" @tap="statusSelect">
<view class="margin-bottom-xs">超时单</view>
@ -331,7 +332,8 @@
ifShowPageMeta: false,
picModalImgList: [],
curDate: '',
curUserInfo: {}
curUserInfo: {},
orderStatistics: {}
}
},
onLoad() {
@ -366,7 +368,9 @@
this.loadCategoryList();
this.loadRegionList();
//
this.loadTeamMembers();
this.loadTeamMembers();
//
this.loadOrderStatistics();
},
reloadMasterOrderPage(params = {}) {
// this.pageParams = [];
@ -379,6 +383,8 @@
this.orderList = [];
this.$refs.loadStatusBar.showLoadMore();
this.loadMasterOrderPage();
//
this.loadOrderStatistics();
},
async loadMasterOrderPage(params = {}) {
params.pageSize = this.$globalData.initPageSize;
@ -464,6 +470,10 @@
});
this.myTeamMembers = res.rows;
},
async loadOrderStatistics() {
let res = await this.$request.orderStatistics();
this.orderStatistics = res.data;
},
bindEvent() {
uni.$on(this.$globalFun.HIDE_MODAL, this.hideModal);
},