订单统计接口对接

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">
@ -50,8 +50,11 @@
<text class="cuIcon-right"></text>
</view>
</view>
<view v-if="!curUserInfo || !curUserInfo.workerId" class="screen-swiper padding text-center">
未登录
</view>
<!-- 轮播 -->
<swiper v-if="curUserInfo && curUserInfo.workerId" class="screen-swiper" :autoplay="true" :circular="true">
<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">
@ -64,8 +67,8 @@
</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>
<!-- 每周公告 -->
@ -153,6 +156,7 @@
curUserInfo: {},
myInfo: {},
waitServOrderToday: [],
orderStatistics: {},
isShowSteer: false,
isAuthWxLoginModal: false,
isAuthWxPhoneModal: false,
@ -208,6 +212,8 @@
this.servModules = newServModules;
//
this.loadTodayWaitServOrder();
//
this.loadOrderStatistics();
},
async loadTodayWaitServOrder() {
let date = new Date();
@ -218,6 +224,10 @@
});
this.waitServOrderToday = waitServRes.rows;
},
async loadOrderStatistics() {
let res = await this.$request.orderStatistics();
this.orderStatistics = res.data;
},
async chooseEntryType(typeCode) {
let status = 1;
if (typeCode === 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() {
@ -367,6 +369,8 @@
this.loadRegionList();
//
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);
},