Commit 9642c77329ad77528a32e22e35922c9f02dbf918

Authored by wangfan
1 parent 7a2d5f77

统计信息

@@ -28,6 +28,9 @@ Page({ @@ -28,6 +28,9 @@ Page({
28 [], 28 [],
29 ], 29 ],
30 speciallist:[], 30 speciallist:[],
  31 + ReservesCountMonth:[],
  32 + ReservesTotal:0,
  33 + timeStrLabel:bookOrder.timeStrLabel
31 }, 34 },
32 sellerid:0, 35 sellerid:0,
33 indexOpt:null, 36 indexOpt:null,
@@ -70,6 +73,8 @@ Page({ @@ -70,6 +73,8 @@ Page({
70 }) 73 })
71 //util.setBarTitle('预定本'); 74 //util.setBarTitle('预定本');
72 this.indexOpt=opt; 75 this.indexOpt=opt;
  76 + this.ReservesCountDay(util.unixtoTime(d,'YYYY-MM-DD'));
  77 + this.ReservesCountMonth(util.unixtoTime(d,'YYYY-MM'));
73 }, 78 },
74 onShow:function(){ 79 onShow:function(){
75 this.setData({ 80 this.setData({
@@ -169,13 +174,14 @@ Page({ @@ -169,13 +174,14 @@ Page({
169 let clickDay = event.detail.date.substr(8,2); 174 let clickDay = event.detail.date.substr(8,2);
170 let changeDay = `dayStyle[1].day`; 175 let changeDay = `dayStyle[1].day`;
171 let changeBg = `dayStyle[1].background`; 176 let changeBg = `dayStyle[1].background`;
172 - this.setData({  
173 - dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),  
174 - [changeDay]: clickDay,  
175 - [changeBg]: "#84e7d0"  
176 - })  
177 - this.getbooklist();  
178 - this.calendarClose(); 177 + this.setData({
  178 + dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),
  179 + [changeDay]: clickDay,
  180 + [changeBg]: "#84e7d0"
  181 + })
  182 + this.getbooklist();
  183 + this.calendarClose();
  184 + this.ReservesCountDay(event.detail.date);
179 }, 185 },
180 calendarClose(){ 186 calendarClose(){
181 this.setData({ 187 this.setData({
@@ -221,4 +227,45 @@ Page({ @@ -221,4 +227,45 @@ Page({
221 exportFile(){ 227 exportFile(){
222 this.getbooklist(true); 228 this.getbooklist(true);
223 }, 229 },
  230 + ReservesCountDay(day){
  231 + App.Reserve.ReservesCountDay({
  232 + sid:this.sellerid,
  233 + day:day
  234 + }).then(res=>{
  235 +
  236 + let ReservesTotal=0;
  237 + let ReservesCountDay={};
  238 + if(res.ret==200){
  239 + ReservesCountDay=res.data;
  240 + Object.keys(res.data).forEach(k=>{
  241 + if(res.data[k]!=-1){
  242 + ReservesTotal+=parseInt(res.data[k])
  243 + }
  244 + })
  245 + }
  246 + this.setData({
  247 + ReservesTotal:ReservesTotal,
  248 + ReservesCountDay:ReservesCountDay,
  249 + })
  250 + })
  251 + },
  252 + ReservesCountMonth(month){
  253 + App.Reserve.ReservesCountMonth({
  254 + sid:this.sellerid,
  255 + month:month
  256 + }).then(res=>{
  257 + let ReservesCountMonth=[];
  258 + if(res.ret==200){
  259 + res.data.forEach(v=>{
  260 + ReservesCountMonth.push(v>=1?1:0)
  261 + })
  262 + }
  263 + this.setData({
  264 + ReservesCountMonth:ReservesCountMonth,
  265 + })
  266 + })
  267 + },
  268 + clickMonth(e){
  269 + this.ReservesCountMonth(e.detail.currentYear+'-'+e.detail.currentMonth);
  270 + }
224 }) 271 })
@@ -33,13 +33,15 @@ @@ -33,13 +33,15 @@
33 </view> 33 </view>
34 </view> 34 </view>
35 </view> 35 </view>
  36 + <view class="book-list-cut flex-ll font26r black-font">
  37 + <text>已订 {{ReservesTotal}}</text>
  38 + <text wx:for="{{ReservesCountDay}}" wx:if="{{item>-1}}" wx:key="ReservesCountDay.key">{{timeStrLabel[index]}} {{item}}</text>
  39 + </view>
36 <block wx:if="{{!bookList}}"> 40 <block wx:if="{{!bookList}}">
37 - <nothingBook height="{{listHeight}}"></nothingBook> 41 + <nothingBook height="{{listHeight}}"></nothingBook>
38 </block> 42 </block>
39 <block wx:else> 43 <block wx:else>
40 - <view class="book-list-cut flex-lr font26r black-font">  
41 - <text>已订 {{bookList.length}}</text>  
42 - </view> 44 +
43 <view bindcsroll="onPullDownRefresh" class="bg_white"> 45 <view bindcsroll="onPullDownRefresh" class="bg_white">
44 46
45 <view class="book-list-thead flex-lr font34r black-font"> 47 <view class="book-list-thead flex-lr font34r black-font">
@@ -81,13 +83,17 @@ @@ -81,13 +83,17 @@
81 datefont-style="datefont-style" 83 datefont-style="datefont-style"
82 todaybtn-style="todaybtn-style" 84 todaybtn-style="todaybtn-style"
83 85
84 - bindnextMonth="nextMonth"  
85 - bindprevMonth="prevMonth" 86 + bindnextMonth="clickMonth"
  87 + bindprevMonth="clickMonth"
86 bindselectDate="dateChange" 88 bindselectDate="dateChange"
87 bindgotoday="gotoday" 89 bindgotoday="gotoday"
88 90
89 colored="#199095" 91 colored="#199095"
90 - circle_show="{{false}}" 92 + circle_show="{{true}}"
  93 + mystatus="{{ReservesCountMonth}}"
  94 + dotcolor-o="dotcolor-o"
  95 + dotcolor-t="dotcolor-t"
  96 + allshow="{{true}}"
91 ></calendar> 97 ></calendar>
92 </view> 98 </view>
93 </view> 99 </view>
@@ -62,6 +62,9 @@ page{ @@ -62,6 +62,9 @@ page{
62 font-size: 26rpx; 62 font-size: 26rpx;
63 line-height: 66rpx; 63 line-height: 66rpx;
64 } 64 }
  65 +.book-list-cut text{
  66 + margin-right: 50rpx;
  67 +}
65 .border-line{ 68 .border-line{
66 width:670rpx; 69 width:670rpx;
67 height:1px; 70 height:1px;
@@ -50,3 +50,15 @@ @@ -50,3 +50,15 @@
50 position: absolute; 50 position: absolute;
51 bottom: 10rpx; right: 60rpx; 51 bottom: 10rpx; right: 60rpx;
52 } 52 }
  53 +/* 出勤 */
  54 +.dotcolor-o{
  55 + background-color: #ff3333!important;
  56 + top: 20rpx!important;
  57 + left: 70%!important;
  58 + width: 10rpx!important;
  59 + height: 10rpx!important;
  60 +}
  61 +/* 未出勤 */
  62 +.dotcolor-t{
  63 + background-color: #fefefe!important;
  64 +}
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav> 2 <nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav>
3 <view class="header"> 3 <view class="header">
4 <view class="info"> 4 <view class="info">
5 - <view class="nick">{{user.nickname}}</view> 5 + <view class="nick">{{user.nick_name || user.nickname}}</view>
6 <view class="seller Medium">{{seller.sellername}} | {{user.role_name||''}}</view> 6 <view class="seller Medium">{{seller.sellername}} | {{user.role_name||''}}</view>
7 </view> 7 </view>
8 </view> 8 </view>
@@ -116,6 +116,12 @@ export default { @@ -116,6 +116,12 @@ export default {
116 alias:'App.SendSMS.SmsBatchSend', 116 alias:'App.SendSMS.SmsBatchSend',
117 silence: false, 117 silence: false,
118 }, 118 },
  119 + //统计某个商家某天预定总数
  120 + 'App.Reserve.ReservesCountDay':null,
  121 + //统计某个商家某月预定总数
  122 + 'App.Reserve.ReservesCountMonth':{
  123 + cachetime: 300,
  124 + },
119 125
120 /**提前点餐**/ 126 /**提前点餐**/
121 'App.Advance.CreateOrder':{ 127 'App.Advance.CreateOrder':{
@@ -177,6 +177,6 @@ module.exports ={ @@ -177,6 +177,6 @@ module.exports ={
177 } 177 }
178 //console.log('times',obj); 178 //console.log('times',obj);
179 return obj; 179 return obj;
180 - }  
181 - 180 + },
  181 + timeStrLabel:{'morning':'早市','noon':'午市','night':'晚市'},
182 } 182 }