Commit 9642c77329ad77528a32e22e35922c9f02dbf918

Authored by wangfan
1 parent 7a2d5f77

统计信息

... ... @@ -28,6 +28,9 @@ Page({
[],
],
speciallist:[],
ReservesCountMonth:[],
ReservesTotal:0,
timeStrLabel:bookOrder.timeStrLabel
},
sellerid:0,
indexOpt:null,
... ... @@ -70,6 +73,8 @@ Page({
})
//util.setBarTitle('预定本');
this.indexOpt=opt;
this.ReservesCountDay(util.unixtoTime(d,'YYYY-MM-DD'));
this.ReservesCountMonth(util.unixtoTime(d,'YYYY-MM'));
},
onShow:function(){
this.setData({
... ... @@ -169,13 +174,14 @@ Page({
let clickDay = event.detail.date.substr(8,2);
let changeDay = `dayStyle[1].day`;
let changeBg = `dayStyle[1].background`;
this.setData({
dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),
[changeDay]: clickDay,
[changeBg]: "#84e7d0"
})
this.getbooklist();
this.calendarClose();
this.setData({
dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),
[changeDay]: clickDay,
[changeBg]: "#84e7d0"
})
this.getbooklist();
this.calendarClose();
this.ReservesCountDay(event.detail.date);
},
calendarClose(){
this.setData({
... ... @@ -221,4 +227,45 @@ Page({
exportFile(){
this.getbooklist(true);
},
ReservesCountDay(day){
App.Reserve.ReservesCountDay({
sid:this.sellerid,
day:day
}).then(res=>{
let ReservesTotal=0;
let ReservesCountDay={};
if(res.ret==200){
ReservesCountDay=res.data;
Object.keys(res.data).forEach(k=>{
if(res.data[k]!=-1){
ReservesTotal+=parseInt(res.data[k])
}
})
}
this.setData({
ReservesTotal:ReservesTotal,
ReservesCountDay:ReservesCountDay,
})
})
},
ReservesCountMonth(month){
App.Reserve.ReservesCountMonth({
sid:this.sellerid,
month:month
}).then(res=>{
let ReservesCountMonth=[];
if(res.ret==200){
res.data.forEach(v=>{
ReservesCountMonth.push(v>=1?1:0)
})
}
this.setData({
ReservesCountMonth:ReservesCountMonth,
})
})
},
clickMonth(e){
this.ReservesCountMonth(e.detail.currentYear+'-'+e.detail.currentMonth);
}
})
\ No newline at end of file
... ...
... ... @@ -33,13 +33,15 @@
</view>
</view>
</view>
<view class="book-list-cut flex-ll font26r black-font">
<text>已订 {{ReservesTotal}}</text>
<text wx:for="{{ReservesCountDay}}" wx:if="{{item>-1}}" wx:key="ReservesCountDay.key">{{timeStrLabel[index]}} {{item}}</text>
</view>
<block wx:if="{{!bookList}}">
<nothingBook height="{{listHeight}}"></nothingBook>
<nothingBook height="{{listHeight}}"></nothingBook>
</block>
<block wx:else>
<view class="book-list-cut flex-lr font26r black-font">
<text>已订 {{bookList.length}}</text>
</view>
<view bindcsroll="onPullDownRefresh" class="bg_white">
<view class="book-list-thead flex-lr font34r black-font">
... ... @@ -81,13 +83,17 @@
datefont-style="datefont-style"
todaybtn-style="todaybtn-style"
bindnextMonth="nextMonth"
bindprevMonth="prevMonth"
bindnextMonth="clickMonth"
bindprevMonth="clickMonth"
bindselectDate="dateChange"
bindgotoday="gotoday"
colored="#199095"
circle_show="{{false}}"
circle_show="{{true}}"
mystatus="{{ReservesCountMonth}}"
dotcolor-o="dotcolor-o"
dotcolor-t="dotcolor-t"
allshow="{{true}}"
></calendar>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -62,6 +62,9 @@ page{
font-size: 26rpx;
line-height: 66rpx;
}
.book-list-cut text{
margin-right: 50rpx;
}
.border-line{
width:670rpx;
height:1px;
... ...
... ... @@ -50,3 +50,15 @@
position: absolute;
bottom: 10rpx; right: 60rpx;
}
/* 出勤 */
.dotcolor-o{
background-color: #ff3333!important;
top: 20rpx!important;
left: 70%!important;
width: 10rpx!important;
height: 10rpx!important;
}
/* 未出勤 */
.dotcolor-t{
background-color: #fefefe!important;
}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav>
<view class="header">
<view class="info">
<view class="nick">{{user.nickname}}</view>
<view class="nick">{{user.nick_name || user.nickname}}</view>
<view class="seller Medium">{{seller.sellername}} | {{user.role_name||''}}</view>
</view>
</view>
... ...
... ... @@ -116,6 +116,12 @@ export default {
alias:'App.SendSMS.SmsBatchSend',
silence: false,
},
//统计某个商家某天预定总数
'App.Reserve.ReservesCountDay':null,
//统计某个商家某月预定总数
'App.Reserve.ReservesCountMonth':{
cachetime: 300,
},
/**提前点餐**/
'App.Advance.CreateOrder':{
... ...
... ... @@ -177,6 +177,6 @@ module.exports ={
}
//console.log('times',obj);
return obj;
}
},
timeStrLabel:{'morning':'早市','noon':'午市','night':'晚市'},
}
... ...