Commit 5fad9c8a1079800d5dfb894cdb813f06706267d0

Authored by wangfan
1 parent 4870598b

fenbao

Showing 151 changed files with 56 additions and 6581 deletions
1 { 1 {
2 - "component": true,  
3 - "usingComponents": {  
4 - "as":"/components/actionSheet/index"  
5 - } 2 + "component": true,
  3 + "usingComponents": {
  4 + "as":"/components/actionSheet/index"
  5 + }
6 } 6 }
1 { 1 {
2 "component": true, 2 "component": true,
3 "usingComponents": { 3 "usingComponents": {
4 - "as":"../../actionSheet/index" 4 + "board":"../board/board"
5 } 5 }
6 } 6 }
1 { 1 {
2 - "component": true,  
3 - "usingComponents": {  
4 - "formids":"/components/formids/formids"  
5 - } 2 + "component": true,
  3 + "usingComponents": {
  4 + "formids":"/components/formids/formids"
  5 + }
6 } 6 }
1 { 1 {
2 "component": true, 2 "component": true,
3 "usingComponents": { 3 "usingComponents": {
4 - "service":"/components/book/smsbatch/service", 4 + "service":"./service",
5 "formids":"/components/formids/formids", 5 "formids":"/components/formids/formids",
6 - "sendsms":"/components/book/smsbatch/sendsms" 6 + "sendsms":"./sendsms"
7 } 7 }
8 } 8 }
1 { 1 {
2 - "component": true,  
3 - "usingComponents": {  
4 - "board":"/components/book/board/board"  
5 - } 2 + "component": true,
  3 + "usingComponents": {
  4 + "as":"/components/actionSheet/index"
  5 + }
6 } 6 }
1 { 1 {
2 - "component": true,  
3 - "usingComponents": {  
4 - "formids":"../../formids/formids"  
5 - } 2 + "component": true,
  3 + "usingComponents": {
  4 + "formids":"/components/formids/formids"
  5 + }
6 } 6 }
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 "navigationBarBackgroundColor": "#fff", 3 "navigationBarBackgroundColor": "#fff",
4 "navigationBarTextStyle":"black", 4 "navigationBarTextStyle":"black",
5 "usingComponents": { 5 "usingComponents": {
6 - "timeDuration":"/components/book/time/time", 6 + "timeDuration":"../../components/book/time/time",
7 "nav":"/components/nav/nav" 7 "nav":"/components/nav/nav"
8 } 8 }
9 9
@@ -3,13 +3,13 @@ @@ -3,13 +3,13 @@
3 "navigationBarBackgroundColor": "#fff", 3 "navigationBarBackgroundColor": "#fff",
4 "navigationBarTextStyle":"black", 4 "navigationBarTextStyle":"black",
5 "usingComponents": { 5 "usingComponents": {
6 - "nothingBook":"/components/book/nothing/nothing",  
7 - "bookList":"/components/book/list/list", 6 + "nothingBook":"../../components/book/nothing/nothing",
  7 + "bookList":"../components/book/list/list",
8 "nav":"/components/nav/nav", 8 "nav":"/components/nav/nav",
9 - "tabBar":"/components/book/tabBar/tabBar", 9 + "tabBar":"../../components/book/tabBar/tabBar",
10 "searchList":"/components/searchlist/searchlist", 10 "searchList":"/components/searchlist/searchlist",
11 "calendar": "plugin://bmCalendar/calendar", 11 "calendar": "plugin://bmCalendar/calendar",
12 - "board":"/components/book/board/board", 12 + "board":"../../components/book/board/board",
13 "formids":"/components/formids/formids", 13 "formids":"/components/formids/formids",
14 "a2l":"/components/tips/add-to-lite" 14 "a2l":"/components/tips/add-to-lite"
15 } 15 }
@@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
3 "navigationBarBackgroundColor": "#fff", 3 "navigationBarBackgroundColor": "#fff",
4 "navigationBarTextStyle":"black", 4 "navigationBarTextStyle":"black",
5 "usingComponents": { 5 "usingComponents": {
6 - "selectPeople":"/components/book/people/people",  
7 - "orderDesk":"/components/book/desk/desk", 6 + "selectPeople":"../../components/book/people/people",
  7 + "orderDesk":"../../components/book/desk/desk",
8 "nav":"/components/nav/nav" 8 "nav":"/components/nav/nav"
9 } 9 }
10 } 10 }
@@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
3 "navigationBarBackgroundColor": "#fff", 3 "navigationBarBackgroundColor": "#fff",
4 "navigationBarTextStyle":"black", 4 "navigationBarTextStyle":"black",
5 "usingComponents": { 5 "usingComponents": {
6 - "noticeCall":"/components/book/notice/notice",  
7 - "step":"/components/book/step/step",  
8 - "board":"/components/book/board/board",  
9 - "cancel":"/components/book/reserveCancel/cancel", 6 + "noticeCall":"../../components/book/notice/notice",
  7 + "step":"../../components/book/step/step",
  8 + "board":"../../components/book/board/board",
  9 + "cancel":"../../components/book/reserveCancel/cancel",
10 "nav":"/components/nav/nav", 10 "nav":"/components/nav/nav",
11 "formids":"/components/formids/formids" 11 "formids":"/components/formids/formids"
12 } 12 }
@@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
3 "navigationBarBackgroundColor": "#fff", 3 "navigationBarBackgroundColor": "#fff",
4 "navigationBarTextStyle":"black", 4 "navigationBarTextStyle":"black",
5 "usingComponents": { 5 "usingComponents": {
6 - "nothingBook":"/components/book/nothing/nothing",  
7 - "bookList":"/components/book/list/list", 6 + "nothingBook":"../../components/book/nothing/nothing",
  7 + "bookList":"../../components/book/list/list",
8 "nav":"/components/nav/nav", 8 "nav":"/components/nav/nav",
9 - "tabBar":"/components/book/tabBar/tabBar", 9 + "tabBar":"../../components/book/tabBar/tabBar",
10 "calendar": "plugin://bmCalendar/calendar", 10 "calendar": "plugin://bmCalendar/calendar",
11 "formids":"/components/formids/formids" 11 "formids":"/components/formids/formids"
12 } 12 }
@@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
3 "navigationBarBackgroundColor": "#fff", 3 "navigationBarBackgroundColor": "#fff",
4 "navigationBarTextStyle":"black", 4 "navigationBarTextStyle":"black",
5 "usingComponents": { 5 "usingComponents": {
6 - "selectPeople":"/components/book/people/people",  
7 - "step":"/components/book/step/step", 6 + "selectPeople":"../../components/book/people/people",
  7 + "step":"../../components/book/step/step",
8 "nav":"/components/nav/nav" 8 "nav":"/components/nav/nav"
9 } 9 }
10 } 10 }
@@ -4,9 +4,9 @@ @@ -4,9 +4,9 @@
4 "navigationBarTextStyle":"black", 4 "navigationBarTextStyle":"black",
5 "usingComponents": { 5 "usingComponents": {
6 "nav":"/components/nav/nav", 6 "nav":"/components/nav/nav",
7 - "tabBar":"/components/book/tabBar/tabBar", 7 + "tabBar":"../../components/book/tabBar/tabBar",
8 "calendar": "plugin://bmCalendar/calendar", 8 "calendar": "plugin://bmCalendar/calendar",
9 - "board":"/components/book/board/board", 9 + "board":"../../components/book/board/board",
10 "formids":"/components/formids/formids" 10 "formids":"/components/formids/formids"
11 } 11 }
12 } 12 }
1 // pages/book/b_sms.js 1 // pages/book/b_sms.js
2 -var util = require('../../utils/util.js')  
3 -import App from '../../utils/api';  
4 -import bcm from '../../utils/bookCommon'; 2 +var util = require('/utils/util.js')
  3 +import App from '/utils/api';
  4 +import bcm from '/utils/bookCommon';
5 const {regeneratorRuntime} = global 5 const {regeneratorRuntime} = global
6 -import ST from './b_sms_tpls'; 6 +import ST from '/utils/sms_tpls';
7 const tpls = { 7 const tpls = {
8 SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!', 8 SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!',
9 SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!', 9 SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!',
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 "navigationBarTextStyle":"white", 4 "navigationBarTextStyle":"white",
5 "usingComponents": { 5 "usingComponents": {
6 "nav":"/components/nav/nav", 6 "nav":"/components/nav/nav",
7 - "tabBar":"/components/book/tabBar/tabBar", 7 + "tabBar":"../../../components/book/tabBar/tabBar",
8 "formids":"/components/formids/formids" 8 "formids":"/components/formids/formids"
9 } 9 }
10 } 10 }
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 "navigationBarTextStyle":"white", 4 "navigationBarTextStyle":"white",
5 "usingComponents": { 5 "usingComponents": {
6 "nav":"/components/nav/nav", 6 "nav":"/components/nav/nav",
7 - "tabBar":"/components/book/tabBar/tabBar", 7 + "tabBar":"../../../components/book/tabBar/tabBar",
8 "formids":"/components/formids/formids" 8 "formids":"/components/formids/formids"
9 } 9 }
10 } 10 }
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 "navigationBarTextStyle":"white", 4 "navigationBarTextStyle":"white",
5 "usingComponents": { 5 "usingComponents": {
6 "nav":"/components/nav/nav", 6 "nav":"/components/nav/nav",
7 - "tabBar":"/components/book/tabBar/tabBar", 7 + "tabBar":"../../../components/book/tabBar/tabBar",
8 "formids":"/components/formids/formids" 8 "formids":"/components/formids/formids"
9 } 9 }
10 } 10 }
@@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
6 "userinfo":"/components/userinfo/userinfo", 6 "userinfo":"/components/userinfo/userinfo",
7 "nav":"/components/nav/nav", 7 "nav":"/components/nav/nav",
8 "formids":"/components/formids/formids", 8 "formids":"/components/formids/formids",
9 - "service":"/components/book/smsbatch/service",  
10 - "sendsms":"/components/book/smsbatch/sendsms" 9 + "service":"../../../components/book/smsbatch/service",
  10 + "sendsms":"../../../components/book/smsbatch/sendsms"
11 } 11 }
12 12
13 } 13 }
@@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
6 "userinfo":"/components/userinfo/userinfo", 6 "userinfo":"/components/userinfo/userinfo",
7 "nav":"/components/nav/nav", 7 "nav":"/components/nav/nav",
8 "formids":"/components/formids/formids", 8 "formids":"/components/formids/formids",
9 - "rows":"/components/book/smsbatch/rows",  
10 - "service":"/components/book/smsbatch/service" 9 + "rows":"../../../components/book/smsbatch/rows",
  10 + "service":"../../../components/book/smsbatch/service"
11 } 11 }
12 12
13 } 13 }
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 "userinfo":"/components/userinfo/userinfo", 6 "userinfo":"/components/userinfo/userinfo",
7 "nav":"/components/nav/nav", 7 "nav":"/components/nav/nav",
8 "formids":"/components/formids/formids", 8 "formids":"/components/formids/formids",
9 - "rows":"/components/book/smsbatch/rows" 9 + "rows":"../../../components/book/smsbatch/rows"
10 } 10 }
11 11
12 } 12 }
1 -var util = require('../../utils/util.js')  
2 -var uri=require('../../utils/uri.js')  
3 -var bookOrder=require('../../utils/bookCommon.js')  
4 -Page({  
5 - data:{  
6 - },  
7 - onLoad:function(){  
8 - util.setBarTitle('选择用餐时间');  
9 - this.getdatelist()  
10 - this.getimelist();  
11 - wx.removeStorage({  
12 - key:'order_pnum',  
13 - })  
14 - wx.removeStorage({  
15 - key:'tabletype',  
16 - })  
17 - },  
18 - onShow:function(){  
19 -  
20 - },  
21 - changelist:function(e){  
22 - console.log('xxxx',e)  
23 - var timelist=this.data.timeList;  
24 - timelist.forEach(function(v,i){  
25 - v.list.forEach(function(r,n){  
26 - r.isselect=false  
27 - })  
28 - })  
29 - this.setData({  
30 - timeList:timelist,  
31 - time_dur:e.detail  
32 - })  
33 - },  
34 - //日期选择  
35 - selectdate:function(e){  
36 - var title=e.currentTarget.dataset.title;  
37 - var datelist=this.data.dateList;  
38 - var selectdate=''  
39 - datelist.forEach(function(v,i){  
40 - v.isActive=false  
41 - if(v.title==title){  
42 - v.isActive=true;  
43 - selectdate=v.date  
44 - }  
45 - })  
46 - this.setData({  
47 - dateList:datelist,  
48 - selectdate:selectdate,  
49 - time_dur:null  
50 - })  
51 - this.getimelist();  
52 - },  
53 - selectOther:function(){  
54 - var currentTime=Date.parse(new Date());  
55 - var timeobj=bookOrder.changedate(currentTime)  
56 - console.log(this.data.selectdate,this.data.time_dur)  
57 - wx.navigateTo({  
58 - url:'b_info?year='+timeobj.year+'&date='+this.data.selectdate+'&time='+this.data.time_dur  
59 - })  
60 - },  
61 - //获取日期列表  
62 - getdatelist:function(){  
63 - var currentTime=Date.parse(new Date());  
64 - var dur=24*60*60*1000;  
65 - var list=[currentTime,currentTime+dur,currentTime+2*dur];  
66 - var desklist=[];  
67 - for(var i=0;i<list.length;i++){  
68 - var dd=bookOrder.changedate(list[i]);  
69 - if(i==0){  
70 - var title='今天';  
71 - var isselect=true  
72 - }  
73 - if(i==1){  
74 - var title='明天';  
75 - var isselect=false  
76 - }  
77 - if(i==2){  
78 - var myDate = new Date(list[2]);  
79 - var title=bookOrder.getweek(myDate.getDay());  
80 - var isselect=false  
81 - }  
82 - desklist.push({  
83 - title:title,  
84 - date:'0'+dd.month+(dd.day<10 ? '-0'+dd.day : '-'+dd.day),  
85 - isActive:isselect,  
86 - year:dd.year  
87 - })  
88 - }  
89 - this.setData({  
90 - dateList:desklist,  
91 - selectdate:desklist[0].date  
92 - })  
93 - console.log(this.data.selectdate)  
94 - },  
95 - //获取时间列表  
96 - getimelist:function(){  
97 - var currentTime=Date.parse(new Date());  
98 - var timeobj=bookOrder.changedate(currentTime)  
99 - var timelist=[  
100 - {  
101 - title:'早市',  
102 - time_dur:'6:00-10:00',  
103 - list:[  
104 - {  
105 - time_dur:'6:00',  
106 - isselect:false,  
107 - time_mask:6  
108 - }  
109 - ],  
110 - starttime:6,  
111 - endtime:10  
112 - },  
113 - {  
114 - title:'午市',  
115 - time_dur:'11:00-15:00',  
116 - list:[  
117 - {  
118 - time_dur:'11:00',  
119 - isselect:false,  
120 - time_mask:11  
121 - }  
122 - ],  
123 - starttime:11,  
124 - endtime:15  
125 - },  
126 - {  
127 - title:'晚市',  
128 - time_dur:'17:00-22:00',  
129 - list:[  
130 - {  
131 - time_dur:'17:00',  
132 - isselect:false,  
133 - time_mask:17  
134 - }  
135 - ],  
136 - starttime:17,  
137 - endtime:22  
138 - },  
139 - ];  
140 - var that=this;  
141 - timelist.forEach(function(v,i){  
142 - var len=(v.endtime-v.starttime)/0.5;  
143 - var time=v.starttime;  
144 - console.log(len)  
145 - for(var j=0;j<len;j++){  
146 - time+=0.5;  
147 - if(bookOrder.isInteger(time)==true){  
148 - v.list.push(  
149 - {  
150 - time_dur:time+':00',  
151 - isselect:false,  
152 - time_mask:time  
153 - }  
154 - )  
155 - }else{  
156 - v.list.push(  
157 - {  
158 - time_dur:Math.floor(time)+':30',  
159 - isselect:false,  
160 - time_mask:time  
161 - }  
162 - )  
163 - }  
164 - }  
165 - })  
166 - var thisdate=0;  
167 - if(that.data.selectdate.split('-')[1].length>1){  
168 - thisdate=parseInt(that.data.selectdate.split('-')[1][0]=='0' ? that.data.selectdate.split('-')[1].slice(1,2) : that.data.selectdate.split('-')[1])  
169 - }else{  
170 - thisdate=parseInt(that.data.selectdate.split('-')[1])  
171 - }  
172 - if(thisdate==timeobj.day){  
173 - var thistime=timeobj.hour+timeobj.minute/60;  
174 - var dd=[]  
175 - timelist.forEach(function(v,i){  
176 - if(thistime<v.endtime){  
177 - dd.push(v)  
178 - }  
179 - })  
180 - timelist=dd;  
181 - timelist.forEach(function(v,i){  
182 - if(thistime>=v.starttime && thistime<=v.endtime){  
183 - var list=[]  
184 - v.list.forEach(function(r,n){  
185 - if(thistime<r.time_mask){  
186 - list.push(r)  
187 - }  
188 - })  
189 - v.list=list  
190 - }  
191 - })  
192 -  
193 - }  
194 -  
195 - this.setData({  
196 - timeList:timelist  
197 - })  
198 -  
199 - },  
200 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "timeDuration":"/components/book/time/time",  
7 - "nav":"/components/nav/nav"  
8 - }  
9 -  
10 -}  
1 -<nav>点餐商户端</nav>  
2 -<!--日期-->  
3 -<view style="padding-bottom:160rpx;">  
4 - <view class="select-date flex-lr smooth">  
5 - <block wx:for="{{dateList}}">  
6 - <view class="single-date gray-deep-font flex-vc" bindtap="selectdate" data-title="{{item.title}}">  
7 - <view class="font30r {{item.isActive==true ? 'black-font' : ''}}">{{item.title}}</view>  
8 - <view class="font34r date-num flex-cc {{item.isActive==true ? 'select-date-active black-font' : ''}}">{{item.date}}</view>  
9 - </view>  
10 - </block>  
11 - <view class="single-date gray-deep-font flex-vc">  
12 - <view class="font30r">更多</view>  
13 - <view class="date-num flex-vc">  
14 - <image src="http://qn.colorcun.com/custom/lite-yd/image/more-dot.png" class="more-dot"></image>  
15 - </view>  
16 - </view>  
17 - </view>  
18 - <block wx:for="{{timeList}}">  
19 - <timeDuration item="{{item}}" bind:changelist="changelist"></timeDuration>  
20 - </block>  
21 -</view>  
22 -<view class="confirm-button white-font flex-vc font34r {{time_dur ? 'confirm-button-active' : ''}}" bindtap="{{time_dur ? 'selectOther' : ''}}">确定</view>  
23 -  
24 -  
25 -<date-picker  
26 - startTime="{{startTime}}"  
27 - endTime="{{endTime}}"  
28 - unit="{{unit}}"  
29 - reserveUnit="{{reserveUnit}}"  
30 - unreserveTime="{{unreserveTime}}"  
31 - activedConst="{{activedConst}}"  
32 - disabledConst="{{disabledConst}}"  
33 - themeColor="#1f78d1"  
34 - bind:selectTime="onSelectTime"  
35 -/>  
1 -.select-date{  
2 - width:680rpx;  
3 - height:180rpx;  
4 - margin:0 auto;  
5 -}  
6 -.more-dot{  
7 - width:50rpx;  
8 - height:10rpx;  
9 -}  
10 -.date-num{  
11 - padding:0 10rpx;  
12 - height:70rpx;  
13 -}  
14 -.select-date-active{  
15 - border-bottom:2px solid #199095;  
16 - box-sizing:border-box;  
17 -}  
18 -.confirm-button{  
19 - width:680rpx;  
20 - height:85rpx;  
21 - background:#74BBBE;  
22 - position:fixed;  
23 - left:0;  
24 - right:0;  
25 - bottom:60rpx;  
26 - margin:0 auto;  
27 - border-radius:10rpx;  
28 -}  
29 -.confirm-button-active{  
30 - background:#199095;  
31 -}  
1 -// pages/book/b_addnew.js  
2 -import util from '../../utils/util';  
3 -import comm from '../../utils/bookCommon';  
4 -import App from '../../utils/api';  
5 -const {regeneratorRuntime} = global  
6 -const formTpl = {  
7 - rid: '',  
8 - date: 0,  
9 - time: 0,  
10 - //pnum_str:'1-4',  
11 - pnum: 6,  
12 - tabid: 0,  
13 -  
14 - rname: '',  
15 - phone: '',  
16 - sex: 1,  
17 - cusdem: '',  
18 -  
19 - tid: [],  
20 -  
21 -}  
22 -Page({  
23 -  
24 - /**  
25 - * 页面的初始数据  
26 - */  
27 - data: {  
28 - dateStr: [],  
29 - form: JSON.parse(JSON.stringify(formTpl)),  
30 - tables: [],  
31 - grand: [  
32 - {  
33 - sex: 1,  
34 - grand_title: '先生',  
35 - isselect: true  
36 - },  
37 - {  
38 - sex: 2,  
39 - grand_title: '女士',  
40 - isselect: false  
41 - },  
42 - {  
43 - sex: 3,  
44 - grand_title: '公司',  
45 - isselect: false  
46 - }  
47 - ],  
48 - buttonhide: true,  
49 -  
50 - calendarMaskLoad: false,  
51 - calendarMask: false,  
52 - dayStyle: [  
53 - {month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'},  
54 - {month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'}  
55 - ],  
56 - timePickerArray: [  
57 - [],  
58 - [],  
59 - [],  
60 - ],  
61 - timePickerIndex: [0, 0, 0],  
62 - tablesLength: 0,  
63 -  
64 - timePickerMask: false,  
65 - pnumInputFocus: false,  
66 - pageMarginBottom: 0,  
67 - speciallist: [],  
68 - calendar: {  
69 - nextNum: 0,  
70 - },  
71 - defDtime: ['', '12:00', '18:30'],  
72 - hasUseDefDtime: true,  
73 - CustomRemark:[],  
74 - CustomRemarkMoreMask:false,  
75 - },  
76 - /**  
77 - * 生命周期函数--监听页面加载  
78 - */  
79 - reserve_id: '',  
80 - checkedTables:{},//已选中的桌子集合  
81 - onLoad: async function (options) {  
82 - this.initLoad(options)  
83 - this.getCustomRemark();  
84 - },  
85 - async initLoad(options = {}){  
86 - let nt = new Date() / 1000;  
87 - let speciallist = [  
88 - {date: util.unixtoTime(nt, 'YYYY-MM-DD'), background: '', text: '今 天'},  
89 - {date: util.unixtoTime(nt + 86400, 'YYYY-MM-DD'), background: '', text: '明 天'},  
90 - {date: util.unixtoTime(nt + 86400 * 2, 'YYYY-MM-DD'), background: '', text: '后 天'},  
91 - ];  
92 - this.reserve_id = options.id || '';  
93 - await this.setDateStr();  
94 - this.sellerid = util.cache('enter_params')['seller_id'];  
95 - let timePickerArray = await comm.getDayTimeSpace();  
96 - //判断hasUseDefDtime  
97 - let hasUseDefDtime = true;  
98 - let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');  
99 - if (mmii > this.data.defDtime[this.data.form.time]) {  
100 - hasUseDefDtime = false;  
101 - }  
102 -  
103 - this.setData({  
104 - timePickerArray: timePickerArray,  
105 - speciallist: speciallist,  
106 - hasUseDefDtime: hasUseDefDtime,  
107 - })  
108 - if (this.reserve_id > 0) {  
109 - this.initModify(this.reserve_id);  
110 - } else if(options.hasQuick==1){  
111 - this.initQuick(options);  
112 - } else {  
113 - this.getTables();  
114 - }  
115 - },  
116 - /**  
117 - *  
118 - * @param d  
119 - *  
120 - */  
121 - async setDateStr(d = new Date() / 1000){  
122 - let ns = new Date() / 1000;  
123 - let dateStr = [  
124 - util.unixtoTime(ns, 'MM-DD `DAY/周WW`'),  
125 - util.unixtoTime(parseInt(ns) + 86400, 'MM-DD `DAY/周WW`'),  
126 - ];  
127 - //let dateStr=this.data.dateStr;  
128 - let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`')  
129 - let form = this.data.form;  
130 -  
131 - let timeObj = await comm.getTimeSpaceIndexData(d);  
132 - //form.time=await comm.getTimeSpaceIndex(d);  
133 - form.time = timeObj.timeIndex;  
134 -  
135 - let ind = dateStr._indexOf(nowStr);  
136 - if (ind > -1) {  
137 - form.date = ind  
138 - } else {  
139 - dateStr.push(nowStr.substr(0, 5));  
140 - form.date = 2;  
141 - }  
142 - let timePickerIndex = this.data.timePickerIndex;  
143 - timePickerIndex[timeObj.timeIndex] = timeObj.timeMatchIndex;  
144 - let obj = {  
145 - dateStr: dateStr,  
146 - form: form,  
147 - timePickerIndex: timePickerIndex,  
148 - timeOpt: timeObj.timeOpt,  
149 - };  
150 - this.setData(obj)  
151 - return obj;  
152 -  
153 - },  
154 -  
155 - /**  
156 - * 生命周期函数--监听页面初次渲染完成  
157 - */  
158 - onReady: function () {  
159 -  
160 - },  
161 -  
162 - /**  
163 - * 生命周期函数--监听页面显示  
164 - */  
165 - onShow: function () {  
166 - //if(!this.reserve_id || util.cache('tableid').length>0){  
167 - //if (util.cache('tableid').length > 0) {  
168 - this.getTables();  
169 - //}  
170 - setTimeout(() => {  
171 - this.setData({  
172 - calendarMaskLoad: true,  
173 - })  
174 - }, 1000);  
175 - this.conditionInfo()  
176 - },  
177 -  
178 - /**  
179 - * 生命周期函数--监听页面隐藏  
180 - */  
181 - onHide: function () {  
182 -  
183 - },  
184 -  
185 - /**  
186 - * 生命周期函数--监听页面卸载  
187 - */  
188 - onUnload: function () {  
189 -  
190 - },  
191 -  
192 - /**  
193 - * 页面相关事件处理函数--监听用户下拉动作  
194 - */  
195 - onPullDownRefresh: function () {  
196 -  
197 - },  
198 -  
199 - /**  
200 - * 页面上拉触底事件的处理函数  
201 - */  
202 - onReachBottom: function () {  
203 -  
204 - },  
205 -  
206 - /**  
207 - * 用户点击右上角分享  
208 - */  
209 - onShareAppMessage: function () {  
210 -  
211 - },  
212 - selectedValue(e){  
213 - console.log(e);  
214 - let key = util.attr(e, 'key');  
215 - let val;  
216 - let sobj = {};  
217 - if (e.type == 'input' || e.type == 'confirm') {  
218 - val = util.val(e);  
219 - if (key == 'phone') {  
220 - var that = this;  
221 - if (e.detail.value != '' && e.detail.value.length >= 3) {  
222 - App.Reserve.GetReserveUser(  
223 - {  
224 - keywords: e.detail.value,  
225 - sid: this.sellerid  
226 - }  
227 - ).then(function (json) {  
228 - if (json.ret == 200 && json.data.length > 0) {  
229 - that.setData({  
230 - searchlist: json.data  
231 - })  
232 - } else {  
233 - that.setData({  
234 - searchlist: null  
235 - })  
236 - }  
237 - })  
238 - } else {  
239 - this.setData({  
240 - searchlist: null  
241 - })  
242 - }  
243 - }  
244 - if (key == 'pnum') {  
245 - sobj.pnumInputFocus = true;  
246 - }  
247 - } else {  
248 - val = util.attr(e, 'value');  
249 - }  
250 - if (key == 'time') {  
251 - if (this.data.timeOpt[val]) return;  
252 - }  
253 - if ((key == 'time' && this.data.form.time == val) || (key == 'date' && this.data.form.date == val)) {  
254 - if (util.attr(e, 'display') != 'block') {  
255 - return;  
256 - }  
257 - }  
258 - let form = this.data.form;  
259 -  
260 - if (key == 'tid') {  
261 - let ts = this.data.tables;  
262 - if (ts[val].isselect) {  
263 - ts[val].isselect = false;  
264 - form.tid.remove(ts[val].id);  
265 - delete this.checkedTables[ts[val].id]  
266 - } else {  
267 - ts[val].isselect = true;  
268 - form.tid.push(ts[val].id);  
269 - this.checkedTables[ts[val].id]=ts[val].name  
270 - }  
271 - sobj.tables = ts;  
272 - } else {  
273 - form[key] = val;  
274 - }  
275 - console.log('ts', sobj.tables,this.checkedTables);  
276 - //console.log(e.type,key,val,form);  
277 - sobj.form = form;  
278 - sobj.buttonhide = this.data.buttonhide;  
279 - if (form.tid.length > 0 && form.rname.length > 0) {  
280 - sobj.buttonhide = false;  
281 - }else{  
282 - sobj.buttonhide = true;  
283 - }  
284 - let displayTimes = false;  
285 - if (key == 'time') {  
286 - if (util.attr(e, 'display') == 'block') {  
287 - displayTimes = true;  
288 - sobj.timePickerMask = true;  
289 - }  
290 - }  
291 - if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {  
292 - if (!displayTimes) {  
293 - //sobj.form.tid = []; //切换日期时间清空桌位  
294 - //sobj.buttonhide = true;  
295 - this.getTables();  
296 - }  
297 - if (key == 'date') {  
298 - let xtime = util.unixtoTime(new Date() / 1000, 'YYYY-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');  
299 - this.setDateStr(util.timetouUnix(xtime));  
300 - }  
301 - }  
302 - //判断hasUseDefDtime  
303 - if ((key == 'time' || key == 'date') && !sobj.timePickerMask) {  
304 - sobj.hasUseDefDtime = true  
305 - }  
306 - if (this.data.form.date == 0) {//  
307 - let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');  
308 - if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) {  
309 - sobj.hasUseDefDtime = false;  
310 - }  
311 - }  
312 - this.setData(sobj)  
313 - },  
314 - async getTables(){  
315 - let form = this.data.form;  
316 - let tableid = util.cache('tableid');  
317 - console.log('getTables-tableid', tableid.length, this.reserve_id);  
318 - //if (tableid.length < 1 && this.reserve_id) {  
319 - if (tableid.length < 1) {  
320 - tableid = this.data.form.tid;  
321 - }  
322 - console.log('getTables-tableid', tableid, tableid.length);  
323 - try {  
324 - let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time);  
325 - console.log('rdate', this.data.dateStr[this.data.form.date], rdate);  
326 - App.Reserve.GetTableList({  
327 - sid: util.cache('enter_params')['seller_id'],  
328 - //pnum_str:form.pnum_str,  
329 - pnum: form.pnum,  
330 - rdate: rdate,  
331 - tid: form.tabid,  
332 - rid: this.reserve_id,  
333 - }).then(res => {  
334 - let tables = [];  
335 - let tablesLength = 0;  
336 - if (tableid.length > 0) {  
337 - let toastTables={...this.checkedTables}  
338 - let resData=res.data.slice(1,res.data.length);  
339 - console.log('resData',resData)  
340 - resData.forEach(p => {  
341 - //if(tables.length>=3) return true;  
342 - p.list.forEach(t => {  
343 - delete toastTables[t.id]  
344 - tablesLength++;  
345 - if (tables.length >= 3) return true;  
346 - if (tableid._indexOf(t.id) > -1) {  
347 - t.isselect = true;  
348 - tables.push(t);  
349 - }  
350 - })  
351 - })  
352 - console.log('toastTables',toastTables,this.data.form.tid,this.checkedTables);  
353 - //清理已选中的桌位  
354 - let toastTablesInfo=[];  
355 - let tid=this.data.form.tid  
356 - Object.keys(this.checkedTables).forEach(ckid=>{  
357 - if(toastTables[ckid]){  
358 - delete this.checkedTables[ckid]  
359 - tid.remove(ckid);  
360 - toastTablesInfo.push(toastTables[ckid]);  
361 - }  
362 - })  
363 - if(toastTablesInfo.length>0){  
364 - this.setData({  
365 - [`form.tid`]:tid,  
366 - })  
367 - util.toast(toastTablesInfo.toString()+'已被占用啦','none');  
368 - }  
369 - wx.removeStorage({key: 'tableid'})  
370 - }  
371 - console.log('tables-first',tables);  
372 - if(tables.length<1){  
373 - tablesLength=0;  
374 - let fortids=[];  
375 - res.data.forEach((p,ri) => {  
376 - p.list.forEach(t => {  
377 - if(fortids._indexOf(t.id)<0) {  
378 - tablesLength++;  
379 - tables.push(t);  
380 - fortids.push(t.id);  
381 - }  
382 - })  
383 - })  
384 - if (tables.length >= 3) {  
385 - tables = tables.slice(0, 3);  
386 - }  
387 - }  
388 - this.tablesLength = tablesLength;  
389 - this.setData({  
390 - tables: tables,  
391 - tablesLength: tablesLength  
392 - })  
393 - })  
394 - } catch (e) {  
395 - this.setData({  
396 - tables: []  
397 - })  
398 - }  
399 - },  
400 - async formsubmit(){  
401 - if (this.data.buttonhide) return;  
402 - try {  
403 - let d_stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]];  
404 - let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],  
405 - this.data.form.time, d_stimestr);  
406 - let stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[0]];  
407 - let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],  
408 - this.data.form.time, stimestr);  
409 - console.log('stimestr', stimestr, this.data.form.time, this.data.timePickerIndex);  
410 - console.log('rdate', rdate);  
411 - this.setData({  
412 - buttonhide: true,  
413 - })  
414 - let form = JSON.parse(JSON.stringify(this.data.form));  
415 - console.log('typeof form.tid', typeof form.tid);  
416 - if (typeof form.tid == 'object') {  
417 - let tid = new Set(form.tid);//tid 去重  
418 - form.tid = [...tid].toString();  
419 - }  
420 - if (!form.tid) {  
421 - return util.toast('请选择桌子', 'none');  
422 - }  
423 - if (!form.rname) {  
424 - return util.toast('请填写预订人', 'none');  
425 - }  
426 - form.sid = this.sellerid;  
427 - form.rdate = rdate  
428 -  
429 - try {  
430 - let enter_params = util.cache('enter_params');  
431 - let sc = (await App.Reserve.SellerInfo(enter_params)).data  
432 - let note_openid = enter_params.seller_openid;  
433 - let note_name = sc.seller_user.nick_name || sc.seller_user.nickname;  
434 - form.note_openid = note_openid || '';  
435 - if (form.rid) {//修改时传递uid  
436 - form.note_openid = enter_params.manager_id || '';  
437 - }  
438 - form.note_name = note_name || '';  
439 - } catch (e) {}  
440 -  
441 - form.ddate = d_rdate.substr(0, 10);  
442 - if (this.data.hasUseDefDtime && this.data.form.time > 0) {//转为默认时间  
443 - let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00");  
444 - form.ddate = util.timetouUnix(ddateStr);  
445 - }  
446 - App.Reserve.SetReserveInfo(form).then(res => {  
447 - if (res.ret == 200) {  
448 - this.getCustomRemark()  
449 - let _id = (res.data.id || res.data)  
450 - this.setData({  
451 - form: JSON.parse(JSON.stringify(formTpl)),  
452 - tables: [],  
453 - timePickerIndex: [0, 0, 0],  
454 - })  
455 - this.initLoad();  
456 - this.checkedTables={};  
457 - App.Reserve.Detail({rid: _id, openid: ''}, 'clear')  
458 - wx.navigateTo({  
459 - url: util.http_build_query({id:_id,tplid:1},'b_invitation'),  
460 - });  
461 - } else {  
462 - util.toast(res.msg, 'none')  
463 - }  
464 - })  
465 - } catch (e) {  
466 - }  
467 - },  
468 - selectphone: function (e) {  
469 - this.data.form.phone = e.detail.phone;  
470 - this.data.form.rname = e.detail.rname;  
471 - this.data.form.cusdem = e.detail.cusdem;  
472 - var form = this.data.form  
473 - this.data.form.sex = e.detail.sex;  
474 - this.setData({  
475 - form: this.data.form,  
476 - searchlist: null  
477 - })  
478 - this.conditionInfo();  
479 - },  
480 - calendarShow(){  
481 - this.setData({  
482 - calendarMask: true  
483 - })  
484 - },  
485 - dateChange(event){  
486 - console.log(event);  
487 - //let cktime=util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day)  
488 - let cktime = util.timetouUnix(event.detail.date)  
489 - let day0 = parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000);  
490 - // if (cktime < day0) {  
491 - // util.toast('请选择有效日期', 'none');  
492 - // return;  
493 - // }  
494 - let clickDay = event.detail.date.substr(8, 2);  
495 - let changeDay = `dayStyle[1].day`;  
496 - let changeBg = `dayStyle[1].background`;  
497 - this.setData({  
498 - [changeDay]: clickDay,  
499 - [changeBg]: "#84e7d0",  
500 - //[`form.tid`]: [], //切换日期时间清空桌位  
501 - //buttonhide: true,  
502 - })  
503 - console.log('cktime',cktime,util.unixtoTime(cktime,'YYYY-MM-DD'))  
504 - this.setDateStr(cktime == day0 ? new Date() / 1000 : cktime)  
505 - this.calendarClose();  
506 - setTimeout(res=>{  
507 - this.getTables();  
508 - },10)  
509 -  
510 - },  
511 - calendarClose(){  
512 - this.setData({  
513 - calendarMask: false,  
514 - timePickerMask: false,  
515 - })  
516 - },  
517 - async selectdesk(){  
518 - let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time);  
519 - console.log(this.data.form)  
520 - wx.navigateTo({  
521 - url: 'b_desk?rdate=' + rdate + '&tid=' + this.data.form.tabid  
522 - //+'&pnum_str='+this.data.form.pnum_str  
523 - + '&pnum=' + this.data.form.pnum  
524 - + '&checked_tids=' + this.data.form.tid  
525 - + '&rid=' + this.reserve_id  
526 - })  
527 - },  
528 - conditionInfo: function () {  
529 - var form = this.data.form  
530 - if (form.tid.length > 0 && form.rname.length > 0) {  
531 - this.data.buttonhide = false;  
532 - }  
533 - this.setData({  
534 - buttonhide: this.data.buttonhide  
535 - })  
536 - },  
537 - /**  
538 - * 选中时间区域  
539 - */  
540 - bindTimePickerChange(e){  
541 - let timeIndex = util.attr(e, 'timeIndex');  
542 - if (timeIndex < 0) return;  
543 - let timePickerIndex = this.data.timePickerIndex;  
544 - //timePickerIndex[timeIndex]=util.val(e);  
545 - timePickerIndex[timeIndex] = util.attr(e, 'val');  
546 -  
547 - console.log(e, timeIndex, util.attr(e, 'val'));  
548 - this.setData({  
549 - timePickerIndex: timePickerIndex,  
550 - hasUseDefDtime: false,  
551 - })  
552 - },  
553 - /**  
554 - * 修改初始化  
555 - */  
556 - async initModify(id){  
557 - try {  
558 - let res = await App.Reserve.Detail({rid: id, openid: ''});  
559 -  
560 - console.log('initModify', res);  
561 - //设置日期  
562 - let obj = await this.setDateStr(res.data.ddate);  
563 - //设置时间  
564 - let nd = util.unixtoTime(res.data.ddate, 'HH:II');  
565 - let timePickerIndex = this.data.timePickerIndex  
566 - console.log('initModify-', this.data.timePickerArray, obj.form.time, nd)  
567 - this.data.timePickerArray[obj.form.time].forEach((dd, ii) => {  
568 - console.log('initModify-', nd, dd)  
569 - if (nd == dd) {  
570 - timePickerIndex[obj.form.time] = ii;  
571 - return true;  
572 - }  
573 - })  
574 -  
575 - console.log('initModify-timePickerIndex', timePickerIndex);  
576 - //obj.form.pnum_str=res.data.pnum_str;  
577 - obj.form.pnum = res.data.pnum || 6;  
578 - obj.form.rname = res.data.rname;  
579 - obj.form.phone = res.data.phone || "";  
580 - obj.form.sex = res.data.sex;  
581 - obj.form.cusdem = res.data.cusdem;  
582 - obj.form.rid = id;  
583 - obj.form.tid = [];  
584 - let tablesed = [];  
585 - res.data.tables.forEach((t, ti) => {  
586 - obj.form.tid.push(t.id)  
587 - if (ti >= 3) return;  
588 - t.isselect = true  
589 - t["isselected"] = 1  
590 - tablesed.push(t);  
591 - this.checkedTables[t.id]=t.name;  
592 - })  
593 - this.setData({  
594 - timePickerIndex: timePickerIndex,  
595 - form: obj.form,  
596 - //tablesed:tablesed,  
597 - hasUseDefDtime: false,  
598 - })  
599 - setTimeout(() => {  
600 - this.getTables();  
601 - }, 300)  
602 -  
603 - } catch (e) {  
604 - console.log('initModify', e)  
605 - }  
606 - },  
607 - pnumInputFocusEvent(e){  
608 - console.log(e);  
609 - this.setData({  
610 - pnumInputFocus: 'focus' == e.type  
611 - })  
612 - },  
613 - inputFocusTime: 0,  
614 - blurTime: 0,  
615 - inputFocus(e){  
616 - console.log(e, this.inputFocusTime);  
617 - return;  
618 - if (e.timeStamp > this.inputFocusTime) {  
619 - this.inputFocusTime = e.timeStamp;  
620 - if (e.type == 'focus' && this.data.pageMarginBottom == 0) {  
621 - this.setData({  
622 - pageMarginBottom: 300  
623 - })  
624 - setTimeout(res => {  
625 - this.pageScrollToBottom();  
626 - }, 100)  
627 - } else {  
628 - if (this.blurTime > 5) {  
629 - this.blurTime = 0;  
630 - this.setData({  
631 - pageMarginBottom: 0  
632 - })  
633 - } else {  
634 - setTimeout(res => {  
635 - this.blurTime += 1;  
636 - this.inputFocus(e);  
637 - }, 300)  
638 - }  
639 -  
640 - }  
641 -  
642 - }  
643 - },  
644 - pageScrollToBottom: function () {  
645 - wx.createSelectorQuery().select('#j_page').boundingClientRect(function (rect) {  
646 - // 使页面滚动到底部  
647 - wx.pageScrollTo({  
648 - scrollTop: rect.bottom  
649 - })  
650 - }).exec()  
651 - },  
652 - gotoday(e){  
653 - this.setData({  
654 - [`calendar.nextNum`]: 0  
655 - })  
656 - },  
657 - nextMonth(e){  
658 - this.setData({  
659 - [`calendar.nextNum`]: this.data.calendar.nextNum + 1  
660 - })  
661 - },  
662 - prevMonth(e){  
663 - this.setData({  
664 - [`calendar.nextNum`]: this.data.calendar.nextNum - 1  
665 - })  
666 - },  
667 - /**  
668 - * 快速预定初始化  
669 - * tid  
670 - * tname  
671 - * ddate  
672 - * pnum  
673 - */  
674 - async initQuick(options){  
675 - try {  
676 - console.log('initQuick', options);  
677 - this.checkedTables[options.tid]=options.tname  
678 - options.ddate=options.ddate.substr(0,10);  
679 - //设置日期  
680 - let obj = await this.setDateStr(options.ddate);  
681 - //设置时间  
682 - let nd = util.unixtoTime(options.ddate, 'HH:II');  
683 - let timePickerIndex = this.data.timePickerIndex  
684 - console.log('initQuick-', this.data.timePickerArray, obj.form.time, nd)  
685 - this.data.timePickerArray[obj.form.time].forEach((dd, ii) => {  
686 - console.log('initQuick-', nd, dd)  
687 - if (nd == dd) {  
688 - timePickerIndex[obj.form.time] = ii;  
689 - return true;  
690 - }  
691 - })  
692 -  
693 - console.log('initQuick-timePickerIndex', timePickerIndex);  
694 - obj.form.pnum = options.pnum || 6;  
695 - obj.form.rname = "";  
696 - obj.form.phone = "";  
697 - obj.form.sex = 1;  
698 - obj.form.cusdem = "";  
699 - obj.form.rid = "";  
700 - obj.form.tid = [options.tid];  
701 - this.setData({  
702 - timePickerIndex: timePickerIndex,  
703 - form: obj.form,  
704 - hasUseDefDtime: false,  
705 - })  
706 - setTimeout(() => {  
707 - this.getTables();  
708 - }, 300)  
709 -  
710 - } catch (e) {  
711 - console.log('initQuick', e)  
712 - }  
713 - },  
714 - getCustomRemark(){  
715 - App.User.GetCustomRemark({  
716 - uid:util.cache('enter_params')['manager_id'],  
717 - }).then(res=>{  
718 - let CustomRemark=[];  
719 - res.data.forEach(r=>{  
720 - if(r.often_use){  
721 - CustomRemark.push(r);  
722 - }  
723 - })  
724 - this.setData({  
725 - CustomRemark:CustomRemark,  
726 - })  
727 - })  
728 - },  
729 - oftenUse(e){  
730 - let id=util.attr(e,'id');  
731 - let val=util.attr(e,'value');  
732 - let CustomRemark=this.data.CustomRemark;  
733 - let form=this.data.form;  
734 - CustomRemark.forEach(r=>{  
735 - if(id==r.id){  
736 - if(r.active){  
737 - form.cusdem=form.cusdem.replace(val+'、','')  
738 - }  
739 - r.active=!r.active  
740 - if(r.active){  
741 - form.cusdem+=val+'、'  
742 - }  
743 - }  
744 - })  
745 - this.setData({  
746 - CustomRemark:CustomRemark,  
747 - form:form,  
748 - })  
749 - this.conditionInfo()  
750 - },  
751 - CustomRemarkMore(){  
752 - this.setData({  
753 - CustomRemarkMoreMask:!this.data.CustomRemarkMoreMask  
754 - })  
755 - }  
756 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "nothingBook":"/components/book/nothing/nothing",  
7 - "bookList":"/components/book/list/list",  
8 - "nav":"/components/nav/nav",  
9 - "tabBar":"/components/book/tabBar/tabBar",  
10 - "searchList":"/components/searchlist/searchlist",  
11 - "calendar": "plugin://bmCalendar/calendar",  
12 - "board":"/components/book/board/board",  
13 - "formids":"/components/formids/formids",  
14 - "a2l":"/components/tips/add-to-lite"  
15 - }  
16 -}  
1 -<!--pages/book/b_addnew.wxml-->  
2 -<nav>录入订座信息</nav>  
3 -<view class="page" style="margin-bottom: {{pageMarginBottom}}rpx;" id="j_page">  
4 - <view class="base-info">  
5 - <!--  
6 - <view class="section flex-lr date">  
7 - <view class="flex-rr" style="width:100%;">  
8 - <item class="date-item {{form.date==0?'checked':''}}"  
9 - bindtap="selectedValue" data-key="date" data-value="0">  
10 - <view class="date-item-text">{{dateStr[0]}}</view>  
11 - </item>  
12 - <item class="date-item {{form.date==1?'checked':''}}"  
13 - bindtap="selectedValue" data-key="date" data-value="1">  
14 - <view class="date-item-text">{{dateStr[1]}}</view>  
15 - </item>  
16 - </view>  
17 - <view class="more flex-ll" bindtap="calendarShow">  
18 - <view></view>  
19 - <view></view>  
20 - <view></view>  
21 - </view>  
22 - </view>  
23 - -->  
24 - <view class="section">  
25 - <view class="tab flex-ll">  
26 - <formids class="item {{form.date==0?'checked':''}}"  
27 - bindtap="selectedValue" data-key="date" data-value="0">  
28 - {{dateStr[0]}}  
29 - </formids>  
30 - <formids class="item {{form.date==1?'checked':''}}"  
31 - bindtap="selectedValue" data-key="date" data-value="1">  
32 - {{dateStr[1]}}  
33 - </formids>  
34 - <view class="item {{form.date==2?'checked':''}} flex-lr"  
35 - bindtap="selectedValue" data-key="date" data-value="2" bindtap="calendarShow">  
36 - <view style="width: 80%" class="item-text">{{dateStr[2]||'其他'}}</view>  
37 - <image  
38 - src="http://qn.colorcun.com/custom/lite-yd/image/date{{dateStr[2]?'.selected':''}}.png"  
39 - style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image>  
40 - </view>  
41 - </view>  
42 - </view>  
43 - <view class="section ">  
44 - <view class="tab flex-ll">  
45 - <formids class="item {{form.time==0?'checked':''}} {{timeOpt[0]}}"  
46 - wx:if="{{timePickerArray[0].length>0}}"  
47 - bindtap="selectedValue" data-key="time" data-value="0">  
48 - <view class="picker">早市</view>  
49 - </formids>  
50 - <formids class="item {{form.time==1?'checked':''}} {{timeOpt[1]}}"  
51 - wx:if="{{timePickerArray[1].length>0}}"  
52 - bindtap="selectedValue" data-key="time" data-value="1">  
53 - <view class="picker">午市</view>  
54 - </formids>  
55 - <formids class="item {{form.time==2?'checked':''}} {{timeOpt[2]}}"  
56 - wx:if="{{timePickerArray[2].length>0}}"  
57 - bindtap="selectedValue" data-key="time" data-value="2">  
58 - <view class="picker">晚市</view>  
59 - </formids>  
60 - </view>  
61 - </view>  
62 - <view class="section" style="height: 90rpx;">  
63 - <view class="tab flex-lr">  
64 - <view class="tab flex-ll">  
65 - <formids class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key"  
66 - bindtap="selectedValue" data-key="pnum" data-value="{{item}}">  
67 - <view class="pnum">{{item}}</view>  
68 - </formids>  
69 - </view>  
70 - <view class="tab" style="margin-left: 20rpx;">  
71 - <view class="item {{form.pnum<6 || form.pnum>10?'checked':''}} flex-lr"  
72 - data-key="pnum" data-value="{{form.pnum}}">  
73 - <view style="width: 80%" class="pnum">  
74 - <input  
75 - bindinput="selectedValue" bindconfirm="selectedValue"  
76 - bindblur="pnumInputFocusEvent"  
77 - data-key="pnum" value="{{(form.pnum<6 || form.pnum>10) || pnumInputFocus?form.pnum:''}}"  
78 - placeholder-class="placeholder-class-pnum"  
79 - maxlength="3" type="number"  
80 - placeholder="{{form.pnum<6 || form.pnum>10?form.pnum:''}} 更多"/>  
81 -  
82 - </view>  
83 - <image  
84 - src="http://qn.colorcun.com/custom/lite-yd/image/pnum{{form.pnum<6 || form.pnum>10?'.selected':''}}.png"  
85 - style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image>  
86 - </view>  
87 - </view>  
88 - </view>  
89 - </view>  
90 - <!--  
91 - <view class="section ">  
92 - <view class="tab flex-ll">  
93 - <view class="item {{form.pnum_str=='1-4'?'checked':''}}"  
94 - bindtap="selectedValue" data-key="pnum_str" data-value="1-4">  
95 - 4人以下  
96 - </view>  
97 - <view class="item {{form.pnum_str=='5-9'?'checked':''}}"  
98 - bindtap="selectedValue" data-key="pnum_str" data-value="5-9">  
99 - 5~9人  
100 - </view>  
101 - <view class="item {{form.pnum_str=='10-99'?'checked':''}}"  
102 - bindtap="selectedValue" data-key="pnum_str" data-value="10-99">  
103 - 10人以上  
104 - </view>  
105 - </view>  
106 - </view>  
107 - <view class="section ">  
108 - <view class="tab flex-ll">  
109 - <view class="item {{form.tabid=='2'?'checked':''}}"  
110 - bindtap="selectedValue" data-key="tabid" data-value="2">  
111 - 包间  
112 - </view>  
113 - <view class="item {{form.tabid=='1'?'checked':''}}"  
114 - bindtap="selectedValue" data-key="tabid" data-value="1">  
115 - 散座  
116 - </view>  
117 - </view>  
118 - </view>  
119 - -->  
120 - </view>  
121 -  
122 - <view class="page-full tables">  
123 - <view class="page" style="margin-top: 0">  
124 - <view class="title flex-lr">  
125 - <view>可订桌位<text wx:if="{{tables.length>0}}"> ({{tablesLength}})</text></view>  
126 - <view class="flex-rr advice-more" bindtap="selectdesk" wx:if="{{tablesLength>1}}">  
127 - <view style="padding-right:20rpx;" class="gray-deep-font font26r">更多</view>  
128 - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image>  
129 - </view>  
130 - </view>  
131 - <view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}">  
132 - <block wx:for="{{tablesed||tables}}" wx:key="tables.key">  
133 - <board width="160" height="180" board="{{item}}"  
134 - style="margin: 20rpx 0 0 20rpx"  
135 - event="boardChoose" className="noBottom"  
136 - data-value="{{index}}"  
137 - bindtap="selectedValue"  
138 - data-key="tid"></board>  
139 - </block>  
140 - </view>  
141 - <view class="advice-desk-detail flex-cc" wx:else="">  
142 - 没有符合条件的桌位!  
143 - </view>  
144 - </view>  
145 - </view>  
146 - <view class="book-info">  
147 - <view class="book-info-single flex-lr" style="align-items:flex-start;position:relative;z-index:10;">  
148 - <input placeholder="客户电话" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11"  
149 - bindinput="selectedValue"  
150 - bindconfirm="selectedValue"  
151 - data-key="phone"  
152 - value="{{form.phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:{{reminder ? 400 : 680}}rpx;" cursor-spacing="260"/>  
153 - <view bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block" style="color:#199095">  
154 - <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:if="{{hasUseDefDtime && form.time>0}}">{{defDtime[form.time]}}</view>  
155 - <view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:else="">{{timePickerArray[form.time][timePickerIndex[form.time]]}}</view>  
156 - </view>  
157 - <block wx:if="{{searchlist}}">  
158 - <searchList searchlist="{{searchlist}}" bind:selectphone="selectphone"></searchList>  
159 - </block>  
160 - </view>  
161 - <view class="book-info-single flex-lr" style="align-items:flex-start;">  
162 - <input placeholder="客户姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r"  
163 - maxlength="12" style="width:450rpx;" value="{{form.rname}}"  
164 - bindinput="selectedValue"  
165 - bindconfirm="selectedValue"  
166 - bindfocus="inputFocus"  
167 - bindblur="inputFocus"  
168 - data-key="rname"/>  
169 - <view class="book-info-grand flex-rr font28r gray-deep-font">  
170 - <block wx:for="{{grand}}" wx:key="grand.key">  
171 - <view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}"  
172 - bindtap="selectedValue"  
173 - data-value="{{item.sex}}"  
174 - data-key="sex">{{item.grand_title}}</view>  
175 - </block>  
176 - </view>  
177 - </view>  
178 -  
179 - <view class="book-info-single flex-lr">  
180 - <input placeholder="客户要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}"  
181 - bindinput="selectedValue"  
182 - bindconfirm="selectedValue"  
183 - bindfocus="inputFocus"  
184 - bindblur="inputFocus"  
185 - data-key="cusdem"/>  
186 - <view class="CustomRemarkMore flex-rr">  
187 - <view bindtap="CustomRemarkMore">快速备注</view>  
188 - </view>  
189 - </view>  
190 - <view wx:if="{{CustomRemark.length>0}}" class="book-info-single last" style="padding-top: 14rpx; height: 60rpx;">  
191 - <view class="flex-lr CustomRemark">  
192 - <view class="CustomRemarks">  
193 - <view class="CustomRemarksView">  
194 - <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"  
195 - bindtap="oftenUse"  
196 - data-id="{{item.id}}"  
197 - data-value="{{item.often_use}}">{{item.often_use}}</view>  
198 - </view>  
199 - </view>  
200 - </view>  
201 - </view>  
202 - </view>  
203 - <view class="page-full submit">  
204 - <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">完成预订</view>  
205 - </view>  
206 -</view>  
207 -<tabBar></tabBar>  
208 -<view class="calendar-mask" bindtap="calendarClose"  
209 - style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}">  
210 - <view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;">  
211 - <calendar catchtap="catchtap"  
212 - isTodaybtn="{{true}}" todaybtn_txt="回到今天"  
213 - custom="{{false}}"  
214 - switchover="{{['上一月','下个月']}}"  
215 - active-coloro="active-coloro"  
216 - active-colort="active-colort"  
217 - speciallist="{{speciallist}}"  
218 - txt_style="txt-style"  
219 - calendar-style="calendar"  
220 - header-style="calendar-header"  
221 - weektitle-style="weektitle-style"  
222 - restcolor-style="restcolor-style"  
223 - txt_type="cn-d"  
224 -  
225 - datefont-style="datefont-style"  
226 - todaybtn-style="todaybtn-style"  
227 -  
228 - bindnextMonth="nextMonth"  
229 - bindprevMonth="prevMonth"  
230 - bindselectDate="dateChange"  
231 - bindgotoday="gotoday"  
232 -  
233 - prev="{{true||calendar.nextNum>0}}"  
234 - circle_show="{{false}}"  
235 - closelaststyle="{{true}}"  
236 - ></calendar>  
237 - </view>  
238 -</view>  
239 -<view class="calendar-mask" bindtap="calendarClose"  
240 - style="height:100%;" wx:if="{{timePickerMask}}">  
241 - <view class="timePicker">  
242 - <view class="flex-rr">  
243 - <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="calendarClose"></image>  
244 - </view>  
245 - <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;">  
246 - <view bindtap="calendarClose">{{form.time==1?'午市':form.time==2?'晚市':'早市'}}</view>  
247 - </view>  
248 - <view class="flex-ll" style="flex-wrap:wrap">  
249 - <view class="time-item {{timePickerIndex[form.time]==index?'checked':''}}"  
250 - style="{{(index+1)%3==0?'margin-right:0;':''}}"  
251 - wx:for="{{timePickerArray[form.time]}}" wx:key=""  
252 - bindtap="bindTimePickerChange"  
253 - data-time-index="{{form.time}}"  
254 - data-val="{{index}}"  
255 - >{{item}}</view>  
256 - </view>  
257 - </view>  
258 -</view>  
259 -  
260 -<view class="calendar-mask" bindtap="CustomRemarkMore"  
261 - style="height:100%;" wx:if="{{CustomRemarkMoreMask}}">  
262 - <view class="timePicker" catchtap="catchtap">  
263 - <view class="flex-rr">  
264 - <image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="CustomRemarkMore"></image>  
265 - </view>  
266 - <view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;">  
267 - <view bindtap="calendarClose">更多标签</view>  
268 - </view>  
269 - <view class="flex-ll" style="flex-wrap:wrap;width: 110%; margin-left: -5%; max-height: 700rpx;overflow-y: auto;">  
270 - <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"  
271 - wx:if="{{item.often_use}}" bindtap="oftenUse"  
272 - data-id="{{item.id}}"  
273 - data-value="{{item.often_use}}">{{item.often_use}}</view>  
274 - </view>  
275 - </view>  
276 -</view>  
277 -<a2l bgColor="#199095"></a2l>  
1 -/* pages/book/b_addnew.wxss */  
2 -.page{  
3 - width: 90%;  
4 - margin: 20rpx 4% 0;  
5 -  
6 -}  
7 -.base-info{  
8 -  
9 -}  
10 -.section{  
11 - height: 110rpx;  
12 -}  
13 -.section .label{  
14 - width: 60rpx;  
15 - font-size: 30rpx;  
16 - margin-right: 38rpx;  
17 -}  
18 -.date{  
19 - color:#199095;  
20 - width: 100%;  
21 - font-size: 38rpx;  
22 - font-weight: bold;  
23 -}  
24 -.date-item{  
25 - width: 50%;  
26 -}  
27 -.date-item-text{  
28 - height: 60rpx;  
29 - line-height: 60rpx;  
30 - border-bottom: 4rpx solid rgba(0,0,0,0);  
31 - width: 200rpx;  
32 - text-align: center;  
33 - color: #666666;  
34 -}  
35 -.checked .date-item-text{  
36 - border-bottom: 4rpx solid #199095;  
37 - color: #199095;  
38 -}  
39 -.date .more{  
40 - width: 65rpx;  
41 - min-width: 65rpx;  
42 - height: 60rpx;  
43 -}  
44 -.date .more view{  
45 - width: 12rpx;  
46 - height: 12rpx;  
47 - border-radius: 50%;  
48 - margin-right: 12rpx;  
49 - background-color: #999;  
50 -}  
51 -.section .tab{  
52 - font-size: 34rpx;  
53 - color: #199095;  
54 -}  
55 -.section .tab .item{  
56 - height: 50rpx;  
57 - line-height: 49rpx;  
58 - width: 210rpx !important;  
59 - min-width: 210rpx !important;  
60 - border-radius: 10rpx;  
61 - border: 2rpx solid #199095;  
62 - margin-right: 20rpx;  
63 - text-align: center;  
64 -}  
65 -.section .tab .item .item-text,.section .tab .item .picker{  
66 - height: 46rpx;  
67 - line-height: 46rpx;  
68 -}  
69 -.section .tab .item .picker{  
70 - width:210rpx;  
71 - text-align: center;  
72 -}  
73 -.section .tab .item-pnum{  
74 - height: 50rpx;  
75 - line-height: 50rpx;  
76 - width: 60rpx !important;  
77 - min-width: 60rpx !important;  
78 - border-radius: 10rpx;  
79 - border: 2rpx solid #199095;  
80 - margin-right: 32rpx;  
81 - text-align: center;  
82 -}  
83 -.section .tab .item-pnum .pnum,.section .tab .item .pnum input{  
84 - height: 46rpx;  
85 - line-height: 46rpx;  
86 - font-size: 34rpx;  
87 -}  
88 -.section .tab .item:last-child{  
89 - margin-right: 0;  
90 -}  
91 -.section .tab .item-pnum:last-child{  
92 - margin-right: 0;  
93 -}  
94 -.section .tab .checked{  
95 - background-color:#199095;  
96 - color: #FEFEFE;  
97 - border: 2rpx solid #199095;  
98 -}  
99 -.section .tab .disabled{  
100 - background-color:#999999;  
101 - color: #efefef;  
102 - border: 2rpx solid #999999;  
103 -}  
104 -  
105 -/**  
106 -可定桌位  
107 - */  
108 -.page-full{  
109 - width: 112%;  
110 - margin-left: -6%;  
111 - background-color: #F5F5F5;  
112 -}  
113 -.tables{  
114 - height: 314rpx;  
115 - font-size: 30rpx;  
116 -}  
117 -.tables .title{  
118 - padding-top: 36rpx;  
119 - height: 42rpx;  
120 - line-height: 42rpx;  
121 -}  
122 -.advice-desk-detail{  
123 - height: 220rpx;  
124 - width:100%;  
125 -}  
126 -.order-desk-info{  
127 - width:160rpx;  
128 - min-width: 160rpx;  
129 - height:160rpx;  
130 - background:#A9E3E6;  
131 - border:1px solid #A9E3E6;  
132 - border-radius:10rpx;  
133 - position:relative;  
134 - overflow:hidden;  
135 - margin-left:22rpx;  
136 -}  
137 -.desk-checked{  
138 - border:1px solid #199095;  
139 -}  
140 -.advice-desk-detail .order-desk-info:first-child{  
141 - margin-left:0;  
142 -}  
143 -.desk-active{  
144 - position: absolute;  
145 - top: -2rpx;  
146 - right: -2rpx;  
147 -}  
148 -.order-desk-type{  
149 - height:30rpx;  
150 - line-height: 30rpx;  
151 - background:#61A5D1;  
152 - position:absolute;  
153 - left:0;  
154 - top:0;  
155 - font-size: 26rpx;  
156 - padding: 0 12rpx 4rpx 8rpx;  
157 - border-radius: 0 16rpx 16rpx 0;  
158 -}  
159 -.advice-more{  
160 - padding:20rpx 0;  
161 - padding-left:30rpx;  
162 -}  
163 -.cut{  
164 - width:100%;  
165 - height:4px;  
166 - background:#efeef3;  
167 -}  
168 -  
169 -  
170 -  
171 -/**  
172 -预定人信息  
173 - */  
174 -.book-info{  
175 - width:100%;  
176 - padding-top:20rpx;  
177 - margin:0 auto;  
178 - padding-bottom: 300rpx;  
179 -}  
180 -.book-info-single{  
181 - width:100%;  
182 - height:120rpx;  
183 - padding-top:40rpx;  
184 - border-bottom:1px solid #efeef3;  
185 -}  
186 -.book-info-single>input{  
187 - width:100%;  
188 - height:100rpx;  
189 -}  
190 -.book-info-grand{  
191 - height:50rpx;  
192 - border:1px solid #199095;  
193 - margin-top:20rpx;  
194 -}  
195 -.book-grand{  
196 - width:90rpx;  
197 - height:100%;  
198 - box-sizing:border-box;  
199 -}  
200 -.book-grand-active{  
201 - background:rgba(25,153,149,.8);  
202 -}  
203 -.book-grand-border{  
204 - border-right:1px solid #199095;  
205 -}  
206 -.book-grand-border:last-child{  
207 - border-width: 0;  
208 -}  
209 -.phone-reminder{  
210 - width:32rpx;  
211 - height:32rpx;  
212 - margin-left:20rpx;  
213 -}  
214 -  
215 -  
216 -/**  
217 -提交按钮  
218 - */  
219 -.submit{  
220 - position: fixed;  
221 - bottom: 120rpx;  
222 - left: 0;  
223 - right: 0;  
224 - height: 150rpx;  
225 - background-color: #fefefe;  
226 - z-index: 9;  
227 -}  
228 -.confirm-button{  
229 - width:680rpx;  
230 - height:85rpx;  
231 - background:#199095;  
232 - margin:42rpx auto 0;  
233 - border-radius:10rpx;  
234 - opacity:.6;  
235 -}  
236 -.confirm-button-active{  
237 - opacity:1;  
238 -}  
239 -  
240 -  
241 -@import "common/calendar.wxss";  
242 -  
243 -  
244 -  
245 -  
246 -.placeholder-class-pnum{  
247 - color:#199095;  
248 - font-size: 34rpx;  
249 -}  
250 -  
251 -.timePicker{  
252 - width: 80%;  
253 - overflow: hidden;  
254 - position: absolute;  
255 - bottom: 0;  
256 - border-top: 2rpx solid #ccc;  
257 - background-color: #FEFEFE;  
258 - padding: 20rpx 10% 80rpx;  
259 -}  
260 -.timePicker .time-item{  
261 - width: 150rpx;  
262 - height: 60rpx;  
263 - line-height: 60rpx;  
264 - font-size: 40rpx;  
265 - font-weight: bold;  
266 - color:#199095;  
267 - border: 2rpx solid #199095;  
268 - border-radius: 10rpx;  
269 - text-align: center;  
270 - margin-right: 66rpx;  
271 - margin-bottom: 60rpx;  
272 -}  
273 -.timePicker .time-item.checked{  
274 - background-color: #199095;  
275 - color:#fefefe;  
276 -}  
277 -.timePicker .close{  
278 - width: 50rpx;  
279 - height: 50rpx;  
280 - transform:rotate(45deg);  
281 - margin-top: -10rpx;  
282 - margin-right: -10%;  
283 -}  
284 -  
285 -.CustomRemark{  
286 - line-height: 60rpx;  
287 - overflow: hidden;  
288 -}  
289 -.CustomRemarks{  
290 - width: 100%;  
291 -}  
292 -.CustomRemarksView{  
293 - height: 60rpx;  
294 - overflow: hidden;  
295 -}  
296 -.CustomRemarkMore{  
297 - width: 200rpx;  
298 - min-width: 200rpx;  
299 - color:#199095;  
300 - font-size: 30rpx;  
301 -}  
302 -.CustomRemarkItem{  
303 - height: 48rpx;  
304 - line-height: 48rpx;  
305 - padding: 4rpx 14rpx;  
306 - background-color: #F5F5F5;  
307 - font-size: 30rpx;  
308 - color: #999999;  
309 - border-radius: 10rpx;  
310 - margin-right: 20rpx;  
311 - float: left;  
312 - margin-bottom: 40rpx;  
313 -}  
314 -.CustomRemarkItem:last-child{  
315 - margin-right: 0;  
316 -}  
317 -.CustomRemarkMore .CustomRemarkItem{  
318 - padding: 4rpx 24rpx;  
319 -}  
320 -.book-info-single.last{  
321 - border-width: 0;  
322 -}  
323 -.CustomRemarkItem.active{  
324 - background-color: #6AB6B9;  
325 - color: #FFFFFF;  
326 -}  
1 -import util from '../../utils/util';  
2 -import comm from '../../utils/bookCommon';  
3 -import App from '../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Page({  
6 - data:{  
7 - menu_active_id:''  
8 - },  
9 - checked_tids:[],  
10 - desks:[],  
11 - onLoad:function(opt){  
12 - console.log('onLoad',opt)  
13 - util.setBarTitle('选择桌位');  
14 - var radio=750/util.getsystem().windowWidth;  
15 - var contentHeight=util.getsystem().windowHeight-Math.ceil(350/radio);  
16 - if(opt.tid==0){  
17 - delete opt.tid  
18 - }  
19 - if(opt.checked_tids){  
20 - this.checked_tids=opt.checked_tids.split(',')  
21 - util.cache('tableid',this.checked_tids)  
22 - }  
23 - this.setData({  
24 - sellerid:util.cache('sellerid'),  
25 - opt:opt,  
26 - hasCheckedTable:this.checked_tids.length>0  
27 - })  
28 - this.getdesklist();  
29 - },  
30 - onShow:function(){  
31 - this.setData({  
32 - height:getApp().system.windowHeight-55  
33 - })  
34 - },  
35 - changedesk:function(e){  
36 - let tableid=util.cache('tableid');  
37 - this.checked_tids= tableid && tableid.length>0?tableid:[];  
38 - this.setData({  
39 - hasCheckedTable:this.checked_tids.length>0  
40 - })  
41 - },  
42 - back:function(){  
43 - this.setData({  
44 - buttonClick:true  
45 - })  
46 - //wx.removeStorage({key:'tableid'})  
47 - wx.navigateBack();  
48 - },  
49 - getdesklist:function(){  
50 - var formdata=this.data.opt;  
51 - formdata.sid=this.data.sellerid;  
52 - var that=this;  
53 - App.Reserve.GetTableList(formdata).then(function (json) {  
54 - if(json.ret==200){  
55 - console.log('this.checked_tids',that.checked_tids);  
56 - that.desks=json.data  
57 - that.formatDesklist(true)  
58 - }  
59 - })  
60 - },  
61 - formatDesklist(hasFirst=true){  
62 - let desks=this.desks;  
63 - if(desks.length>0){  
64 - desks.forEach((v,i)=>{  
65 - v.list.forEach((r,n)=>{  
66 - r.isselect=false  
67 - if(this.checked_tids._indexOf(r.id)>-1){  
68 - r.isselect=true;  
69 - }  
70 - })  
71 - })  
72 - let param={  
73 - desklist:desks,  
74 - }  
75 - if(hasFirst){  
76 - param.menu_active_id=desks[0].name  
77 - }  
78 - this.setData(param)  
79 - }  
80 - return desks;  
81 - },  
82 - switchMenu(e){  
83 -  
84 - this.formatDesklist(false)  
85 - this.setData({  
86 - menu_active_id:util.attr(e,'id')  
87 - })  
88 - },  
89 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "selectPeople":"/components/book/people/people",  
7 - "orderDesk":"/components/book/desk/desk",  
8 - "nav":"/components/nav/nav"  
9 - }  
10 -}  
1 -<nav>选择桌位</nav>  
2 -<!--桌位状态-->  
3 -<view class="flex-lr" style="border-top:1rpx solid #E0E0E0">  
4 - <view class="menus" style="height: {{height}}px; overflow-y: auto;overflow-x: hidden;align-self:flex-start ">  
5 - <view class="menus-item flex-cc {{item.name==menu_active_id?'active':''}}"  
6 - wx:for="{{desklist}}" wx:key="desklist.key"  
7 - bindtap="switchMenu" data-id="{{item.name}}">  
8 - <view class="name">{{item.name}}</view>  
9 - <view class="hip" wx:if="{{item.chenkNum>0}}">{{item.chenkNum}}</view>  
10 - </view>  
11 - </view>  
12 - <view style="height: {{height-80}}px;overflow-y: auto;padding-bottom: 160rpx;overflow-x: hidden;width: 100%;">  
13 - <block wx:for="{{desklist}}" wx:key="desklist.key">  
14 - <orderDesk list="{{item.list}}" bind:changedesk="changedesk" wx:if="{{item.name==menu_active_id}}"></orderDesk>  
15 - </block>  
16 -  
17 - </view>  
18 -</view>  
19 -<view class="confirm-button white-font flex-vc font34r {{hasCheckedTable ? 'confirm-button-active' : ''}}" bindtap="back">确定</view>  
20 -  
21 -  
1 -view{  
2 - line-height:1.2;  
3 -}  
4 -.other-info{  
5 - width:100%;  
6 - height:220rpx;  
7 - padding:20rpx 0;  
8 - box-sizing:border-box;  
9 -}  
10 -.selected-time{  
11 - width:375rpx;  
12 - height:100%;  
13 - border-right:1px solid #efeef3;  
14 - box-sizing:border-box;  
15 -}  
16 -.actual-time{  
17 - margin-top:10rpx;  
18 -}  
19 -.cut{  
20 - width:100%;  
21 - height:4px;  
22 - background:#efeef3;  
23 -}  
24 -  
25 -  
26 -  
27 -.desk-type{  
28 - width:680rpx;  
29 - padding:40rpx 0 20rpx;  
30 - margin:0 auto;  
31 -}  
32 -.desk-type-single{  
33 - width:160rpx;  
34 - height:60rpx;  
35 - border:1px solid #199095;  
36 - border-radius:30rpx;  
37 - background:#EBF8F8;  
38 -}  
39 -.desk-type-single-active{  
40 - background:#199095;  
41 -}  
42 -  
43 -.desk-list{  
44 - width:100%;  
45 -}  
46 -.desk-region{  
47 - width:680rpx;  
48 - padding-top:40rpx;  
49 - margin:0 auto;  
50 -}  
51 -  
52 -.confirm-button{  
53 - width:460rpx;  
54 - height:85rpx;  
55 - background:#74BBBE;  
56 - position:fixed;  
57 - left:250rpx;  
58 - bottom:40rpx;  
59 - margin:0 auto;  
60 - border-radius:10rpx;  
61 -}  
62 -.confirm-button-active{  
63 - background:#199095;  
64 -}  
65 -  
66 -.menus{  
67 - width: 168rpx;  
68 - min-width: 168rpx;  
69 - background-color: #F5F5F5;  
70 -}  
71 -.menus-item{  
72 - width: 168rpx;  
73 - height: 158rpx;  
74 - line-height: 158rpx;  
75 - font-size: 34rpx;  
76 - border: 1rpx solid #E0E0E0;  
77 - border-top-width: 0;  
78 - border-left-width: 0;  
79 - position: relative;  
80 -}  
81 -.menus-item.active{  
82 - background-color: #FEFEFE;  
83 -}  
84 -.menus-item .name{  
85 - width: 140rpx;  
86 - max-height: 96rpx;  
87 - line-height: 48rpx;  
88 - overflow: hidden;  
89 - text-align: center;  
90 -}  
91 -.menus-item .hip{  
92 - background-color: #f00;  
93 - width: 40rpx;  
94 - height: 40rpx;  
95 - position: absolute;  
96 - border-radius: 50%;  
97 - color: #fefefe;  
98 - text-align: center;  
99 - line-height: 40rpx;  
100 - font-size: 22rpx;  
101 - top:10rpx;  
102 - right: 10rpx;  
103 -}  
1 -var util = require('../../utils/util.js')  
2 -var uri=require('../../utils/uri.js')  
3 -import App from '../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -import TP from '../../utils/tpls';  
6 -Page({  
7 - data:{  
8 - actionSheetHidden:true,  
9 - actionSheetItems:['客户取消','客户行程改变']  
10 - },  
11 - sc:{},  
12 - tpls:TP.tpls(),  
13 - enter_params:{},  
14 - onLoad:async function (opt) {  
15 - util.setBarTitle('预定详情');  
16 - console.log(opt)  
17 - this.getDetail(opt.id);  
18 - wx.showShareMenu({  
19 - withShareTicket: true,  
20 - success:function(res){  
21 - console.log(res)  
22 - }  
23 - })  
24 - this.enter_params=util.cache('enter_params');  
25 - this.sc=(await App.Reserve.SellerInfo(this.enter_params)).data;  
26 - console.log('this.sc',this.sc);  
27 - this.chooseManagerInit();  
28 - },  
29 - onShow:function(){  
30 - this.notice=this.selectComponent('#notice');  
31 - },  
32 - noticeCall:function(){  
33 - this.selectComponent('#notice').show();  
34 - },  
35 - onShareAppMessage: function () {  
36 - this.selectComponent('#notice').close();  
37 - var obj=this.data.bookInfo;  
38 - let path=util.http_build_query({  
39 - id:this.data.bookInfo.id,  
40 - fromid:getApp().openid,  
41 - hasSellerShare:1,  
42 - hasInvitation:1,  
43 - tplid:1  
44 - },'/pages/customer/index')  
45 - return {  
46 - //title: (nickname||'')+'给你发送了一个订座信息,点击查看详情',  
47 - title: this.tpls[0].shareFirstTitle,  
48 - path: path,  
49 - imageUrl:this.tpls[0].shareFirstImage,  
50 - success: function (res) {  
51 - console.log(res,666666)  
52 - },  
53 - fail:function(){  
54 - console.log('ccccc')  
55 - },  
56 - complete:function(){  
57 - console.log('ccccc')  
58 - }  
59 - };  
60 - },  
61 - getcall:function(){  
62 - if(!this.detailData.hasOwner){  
63 - return util.toast('只有记录人可以拨打','none');  
64 - }  
65 - if(this.data.bookInfo.phone.length<3){  
66 - return util.toast('号码错误','none');  
67 - }  
68 - wx.makePhoneCall({  
69 - phoneNumber: this.data.bookInfo.phone, //仅为示例,并非真实的电话号码  
70 - complete:()=>{  
71 - this.selectComponent('#notice').close();  
72 - }  
73 - })  
74 - },  
75 - chooseManagerInit(){  
76 - try{  
77 - let managers=this.sc.manager;  
78 - let mans=[];  
79 - let mans_role=[];  
80 - // let space='';  
81 - // for(let i=0;i<50;i++){  
82 - // space+=' ';  
83 - // }  
84 - if(managers.length>0){  
85 - managers.forEach(man=>{  
86 - let nickname=man.nick_name||man.user_name;  
87 - mans.push(nickname);  
88 - //mans_role.push('     ['+man.role_name+'] -- '+man.user_name+space);  
89 - mans_role.push('['+man.role_name+'] -- '+nickname);  
90 - })  
91 - }  
92 - this.setData({mans:mans,mans_role:mans_role})  
93 - }catch(e){  
94 - wx.showToast({  
95 - title:'无客户经理',  
96 - icon:'none'  
97 - });  
98 - }  
99 - },  
100 - chooseManager(e){  
101 - let mansIndex=util.val(e);  
102 - this.setData({mansIndex:mansIndex});  
103 - try{  
104 - let managers=this.sc.manager;  
105 - let man=managers[mansIndex];  
106 - if(man){  
107 - App.Reserve.SetReserveCusman({  
108 - rid:this.data.bookInfo.id,  
109 - cusman_id:man.id,  
110 - cusman:man.nick_name||man.user_name,  
111 - cusman_phone:man.user_phone?man.user_phone:'',  
112 - cusman_account:man.user_wechat?man.user_wechat:'',  
113 - cusman_openid:man.seat_openid?man.seat_openid:''  
114 - }).then(()=>{  
115 - this.getDetail(this.data.bookInfo.id,true);  
116 - });  
117 - }  
118 - }catch(e){  
119 - console.log(e);  
120 - }  
121 -  
122 - },  
123 - flushSellerInfo(){  
124 - App.Reserve.SellerInfo(util.cache('enter_params'),true);  
125 - },  
126 - detailData:null,  
127 - async getDetail(id,force=false){  
128 - let res=await App.Reserve.Detail({rid:id,openid:''},force);  
129 - res.data.rdateStr=util.unixtoTime(res.data.ddate,"MM月DD日 HH:II")  
130 - res.data.phoneStr=res.data.phone||'';  
131 - let enter_params=util.cache('enter_params');  
132 - let sc=(await App.Reserve.SellerInfo(enter_params)).data  
133 - let note_openid=enter_params.seller_openid;  
134 - res.data.hasOwner=false;  
135 - if(note_openid==res.data.note_openid || sc.seller_user.role_name=='管理员'){  
136 - res.data.hasOwner=true;  
137 - }  
138 - if(!res.data.hasOwner){  
139 - res.data.phoneStr=res.data.phoneStr.replace(/(\d{2})(.{5})(\d{3})/,function($0,$1,$2,$3){  
140 - return $1+'**'+$3;  
141 - })  
142 - }  
143 - if(res.data.status==4 && res.data.cancel){  
144 - res.data.cancel.cdateStr=util.unixtoTime(res.data.cancel.cdate,"YYYY.MM.DD HH:II")  
145 - }  
146 - this.detailData=res.data;  
147 -  
148 - this.setData({  
149 - tables:res.data.tables,  
150 - bookInfo:res.data,  
151 - })  
152 - },  
153 - gotoModify(){  
154 - wx.redirectTo({  
155 - url:'./b_addnew?id='+this.data.bookInfo.id  
156 - })  
157 - },  
158 - cancelReserve(){  
159 - this.selectComponent('#cancel').show();  
160 - },  
161 - reserveCancel(e){  
162 - console.log('reserveCancel',e.detail);  
163 - this.getDetail(this.data.bookInfo.id,true);  
164 - },  
165 - actionSheetChange(e){  
166 - this.setData({  
167 - actionSheetHidden:true  
168 - })  
169 - },  
170 - async startDinner(e){  
171 - let cause={};  
172 - let enter_params=util.cache('enter_params');  
173 - let sc=(await App.Reserve.SellerInfo(enter_params)).data  
174 - cause={desc:""}  
175 - if(enter_params){  
176 - cause.uid=enter_params.manager_id;  
177 - }  
178 - if(sc.seller_user){  
179 - cause.uname=(sc.seller_user.nick_name||sc.seller_user.nickname)  
180 - }  
181 - App.Reserve.SetReserveStatus({  
182 - rid:this.data.bookInfo.id,  
183 - status:util.attr(e,'status'),  
184 - cause:JSON.stringify(cause),  
185 - }).then(()=>{  
186 - this.getDetail(this.data.bookInfo.id,true);  
187 - });  
188 - },  
189 - showOrder(){  
190 - wx.navigateTo({  
191 - url:util.http_build_query({rid:this.data.bookInfo.id,oid:this.data.bookInfo.orderid,identity:2},'/pack-cookbook/pages/success')  
192 - });  
193 - },  
194 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "noticeCall":"/components/book/notice/notice",  
7 - "step":"/components/book/step/step",  
8 - "board":"/components/book/board/board",  
9 - "cancel":"/components/book/reserveCancel/cancel",  
10 - "nav":"/components/nav/nav",  
11 - "formids":"/components/formids/formids"  
12 - }  
13 -}  
1 -<nav hasHome>订座详情</nav>  
2 -<!--订单信息-->  
3 -<view class="order-info">  
4 - <view class="flex-lr order-detail">  
5 - <view class="gray-deep-font font30r">到店时间</view>  
6 - <view class="black-font font34r">{{bookInfo.rdateStr}}</view>  
7 - </view>  
8 - <view class="flex-lr order-detail">  
9 - <view class="gray-deep-font font30r">用餐人数</view>  
10 - <view class="black-font font34r">{{bookInfo.pnum_str||bookInfo.pnum}}人</view>  
11 - </view>  
12 - <view class="reserve-status-tip" wx:if="{{bookInfo.status!=null}}">  
13 - <image src="http://qn.colorcun.com/custom/lite-yd/image/reserve-status-{{bookInfo.status}}.png"></image>  
14 - </view>  
15 - <view class="flex-lr order-detail">  
16 - <view class="gray-deep-font font30r">预订座位</view>  
17 - <view class="black-font font34r">{{tables.length}}个</view>  
18 - </view>  
19 - <view class="flex-lr order-desk">  
20 - <view class="gray-deep-font font30r"></view>  
21 - <view class="flex-re" style="width:100%;flex-wrap:wrap;">  
22 - <block wx:for="{{tables}}" wx:key="tables.key">  
23 - <board width="160" height="180" board="{{item}}" className="noBottom"  
24 - style="margin-left:20rpx;zoom: 0.8; margin-bottom: 20rpx;"></board>  
25 - </block>  
26 - </view>  
27 - </view>  
28 - <view class="flex-lr order-detail">  
29 - <text class="gray-deep-font font30r" space="true" decode="true">客户姓名</text>  
30 - <view class="black-font font34r">{{bookInfo.rname}} {{bookInfo.sex==1?'先生':(bookInfo.sex==2?'女士':'')}}</view>  
31 - </view>  
32 - <view class="flex-lr order-detail">  
33 - <view class="gray-deep-font font30r">客户电话</view>  
34 - <view class="black-font font34r" bindtap="getcall">{{bookInfo.phoneStr||''}}</view>  
35 - </view>  
36 - <block wx:if="{{bookInfo.cusdem!='' && bookInfo.cusdem!='null'}}">  
37 - <view class="flex-lr order-detail">  
38 - <view class="gray-deep-font font30r">备注信息</view>  
39 - <view class="black-font font34r">{{bookInfo.cusdem}}</view>  
40 - </view>  
41 - </block>  
42 -</view>  
43 -<view class="order-info">  
44 - <view class="flex-lr order-detail">  
45 - <view class="gray-deep-font font30r">客户经理</view>  
46 - <view class="flex-lr black-font font34r" style=" border-bottom: 2rpx solid #999;">  
47 - <picker bindchange="chooseManager" catchtap="flushSellerInfo" value="{{mansIndex}}" range="{{mans_role}}">  
48 - <view class="picker">  
49 - {{mans[mansIndex]?mans[mansIndex]:bookInfo.cusman?bookInfo.cusman:'请选择'}}  
50 - </view>  
51 - </picker>  
52 - </view>  
53 - </view>  
54 - <view class="flex-lr order-detail">  
55 - <view class="gray-deep-font font30r">记录人</view>  
56 - <view class="black-font font34r">{{bookInfo.note_name}}</view>  
57 - </view>  
58 -</view>  
59 -<view class="order-info" wx:if="{{bookInfo.status==4 && bookInfo.cancel}}">  
60 - <view class="flex-lr order-detail">  
61 - <view class="gray-deep-font font30r">取消原因</view>  
62 - <view class="flex-lr black-font font34r">  
63 - {{bookInfo.cancel.desc}}  
64 - </view>  
65 - </view>  
66 - <view class="flex-lr order-detail">  
67 - <view class="gray-deep-font font30r">取消时间</view>  
68 - <view class="black-font font34r">{{bookInfo.cancel.cdateStr}}</view>  
69 - </view>  
70 - <view class="flex-lr order-detail">  
71 - <view class="gray-deep-font font30r">操作人</view>  
72 - <view class="black-font font34r">{{bookInfo.cancel.uname}}</view>  
73 - </view>  
74 -</view>  
75 -  
76 -<view style="height: 250rpx;"></view>  
77 -  
78 -<!--通知预订人-->  
79 -<view class="notice-opt" wx:if="{{bookInfo.status==1}}">  
80 - <view class="notice-button-border font34r flex-lr">  
81 - <view>  
82 - <formids bindclick="noticeCall">通知客户</formids>  
83 - </view>  
84 - <view wx:if="{{bookInfo.order && bookInfo.order.cookbooklist.length>0}}">  
85 - <formids bindclick="showOrder">查看菜品</formids>  
86 - </view>  
87 - </view>  
88 - <view class="notice-button-border font34r flex-lr">  
89 - <view>  
90 - <formids bindclick="gotoModify">变更预订</formids>  
91 - </view>  
92 - <view >  
93 - <formids bindclick="cancelReserve">取消预订</formids>  
94 - </view>  
95 - <view>  
96 - <formids bindclick="startDinner" data-status="2">确认到店</formids>  
97 - </view>  
98 - </view>  
99 -</view>  
100 -<view class="notice-opt" wx:if="{{bookInfo.status==2}}">  
101 - <formids class="notice-button white-font font34r flex-cc" bindclick="startDinner" data-status="3">客户就餐完毕</formids>  
102 -</view>  
103 -<noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall>  
104 -<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll">  
105 - <block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key">  
106 - <action-sheet-item>{{item}}</action-sheet-item>  
107 - </block>  
108 - <action-sheet-item>  
109 - <input placeholder="请输入" style="width:100%"/>  
110 - </action-sheet-item>  
111 - <action-sheet-cancel >取消</action-sheet-cancel>  
112 -  
113 -</action-sheet>  
114 -<cancel id="cancel" bindreserveCancel="reserveCancel" bookInfo="{{bookInfo}}"></cancel>  
1 -view{  
2 - line-height:1.2;  
3 -}  
4 -  
5 -  
6 -/*商家信息*/  
7 -.seller-info{  
8 - width:680rpx;  
9 - height:auto;  
10 - padding:40rpx 0;  
11 - margin:0 auto;  
12 - border-bottom:1px solid #efeef3;  
13 -}  
14 -.seller-image{  
15 - width:60rpx;  
16 - height:60rpx;  
17 - border-radius:50%;  
18 - margin-right:20rpx;  
19 -}  
20 -.seller-address{  
21 - margin-top:10rpx;  
22 -}  
23 -.seller-location{  
24 - width:32rpx;  
25 - height:34rpx;  
26 -}  
27 -  
28 -  
29 -/*订单信息*/  
30 -.order-info{  
31 - width:680rpx;  
32 - height:auto;  
33 - padding:0 20rpx;  
34 - margin:0 auto;  
35 - border-bottom:1px solid #efeef3;  
36 - box-sizing:border-box;  
37 -}  
38 -.order-detail{  
39 - width:100%;  
40 - padding:40rpx 0;  
41 -}  
42 -.order-desk{  
43 - width:100%;  
44 - height:auto;  
45 - position:relative;  
46 -}  
47 -.order-status{  
48 - width:172rpx;  
49 - height:100rpx;  
50 - position:absolute;  
51 - left:0;  
52 - right:0;  
53 - top:0;  
54 - bottom:0;  
55 - margin:auto;  
56 - z-index:2;  
57 -}  
58 -.order-desk-info{  
59 - width:120rpx;  
60 - height:120rpx;  
61 - background:#A9E3E6;  
62 - border:1px solid #199095;  
63 - border-radius:10rpx;  
64 - position:relative;  
65 - overflow:hidden;  
66 - margin-left:20rpx;  
67 - margin-top:20rpx;  
68 -}  
69 -.order-desk-detail{  
70 - width:100%;  
71 - height:90rpx;  
72 -}  
73 -.order-desk-type{  
74 - width:100%;  
75 - height:30rpx;  
76 - background:#199095;  
77 - position:absolute;  
78 - left:0;  
79 - bottom:0;  
80 -}  
81 -  
82 -  
83 -  
84 -.seller-staff{  
85 - width:680rpx;  
86 - padding:40rpx 20rpx;  
87 - box-sizing:border-box;  
88 - margin:0 auto;  
89 -}  
90 -  
91 -.notice-opt{  
92 - position:fixed;  
93 - left:0;  
94 - right:0;  
95 - bottom: 0;  
96 - padding-bottom: 50rpx;  
97 - background-color: #fefefe;  
98 -}  
99 -.notice-button{  
100 - height:85rpx;  
101 - width:90%;  
102 - background:#199095;  
103 - border-radius:0;  
104 - margin:20rpx auto 0;  
105 -}  
106 -.notice-button-border{  
107 - height:85rpx;  
108 - width:90%;  
109 - border:solid 2rpx #199095;  
110 - border-radius:0;  
111 - margin:20rpx auto 0;  
112 - color: #199095;  
113 -}  
114 -.notice-button-border view{  
115 - width: 100%;  
116 - border-right: 2rpx solid #199095;  
117 - text-align: center;  
118 - height: 50rpx;  
119 - line-height: 50rpx;  
120 -}  
121 -.notice-button-border view:last-child{  
122 - border-right-width: 0;  
123 -}  
124 -.reserve-status-tip{  
125 - position: absolute;  
126 - top:300rpx;  
127 - right:200rpx;  
128 - width: 82rpx;  
129 - height: 52rpx;  
130 -}  
131 -.reserve-status-tip image{  
132 - width: 100%;  
133 - height: 100%;  
134 -}  
1 -var mta=require('mta-wechat-analysis')  
2 -var util = require('../../utils/util.js')  
3 -var uri=require('../../utils/uri.js')  
4 -var bookOrder=require('../../utils/bookCommon.js')  
5 -import App from '../../utils/api';  
6 -const {regeneratorRuntime} = global  
7 -Page({  
8 - data:{  
9 - isloading:false,  
10 - pagex:1,  
11 - pagey:10,  
12 - sort:null,  
13 - dateStr:'',  
14 - calendarMaskLoad:false,  
15 - calendarMask:false,  
16 - dayStyle:[  
17 - { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' },  
18 - { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }  
19 - ],  
20 - keywords:'',  
21 - sort:'',  
22 - form:{  
23 - time:-1,  
24 - },  
25 - timePickerArray:[  
26 - [],  
27 - [],  
28 - [],  
29 - ],  
30 - speciallist:[],  
31 - ReservesCountMonth:[],  
32 - ReservesTotal:0,  
33 - timeStrLabel:bookOrder.timeStrLabel  
34 - },  
35 - sellerid:0,  
36 - indexOpt:null,  
37 - YYYY:'YYYY',  
38 - onLoad:async function(opt){  
39 - this.indexOpt=opt;  
40 - mta.Page.init({  
41 - "appID":"500667280",  
42 - "eventID":"500667287",  
43 - "statPullDownFresh":true,  
44 - "statShareApp":true,  
45 - "statReachBottom":true,  
46 - "lauchOpts":opt, //渠道分析  
47 - });  
48 - let d=new Date()/1000;  
49 - let dateStr=util.unixtoTime(d,'MM-DD DAY');  
50 - var radio=750/util.getsystem().windowWidth;  
51 - var contentHeight=util.getsystem().windowHeight-Math.ceil(120/radio)  
52 - if(opt.seller_id){  
53 - this.sellerid=opt.seller_id;  
54 - util.cache('sellerid',opt.seller_id)  
55 - util.cache('enter_params',opt)  
56 - App.Reserve.SellerInfo(opt)  
57 - }else{  
58 - this.sellerid=util.cache('sellerid');  
59 - }  
60 - //this.sellerid=opt.seller_id ? opt.seller_id : util.cache('sellerid');  
61 - let timePickerArray= await bookOrder.getDayTimeSpace();  
62 - let speciallist=[  
63 - { date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' },  
64 - { date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' },  
65 - { date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },  
66 - ];  
67 - this.setData({  
68 - sellerid:this.sellerid,  
69 - listHeight:contentHeight-Math.ceil(210/radio),  
70 - dateStr:dateStr,  
71 - timePickerArray: timePickerArray,  
72 - speciallist:speciallist,  
73 - })  
74 - //util.setBarTitle('预定本');  
75 - this.indexOpt=opt;  
76 - this.ReservesCountDay(util.unixtoTime(d,'YYYY-MM-DD'));  
77 - this.ReservesCountMonth(util.unixtoTime(d,'YYYY-MM'));  
78 - },  
79 - onShow:function(){  
80 - this.setData({  
81 - isloading:false,  
82 - })  
83 - this.getbooklist();  
84 - this.selectComponent('#nav').init();  
85 - setTimeout(()=>{  
86 - this.setData({  
87 - calendarMaskLoad:true,  
88 - })  
89 - let openid=getApp().openid;  
90 - if(openid && this.indexOpt.seller_id){  
91 - App.Reserve.SellerForOpenid({openid:openid,sedata:JSON.stringify(this.indexOpt)})  
92 - //客户经理=>人人都是客户经理  
93 - //if(this.indexOpt.manager_id){  
94 - App.Reserve.UpdateSellerUser({seat_openid:openid,kid:this.indexOpt.manager_id});  
95 - //}  
96 - }else{  
97 - console.log('index-opt',openid,this.indexOpt);  
98 - }  
99 -  
100 - },1000);  
101 - },  
102 - async getbooklist(isExport=false){  
103 - let time=0;  
104 - if(this.data.form.time<0){  
105 - let sid=await bookOrder.getTimeSpaceIndexData();  
106 - time=sid.timeIndex  
107 - }else{  
108 - time=this.data.form.time;  
109 - }  
110 - var formdata={};  
111 - if(this.data.sort!=''){  
112 - formdata.sort=this.data.sort  
113 - }  
114 - if(this.data.keywords!=''){  
115 - formdata.keywords=this.data.keywords  
116 - }  
117 - formdata.sid=this.sellerid;  
118 - formdata.x=1;  
119 - formdata.y=200;  
120 - let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY);  
121 - formdata.rdate=rdate;  
122 - if(isExport){  
123 - this.__exportFile(formdata);  
124 - }else{  
125 - var that=this;  
126 - App.Reserve.GetReserveList(formdata).then(function(json){  
127 - console.log(json)  
128 - if(json.ret==200){  
129 - that.setData({  
130 - isloading:true,  
131 - bookList:json.data.length==0 ? null : json.data,  
132 - form:{time:time},  
133 - })  
134 - that.boolists=that.selectAllComponents('.orderbook');  
135 - that.boolists.forEach(function(v,i){  
136 - v.changeitem();  
137 - })  
138 - }  
139 - }).catch(e=>{})  
140 - }  
141 - },  
142 - timeorder:function(){  
143 - if(this.data.sort==''){  
144 - this.data.sort=1;  
145 - }else{  
146 - this.data.sort='';  
147 - }  
148 -  
149 - this.setData({  
150 - sort:this.data.sort  
151 - })  
152 - this.getbooklist();  
153 - },  
154 - searchinput:function(e){  
155 - this.data.keywords=e.detail.value;  
156 - this.setData({  
157 - keywords:this.data.keywords  
158 - })  
159 - if(e.detail.value==''){  
160 - this.getbooklist();  
161 - }  
162 - },  
163 - calendarShow(){  
164 - console.log('xxxxx')  
165 - this.setData({  
166 - calendarMask:true  
167 - })  
168 - console.log(this.data.calendarMask)  
169 - },  
170 - dateChange(event){  
171 - this.YYYY=event.detail.date.substr(0,4);  
172 - let cktime=util.timetouUnix(event.detail.date)  
173 - console.log('cktime',cktime,this.YYYY)  
174 - let clickDay = event.detail.date.substr(8,2);  
175 - let changeDay = `dayStyle[1].day`;  
176 - let changeBg = `dayStyle[1].background`;  
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);  
185 - },  
186 - calendarClose(){  
187 - this.setData({  
188 - calendarMask:false  
189 - })  
190 - },  
191 - selectedValue:function (e) {  
192 - this.setData({  
193 - form:{time:e.currentTarget.dataset.value}  
194 - })  
195 - this.getbooklist();  
196 - },  
197 - searchbook:function(e){  
198 - console.log(this.data.form)  
199 - this.getbooklist();  
200 - },  
201 - __exportFile(formdata){  
202 - App.Reserve.ExportReserve(formdata).then(res=>{  
203 - let url=res.data;  
204 - if(!url){  
205 - return util.toast('没有预订数据','none')  
206 - }  
207 - wx.downloadFile({  
208 - url: url,  
209 - success: function(res) {  
210 - const filePath = res.tempFilePath;  
211 - console.log('filePath',filePath);  
212 - wx.previewImage({  
213 - current: filePath,  
214 - urls: [filePath]  
215 - })  
216 - wx.saveImageToPhotosAlbum({  
217 - filePath:filePath,  
218 - fail (res) {  
219 - util.toast('保存失败','none')  
220 - }  
221 - })  
222 - }  
223 - })  
224 - });  
225 -  
226 - },  
227 - exportFile(){  
228 - this.getbooklist(true);  
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 - },  
271 - gotoday(e){  
272 - this.ReservesCountMonth(e.detail.date.substr(0,7));  
273 - }  
274 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "nothingBook":"/components/book/nothing/nothing",  
7 - "bookList":"/components/book/list/list",  
8 - "nav":"/components/nav/nav",  
9 - "tabBar":"/components/book/tabBar/tabBar",  
10 - "calendar": "plugin://bmCalendar/calendar",  
11 - "formids":"/components/formids/formids"  
12 - }  
13 -}  
1 -<nav id="nav">订座</nav>  
2 -<view class="page">  
3 -<block wx:if="{{isloading==true}}">  
4 - <view class="book-page bg_white">  
5 - <view class="book-search flex-lr">  
6 - <view class="flex-ll book-search-left">  
7 - <image src="http://qn.colorcun.com/custom/lite-yd/image/search.png" class="search-icon"></image>  
8 - <input placeholder="桌位/客户姓名/手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/>  
9 - </view>  
10 - <view bindtap="exportFile" class="exportFile flex-vc">  
11 - <image src="http://qn.colorcun.com/custom/lite-yd/image/export.png" class="search-icon"></image>  
12 - <view>导出</view>  
13 - </view>  
14 - </view>  
15 - <view class="search-easy flex-lr">  
16 - <formids class="block flex-vc" bindtap="calendarShow">  
17 - <view class="flex-vc" >  
18 - <view class="green-font font34r font-bold flex-cc">{{dateStr}}</view>  
19 - </view>  
20 - </formids>  
21 - <view class="block section flex-vc">  
22 - <view class="tab flex-cc">  
23 - <formids class="item flex-vc {{form.time==0?'checked':''}}"  
24 - wx:if="{{timePickerArray[0].length>0}}"  
25 - bindtap="selectedValue" data-key="time" data-value="0">早市</formids>  
26 - <formids class="item flex-cc {{form.time==1?'checked':''}}"  
27 - wx:if="{{timePickerArray[1].length>0}}"  
28 - bindtap="selectedValue" data-key="time" data-value="1">午市</formids>  
29 - <formids class="item flex-cc {{form.time==2?'checked':''}}"  
30 - wx:if="{{timePickerArray[2].length>0}}"  
31 - bindtap="selectedValue" data-key="time" data-value="2">晚市</formids>  
32 - </view>  
33 - </view>  
34 - </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>  
40 - <block wx:if="{{!bookList}}">  
41 - <nothingBook height="{{listHeight}}"></nothingBook>  
42 - </block>  
43 - <block wx:else>  
44 -  
45 - <view bindcsroll="onPullDownRefresh" class="bg_white">  
46 -  
47 - <view class="book-list-thead flex-lr font34r black-font">  
48 - <view>桌号</view>  
49 - <view class="flex-cc">客户姓名</view>  
50 - <view class="flex-cc" bindtap="timeorder">时间<image src="http://qn.colorcun.com/custom/lite-yd/image/direction.png" class="icon22-26" background-size="cover"></image></view>  
51 - <view class="flex-rr">操作</view>  
52 - </view>  
53 - <view class="book-list" style="padding-bottom:118rpx;">  
54 - <view class="book-list-body">  
55 - <block wx:for="{{bookList}}" wx:key="bookList.key">  
56 - <bookList item="{{item}}" class="orderbook"></bookList>  
57 - </block>  
58 - </view>  
59 - </view>  
60 - </view>  
61 - </block>  
62 -</block>  
63 -</view>  
64 -<tabBar></tabBar>  
65 -  
66 -<view class="calendar-mask" bindtap="calendarClose"  
67 - style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}">  
68 - <view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;">  
69 - <calendar catchtap="catchtap"  
70 - isTodaybtn="{{true}}" todaybtn_txt="回到今天"  
71 - custom="{{false}}"  
72 - switchover="{{['上一月','下个月']}}"  
73 - active-coloro="active-coloro"  
74 - active-colort="active-colort"  
75 - speciallist="{{speciallist}}"  
76 - txt_style="txt-style"  
77 - calendar-style="calendar"  
78 - header-style="calendar-header"  
79 - weektitle-style="weektitle-style"  
80 - restcolor-style="restcolor-style"  
81 - txt_type="cn-d"  
82 -  
83 - datefont-style="datefont-style"  
84 - todaybtn-style="todaybtn-style"  
85 -  
86 - bindnextMonth="clickMonth"  
87 - bindprevMonth="clickMonth"  
88 - bindselectDate="dateChange"  
89 - bindgotoday="gotoday"  
90 -  
91 - colored="#199095"  
92 - circle_show="{{true}}"  
93 - mystatus="{{ReservesCountMonth}}"  
94 - dotcolor-o="dotcolor-o"  
95 - dotcolor-t="dotcolor-t"  
96 - allshow="{{true}}"  
97 - ></calendar>  
98 - </view>  
99 -</view>  
1 -page{  
2 - background:#efeef3;  
3 -}  
4 -.page{  
5 - width: 100%;  
6 - margin: 0;  
7 - overflow: hidden;  
8 -}  
9 -.book-page{  
10 - width:100%;  
11 - padding-top:20rpx;  
12 -}  
13 -.book-search{  
14 - width:675rpx;  
15 - height:80rpx;  
16 - margin:0 auto;  
17 -}  
18 -.book-search-left{  
19 - width:590rpx;  
20 - height:80rpx;  
21 - border-radius:40rpx;  
22 - box-shadow: 0 0 8px #ccc;  
23 - margin:0 auto;  
24 - margin-bottom:10rpx;  
25 -}  
26 -.search-icon{  
27 - width:40rpx;  
28 - height:40rpx;  
29 - margin-left:30rpx;  
30 -}  
31 -.search-input{  
32 - width:520rpx;  
33 - height:100%;  
34 - padding:10rpx;  
35 - box-sizing:border-box;  
36 -}  
37 -.book-list-thead{  
38 - width:100%;  
39 - height:120rpx;  
40 - padding:0 40rpx;  
41 - box-sizing:border-box;  
42 - font-weight:400;  
43 - border-bottom: 2rpx solid #F1F0F4;  
44 -}  
45 -.book-list-thead>view{  
46 - width:25%;  
47 -}  
48 -.icon22-26{  
49 - width:22rpx;  
50 - height:26rpx;  
51 - margin-left:8rpx;  
52 -}  
53 -.book-list-body{  
54 - width:100%;  
55 - height:auto;  
56 - box-sizing:border-box;  
57 -}  
58 -.book-list-cut{  
59 - height:66rpx;  
60 - background:#F5F5F5;  
61 - padding-left:44rpx;  
62 - font-size: 26rpx;  
63 - line-height: 66rpx;  
64 -}  
65 -.book-list-cut text{  
66 - margin-right: 50rpx;  
67 -}  
68 -.border-line{  
69 - width:670rpx;  
70 - height:1px;  
71 - background:#efeef3;  
72 - margin:0 auto;  
73 -}  
74 -  
75 -.search-easy{  
76 - height:80rpx;  
77 - padding:20rpx 0;  
78 -}  
79 -.search-easy .block{  
80 - width: 50%;  
81 - min-width: 50%;  
82 - height: 100%;  
83 -}  
84 -.search-easy .block:first-child{  
85 - border-right: 1px solid #E0E0E0;  
86 -}  
87 -.section .tab{  
88 - font-size: 34rpx;  
89 - color: #199095;  
90 - height: 50rpx;  
91 -}  
92 -.section .tab .item{  
93 - height: 50rpx;  
94 - line-height: 49rpx;  
95 - width: 94rpx !important;  
96 - min-width: 94rpx !important;  
97 - border-radius: 10rpx;  
98 - border: 2rpx solid #199095;  
99 - margin-right: 16rpx;  
100 - text-align: center;  
101 - display: block;  
102 -}  
103 -.section .tab .item:after{  
104 - padding-right: 5rpx;  
105 -}  
106 -.section .tab .checked{  
107 - background-color:#199095;  
108 - color: #FEFEFE;  
109 -}  
110 -.exportFile{  
111 - font-size: 26rpx;  
112 - color:#353535;  
113 -}  
114 -.exportFile image{  
115 - width: 32rpx;  
116 - height: 32rpx;  
117 - margin: 0 auto 8rpx;  
118 -}  
119 -  
120 -  
121 -@import "common/calendar.wxss";  
1 -var util = require('../../utils/util.js')  
2 -var uri=require('../../utils/uri.js')  
3 -var bookOrder=require('../../utils/bookCommon.js')  
4 -const {regeneratorRuntime} = global  
5 -Page({  
6 - data:{  
7 - grand:[  
8 - {  
9 - sex:1,  
10 - grand_title:'先生',  
11 - isselect:true  
12 - },  
13 - {  
14 - sex:2,  
15 - grand_title:'女士',  
16 - isselect:false  
17 - }  
18 - ],  
19 - name:'',  
20 - sex:1,  
21 - phone:'',  
22 - remark:'',  
23 - buttonhide:true,  
24 - pnum:'6'  
25 - },  
26 - onLoad:function(opt){  
27 - wx.removeStorage({  
28 - key:'tableid',  
29 - })  
30 - wx.removeStorage({  
31 - key:'tabletype',  
32 - })  
33 - util.setBarTitle('录入订座信息');  
34 - var selectmonth=opt.date.split('-')[0][0]=='0' ? opt.date.split('-')[0][1] : opt.date.split('-')[0];  
35 - var selectday=opt.date.split('-')[1][0]=='0' ? opt.date.split('-')[1][1] : opt.date.split('-')[1];  
36 - console.log(opt)  
37 - var stringTime =opt.year+'-'+opt.date+' ' +opt.time+':00';  
38 - console.log(stringTime)  
39 - var time=bookOrder.gettimestamp(stringTime);  
40 - console.log(time)  
41 - this.setData({  
42 - thisyear:opt.year,  
43 - selectdate:selectmonth+'月'+selectday+'日',  
44 - time_dur:opt.time,  
45 - sellerid:util.cache('sellerid'),  
46 - time:time,  
47 - pnum:util.cache('order_pnum') ? util.cache('order_pnum') : this.data.pnum,  
48 - })  
49 - this.getdesklist();  
50 - },  
51 - onShow:function(){  
52 - var that=this;  
53 - if(util.cache('tableid')){  
54 - var tables=util.cache('tableid');  
55 - var templist=this.data.templist;  
56 - var showdesk=[];  
57 - for(var i=0;i<tables.length;i++){  
58 - templist.forEach(function(r,n){  
59 - if(tables[i]==r.id){  
60 - r.isselect=true;  
61 - if(r.tid==2){  
62 - r.name=r.name.length>4 ? r.name.slice(0,3)+'...' : r.name;  
63 - showdesk.unshift(r);  
64 - }else {  
65 - r.name=r.name.length>4 ? r.name.slice(0,3)+'...' : r.name;  
66 - showdesk.push(r);  
67 - }  
68 - }  
69 - })  
70 - }  
71 - this.setData({  
72 - showdesk:showdesk.slice(0,2)  
73 - })  
74 - }  
75 - if(util.cache('tableid') && util.cache('tableid').length>0){  
76 - if(this.data.name!='' && this.data.phone!='' && !this.data.reminder){  
77 - this.setData({  
78 - buttonhide:false  
79 - })  
80 - }  
81 - }  
82 - util.postSuccessFun=function(json,uri_code){  
83 - switch (uri_code) {  
84 - case uri.CGI_USER_SETRESERVEINFO__CODE:  
85 - wx.hideLoading()  
86 - if(json.ret==200){  
87 - wx.reLaunch({  
88 - url:util.http_build_query(json.data,'b_detail')  
89 - })  
90 - }  
91 - break;  
92 - case uri.CGI_USER_GETTABLELIST__CODE:  
93 - console.log('xxxx',json.data);  
94 - var list=json.data;  
95 - var templist=[];  
96 - for(var key in list){  
97 - if(key!='typex' && key!='typey'){  
98 - list[key].list.forEach(function(v,i){  
99 - templist.push(v)  
100 - })  
101 -  
102 - }  
103 - }  
104 - var tempsan=[];  
105 - var tempbao=[];  
106 - var showdesk=[];  
107 - var temp={};  
108 - templist.forEach(function(v,i){  
109 - v.name=v.name.length>4 ? v.name.slice(0,3)+'...' : v.name;  
110 - if(!v.r_status){  
111 - if(v.tid==2){  
112 - tempbao.push(v);  
113 - v.isselect=false;  
114 - showdesk.unshift(v);  
115 - }else{  
116 - tempsan.push(v);  
117 - v.isselect=false;  
118 - showdesk.push(v);  
119 - }  
120 - }  
121 - if(v.tid==2){  
122 - if(!temp.hasOwnProperty("tabletype_2")){  
123 - temp['tabletype_2']=true  
124 - }  
125 -  
126 - }else{  
127 - if(!temp.hasOwnProperty("tabletype_1")){  
128 - temp['tabletype_1']=true  
129 - }  
130 - }  
131 - })  
132 - util.cache('tabletype',temp);  
133 - console.log(showdesk)  
134 - that.setData({  
135 - sancount:list.typex, //typex散座  
136 - baocount:list.typey, //typey包间  
137 - showdesk:showdesk.slice(0,2),  
138 - templist:templist  
139 -  
140 - })  
141 - break;  
142 - }  
143 - }  
144 - },  
145 - changetime:function(){  
146 - wx.navigateBack()  
147 - },  
148 - selectgrand:function(e){  
149 - var sex=e.currentTarget.dataset.sex;  
150 - console.log(sex)  
151 - var grandlist=this.data.grand;  
152 - grandlist.forEach(function(v,i){  
153 - v.isselect=false;  
154 - if(v.sex==sex){  
155 - v.isselect=true;  
156 - }  
157 - })  
158 - this.setData({  
159 - grand:grandlist,  
160 - sex:sex  
161 - })  
162 - },  
163 - condition:function(e){  
164 - var name=this.data.name;  
165 - var phone=e.detail.value;  
166 - var regExp = /^(86)?((13\d{9})|(15[0,1,2,3,5,6,7,8,9]\d{8})|(18[0,5,6,7,8,9]\d{8}))$/  
167 - if(!(regExp.test(phone))){  
168 - this.setData({  
169 - reminder:'手机格式不正确'  
170 - })  
171 - }else{  
172 - this.setData({  
173 - reminder:null  
174 - })  
175 - }  
176 - if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){  
177 - this.setData({  
178 - buttonhide:false  
179 - })  
180 - }  
181 - },  
182 - changename:function(e){  
183 - this.setData({  
184 - name:e.detail.value  
185 - })  
186 - },  
187 - changephone:function(e){  
188 - this.setData({  
189 - phone:e.detail.value  
190 - })  
191 - },  
192 - changeremark:function(e){  
193 - this.setData({  
194 - remark:e.detail.value  
195 - })  
196 - },  
197 - ifAll:function(){  
198 - var name=this.data.name;  
199 - var phone=this.data.phone;  
200 - if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){  
201 - this.setData({  
202 - buttonhide:false  
203 - })  
204 - }  
205 - },  
206 - formsubmit:async function(){  
207 - wx.showLoading({  
208 - title:'正在预定',  
209 - mask:true  
210 - });  
211 - console.log(this.data.time)  
212 - var formData={  
213 - sid:this.data.sellerid,  
214 - tid:util.cache('tableid').toString(),  
215 - rname:this.data.name, //姓名  
216 - phone:this.data.phone, //手机号  
217 - sex:this.data.sex, //性别  
218 - pnum:this.data.pnum, //人数  
219 - rdate:this.data.time, //时间  
220 - cusdem:this.data.remark //备注  
221 - }  
222 - try{  
223 - let enter_params=util.cache('enter_params');  
224 - let manager_id=enter_params.manager_id;  
225 - if(manager_id){  
226 - let sc=(await App.Reserve.SellerInfo(enter_params)).data  
227 - let managers=sc.manager;  
228 - managers.forEach(man=>{  
229 - if(manager_id==man.id){  
230 - formData.cusman_id=man.id;  
231 - formData.cusman=man.user_name;  
232 - formData.cusman_phone=man.user_phone?man.user_phone:'';  
233 - formData.cusman_account=man.user_wechat?man.user_wechat:'';  
234 - }  
235 - })  
236 - }  
237 -  
238 -  
239 - let man=managers[mansIndex];  
240 - if(man){  
241 - App.Reserve.SetReserveCusman({  
242 - rid:this.data.bookInfo.id,  
243 - cusman_id:man.id,  
244 - cusman:man.user_name,  
245 - cusman_phone:man.user_phone?man.user_phone:'158777556369',  
246 - cusman_account:man.user_wechat?man.user_wechat:'',  
247 - });  
248 - }  
249 - }catch (e){}  
250 - console.log(formData)  
251 - util.post(uri.CGI_USER_SETRESERVEINFO,formData,uri.CGI_USER_SETRESERVEINFO__CODE)  
252 - },  
253 - changepnum:function(e){  
254 - console.log(e)  
255 - this.setData({  
256 - pnum:e.detail  
257 - })  
258 - this.getdesklist();  
259 - },  
260 - selectdesk:function(){  
261 - wx.navigateTo({  
262 - url:'b_desk?pnum='+this.data.pnum+'&year='+this.data.thisyear+'&date='+this.data.selectdate+'&time_dur='+this.data.time_dur  
263 - })  
264 - },  
265 - getdesklist:function(){  
266 - util.post(uri.CGI_USER_GETTABLELIST,{sid:this.data.sellerid,pnum:parseInt(this.data.pnum),rdate:this.data.time},uri.CGI_USER_GETTABLELIST__CODE)  
267 - },  
268 - binddesk:function(e){  
269 - var id=e.currentTarget.dataset.id;  
270 - var tables=util.cache('tableid') ? util.cache('tableid') : [];  
271 - var showdesk=this.data.showdesk;  
272 - showdesk.forEach(function(v,i){  
273 - if(v.id==id){  
274 - if(v.isselect==true){  
275 - var thisindex=tables.indexOf(id);  
276 - tables.splice(thisindex,1)  
277 - }else{  
278 - tables.push(id)  
279 - }  
280 - v.isselect=!v.isselect  
281 - }  
282 - })  
283 - util.cache('tableid',tables);  
284 - this.setData({  
285 - showdesk:showdesk  
286 - })  
287 - var name=this.data.name;  
288 - var phone=this.data.phone;  
289 - if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){  
290 - this.setData({  
291 - buttonhide:false  
292 - })  
293 - }  
294 - }  
295 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "selectPeople":"/components/book/people/people",  
7 - "step":"/components/book/step/step",  
8 - "nav":"/components/nav/nav"  
9 - }  
10 -}  
1 -<nav>点餐商户端</nav>  
2 -<step step="1"></step>  
3 -<view class="other-info flex-lr">  
4 - <view class="selected-time flex-vc" bindtap="changetime">  
5 - <view class="font30r black-font">时间</view>  
6 - <view class="actual-time green-font font34r">{{selectdate}} {{time_dur}}</view>  
7 - </view>  
8 - <selectPeople bind:changepnum="changepnum" pnum="{{pnum}}"></selectPeople>  
9 -</view>  
10 -<view class="border-line"></view>  
11 -  
12 -<view class="advice-desk flex-lr">  
13 - <view class="black-font font30r">桌位</view>  
14 - <view>  
15 - <view class="font26r gray-deep-font flex-rr">(包间余{{baocount}}个,散座余{{sancount}}个)</view>  
16 - <view class="advice-desk-detail flex-rr">  
17 - <block wx:for="{{showdesk}}">  
18 - <block wx:if="{{item.tid==2}}">  
19 - <view class="order-desk-info {{item.isselect==true ? 'desk-active' : ''}}" bindtap="binddesk" data-id="{{item.id}}" data-type="{{item.tid}}">  
20 - <view class="flex-vc order-desk-detail">  
21 - <view class="font28r black-font smooth">{{item.name}}</view>  
22 - <view class="font26r black-font" style="margin-top:6rpx;">{{item.table_pnum}}人</view>  
23 - </view>  
24 - <view class="order-desk-type flex-cc white-font font20r">包间</view>  
25 - </view>  
26 - </block>  
27 - <block wx:else>  
28 - <view class="order-desk-info {{item.isselect==true ? 'desk-active' : ''}}" bindtap="binddesk" data-id="{{item.id}}" data-type="{{item.tid}}">  
29 - <view class="flex-vc order-desk-detail" style="height:100%;">  
30 - <view class="font28r black-font smooth">{{item.name}}</view>  
31 - <view class="font26r black-font" style="margin-top:6rpx;">6人</view>  
32 - </view>  
33 - </view>  
34 - </block>  
35 - </block>  
36 - <view class="flex-rr advice-more" bindtap="selectdesk">  
37 - <view style="padding-right:30rpx;" class="gray-deep-font font26r">更多</view>  
38 - <image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image>  
39 - </view>  
40 - </view>  
41 - </view>  
42 -</view>  
43 -<view class="cut"></view>  
44 -  
45 -  
46 -<view class="book-info" style="margin-bottom: 205rpx;">  
47 - <view class="book-info-single flex-lr" style="align-items:flex-start;">  
48 - <input placeholder="请输入预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{name}}" bindinput="changename" bindblur="ifAll"/>  
49 - <view class="book-info-grand flex-rr font28r gray-deep-font">  
50 - <block wx:for="{{grand}}">  
51 - <view class="book-grand flex-cc {{index==0 ? 'book-grand-border' : ''}} {{item.isselect==true ? 'book-grand-active white-font' : ''}}" bindtap="selectgrand" data-sex="{{item.sex}}">{{item.grand_title}}</view>  
52 - </block>  
53 - </view>  
54 - </view>  
55 - <view class="book-info-single flex-lr" style="align-items:flex-start;">  
56 - <input placeholder="请输入预订人手机号码(必填)" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11" bindblur="condition" bindinput="changephone" value="{{phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:{{reminder ? 400 : 680}}rpx;"/>  
57 - <block wx:if="{{reminder}}">  
58 - <view class="flex-rr" style="height:100rpx;">  
59 - <view style="color:#E14553;" class="font28r">{{reminder}}</view>  
60 - <image src="http://qn.colorcun.com/custom/lite-yd/image/name-have.png" class="phone-reminder"></image>  
61 - </view>  
62 - </block>  
63 - </view>  
64 - <view class="book-info-single">  
65 - <input placeholder="请输入顾客要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{remark}}" bindinput="changeremark"/>  
66 - </view>  
67 -</view>  
68 -<view class="zhanwei">  
69 - <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view>  
70 -</view>  
1 -view{  
2 - line-height:1.2;  
3 -}  
4 -.other-info{  
5 - width:100%;  
6 - height:220rpx;  
7 - padding:20rpx 0;  
8 - box-sizing:border-box;  
9 -}  
10 -.selected-time{  
11 - width:375rpx;  
12 - height:100%;  
13 - border-right:1px solid #efeef3;  
14 - box-sizing:border-box;  
15 -}  
16 -.actual-time{  
17 - margin-top:30rpx;  
18 -}  
19 -.border-line{  
20 - width:680rpx;  
21 - height:1px;  
22 - background:#efeef3;  
23 - margin:0 auto;  
24 -}  
25 -.advice-desk{  
26 - width:680rpx;  
27 - height:auto;  
28 - padding:40rpx 0;  
29 - margin:0 auto;  
30 -}  
31 -.advice-desk-detail{  
32 - margin-top:30rpx;  
33 -}  
34 -.order-desk-info{  
35 - width:120rpx;  
36 - height:120rpx;  
37 - background:#EBF8F8;  
38 - border:1px solid #199095;  
39 - border-radius:10rpx;  
40 - position:relative;  
41 - overflow:hidden;  
42 - margin-right:40rpx;  
43 -}  
44 -.desk-active{  
45 - background:#A9E3E6;  
46 -}  
47 -.order-desk-detail{  
48 - width:100%;  
49 - height:90rpx;  
50 -}  
51 -.order-desk-type{  
52 - width:100%;  
53 - height:30rpx;  
54 - background:#199095;  
55 - position:absolute;  
56 - left:0;  
57 - bottom:0;  
58 -}  
59 -.advice-more{  
60 - padding:20rpx 0;  
61 - padding-left:30rpx;  
62 -}  
63 -.cut{  
64 - width:100%;  
65 - height:4px;  
66 - background:#efeef3;  
67 -}  
68 -  
69 -  
70 -  
71 -.book-info{  
72 - width:680rpx;  
73 - padding-top:20rpx;  
74 - margin:0 auto;  
75 -}  
76 -.book-info-single{  
77 - width:100%;  
78 - height:120rpx;  
79 - padding-top:80rpx;  
80 - border-bottom:1px solid #efeef3;  
81 -}  
82 -.book-info-single>input{  
83 - width:100%;  
84 - height:100rpx;  
85 -}  
86 -.book-info-grand{  
87 - height:50rpx;  
88 - border:1px solid #199095;  
89 - margin-top:20rpx;  
90 -}  
91 -.book-grand{  
92 - width:90rpx;  
93 - height:100%;  
94 - box-sizing:border-box;  
95 -}  
96 -.book-grand-active{  
97 - background:rgba(25,153,149,.8);  
98 -}  
99 -.book-grand-border{  
100 - border-right:1px solid #199095;  
101 -}  
102 -.phone-reminder{  
103 - width:32rpx;  
104 - height:32rpx;  
105 - margin-left:20rpx;  
106 -}  
107 -  
108 -.zhanwei{  
109 - width:100%;  
110 - height:170rpx;  
111 - background:#efeef3;  
112 - position:fixed;  
113 - left:0;  
114 - right:0;  
115 - bottom:0;  
116 - z-index: 99;  
117 -}  
118 -  
119 -  
120 -.confirm-button{  
121 - width:680rpx;  
122 - height:85rpx;  
123 - background:#199095;  
124 - margin:42rpx auto 0;  
125 - border-radius:10rpx;  
126 - opacity:.6;  
127 -}  
128 -.confirm-button-active{  
129 - opacity:1;  
130 -}  
1 -// pages/manager-invitation/review.js  
2 -import util from '../../utils/util';  
3 -import App from '../../utils/api';  
4 -import TP from '../../utils/tpls';  
5 -const {regeneratorRuntime} = global  
6 -Page({  
7 -  
8 - /**  
9 - * 页面的初始数据  
10 - */  
11 - data: {  
12 - height: 667,  
13 - current: 0,  
14 - tpls: TP.tpls(),  
15 - seller:{  
16 - name:'',  
17 - room:'',  
18 - date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),  
19 - addr:'',  
20 - hasOwner:true,  
21 - },  
22 - options:{},  
23 - },  
24 - detail:{},  
25 -  
26 - /**  
27 - * 生命周期函数--监听页面加载  
28 - */  
29 - onLoad: function (options) {  
30 - options.tplid=options.tplid||1;  
31 - let param={  
32 - options:options,  
33 - }  
34 - if(true){  
35 - param.tpls=[TP.tpls(options.tplid)]  
36 - }  
37 - this.setData(param)  
38 - this.initData(options);  
39 - },  
40 - initData(options){  
41 - App.Reserve.Detail({rid:options.id,openid:''}).then(res=>{  
42 - this.detail=res.data;  
43 - let tables=[];  
44 - res.data.tables.forEach(t=>{  
45 - tables.push(t.name);  
46 - })  
47 - this.setData({  
48 - seller:{  
49 - name:res.data.seller.sellername,  
50 - room:tables.join('、'),  
51 - date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr),  
52 - addr:res.data.seller.real_address||res.data.seller.map_address,  
53 - image:res.data.image_url,  
54 - hasOwner:true,  
55 - }  
56 - })  
57 - })  
58 - },  
59 - /**  
60 - * 生命周期函数--监听页面初次渲染完成  
61 - */  
62 - onReady: function () {  
63 -  
64 - },  
65 -  
66 - /**  
67 - * 生命周期函数--监听页面显示  
68 - */  
69 - onShow: function () {  
70 - //导航栏自适应  
71 - let systemInfo = wx.getSystemInfoSync();  
72 - let reg = /ios/i;  
73 - let pt = 20;//导航状态栏上内边距  
74 - let h = 44;//导航状态栏高度  
75 - if (reg.test(systemInfo.system)) {  
76 - pt = systemInfo.statusBarHeight;  
77 - h = 44;  
78 - } else {  
79 - pt = systemInfo.statusBarHeight;  
80 - h = 48;  
81 - }  
82 - this.setData({  
83 - statusBarHeight: pt,  
84 - titleBarHeight: h,  
85 - height: systemInfo.windowHeight  
86 - })  
87 - },  
88 -  
89 - /**  
90 - * 生命周期函数--监听页面隐藏  
91 - */  
92 - onHide: function () {  
93 -  
94 - },  
95 -  
96 - /**  
97 - * 生命周期函数--监听页面卸载  
98 - */  
99 - onUnload: function () {  
100 -  
101 - },  
102 -  
103 - /**  
104 - * 页面相关事件处理函数--监听用户下拉动作  
105 - */  
106 - onPullDownRefresh: function () {  
107 -  
108 - },  
109 -  
110 - /**  
111 - * 页面上拉触底事件的处理函数  
112 - */  
113 - onReachBottom: function () {  
114 -  
115 - },  
116 -  
117 - /**  
118 - * 用户点击右上角分享  
119 - */  
120 - onShareAppMessage: function () {  
121 - let path=util.http_build_query({  
122 - ...this.data.options,  
123 - fromid:getApp().openid,  
124 - hasSellerShare:1,  
125 - hasInvitation:1,  
126 - },'/pages/customer/index')  
127 - return {  
128 - title: this.data.tpls[this.data.current].shareFirstTitle,  
129 - path: path,  
130 - imageUrl:this.data.tpls[this.data.current].shareFirstImage,  
131 - }  
132 - },  
133 - swiperChange(e){  
134 - let current=e.detail.current  
135 - this.setData({  
136 - current:current,  
137 - [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)  
138 - })  
139 - },  
140 - switchTabs(e){  
141 - let current=util.attr(e,'current')  
142 - this.setData({  
143 - current:current,  
144 - [`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)  
145 - })  
146 - },  
147 - sendmsg(){  
148 - if (!this.detail.phone) {  
149 - util.toast('未填写手机号码', 'none')  
150 - return;  
151 - } else if (!/^1\d{10}$/.test(this.detail.phone)) {  
152 - util.toast('手机号码错误', 'none')  
153 - return;  
154 - }  
155 - wx.navigateTo({  
156 - url: '/pages/book/b_sms?id=' + this.detail.id  
157 - });  
158 - },  
159 - gotoDetail(){  
160 - wx.redirectTo({  
161 - url: '/pages/book/b_detail?id=' + this.detail.id  
162 - });  
163 - }  
164 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav",  
7 - "formids":"/components/formids/formids",  
8 - "userinfo-share": "/components/userinfo/share"  
9 - }  
10 -}  
1 -<import src="../tpl/invitation"></import>  
2 -<swiper  
3 - indicator-dots="{{false}}"  
4 - autoplay="{{false}}"  
5 - duration="{{500}}"  
6 - bindchange="swiperChange"  
7 - current="{{current}}"  
8 - style="height:{{height}}px;"  
9 ->  
10 - <block wx:for="{{tpls}}" wx:key="tpls.key">  
11 - <swiper-item>  
12 - <view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;width:100%;">  
13 - <template is="tpl-{{item.id}}" data="{{seller,options}}"></template>  
14 - </view>  
15 - </swiper-item>  
16 - </block>  
17 -</swiper>  
18 -<view class="flex-vc"  
19 - style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;">  
20 - <view class="tabs flex-ll">  
21 - <formids class="back" bindclick="gotoDetail" >  
22 - <view style="min-width: 100rpx;" class="flex-ll">  
23 - <image class="back-image"  
24 - src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image>  
25 - </view>  
26 - </formids>  
27 - <block wx:if="{{false}}" wx:for="{{tpls}}" wx:key="tpls.key">  
28 - <view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view>  
29 - </block>  
30 - </view>  
31 -</view>  
32 -<view class="bottom flex-lr">  
33 - <formids bindclick="sendmsg" class="sendmsg">  
34 - 发短信  
35 - </formids>  
36 - <userinfo-share binduserinfo="share" class="share Semibold">  
37 - 通知客户  
38 - </userinfo-share>  
39 -</view>  
40 -<!--//商务-->  
41 -<template name="tpl-1">  
42 - <view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}">  
43 - <template is="tpl-shangwu" data="{{...seller,options}}"></template>  
44 - </view>  
45 -</template>  
46 -  
47 -<!--//温馨-->  
48 -<template name="tpl-2">  
49 - <template is="tpl-wenxin" data="{{...seller,options}}"></template>  
50 -</template>  
1 -@import "../manager-invitation/tpls.wxss";  
2 -.pages{  
3 - background-size: 100%;  
4 - font-size: 34rpx;  
5 -}  
6 -.tabs{  
7 -}  
8 -.tabs .item{  
9 - font-size: 32rpx;  
10 - color:#999999;  
11 - margin-left: 20rpx;  
12 - padding: 0 10rpx;  
13 - height: 66rpx;  
14 - line-height: 66rpx;  
15 -}  
16 -.tabs .item.active{  
17 - font-size: 36rpx;  
18 - font-weight: bold;  
19 - color: #E9D9B7;  
20 - border-bottom: 2rpx solid #E9D9B7;  
21 -}  
22 -image{  
23 - width: 100%;  
24 - height: 100%;  
25 -}  
26 -  
27 -.buts-share{  
28 - background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%8F%91%E9%82%80%E8%AF%B7%E5%87%BD.png");  
29 -}  
30 -.buts-share.customer{  
31 - background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E7%A1%AE%E8%AE%A4%E6%94%B6%E5%88%B0.png");  
32 -}  
33 -  
34 -.shangwu{  
35 - margin-top: 52rpx;  
36 -}  
37 -.shangwu .seller{  
38 - margin-bottom: 42rpx;  
39 -}  
40 -.shangwu .invit-logo.owner{  
41 - width: 380rpx;  
42 - height: 200rpx;  
43 - background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png");  
44 -}  
45 -.shangwu .invit-logo.customer{  
46 - width: 352rpx;  
47 - height: 164rpx;  
48 - background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png");  
49 -}  
50 -  
51 -  
52 -.wenxin-mask{  
53 - margin-top: 20rpx;  
54 -}  
55 -.wenxin-baitou{  
56 - margin-top: 20rpx;  
57 -}  
58 -.wenxin .seller{  
59 - margin-bottom: 22rpx;  
60 -}  
61 -.wenxin .invit-logo.owner{  
62 - width: 340rpx;  
63 - height: 184rpx;  
64 - background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.png");  
65 -}  
66 -.wenxin .invit-logo.customer{  
67 - width: 344rpx;  
68 - height: 198rpx;  
69 - background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%82%80%E8%AF%B7%E5%87%BD.png");  
70 -}  
71 -  
72 -.back{  
73 - margin-left: 40rpx;  
74 -}  
75 -.back-image{  
76 - height: 32rpx;  
77 - width: 18rpx;  
78 -}  
79 -.bottom{  
80 - position: fixed;  
81 - bottom: 0;  
82 - height: 98rpx;  
83 - line-height: 98rpx;  
84 - border-top: 2rpx solid #ECD9B7;  
85 - background-color: #ECD9B7;  
86 - width: 100%;  
87 -}  
88 -.bottom .sendmsg{  
89 - background-color: #262628;  
90 - width: 30%;  
91 - min-width: 30%;  
92 - color: #ECD9B7;  
93 - font-size: 30rpx;  
94 -}  
95 -.bottom .share{  
96 - text-align: center;  
97 - width: 70%;  
98 - font-size: 36rpx;  
99 - color: #794F28;  
100 -}  
1 -// pages/book/b_setting.js  
2 -var util = require('../../utils/util.js')  
3 -var bookOrder=require('../../utils/bookCommon.js')  
4 -import App from '../../utils/api';  
5 -const {regeneratorRuntime} = global  
6 -  
7 -Page({  
8 -  
9 - /**  
10 - * 页面的初始数据  
11 - */  
12 - data: {  
13 - dateStr:'',  
14 - calendarMaskLoad:false,  
15 - calendarMask:false,  
16 - dayStyle:[  
17 - { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' },  
18 - { month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5' }  
19 - ],  
20 - regions:[],  
21 - regions_active:'',  
22 - time:-1,  
23 - speciallist:[],  
24 - calendar:{  
25 - nextNum:0,  
26 - },  
27 - rdate:'',  
28 - },  
29 - regions:[],  
30 - sellerid:0,  
31 - timePickerArray:[  
32 - [],  
33 - [],  
34 - [],  
35 - ],  
36 - /**  
37 - * 生命周期函数--监听页面加载  
38 - */  
39 - onLoad: async function (options) {  
40 - let d=new Date()/1000;  
41 - let dateStr=util.unixtoTime(d,'MM-DD DAY');  
42 - let timePickerArray= await bookOrder.getDayTimeSpace();  
43 - let speciallist=[  
44 - { date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' },  
45 - { date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' },  
46 - { date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },  
47 - ];  
48 - this.setData({  
49 - dateStr:dateStr,  
50 - timePickerArray:timePickerArray,  
51 - speciallist:speciallist,  
52 - })  
53 - },  
54 -  
55 - /**  
56 - * 生命周期函数--监听页面初次渲染完成  
57 - */  
58 - onReady: function () {  
59 -  
60 - },  
61 -  
62 - /**  
63 - * 生命周期函数--监听页面显示  
64 - */  
65 - onShow: async function () {  
66 - this.setData({  
67 - height:getApp().system.windowHeight-170,  
68 - })  
69 - setTimeout(()=>{  
70 - this.setData({  
71 - calendarMaskLoad:true,  
72 - })  
73 - },1000);  
74 - this.selectComponent('#nav').init();  
75 - this.sellerid=util.cache('sellerid');  
76 - App.Tables.GetTableListsBySellerId({  
77 - sellerid:this.sellerid  
78 - }).then((res)=>{  
79 - this.regions=res.data[0];  
80 - this.getbooklist();  
81 - })  
82 - },  
83 -  
84 - /**  
85 - * 生命周期函数--监听页面隐藏  
86 - */  
87 - onHide: function () {  
88 -  
89 - },  
90 -  
91 - /**  
92 - * 生命周期函数--监听页面卸载  
93 - */  
94 - onUnload: function () {  
95 -  
96 - },  
97 - calendarShow(){  
98 - console.log('xxxxx')  
99 - this.setData({  
100 - calendarMask:true  
101 - })  
102 - console.log(this.data.calendarMask)  
103 - },  
104 - dateChange(event){  
105 - let cktime=util.timetouUnix(event.detail.date)  
106 - let day0=parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000);  
107 - // if(cktime<day0){  
108 - // util.toast('请选择今天之后的日期','none');  
109 - // return;  
110 - // }  
111 - let clickDay = event.detail.date.substr(8,2);  
112 - let changeDay = `dayStyle[1].day`;  
113 - let changeBg = `dayStyle[1].background`;  
114 - this.setData({  
115 - dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),  
116 - [changeDay]: clickDay,  
117 - [changeBg]: "#84e7d0",  
118 - })  
119 -  
120 - this.getbooklist();  
121 - this.calendarClose();  
122 - },  
123 - calendarClose(){  
124 - this.setData({  
125 - calendarMask:false  
126 - })  
127 - },  
128 - async getbooklist(){  
129 - let obj={};  
130 -  
131 - let formdata={};  
132 - formdata.sid=this.sellerid;  
133 - formdata.x=1;  
134 - formdata.y=200;  
135 - let time=0;  
136 - if(this.data.time<0){  
137 - let sid=await bookOrder.getTimeSpaceIndexData();  
138 - time=sid.timeIndex  
139 - obj.time=time;  
140 - }else{  
141 - time=this.data.time;  
142 - }  
143 - let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time);  
144 - formdata.rdate=rdate;  
145 - formdata.status='1,2';  
146 - obj.rdate=rdate;  
147 - let tids={};  
148 - let reserves=await App.Reserve.GetReserveList(formdata);  
149 - if(reserves.data.length>0){  
150 - reserves.data.forEach(r=>{  
151 - let ts=r.tid.split(',');  
152 - ts.forEach(tid=>{  
153 - let rname='';  
154 - if(r.sex==3){  
155 - rname=r.rname.substr(0,10)  
156 - }else{  
157 - rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')  
158 - }  
159 - tids[tid]={  
160 - rdate:r.rdate,  
161 - id:r.id,  
162 - status:r.status,  
163 - rname:rname,  
164 - }  
165 - })  
166 - })  
167 - }  
168 - console.log('tids',tids);  
169 - let regions=[];  
170 - this.regions.forEach(region=>{  
171 - if(region.list.length>0){  
172 - let list_num=0;  
173 - region.list.forEach(tb=>{  
174 - tb.status_str='';  
175 - tb.status_classname='enabled'  
176 - tb.reserve_name=''  
177 - tb.reserve_id=''  
178 - if(tb.status!=0 && tb.status!=""){  
179 - tb.status_str='用餐中';  
180 - tb.status_classname='highlight';  
181 - tb.reserve_name=tb.spell==1?'拼桌':'堂食';  
182 - }else if(tids[tb.id]){  
183 - console.log('tids',region.name,tb.name);  
184 - tb.status_str=tids[tb.id].status==2?'用餐中':'已预订';  
185 - tb.status_classname='highlight';  
186 - tb.reserve_id=tids[tb.id].id;  
187 - tb.reserve_name=tids[tb.id].rname;  
188 - }  
189 - if(tb.enable!=1){  
190 - if(tb.status_str){  
191 - tb.status_classname='disabled-highlight';  
192 - }else{  
193 - tb.status_str='已停用';  
194 - tb.status_classname='disabled';  
195 - }  
196 - }  
197 - if(!tb.status_str){  
198 - list_num++;  
199 - }  
200 - region.list_num=list_num;  
201 - })  
202 - regions.push(region);  
203 - }  
204 - })  
205 - obj.regions=regions  
206 - if(!this.data.regions_active){  
207 - obj.regions_active=this.regions[0].name  
208 - }  
209 - this.setData(obj)  
210 - },  
211 - chooseRegion(e){  
212 - this.setData({  
213 - regions_active:util.attr(e,'name')  
214 - })  
215 - },  
216 - selectedValue(e){  
217 - this.setData({  
218 - time:util.attr(e,'value')  
219 - })  
220 - this.getbooklist();  
221 - },  
222 - boardEvent(e){  
223 - console.log(e);  
224 - App.Tables.GetTableListsBySellerId({  
225 - sellerid:this.sellerid  
226 - },true).then((res)=>{  
227 - this.regions=res.data[0];  
228 - this.getbooklist();  
229 - })  
230 - },  
231 - gotoday(e){  
232 - this.setData({  
233 - [`calendar.nextNum`]:0  
234 - })  
235 - },  
236 - nextMonth(e){  
237 - this.setData({  
238 - [`calendar.nextNum`]:this.data.calendar.nextNum+1  
239 - })  
240 - },  
241 - prevMonth(e){  
242 - this.setData({  
243 - [`calendar.nextNum`]:this.data.calendar.nextNum-1  
244 - })  
245 - },  
246 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav",  
7 - "tabBar":"/components/book/tabBar/tabBar",  
8 - "calendar": "plugin://bmCalendar/calendar",  
9 - "board":"/components/book/board/board",  
10 - "formids":"/components/formids/formids"  
11 - }  
12 -}  
1 -<!--pages/book/b_setting.wxml-->  
2 -<nav id="nav">桌位</nav>  
3 -<view class="page">  
4 - <view class="search-easy flex-lr">  
5 - <formids class="block flex-vc" bindtap="calendarShow">  
6 - <view class="flex-vc">  
7 - <view class="green-font font34r font-bold flex-cc">{{dateStr}}</view>  
8 - </view>  
9 - </formids>  
10 - <view class="block section flex-vc">  
11 - <view class="tab flex-cc">  
12 - <formids class="item {{time==0?'checked':''}} flex-cc"  
13 - wx:if="{{timePickerArray[0].length>0}}"  
14 - bindtap="selectedValue" data-key="time" data-value="0">早市</formids>  
15 - <formids class="item {{time==1?'checked':''}} flex-cc"  
16 - wx:if="{{timePickerArray[1].length>0}}"  
17 - bindtap="selectedValue" data-key="time" data-value="1">午市</formids>  
18 - <formids class="item {{time==2?'checked':''}} flex-cc"  
19 - wx:if="{{timePickerArray[2].length>0}}"  
20 - bindtap="selectedValue" data-key="time" data-value="2">晚市</formids>  
21 - </view>  
22 - </view>  
23 - </view>  
24 - <view class="flex-lr disks">  
25 - <view class="menus Medium" style="height: {{height}}px;">  
26 - <view class="menu flex-cc {{regions_active==item.name?'active':''}}"  
27 - wx:for="{{regions}}" wx:key="regions.key"  
28 - bindtap="chooseRegion" data-name="{{item.name}}">  
29 - <view class="menu-text">{{item.name}}</view>  
30 - <view class="last-num {{item.list_num>0?'':'full'}}">{{item.list_num>0?'余'+item.list_num:'满座'}}</view>  
31 - </view>  
32 - </view>  
33 - <view class="items" style="height: {{height}}px;">  
34 - <block wx:for="{{regions}}" wx:key="regions.key">  
35 - <view class="items-disks flex-ll" style="flex-wrap: wrap"  
36 - wx:if="{{regions_active==item.name}}">  
37 - <board width="160" height="180" board="{{item}}"  
38 - ddate="{{rdate}}"  
39 - style="margin: 20rpx 0 0 20rpx"  
40 - bindboardEvent="boardEvent"  
41 - event="boardOpt"  
42 - wx:for="{{item.list}}" wx:key="item.key" ></board>  
43 - </view>  
44 - </block>  
45 - </view>  
46 - </view>  
47 -</view>  
48 -<tabBar></tabBar>  
49 -<view class="calendar-mask" bindtap="calendarClose"  
50 - style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}">  
51 - <view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;">  
52 - <calendar catchtap="catchtap"  
53 - isTodaybtn="{{true}}" todaybtn_txt="回到今天"  
54 - custom="{{false}}"  
55 - switchover="{{['上一月','下个月']}}"  
56 - active-coloro="active-coloro"  
57 - active-colort="active-colort"  
58 - speciallist="{{speciallist}}"  
59 - txt_style="txt-style"  
60 - calendar-style="calendar"  
61 - header-style="calendar-header"  
62 - weektitle-style="weektitle-style"  
63 - restcolor-style="restcolor-style"  
64 - txt_type="cn-d"  
65 -  
66 - datefont-style="datefont-style"  
67 - todaybtn-style="todaybtn-style"  
68 -  
69 - bindnextMonth="nextMonth"  
70 - bindprevMonth="prevMonth"  
71 - bindselectDate="dateChange"  
72 - bindgotoday="gotoday"  
73 -  
74 - prev="{{true||calendar.nextNum>0}}"  
75 - circle_show="{{false}}"  
76 - closelaststyle="{{true}}"  
77 - ></calendar>  
78 - </view>  
79 -</view>  
1 -/* pages/book/b_setting.wxss */  
2 -.page{  
3 - width: 100%;  
4 - margin: 20rpx 0 0;  
5 - overflow: hidden;  
6 -}  
7 -.search-easy{  
8 - height:80rpx;  
9 -}  
10 -.search-easy .block{  
11 - width: 50%;  
12 - min-width: 50%;  
13 - height: 100%;  
14 -}  
15 -  
16 -.search-easy .block:first-child{  
17 - border-right: 1px solid #E0E0E0;  
18 -}  
19 -.section .tab{  
20 - font-size: 34rpx;  
21 - color: #199095;  
22 - height: 50rpx;  
23 -}  
24 -.section .tab .item{  
25 - height: 50rpx;  
26 - line-height: 49rpx;  
27 - width: 94rpx !important;  
28 - min-width: 94rpx !important;  
29 - border-radius: 10rpx;  
30 - border: 2rpx solid #199095;  
31 - margin-right: 16rpx;  
32 - text-align: center;  
33 - display: block;  
34 -}  
35 -.section .tab .checked{  
36 - background-color:#199095;  
37 - color: #FEFEFE;  
38 -}  
39 -  
40 -  
41 -@import "common/calendar.wxss";  
42 -  
43 -  
44 -  
45 -.disks{  
46 - width: 100%;  
47 - border-top: 1rpx solid #E0E0E0;  
48 - margin-top: 14rpx;  
49 - background-color: #F5F5F5;  
50 -}  
51 -.disks .menus,.disks .items{  
52 - overflow-y: auto;  
53 -}  
54 -.disks .menus{  
55 - background-color: #fefefe;  
56 - width: 168rpx;  
57 - min-width: 168rpx;  
58 - color: #999999;  
59 -}  
60 -.disks .menu{  
61 - height: 160rpx;  
62 - overflow: hidden;  
63 - border-left: 4rpx solid #fefefe;  
64 - border-bottom: 1rpx solid #F5F5F5;  
65 - position: relative;  
66 -}  
67 -.disks .menu.active{  
68 - background-color: #F5F5F5;  
69 - border-left: 4rpx solid #199095;  
70 - color: #199095;  
71 -}  
72 -.disks .menu-text{  
73 - font-size: 30rpx;  
74 - width: 120rpx;  
75 - margin: 0 auto;  
76 - max-height: 84rpx;  
77 - line-height: 42rpx;  
78 - overflow: hidden;  
79 -}  
80 -  
81 -.disks .items{  
82 - width: 100%;  
83 -}  
84 -.disks .items-disks{  
85 - margin: 0 auto;  
86 - width: 570rpx;  
87 - padding-bottom: 80rpx;  
88 -}  
89 -.disks .menu .last-num{  
90 - position: absolute;  
91 - right: 0rpx;  
92 - top:0rpx;  
93 - width: 78rpx;  
94 - height: 30rpx;  
95 - line-height: 30rpx;  
96 - font-size: 24rpx;  
97 - color: #FEFEFE;  
98 - background-color: #61A5D1;  
99 - text-align: center;  
100 -}  
101 -.disks .menu .last-num.full{  
102 - background-color: #999999;  
103 -}  
1 -// pages/book/b_sms.js  
2 -var util = require('../../utils/util.js')  
3 -import App from '../../utils/api';  
4 -import bcm from '../../utils/bookCommon';  
5 -const {regeneratorRuntime} = global  
6 -import ST from './b_sms_tpls';  
7 -const tpls = {  
8 - SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!',  
9 - SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!',  
10 - SMS_163050401: '尊敬的贵宾,您好!\n ${seller_name}已为您安排${date}的用餐,房间:${region_room_name}; \n地址:${seller_addr}; \n电话:${seller_phone} \n预祝用餐愉快,${cusman}期待您的光临!',  
11 -};  
12 -Page({  
13 -  
14 - /**  
15 - * 页面的初始数据  
16 - */  
17 - tplsIndex: 'SMS_163050401',  
18 - data: {  
19 - bookInfo: {},  
20 - tplMsg: ''  
21 - },  
22 - sc:{},  
23 - /**  
24 - * 生命周期函数--监听页面加载  
25 - */  
26 - onLoad: function (options) {  
27 - this.enter_params=util.cache('enter_params');  
28 - App.Reserve.SellerInfo(this.enter_params).then(res=>{  
29 - this.sc=res.data;  
30 - try{  
31 - this.tplsIndex=res.data.setting.template_code  
32 - }catch(e){}  
33 - this.getDetail(options.id);  
34 - });  
35 - },  
36 -  
37 - /**  
38 - * 生命周期函数--监听页面初次渲染完成  
39 - */  
40 - onReady: function () {  
41 -  
42 - },  
43 -  
44 - /**  
45 - * 生命周期函数--监听页面显示  
46 - */  
47 - onShow: function () {  
48 -  
49 - },  
50 -  
51 - /**  
52 - * 生命周期函数--监听页面隐藏  
53 - */  
54 - onHide: function () {  
55 -  
56 - },  
57 -  
58 - /**  
59 - * 生命周期函数--监听页面卸载  
60 - */  
61 - onUnload: function () {  
62 -  
63 - },  
64 - bookInfo: null,  
65 - async getDetail(id){  
66 - let res=await App.Reserve.Detail({rid: id, openid: ''});  
67 - this.bookInfo=res.data  
68 - let tplMsg=await ST.getTplMsg(res.data,this.sc.setting.template_code,this.sc)  
69 - this.setData({  
70 - bookInfo: res.data,  
71 - tplMsg: tplMsg  
72 - })  
73 - },  
74 - sendsms(){  
75 - App.SendSMS.Message({  
76 - phone: this.bookInfo.phone,  
77 - sign_name: '一键订',  
78 - template_code: this.tplsIndex,  
79 - template_param: JSON.stringify(ST.smsData),  
80 - rid: this.bookInfo.id,  
81 - len:this.data.tplMsg.length  
82 - }).then((res) => {  
83 - if (res.ret != 200) {  
84 - return util.toast(res.msg, 'none');  
85 - }  
86 - util.toast('短信已发送');  
87 - this.setData({  
88 - hideSendsms: true,  
89 - })  
90 - App.Reserve.SmsInfo({seller_id: this.bookInfo.seller.id}, 'clear')  
91 - })  
92 - },  
93 - copysms(){  
94 - wx.setClipboardData({  
95 - data: this.data.tplMsg  
96 - })  
97 - },  
98 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav"  
7 - }  
8 -}  
1 -<!--pages/book/b_sms.wxml-->  
2 -<nav>发送短信</nav>  
3 -<view class="page">  
4 - <view class="tip">已自动生成通知短信,可直接发送</view>  
5 - <textarea class="tpl" auto-height value="{{tplMsg}}" maxlength="-1" disabled>  
6 -  
7 - </textarea>  
8 - <button class="sms-but send" bindtap="sendsms" hidden="{{hideSendsms}}">直接发送</button>  
9 - <button class="sms-but copy" plain bindtap="copysms">复制短信</button>  
10 -</view>  
11 -  
1 -/* pages/book/b_sms.wxss */  
2 -.page{  
3 - width: 90%;  
4 - margin: 60rpx 5% 0;  
5 - font-size: 30rpx;  
6 -}  
7 -.tip{  
8 - margin-bottom: 34rpx;  
9 -}  
10 -.tpl{  
11 - border: solid 2rpx #999999;  
12 - border-radius: 10rpx;  
13 - width: 90%;  
14 - padding: 5%;  
15 - margin-bottom: 200rpx;  
16 -}  
17 -.sms-but,.sms-but[plain]{  
18 - margin-bottom: 18rpx;  
19 - border: solid 2rpx #199095;  
20 - font-size: 34rpx;  
21 - height: 84rpx;  
22 - line-height: 84rpx;  
23 -}  
24 -.sms-but.send{  
25 - background-color: #199095;  
26 - color:#fff;  
27 -}  
28 -.sms-but.copy{  
29 - color:#199095;  
30 -}  
1 -.calendar-mask{  
2 - position: fixed;  
3 - z-index: 99;  
4 - width: 100%;  
5 - height: 100%;  
6 - left:0;  
7 - top:0;  
8 - background-color: rgba(0,0,0,.5);  
9 -}  
10 -.calendar {  
11 - background-color: #fefefe;  
12 - position: absolute;  
13 - bottom: 0;  
14 - width: 100%;  
15 - height: 720rpx;  
16 -}  
17 -.calendar-header{  
18 - background: #199095 ;  
19 - color: #fff;  
20 -}  
21 -.weektitle-style {  
22 - background-color: #199095;  
23 - color: #4fcfcf;  
24 -}  
25 -.restcolor-style{  
26 - color:orange !important;  
27 -}  
28 -.active-coloro {  
29 - color: #fff!important;  
30 - background: #199095;  
31 -}  
32 -.active-colort {  
33 - color: #fff!important;  
34 - background: #b8d5eb;  
35 -}  
36 -.txt-style{  
37 - margin-top: -24rpx;  
38 - color: #199095;  
39 -}  
40 -.datefont-style{  
41 - color: #199095;  
42 -}  
43 -.todaybtn-style{  
44 - line-height: 30rpx!important;  
45 - width: 60rpx!important;  
46 - height: 60rpx!important;  
47 - padding: 20rpx;  
48 - color: #fff!important;  
49 - background-color: #199095!important;  
50 - position: absolute;  
51 - bottom: 10rpx; right: 60rpx;  
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 -}  
1 -// pages/book/setting/index.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -import PubSub from '../../../utils/PubSub'  
6 -Page({  
7 - offset: 0,  
8 - limit: 10,  
9 - hasMore: true,  
10 - list:{},  
11 - /**  
12 - * 页面的初始数据  
13 - */  
14 - data: {  
15 - list:[],  
16 - hasMore:true,  
17 - hasSalesman:false,  
18 - },  
19 -  
20 - /**  
21 - * 生命周期函数--监听页面加载  
22 - */  
23 - enter_params: {},  
24 - onLoad: function (options) {  
25 - this.enter_params = util.cache('enter_params');  
26 - if(this.enter_params){  
27 - App.Reserve.SellerInfo(this.enter_params).then(res=>{  
28 - this.setData({  
29 - hasSalesman:res.data.hasSalesman==1  
30 - })  
31 - })  
32 - }  
33 - this.seller_id=options.seller_id||this.enter_params.seller_id;  
34 - this.getMembers();  
35 - App.Reserve.GetNewCustomerTotal({},'clean');  
36 - },  
37 -  
38 - /**  
39 - * 生命周期函数--监听页面初次渲染完成  
40 - */  
41 - onReady: function () {  
42 -  
43 - },  
44 -  
45 - /**  
46 - * 生命周期函数--监听页面显示  
47 - */  
48 - onShow: function () {  
49 -  
50 - },  
51 -  
52 - /**  
53 - * 生命周期函数--监听页面隐藏  
54 - */  
55 - onHide: function () {  
56 -  
57 - },  
58 - onUnload(){  
59 - PubSub.emit(  
60 - 'flushNewCustomer',  
61 - []  
62 - )  
63 - },  
64 - /**  
65 - * 页面上拉触底事件的处理函数  
66 - */  
67 - onReachBottom: function () {  
68 - if(this.hasMore){  
69 - this.getMembers(true);  
70 - }  
71 - },  
72 - getMembers(hasReachBottom=false){  
73 - App.Reserve.Members({  
74 - sid: this.seller_id||'xxxx',  
75 - //manager_id:this.enter_params.manager_id,  
76 - //manager_openid:this.enter_params.seller_openid,  
77 - offset: this.offset,  
78 - limit: this.limit,  
79 - }).then(res => {  
80 - let list = this.data.list;  
81 - let dl=res.data.length;  
82 - if (dl > 0) {  
83 - res.data.forEach(r => {  
84 - //r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II')  
85 - list.push(r)  
86 - this.list[r.id] = r;  
87 - })  
88 - }  
89 - let obj={list:list};  
90 - if(dl<this.limit && hasReachBottom){  
91 - this.hasMore=false;  
92 - obj.hasMore=false;  
93 - }else{  
94 - this.offset+=this.limit;  
95 - }  
96 - this.setData(obj)  
97 - })  
98 - },  
99 - sendSalesmanMsg(e){  
100 - let openid=util.attr(e,'openid')  
101 - App.Reserve.OperationalMessagePush({  
102 - openid:openid  
103 - }).then(res=>{  
104 - if(res.ret!=200){  
105 - return util.toast(res.msg,'none')  
106 - }  
107 - util.toast('已发送')  
108 - })  
109 - },  
110 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav",  
7 - "tabBar":"/components/book/tabBar/tabBar",  
8 - "formids":"/components/formids/formids"  
9 - }  
10 -}  
1 -<!--pages/book/setting/index.wxml-->  
2 -<nav id="nav" backgroundColor="#199095" color="#fefefe">我的客户</nav>  
3 -<view class="pages">  
4 - <block wx:if="{{list.length>0}}">  
5 - <view class="row flex-lr" wx:for="{{list}}" wx:key="list.key" >  
6 - <view class="flex-ll">  
7 - <view class="avatar">  
8 - <image src="{{item.headimgurl}}"></image>  
9 - </view>  
10 - <view class="nickname">{{item.nickname||''}}</view>  
11 - </view>  
12 - <view class="flex-rr optmsg" wx:if="{{hasSalesman}}" bindtap="sendSalesmanMsg" data-openid="{{item.openid}}">  
13 - <view>发送消息</view>  
14 - <view class="more"></view>  
15 - </view>  
16 - </view>  
17 - </block>  
18 - <view wx:else="" class="history-is-empty flex-vc Medium">  
19 - <image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image>  
20 - <view>暂时还没有客户</view>  
21 - </view>  
22 - <view wx:if="{{!hasMore}}" class="row flex-vc">已经到底了</view>  
23 -</view>  
1 -/* pages/book/setting/index.wxss */  
2 -/*  
3 -http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png  
4 -http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png  
5 -*/  
6 -.pages{  
7 - width: 90%;  
8 - margin: 0 auto 50rpx;  
9 - color: #353535;  
10 - overflow-y: auto;  
11 -}  
12 -.row{  
13 - font-size: 34rpx;  
14 - height: 106rpx;  
15 - border-bottom: 2rpx solid #F1F0F4;  
16 - padding-top: 34rpx;  
17 -}  
18 -.row .right{  
19 - font-size: 30rpx;  
20 - color:#999999;  
21 -}  
22 -.row .more{  
23 - margin-left: 20rpx;  
24 -}  
25 -.row:last-child{  
26 - border-bottom-width: 0;  
27 -}  
28 -  
29 -.history-is-empty{  
30 - margin: 200rpx auto;  
31 - font-size: 34rpx;  
32 -  
33 -}  
34 -.history-is-empty image{  
35 - width: 376rpx;  
36 - height: 310rpx;  
37 - margin-bottom: 122rpx;  
38 -}  
39 -.avatar{  
40 - width: 80rpx;  
41 - height: 80rpx;  
42 - border-radius: 50%;  
43 - overflow: hidden;  
44 -}  
45 -.avatar image{  
46 - width: 100%;  
47 - height: 100%;  
48 -}  
49 -.nickname{  
50 - margin-left: 40rpx;  
51 - font-size: 34rpx;  
52 -}  
53 -.optmsg{  
54 - font-size: 30rpx;  
55 - color:#199095;  
56 -}  
1 -import util from '../../../utils/util';  
2 -import App from '../../../utils/api';  
3 -Page({  
4 - data:{  
5 - alllabel:[  
6 -  
7 - ],  
8 - },  
9 - onLoad:function(){  
10 - this.getlabellist();  
11 - },  
12 - onShow:function(){  
13 -  
14 - },  
15 - inputremark:function(e){  
16 - this.setData({  
17 - defineremark:util.trim(e.detail.value)  
18 - })  
19 - },  
20 - //选择常用备注  
21 - taplabel:function(e){  
22 - var _target=e.currentTarget.dataset;  
23 - var oftenlabel=0,alllabel=this.data.alllabel;  
24 - alllabel.forEach(function(v,i){  
25 - if(v.often_use!=''){  
26 - oftenlabel++;  
27 - }  
28 - })  
29 - if(_target.type=='often'){  
30 - this.setlabel(_target.id,_target.type);  
31 - }else{  
32 - if(oftenlabel<10){  
33 - this.setlabel(_target.id,_target.type);  
34 - }else{  
35 - wx.showToast({  
36 - title:'最多可添加10个',  
37 - icon:'none',  
38 - duration:2000  
39 - })  
40 - }  
41 - }  
42 - },  
43 - getlabellist:function(){  
44 - App.User.GetCustomRemark({  
45 - uid:util.cache('enter_params')['manager_id']  
46 - }).then(res=>{  
47 - console.log(res)  
48 - this.setData({  
49 - alllabel:res.data,  
50 - })  
51 - this.setData({  
52 - focus:true,  
53 - })  
54 - })  
55 - },  
56 - setlabel:function(id,flag){  
57 - App.User.GetCustomRemark({  
58 - uid:util.cache('enter_params')['manager_id'],  
59 - kid:id,  
60 - flag:flag,  
61 - }).then(res=>{  
62 - console.log(res)  
63 - this.setData({  
64 - alllabel:res.data  
65 - })  
66 - })  
67 - },  
68 - addinputlabel:function(e){  
69 - this.setData({  
70 - focus:false  
71 - })  
72 - if(util.trim(e.detail.value)!=''){  
73 - this.addlabel(util.trim(e.detail.value))  
74 - }  
75 -  
76 - },  
77 - //添加自定义标签  
78 - addlabel:function(custom){  
79 - App.User.AddCustomRemark({  
80 - uid:util.cache('enter_params')['manager_id'],  
81 - custom:custom,  
82 - }).then(res=>{  
83 - console.log(res)  
84 - if(res.ret==200){  
85 - this.setData({  
86 - defineremark:null,  
87 - })  
88 - this.getlabellist();  
89 - }else{  
90 - this.setData({  
91 - defineremark:null,  
92 - })  
93 - wx.showToast({  
94 - title:'最多可添加20个备注',  
95 - icon:'none',  
96 - duration:2000  
97 - })  
98 - }  
99 - })  
100 - },  
101 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav",  
7 - "tabBar":"/components/book/tabBar/tabBar",  
8 - "formids":"/components/formids/formids"  
9 - }  
10 -}  
1 -<nav id="nav">常用备注</nav>  
2 -<view class="cut"></view>  
3 -<view class="label">  
4 - <view class="label-title black-font font30r smooth" style="padding-bottom:40rpx;">我的常用备注<text class="font24r smooth gray-deep-font">(最多添加10个)</text></view>  
5 - <view class="label-list flex-rs me-label-list">  
6 - <block wx:for="{{alllabel}}">  
7 - <block wx:if="{{item.often_use!=''}}">  
8 - <view class="label-single-all flex-ll bg_green" data-id="{{item.id}}" data-type="often" bindtap="taplabel">  
9 - <view class="white-font label-single flex-cc font28r smooth">{{item.custom}}</view>  
10 - <view style="height:40rpx;border-left:1px solid rgba(255,255,255,.3);padding:0 8rpx;" class="flex-cc"><image src="../../image/close.svg" class="close"></image></view>  
11 - </view>  
12 - </block>  
13 - </block>  
14 - <view style="min-width:176rpx;"><input class="black-font flex-cc font28r smooth label-input flex-cc" placeholder="添加备注" maxlength="10" style="width:{{defineremark && defineremark.length>4 ? (defineremark.length-4)*28+160 : 160}}rpx;" value="{{defineremark}}" bindinput="inputremark" focus="{{focus}}" cursor-spacing="160" bindblur="addinputlabel" placeholder-style="color:#999;font-size:28rpx;text-align:center;"/></view>  
15 - </view>  
16 - <view class="label-title black-font font30r smooth">所有备注<text class="font24r smooth gray-deep-font">(最多添加20个)</text></view>  
17 - <view class="label-list flex-rs">  
18 - <block wx:for="{{alllabel}}">  
19 - <view class="label-single flex-cc font28r smooth {{item.often_use!='' ? 'bg_green white-font' : 'all-label green-font'}}" data-id="{{item.id}}" data-type="{{item.often_use!='' ? 'often' : 'custom'}}" bindtap="taplabel" style="margin:0 16rpx 20rpx 0;">{{item.custom}}</view>  
20 - </block>  
21 - </view>  
22 -</view>  
1 -.label{  
2 - width:100%;  
3 - padding:0 30rpx;  
4 - box-sizing: border-box;  
5 -}  
6 -.label-title{  
7 - width:100%;  
8 - padding:30rpx 0;  
9 -}  
10 -.me-label-list{  
11 - padding-bottom: 10rpx;  
12 - border-bottom:1px solid #eee;  
13 - margin-bottom:40rpx;  
14 -}  
15 -.label-single-all{  
16 - height:56rpx;  
17 - margin:0 16rpx 20rpx 0;  
18 - border-radius:8rpx;  
19 - overflow:hidden;  
20 -}  
21 -.label-single{  
22 - height:56rpx;  
23 - padding:0 24rpx;  
24 - border-radius:8rpx;  
25 -}  
26 -.label-input{  
27 - width:160rpx;  
28 - height:56rpx;  
29 - box-sizing: border-box;  
30 - border:1px solid #ccc;  
31 - max-width:400rpx;  
32 - min-width:140rpx;  
33 - margin:0 16rpx 20rpx 0;  
34 - border-radius:8rpx;  
35 - text-align:center;  
36 - padding:0 10rpx;  
37 -}  
38 -.all-label{  
39 - box-sizing: border-box;  
40 - border:1px solid rgba(25,144,149,.3);  
41 -}  
42 -.close{  
43 - width:18rpx;  
44 - height:18rpx;  
45 -}  
1 -// pages/book/setting/index.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -import PubSub from '../../../utils/PubSub'  
6 -Page({  
7 -  
8 - /**  
9 - * 页面的初始数据  
10 - */  
11 - data: {  
12 - NewCustomerTotal:0,  
13 - },  
14 -  
15 - /**  
16 - * 生命周期函数--监听页面加载  
17 - */  
18 - enter_params: {},  
19 - onLoad: function (options) {  
20 - this.enter_params = util.cache('enter_params');  
21 - App.Reserve.SellerInfo(this.enter_params).then(res => {  
22 - this.setData({  
23 - seller: res.data.seller,  
24 - user: res.data.seller_user  
25 - })  
26 - })  
27 - PubSub.on(  
28 - 'flushNewCustomer',  
29 - data=>{  
30 - console.log('flushNewCustomer',data)  
31 - this.selectComponent('#tabBar').hasDot();  
32 - }  
33 - )  
34 - },  
35 -  
36 - /**  
37 - * 生命周期函数--监听页面初次渲染完成  
38 - */  
39 - onReady: function () {  
40 -  
41 - },  
42 -  
43 - /**  
44 - * 生命周期函数--监听页面显示  
45 - */  
46 - onShow: function () {  
47 - App.Reserve.SmsInfo({seller_id: this.enter_params.seller_id}).then(res => {  
48 - if (res.ret == 404) {  
49 - res.data = {  
50 - last_num: 100,  
51 - meals: [  
52 - {id: 1, total: 550, price_ave: 0.09, price_old: 50, price: 50, discount: 0},  
53 - {id: 2, total: 1200, price_ave: 0.083, price_old: 100, price: 100, discount: 0},  
54 - {id: 3, total: 3650, price_ave: 0.082, price_old: 328, price: 300, discount: 9.1},  
55 - ],  
56 - };  
57 - }  
58 - this.setData({  
59 - sms: res.data,  
60 - })  
61 - })  
62 - },  
63 -  
64 - /**  
65 - * 生命周期函数--监听页面隐藏  
66 - */  
67 - onHide: function () {  
68 -  
69 - },  
70 - NewCustomer(e){  
71 - this.setData({  
72 - NewCustomerTotal:e.detail.total  
73 - })  
74 - }  
75 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav",  
7 - "tabBar":"/components/book/tabBar/tabBar",  
8 - "formids":"/components/formids/formids"  
9 - }  
10 -}  
1 -<!--pages/book/setting/index.wxml-->  
2 -<nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav>  
3 -<view class="header">  
4 - <view class="info">  
5 - <view class="nick">{{user.nick_name || user.nickname}}</view>  
6 - <view class="seller Medium">{{seller.sellername}} | {{user.role_name||''}}</view>  
7 - </view>  
8 -</view>  
9 -<view class="page">  
10 - <formids url="/pages/book/setting/sms">  
11 - <view class="row flex-lr">  
12 - <view>短信管理</view>  
13 - <view class="flex-rr">  
14 - <view class="right lastNum">剩余{{sms.last_num||0}}条</view>  
15 - <view class="more"></view>  
16 - </view>  
17 - </view>  
18 - </formids>  
19 - <formids url="/pages/book/smsbatch/index">  
20 - <view class="row flex-lr" style="padding-top: 34rpx;">  
21 - <view>短信营销</view>  
22 - <view class="flex-rr">  
23 - <view class="more"></view>  
24 - </view>  
25 - </view>  
26 - </formids>  
27 - <formids url="/pages/book/crm/index">  
28 - <view class="row flex-lr" style="padding-top: 34rpx;">  
29 - <view>我的客户</view>  
30 - <view class="flex-rr">  
31 - <text class="right" wx:if="{{NewCustomerTotal>0}}" style="color: #F05522;">新增{{NewCustomerTotal}}位</text>  
32 - <view class="more"></view>  
33 - </view>  
34 - </view>  
35 - </formids>  
36 - <formids url="/pages/book/remark/index">  
37 - <view class="row flex-lr" style="padding-top: 34rpx;">  
38 - <view>常用备注</view>  
39 - <view class="flex-rr">  
40 - <view class="more"></view>  
41 - </view>  
42 - </view>  
43 - </formids>  
44 - <formids url="/pages/customer/index?islove=customer">  
45 - <view class="row flex-lr" style="padding-top: 34rpx;">  
46 - <view>切换到顾客模式</view>  
47 - <view class="flex-rr">  
48 - <view class="more"></view>  
49 - </view>  
50 - </view>  
51 - </formids>  
52 - <formids url="/pages/manager-invitation/index">  
53 - <view class="row flex-lr" style="padding-top: 34rpx;">  
54 - <view>切换到客户经理模式</view>  
55 - <view class="flex-rr">  
56 - <view class="more"></view>  
57 - </view>  
58 - </view>  
59 - </formids>  
60 -</view>  
61 -<tabBar bindNewCustomer="NewCustomer" id="tabBar"></tabBar>  
1 -/* pages/book/setting/index.wxss */  
2 -/*  
3 -http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png  
4 -http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png  
5 -*/  
6 -.header{  
7 - height: 302rpx;  
8 - background-color: #199095;  
9 - margin-top: -2rpx;  
10 -}  
11 -.header .info{  
12 - color:#FEFEFE;  
13 - width: 90%;  
14 - padding-top: 86rpx;  
15 - margin: 0 auto;  
16 -}  
17 -.header .info .nick{  
18 - font-size: 44rpx;  
19 - font-weight: bold;  
20 - margin-bottom: 28rpx;  
21 -}  
22 -.header .info .seller{  
23 - font-size: 34rpx;  
24 -}  
25 -.page{  
26 - width: 90%;  
27 - margin: 0 auto;  
28 - color: #353535;  
29 - padding-top: 34rpx;  
30 - padding-bottom: 120rpx;  
31 -}  
32 -.row{  
33 - font-size: 34rpx;  
34 - height: 106rpx;  
35 - line-height: 106rpx;  
36 - border-bottom: 2rpx solid #F1F0F4;  
37 -}  
38 -.row .right{  
39 - font-size: 30rpx;  
40 - color:#999999;  
41 - height: 42rpx;  
42 - line-height: 42rpx;  
43 -}  
44 -.row .more{  
45 - margin-left: 20rpx;  
46 -}  
1 -// pages/book/setting/sms.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Page({  
6 -  
7 - /**  
8 - * 页面的初始数据  
9 - */  
10 - data: {  
11 - seller_id:'',  
12 - },  
13 -  
14 - /**  
15 - * 生命周期函数--监听页面加载  
16 - */  
17 - seller_id:0,  
18 - onLoad: function (options) {  
19 - if(!options.seller_id){  
20 - let enter_params=util.cache('enter_params');  
21 - options.seller_id=enter_params.seller_id;  
22 - }  
23 - this.seller_id=options.seller_id;  
24 - },  
25 -  
26 - /**  
27 - * 生命周期函数--监听页面初次渲染完成  
28 - */  
29 - onReady: function () {  
30 -  
31 - },  
32 -  
33 - /**  
34 - * 生命周期函数--监听页面显示  
35 - */  
36 - onShow: function () {  
37 - App.Reserve.SmsInfo({seller_id:this.seller_id}).then(res=>{  
38 - if(res.ret==404){  
39 - res.data={  
40 - last_num:100,  
41 - meals:[  
42 - {id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0},  
43 - {id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0},  
44 - {id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1},  
45 - ],  
46 - };  
47 - }  
48 - this.setData({  
49 - seller_id:this.seller_id,  
50 - sms:res.data,  
51 - })  
52 - })  
53 - },  
54 -  
55 - /**  
56 - * 生命周期函数--监听页面隐藏  
57 - */  
58 - onHide: function () {  
59 -  
60 - },  
61 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav",  
7 - "formids":"/components/formids/formids"  
8 - }  
9 -}  
1 -<!--pages/book/setting/sms.wxml-->  
2 -<nav id="nav" backgroundColor="#199095" color="#fefefe" hasHome>短信管理</nav>  
3 -<view class="header">  
4 - <view class="info flex-vc">  
5 - <view class="nick">短信余量</view>  
6 - <view class="last flex-lr">  
7 - <view class="lastNum">{{sms.last_num||0}}</view>  
8 - <view class="lastNum-txt">条</view>  
9 - </view>  
10 - <formids class="button" url="/pages/book/setting/sms_buy?seller_id={{seller_id}}">  
11 - <view class="txt Semibold">立即充值</view>  
12 - <view class="icon-cz">特惠</view>  
13 - </formids>  
14 - </view>  
15 -</view>  
16 -<view class="page">  
17 - <view class="line">  
18 - <view>常见问题说明</view>  
19 - </view>  
20 - <view class="action">  
21 - <view class="tip Medium">1.短信计费</view>  
22 - <view class="item">短信计费统一根据三大运营商标注计算;</view>  
23 - <view class="item">当短信内容字符数≤70,短信按照一条计费;</view>  
24 - <view class="item">当短信内容字符数>70个字符时,按照每70个字符 为一条短信;</view>  
25 - </view>  
26 - <view class="action">  
27 - <view class="tip Medium">2.短信统计</view>  
28 - <view class="item">短信统计只统计计费短信,与订单数量无关,一个订 单可能会发送多条短信,则计费时按照多条短信计费;</view>  
29 - </view>  
30 - <view class="action">  
31 - <view class="tip Medium">3.充值说明</view>  
32 - <view class="item">短信统一在订座商户小程序上进行充值,充值记录和 详细使用情况统一在小程序上查看;</view>  
33 - </view>  
34 -</view>  
35 -  
1 -/* pages/book/setting/sms.wxss */  
2 -/*  
3 -http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png  
4 -http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png  
5 -*/  
6 -.header{  
7 - height: 402rpx;  
8 - background-color: #199095;  
9 - margin-top: -2rpx;  
10 -}  
11 -.header .info{  
12 - color:#FEFEFE;  
13 - width: 90%;  
14 - padding-top: 86rpx;  
15 - margin: 0 auto;  
16 -}  
17 -.header .info .nick{  
18 - font-size: 34rpx;  
19 - margin-bottom: 10rpx;  
20 -}  
21 -.header .info .last{  
22 - height: 66rpx;  
23 - line-height: 66rpx;  
24 -}  
25 -.header .info .last .lastNum{  
26 - font-size: 48rpx;  
27 - font-weight: bold;  
28 - margin-right: 10rpx;  
29 -}  
30 -.header .info .last .lastNum-txt{  
31 - font-size: 30rpx;  
32 -}  
33 -.header .info .button{  
34 - margin-top: 76rpx;  
35 - position: relative;  
36 - background-color: #FEFEFE;  
37 - height: 80rpx;  
38 - width: 240rpx;  
39 - line-height: 75rpx;  
40 - border-radius: 10rpx;  
41 - color:#199095;  
42 - text-align: center;  
43 -}  
44 -.header .info .button .icon-cz{  
45 - width: 74rpx;  
46 - height: 40rpx;  
47 - background-image: url("http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png");  
48 - background-size: 100%;  
49 - position: absolute;  
50 - top:-10rpx;  
51 - right:-6rpx;  
52 - font-size: 24rpx;  
53 - color: #FEFEFE;  
54 - line-height: 35rpx;  
55 - text-align: center;  
56 -}  
57 -.page{  
58 - width: 90%;  
59 - margin: 0 auto;  
60 - color: #353535;  
61 - padding-top: 28rpx;  
62 - font-size: 28rpx;  
63 - color: #353535;  
64 -}  
65 -.action{  
66 - padding-bottom: 30rpx;  
67 - border-bottom: 2rpx solid #F1F0F4;  
68 - margin-bottom: 30rpx;  
69 -}  
70 -.action .tip{  
71 - margin-bottom: 22rpx;  
72 -}  
73 -.action .item:before{  
74 - content: '·';  
75 - padding: 10rpx;  
76 -}  
77 -.action:last-child{  
78 - border-bottom-width: 0;  
79 -}  
80 -.line{  
81 - height: 40rpx;  
82 - width: 80%;  
83 - margin: 42rpx auto 0;  
84 - border-top: 2rpx solid #E0E0E0;  
85 - position: relative;  
86 -}  
87 -.line view{  
88 - background-color: #FEFEFE;  
89 - width: 248rpx;  
90 - margin: -22rpx auto 0;  
91 - text-align: center;  
92 -}  
1 -// pages/book/setting/sms_buy.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Page({  
6 -  
7 - /**  
8 - * 页面的初始数据  
9 - */  
10 - data: {  
11 - form:{},  
12 - },  
13 -  
14 - /**  
15 - * 生命周期函数--监听页面加载  
16 - */  
17 - hasScene:false,  
18 - onLoad: function (options) {  
19 - //转化场景值到 options  
20 - if(options.scene){//扫码进入  
21 - let query=decodeURIComponent(options.scene);  
22 - query.split('&').forEach(q=>{  
23 - let _q=q.split('=');  
24 - options[_q[0]]=_q[1];  
25 - })  
26 - this.hasScene=true  
27 - }  
28 - if(!options.seller_id){  
29 - let enter_params=util.cache('enter_params');  
30 - options.seller_id=enter_params.seller_id;  
31 - }  
32 - App.Reserve.SmsInfo({seller_id:options.seller_id}).then(res=>{  
33 - if(res.ret==404){  
34 - res.data={  
35 - last_num:100,  
36 - meals:[  
37 - {id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0},  
38 - {id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0},  
39 - {id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1},  
40 - ],  
41 - };  
42 - }  
43 - this.setData({  
44 - seller_id:options.seller_id,  
45 - sms:res.data,  
46 - })  
47 - })  
48 - },  
49 -  
50 - /**  
51 - * 生命周期函数--监听页面初次渲染完成  
52 - */  
53 - onReady: function () {  
54 -  
55 - },  
56 -  
57 - /**  
58 - * 生命周期函数--监听页面显示  
59 - */  
60 - onShow: function () {  
61 -  
62 - },  
63 -  
64 - /**  
65 - * 生命周期函数--监听页面隐藏  
66 - */  
67 - onHide: function () {  
68 -  
69 - },  
70 - chooseMeal(e){  
71 - this.setData({  
72 - form:{  
73 - meal_id:util.attr(e,'id'),  
74 - price:util.attr(e,'price'),  
75 - seller_id:this.data.seller_id  
76 - }  
77 - })  
78 - },  
79 - buy(){  
80 - if(!this.data.form.meal_id) return;  
81 - let prarms={  
82 - sellerid: this.data.form.seller_id,  
83 - //price:this.data.form.price,  
84 - price:0.01,  
85 - meal_id:this.data.form.meal_id,  
86 - openid:getApp().openid,  
87 - }  
88 - App.Reserve.SmsBuy(prarms).then(res=>{  
89 - let pay=res.data;  
90 - wx.requestPayment({  
91 - 'timeStamp': pay.timeStamp,  
92 - 'nonceStr': pay.nonceStr,  
93 - 'package': pay.package,  
94 - 'signType': 'MD5',  
95 - 'paySign': pay.paySign,  
96 - 'success':(payRes)=>{  
97 - if(payRes){  
98 - App.Reserve.SmsInfo({seller_id:prarms.sellerid},'clear');  
99 - wx.showToast({  
100 - title: '支付成功',  
101 - icon: 'loading',  
102 - duration: 1000,  
103 - mask:true,  
104 - success:()=> {  
105 - setTimeout(()=>{  
106 - if(this.hasScene){  
107 - wx.redirectTo({  
108 - url:'/pages/book/setting/sms?seller_id='+prarms.sellerid  
109 - });  
110 - }else{  
111 - wx.navigateBack();  
112 - }  
113 - },1500)  
114 - }  
115 - })  
116 - }  
117 - },  
118 - 'fail':function(res){  
119 - wx.showToast({  
120 - title: '已取消支付',  
121 - icon: 'loading',  
122 - duration: 1000,  
123 - mask:true,  
124 - })  
125 - }  
126 - })  
127 - });  
128 - },  
129 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav",  
7 - "formids":"/components/formids/formids"  
8 - }  
9 -}  
1 -<!--pages/book/setting/sms_buy.wxml-->  
2 -<nav id="nav" hasHome>短信充值</nav>  
3 -<view class="page">  
4 - <view class="title Medium">短信套餐</view>  
5 - <view class="subtitle">购买套餐,使用更划算</view>  
6 - <block wx:for="{{sms.meals}}" wx:key="sms.meals.key">  
7 - <view class="block {{form.meal_id==item.id?'checked':''}} flex-vc"  
8 - data-id="{{item.id}}" data-price="{{item.price}}"  
9 - bindtap="chooseMeal">  
10 - <view class="flex-lr info">  
11 - <view class="left">  
12 - <view class="count Medium">{{item.total}}条</view>  
13 - <view class="price-pre">约{{item.price_ave}}元/条</view>  
14 - </view>  
15 - <view class="right">  
16 - <view class="price Medium">¥{{item.price}}</view>  
17 - <view class="price-old" wx:if="{{item.price_old && item.price_old>item.price}}">¥{{item.price_old}}</view>  
18 - </view>  
19 - </view>  
20 - <view class="icon-zk Medium" wx:if="{{item.discount>0 && item.discount<10}}">{{item.discount}}折</view>  
21 - </view>  
22 - </block>  
23 -</view>  
24 -<view class="button-view flex-vc {{form.price>0?'active':''}}">  
25 - <view class="page flex-lr" style="padding-top: 0;">  
26 - <view class="tip" wx:if="{{form.price>0}}">{{form.price}}元</view>  
27 - <view class="tip" wx:else="">剩余{{sms.last_num}}条短信,请及时充值以保证正常使用</view>  
28 - <view class="button Medium" bindtap="buy">购买</view>  
29 - </view>  
30 -</view>  
1 -/* pages/book/setting/sms_buy.wxss */  
2 -.page{  
3 - width: 90%;  
4 - margin: 0 auto;  
5 - color: #353535;  
6 - padding-top: 28rpx;  
7 - font-size: 30rpx;  
8 - color: #353535;  
9 -}  
10 -.title{  
11 - font-size: 40rpx;  
12 - height: 56rpx;  
13 - line-height: 56rpx;  
14 - margin-bottom: 20rpx;  
15 -}  
16 -.subtitle{  
17 - font-size: 30rpx;  
18 - margin-bottom: 30rpx;  
19 -}  
20 -.block{  
21 - border: 2rpx solid #999999;  
22 - border-radius: 10rpx;  
23 - height: 172rpx;  
24 - position: relative;  
25 - margin-bottom: 38rpx;  
26 -}  
27 -.block .icon-zk{  
28 - width: 104rpx;  
29 - height: 54rpx;  
30 - background-image: url("http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png");  
31 - background-size: 100%;  
32 - position: absolute;  
33 - top:-10rpx;  
34 - right:-6rpx;  
35 - font-size: 34rpx;  
36 - color: #FEFEFE;  
37 - line-height: 48rpx;  
38 - text-align: center;  
39 -}  
40 -.block .info{  
41 - width: 90%;  
42 -}  
43 -.block .count{  
44 - font-size: 40rpx;  
45 - height: 56rpx;  
46 - line-height: 56rpx;  
47 - margin-bottom: 10rpx;  
48 -}  
49 -.block .price-pre{  
50 - font-size: 34rpx;  
51 - height: 48rpx;  
52 - line-height: 48rpx;  
53 -}  
54 -.block .price{  
55 - font-size: 40rpx;  
56 - height: 56rpx;  
57 - line-height: 56rpx;  
58 - font-weight: bold;  
59 -}  
60 -.block .price-old{  
61 - font-size: 34rpx;  
62 - height: 48rpx;  
63 - line-height: 48rpx;  
64 - color: #999999;  
65 - text-decoration: line-through;  
66 - margin-top: -10rpx;  
67 - position: absolute;  
68 -}  
69 -.block .info .right{  
70 - position: relative;  
71 - width: 150rpx;  
72 -}  
73 -.block.checked{  
74 - border: 2rpx solid #199095;  
75 - background-color: #199095;  
76 - color:#FEFEFE;  
77 -}  
78 -.block.checked .price-old{  
79 - color:#efefef;  
80 -}  
81 -  
82 -.button-view{  
83 - position: fixed;  
84 - bottom: 0;  
85 - height: 144rpx;  
86 - border-top: 2rpx solid #F1F0F4;  
87 - line-height: 144rpx;  
88 - width: 100%;  
89 -}  
90 -.button-view .button{  
91 - width: 190rpx;  
92 - min-width: 190rpx;  
93 - height: 80rpx;  
94 - line-height: 80rpx;  
95 - background-color: #75BCBF;  
96 - color:#FEFEFE;  
97 - font-size: 34rpx;  
98 - border-radius: 10rpx;  
99 - text-align: center;  
100 -}  
101 -.button-view .tip{  
102 - width: 100%;  
103 - height: 84rpx;  
104 - line-height: 42rpx;  
105 -}  
106 -.button-view.active .button{  
107 - background-color: #199095;  
108 -}  
109 -.button-view.active .tip{  
110 - font-size: 40rpx;  
111 - line-height: 84rpx;  
112 - font-weight: bold;  
113 -}  
1 -// pages/book/smsbatch/detail.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Page({  
6 -  
7 - /**  
8 - * 页面的初始数据  
9 - */  
10 - data: {},  
11 -  
12 - /**  
13 - * 生命周期函数--监听页面加载  
14 - */  
15 - onLoad: function (options) {  
16 - console.log('options',options)  
17 - this.getInfo(options.id)  
18 - },  
19 -  
20 - /**  
21 - * 生命周期函数--监听页面初次渲染完成  
22 - */  
23 - onReady: function () {  
24 -  
25 - },  
26 -  
27 - /**  
28 - * 生命周期函数--监听页面显示  
29 - */  
30 - onShow: function () {  
31 -  
32 - },  
33 -  
34 - /**  
35 - * 生命周期函数--监听页面隐藏  
36 - */  
37 - onHide: function () {  
38 -  
39 - },  
40 -  
41 - /**  
42 - * 生命周期函数--监听页面卸载  
43 - */  
44 - onUnload: function () {  
45 -  
46 - },  
47 -  
48 - /**  
49 - * 页面相关事件处理函数--监听用户下拉动作  
50 - */  
51 - onPullDownRefresh: function () {  
52 -  
53 - },  
54 -  
55 - /**  
56 - * 页面上拉触底事件的处理函数  
57 - */  
58 - onReachBottom: function () {  
59 -  
60 - },  
61 -  
62 - /**  
63 - * 用户点击右上角分享  
64 - */  
65 - onShareAppMessage: function () {  
66 -  
67 - },  
68 - getInfo(id,flag=false){  
69 - App.Reserve.SmsBatchInfo({id: id},flag).then(res => {  
70 - this.setData({  
71 - item:res.data,  
72 - ...res.data,  
73 - addtimeStr: util.unixtoTime(res.data.addtime, 'YYYY-MM-DD HH:II'),  
74 - sendertimeStr: util.unixtoTime(res.data.stime || '', 'YYYY-MM-DD HH:II'),  
75 - });  
76 - })  
77 - },  
78 - sendoff(){  
79 - this.getInfo(this.data.id,true)  
80 - },  
81 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "userinfo":"/components/userinfo/userinfo",  
7 - "nav":"/components/nav/nav",  
8 - "formids":"/components/formids/formids",  
9 - "service":"/components/book/smsbatch/service",  
10 - "sendsms":"/components/book/smsbatch/sendsms"  
11 - }  
12 -  
13 -}  
1 -<!--pages/book/smsbatch/detail.wxml-->  
2 -<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">短信详情</nav>  
3 -<view class="page">  
4 - <view class="send_msg">{{send_msg}}</view>  
5 - <view class="rows flex-ll">  
6 - <view class="label">活动人数</view>  
7 - <view class="value Medium">{{send_total}}</view>  
8 - </view>  
9 - <view class="rows flex-ll">  
10 - <view class="label">创建时间</view>  
11 - <view class="value Medium">{{addtimeStr}}</view>  
12 - </view>  
13 - <view class="rows flex-ll">  
14 - <view class="label">创 建 人</view>  
15 - <view class="value Medium">{{note_name}}</view>  
16 - </view>  
17 - <view class="rows flex-ll">  
18 - <view class="label">联系姓名</view>  
19 - <view class="value Medium">{{name}}</view>  
20 - </view>  
21 - <view class="rows flex-ll">  
22 - <view class="label">联系电话</view>  
23 - <view class="value Medium">{{phone}}</view>  
24 - </view>  
25 - <block wx:if="{{sender}}">  
26 - <view class="rows rows-border"></view>  
27 - <view class="rows flex-ll">  
28 - <view class="label">发 放 人</view>  
29 - <view class="value Medium">{{sender||''}}</view>  
30 - </view>  
31 - <view class="rows flex-ll">  
32 - <view class="label">发放时间</view>  
33 - <view class="value Medium">{{sendertimeStr}}</view>  
34 - </view>  
35 - </block>  
36 - <view class="rows flex-ll">  
37 - <view class="label">短信状态</view>  
38 - <view class="value Medium">  
39 - <view class="sms-status{{status}}"></view>  
40 - </view>  
41 - </view>  
42 - <view class="rows flex-ll"></view>  
43 - <service wx:if="{{status==-1}}">  
44 - <view class="opt-but">联系客服</view>  
45 - </service>  
46 - <sendsms wx:if="{{status==1}}" bindsend="sendoff" item="{{item}}">  
47 - <view class="opt-but">立即发放</view>  
48 - </sendsms>  
49 -</view>  
1 -/* pages/book/smsbatch/detail.wxss */  
2 -.page{  
3 - width: 90%;  
4 - margin: 0 auto;  
5 - color: #353535;  
6 - padding-top: 28rpx;  
7 - font-size: 34rpx;  
8 - color: #353535;  
9 -}  
10 -.send_msg{  
11 - border: 1rpx solid #E0E0E0;  
12 - border-radius: 8rpx;  
13 - box-shadow: 0 2rpx 8rpx 0 #E0E0E0;  
14 - padding: 32rpx;  
15 - margin-bottom: 40rpx;  
16 -}  
17 -.rows{  
18 - height: 88rpx;  
19 - line-height: 88rpx;  
20 -}  
21 -.rows .label{  
22 - width: 180rpx;  
23 - color:#666;  
24 -}  
25 -.rows .value{}  
26 -.rows-border{  
27 - width: 100%;  
28 - background-color: #F1F0F4;  
29 - height: 2rpx;  
30 - margin: 43rpx 0;  
31 -}  
32 -.opt-but{  
33 - background-color: #199095;  
34 - height: 84rpx;  
35 - line-height: 84rpx;  
36 - color:#FEFEFE;  
37 - text-align: center;  
38 - border-radius: 10rpx;  
39 -}  
40 -  
41 -  
42 -  
43 -.sms-status0:before{  
44 - content: '审核中';  
45 - color:#09BB07;  
46 -}  
47 -.sms-status1:before{  
48 - content: '已通过';  
49 - color:#353535;  
50 -}  
51 -.sms-status2:before{  
52 - content: '已发放';  
53 - color:#353535;  
54 -}  
55 -.sms-status-1:before{  
56 - content: '未通过';  
57 - color:#D0021B;  
58 -}  
1 -// pages/book/smsbatch/index.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Page({  
6 - offset:0,  
7 - limit:30,  
8 - hasMore:true,  
9 - /**  
10 - * 页面的初始数据  
11 - */  
12 - data: {  
13 - hasScene:0,  
14 - seller_id:'',  
15 - list:[],  
16 - hasMore:true,  
17 - height:350,  
18 - hiddenQuestion:true,  
19 - },  
20 -  
21 - /**  
22 - * 生命周期函数--监听页面加载  
23 - */  
24 - hasScene:0,  
25 - seller_id:'',  
26 - list:{},  
27 - onLoad: function (options) {  
28 - //转化场景值到 options  
29 - if(options.scene){//扫码进入  
30 - let query=decodeURIComponent(options.scene);  
31 - query.split('&').forEach(q=>{  
32 - let _q=q.split('=');  
33 - options[_q[0]]=_q[1];  
34 - })  
35 - this.hasScene=1  
36 - }  
37 - if(!options.seller_id){  
38 - let enter_params=util.cache('enter_params');  
39 - options.seller_id=enter_params.seller_id;  
40 - }  
41 - this.seller_id=options.seller_id;  
42 - this.setData({  
43 - hasScene:this.hasScene,  
44 - seller_id:this.seller_id,  
45 - })  
46 - },  
47 -  
48 - /**  
49 - * 生命周期函数--监听页面初次渲染完成  
50 - */  
51 - onReady: function () {  
52 -  
53 - },  
54 -  
55 - /**  
56 - * 生命周期函数--监听页面显示  
57 - */  
58 - onShow: function () {  
59 - this.SmsBatchList();  
60 - console.log('getApp().system',getApp().system);  
61 - this.setData({  
62 - height:getApp().system.windowHeight-370,  
63 - })  
64 - },  
65 -  
66 - /**  
67 - * 生命周期函数--监听页面隐藏  
68 - */  
69 - onHide: function () {  
70 -  
71 - },  
72 -  
73 - /**  
74 - * 生命周期函数--监听页面卸载  
75 - */  
76 - onUnload: function () {  
77 -  
78 - },  
79 - /**  
80 - * 页面上拉触底事件的处理函数  
81 - */  
82 - onReachBottom: function () {  
83 - if(this.hasMore){  
84 - this.SmsBatchList(true);  
85 - }  
86 - },  
87 - SmsBatchList(hasReachBottom=false){  
88 - App.Reserve.SmsBatchList({  
89 - sid: this.seller_id,  
90 - offset: this.offset,  
91 - limit: this.limit,  
92 - status:'-1,0,1',  
93 - }).then(res => {  
94 - let list = [];  
95 - let dl=res.data.length;  
96 - if (dl > 0) {  
97 - res.data.forEach(r => {  
98 - r.addtimeStr=util.unixtoTime(r.addtime,'YYYY.MM.DD')  
99 - list.push(r)  
100 - this.list[r.id] = r;  
101 - })  
102 - }  
103 - let obj={list:list};  
104 - if(dl<this.limit && hasReachBottom){  
105 - this.hasMore=false;  
106 - obj.hasMore=false;  
107 - }  
108 - this.setData(obj)  
109 - })  
110 - },  
111 - showQuestion(){  
112 - this.setData({  
113 - hiddenQuestion:false,  
114 - })  
115 - },  
116 - hideQuestion(){  
117 - this.setData({  
118 - hiddenQuestion:true,  
119 - })  
120 - },  
121 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "userinfo":"/components/userinfo/userinfo",  
7 - "nav":"/components/nav/nav",  
8 - "formids":"/components/formids/formids",  
9 - "rows":"/components/book/smsbatch/rows",  
10 - "service":"/components/book/smsbatch/service"  
11 - }  
12 -  
13 -}  
1 -<!--pages/book/smsbatch/index.wxml-->  
2 -<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">短信营销</nav>  
3 -<view class="header flex-vc">  
4 - <view class="info">  
5 - <view>流失客户召回,新老客户回馈</view>  
6 - <view style="margin-top: 10rpx;">沉默客户激活</view>  
7 - </view>  
8 - <formids url="./update?seller_id={{seller_id}}&hasScene={{hasScene}}">  
9 - <view class="button-create Semibold">立即创建</view>  
10 - </formids>  
11 -</view>  
12 -<view class="page" style="padding-top: 60rpx;">  
13 - <view class="title Medium flex-lr">  
14 - <view>短信记录</view>  
15 - <formids url="./list?seller_id={{seller_id}}&hasScene={{hasScene}}">  
16 - <view style="color: #999999;font-size: 30rpx;">历史记录</view>  
17 - </formids>  
18 - </view>  
19 - <view class="flex-vc">  
20 - <block wx:if="{{list.length>0}}">  
21 - <scroll-view  
22 - scroll-y  
23 - style="height: {{height}}px;"  
24 - bindscrolltoupper="upper"  
25 - bindscrolltolower="lower"  
26 - bindscroll="scroll"  
27 - scroll-into-view=""  
28 - scroll-top="0"  
29 - >  
30 - <view class="list-rows" wx:for="{{list}}" wx:key="list.key" style="width: 100%;">  
31 - <rows item="{{item}}" bindsendoff="SmsBatchList"></rows>  
32 - </view>  
33 - </scroll-view>  
34 - </block>  
35 - <view wx:else="" class="list-rows" style="font-size: 34rpx; margin-top: 35rpx;">暂无记录</view>  
36 - <view wx:if="{{!hasMore}}" class="list-rows">已经到底了</view>  
37 - </view>  
38 -</view>  
39 -<view class="bottom-opt flex-lr">  
40 - <view class="bottom-opt-but flex-cc">  
41 - <image src="http://qn.colorcun.com/custom/lite-yd/image/service.png" style="width: 40rpx;"></image>  
42 - <service><view class="txt">电话咨询</view></service>  
43 - </view>  
44 - <view class="bottom-opt-but flex-cc" bindtap="showQuestion">  
45 - <image src="http://qn.colorcun.com/custom/lite-yd/image/question.png"></image>  
46 - <view class="txt">常见问题</view>  
47 - </view>  
48 -</view>  
49 -<view class="question-mask" hidden="{{hiddenQuestion}}">  
50 - <view class="question page Medium">  
51 - <view class="que-title flex-vc Semibold">  
52 - <view>常见问题说明</view>  
53 - </view>  
54 - <view class="que-content">  
55 - <view class="block">  
56 - <view class="block-title">  
57 - 1.营销攻略  
58 - </view>  
59 - <view class="block-desc">  
60 - <view>  
61 - · 短信营销步骤:第一步创建营销内容,第二步提交审核,第三步审核通过投放;  
62 - </view>  
63 - </view>  
64 - </view>  
65 - <view class="block">  
66 - <view class="block-title">  
67 - 2.短信计费  
68 - </view>  
69 - <view class="block-desc">  
70 - <view>  
71 - · 短信字数=短信模版内容字数 + 签名字数;  
72 - </view>  
73 - <view>  
74 - <text decode="{{true}}">· 短信字数&lt;=70个字数,按照70个字数一条短信计算;</text>  
75 - </view>  
76 - <view>  
77 - <text decode="{{true}}">· 短信字数&gt;70个字数,即为长短信,按照67个字数记为一条短信计算;</text>  
78 - </view>  
79 - </view>  
80 - </view>  
81 - <view class="block">  
82 - <view class="block-title">  
83 - 3.短信审核  
84 - </view>  
85 - <view class="block-desc">  
86 - <view>  
87 - · 应国家监管要求,短信营销内容需要进行审核,审核记过将以短信/电话的方式通知到您;  
88 - </view>  
89 - <view>  
90 - · 预计1个工作日完成审核;  
91 - </view>  
92 - <view>  
93 - · 审核工作时间:周一至周五9:00-23:00(法定节日顺延);  
94 - </view>  
95 - </view>  
96 - </view>  
97 - <view class="block">  
98 - <view class="block-title">  
99 - 4.短信发放  
100 - </view>  
101 - <view class="block-desc">  
102 - <view>  
103 - · 短信发放时,需要有充足的短信余量,如果短信余量不足,将无法发送;  
104 - </view>  
105 - </view>  
106 - </view>  
107 - </view>  
108 - <view class="que-bottom">  
109 - <view class="opt-but Semibold" bindtap="hideQuestion">  
110 - 关闭  
111 - </view>  
112 - </view>  
113 - </view>  
114 -</view>  
1 -/* pages/book/smsbatch/index.wxss */  
2 -.page{  
3 - width: 90%;  
4 - margin: 0 auto;  
5 - color: #353535;  
6 - padding-top: 28rpx;  
7 - font-size: 30rpx;  
8 - color: #353535;  
9 -}  
10 -.header{  
11 - height: 380rpx;  
12 - background-color: #199095;  
13 - margin-top: -2rpx;  
14 - color:#FEFEFE;  
15 - font-size: 34rpx;  
16 -}  
17 -.header .info view{  
18 - text-align: center;  
19 -}  
20 -.button-create{  
21 - height: 80rpx;  
22 - line-height: 80rpx;  
23 - width: 240rpx;  
24 - margin-top: 52rpx;  
25 - border-radius: 10rpx;  
26 - background-color: #fefefe;  
27 - color: #199095;  
28 -}  
29 -.history{  
30 - width: 100%;  
31 - background-color: #fefefe;  
32 - margin-top: 20rpx;  
33 - height: 340rpx;  
34 -}  
35 -.history .title{  
36 - height: 40rpx;  
37 - line-height: 40rpx;  
38 -}  
39 -.history .lists{  
40 - height: 300rpx;  
41 -}  
42 -  
43 -.list-rows{  
44 - height: 140rpx;  
45 - line-height: 140rpx;  
46 - border-bottom: 2rpx solid #F1F0F4;  
47 -}  
48 -.list-rows:last-child{  
49 - border-bottom-width: 0;  
50 -}  
51 -  
52 -.bottom-opt{  
53 - position: fixed;  
54 - bottom: 0;  
55 - height: 140rpx;  
56 - line-height: 140rpx;  
57 - background-color: #fefefe;  
58 - color:#199095;  
59 - width: 100%;  
60 - font-size: 28rpx;  
61 -}  
62 -.bottom-opt-but {  
63 - width: 50%;  
64 - line-height: 40rpx;  
65 - height: 40rpx;  
66 - text-align: center;  
67 -}  
68 -.bottom-opt-but:last-child{  
69 - border-left: 2rpx solid #199095;  
70 -}  
71 -.bottom-opt-but image{  
72 - width: 34rpx;  
73 - height: 34rpx;  
74 -}  
75 -.bottom-opt-but .txt{  
76 - margin-left: 18rpx;  
77 -}  
78 -  
79 -.question-mask{  
80 - position: fixed;  
81 - bottom: 0;  
82 - top:0;  
83 - left: 0;  
84 - right:0;  
85 - background-color: rgba(13,13,13,0.5);  
86 - z-index: 9999;  
87 -}  
88 -.question{  
89 - background-color: #fefefe;  
90 - border-radius: 10rpx;  
91 - bottom: 190rpx;  
92 - position: fixed;  
93 - left:5%;  
94 - height: 834rpx;  
95 - font-size: 30rpx;  
96 - padding: 4%;  
97 - width: 82%;  
98 -}  
99 -.que-title{  
100 - font-size: 34rpx;  
101 - height: 100rpx;  
102 -}  
103 -.que-title view{  
104 - margin-top: 40rpx;  
105 -}  
106 -.que-bottom{  
107 - height: 160rpx;  
108 -}  
109 -.opt-but{  
110 - width: 300rpx;  
111 - background-color: #199095;  
112 - height: 80rpx;  
113 - line-height: 80rpx;  
114 - font-size: 34rpx;  
115 - color:#FFFFFF;  
116 - margin: 34rpx auto 0;  
117 - border-radius: 10rpx;  
118 - text-align: center;  
119 -}  
120 -.que-content{  
121 - height: 574rpx;  
122 - overflow-y: auto;  
123 - padding-top: 24rpx;  
124 - color:#666666;  
125 - font-size: 30rpx;  
126 -}  
127 -.block-title{  
128 - height: 42rpx;  
129 - line-height: 42rpx;  
130 - margin-bottom: 22rpx;  
131 -}  
132 -.block-desc{  
133 - line-height: 42rpx;  
134 - margin-bottom: 44rpx;  
135 -}  
136 -.block:last-child{  
137 - margin-bottom: 88rpx;  
138 -}  
1 -// pages/book/smsbatch/list.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Page({  
6 - offset:0,  
7 - limit:10,  
8 - hasMore:true,  
9 - seller_id:0,  
10 - hasScene:0,  
11 - list:{},  
12 - /**  
13 - * 页面的初始数据  
14 - */  
15 - data: {  
16 - list:[],  
17 - hasMore:true,  
18 - },  
19 -  
20 - /**  
21 - * 生命周期函数--监听页面加载  
22 - */  
23 - onLoad: function (options) {  
24 - this.seller_id=options.seller_id;  
25 - this.hasScene=options.hasScene;  
26 - this.SmsBatchList();  
27 - },  
28 -  
29 - /**  
30 - * 生命周期函数--监听页面初次渲染完成  
31 - */  
32 - onReady: function () {  
33 -  
34 - },  
35 -  
36 - /**  
37 - * 生命周期函数--监听页面显示  
38 - */  
39 - onShow: function () {  
40 -  
41 - },  
42 -  
43 - /**  
44 - * 生命周期函数--监听页面隐藏  
45 - */  
46 - onHide: function () {  
47 -  
48 - },  
49 -  
50 - /**  
51 - * 生命周期函数--监听页面卸载  
52 - */  
53 - onUnload: function () {  
54 -  
55 - },  
56 -  
57 - /**  
58 - * 页面相关事件处理函数--监听用户下拉动作  
59 - */  
60 - onPullDownRefresh: function () {  
61 -  
62 - },  
63 -  
64 - /**  
65 - * 页面上拉触底事件的处理函数  
66 - */  
67 - onReachBottom: function () {  
68 - if(this.hasMore){  
69 - this.SmsBatchList(true);  
70 - }  
71 - },  
72 -  
73 - /**  
74 - * 用户点击右上角分享  
75 - */  
76 - onShareAppMessage: function () {  
77 -  
78 - },  
79 - SmsBatchList(hasReachBottom=false){  
80 - App.Reserve.SmsBatchList({  
81 - sid: this.seller_id,  
82 - offset: this.offset,  
83 - limit: this.limit,  
84 - status:'2',  
85 - }).then(res => {  
86 - let list = this.data.list;  
87 - let dl=res.data.length;  
88 - if (dl > 0) {  
89 - res.data.forEach(r => {  
90 - r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II')  
91 - list.push(r)  
92 - this.list[r.id] = r;  
93 - })  
94 - }  
95 - let obj={list:list};  
96 - if(dl<this.limit && hasReachBottom){  
97 - this.hasMore=false;  
98 - obj.hasMore=false;  
99 - }  
100 - this.setData(obj)  
101 - })  
102 - },  
103 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "userinfo":"/components/userinfo/userinfo",  
7 - "nav":"/components/nav/nav",  
8 - "formids":"/components/formids/formids",  
9 - "rows":"/components/book/smsbatch/rows"  
10 - }  
11 -  
12 -}  
1 -<!--pages/book/smsbatch/list.wxml-->  
2 -<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">历史记录</nav>  
3 -<view class="page">  
4 - <block wx:if="{{list.length>0}}">  
5 - <view class="list-rows" wx:for="{{list}}" wx:key="list.key" >  
6 - <rows item="{{item}}"></rows>  
7 - </view>  
8 - </block>  
9 - <view wx:else="" class="history-is-empty flex-vc Medium">  
10 - <image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image>  
11 - <view>暂时还没有历史记录</view>  
12 - </view>  
13 - <view wx:if="{{!hasMore}}" class="list-rows">已经到底了</view>  
14 -</view>  
1 -/* pages/book/smsbatch/list.wxss */  
2 -.page{  
3 - width: 90%;  
4 - margin: 0 auto;  
5 - color: #353535;  
6 - padding-top: 28rpx;  
7 - font-size: 30rpx;  
8 - color: #353535;  
9 -}  
10 -.list-rows{  
11 - height: 140rpx;  
12 - line-height: 140rpx;  
13 - border-bottom: 2rpx solid #F1F0F4;  
14 -}  
15 -.list-rows:last-child{  
16 - border-bottom-width: 0;  
17 -}  
18 -.title{  
19 - height: 48rpx;  
20 - line-height: 48rpx;  
21 -}  
22 -.history-is-empty{  
23 - margin: 200rpx auto;  
24 - font-size: 34rpx;  
25 -  
26 -}  
27 -.history-is-empty image{  
28 - width: 376rpx;  
29 - height: 310rpx;  
30 - margin-bottom: 122rpx;  
31 -}  
1 -// pages/book/smsbatch/result.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -Page({  
6 -  
7 - /**  
8 - * 页面的初始数据  
9 - */  
10 - data: {  
11 - total: 0,  
12 - last_num:0,  
13 - },  
14 -  
15 - /**  
16 - * 生命周期函数--监听页面加载  
17 - */  
18 - options:{},  
19 - onLoad: function (options) {  
20 - console.log('options',options);  
21 - this.options=options  
22 - App.Reserve.SmsInfo({seller_id: options.seller_id}, true).then(res => {  
23 - this.setData({  
24 - total: parseInt(options.total),  
25 - last_num:parseInt(res.data.last_num),  
26 - })  
27 - })  
28 - },  
29 -  
30 - /**  
31 - * 生命周期函数--监听页面初次渲染完成  
32 - */  
33 - onReady: function () {  
34 -  
35 - },  
36 -  
37 - /**  
38 - * 生命周期函数--监听页面显示  
39 - */  
40 - onShow: function () {  
41 -  
42 - },  
43 -  
44 - /**  
45 - * 生命周期函数--监听页面隐藏  
46 - */  
47 - onHide: function () {  
48 -  
49 - },  
50 -  
51 - /**  
52 - * 生命周期函数--监听页面卸载  
53 - */  
54 - onUnload: function () {  
55 -  
56 - },  
57 -  
58 - /**  
59 - * 页面相关事件处理函数--监听用户下拉动作  
60 - */  
61 - onPullDownRefresh: function () {  
62 -  
63 - },  
64 -  
65 - /**  
66 - * 页面上拉触底事件的处理函数  
67 - */  
68 - onReachBottom: function () {  
69 -  
70 - },  
71 -  
72 - /**  
73 - * 用户点击右上角分享  
74 - */  
75 - onShareAppMessage: function () {  
76 -  
77 - },  
78 - goPay(){  
79 - wx.navigateTo({  
80 - url:'/pages/book/setting/sms_buy?scene='+encodeURI('seller_id='+this.options.seller_id)  
81 - })  
82 - },  
83 - back(){  
84 - wx.navigateBack();  
85 - },  
86 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"white",  
5 - "usingComponents": {  
6 - "nav":"/components/nav/nav",  
7 - "formids":"/components/formids/formids"  
8 - }  
9 -}  
1 -<!--pages/book/smsbatch/result.wxml-->  
2 -<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">提交审核</nav>  
3 -<view class="page flex-vc Medium" style="padding-top: 24rpx; padding-bottom: 20rpx;">  
4 - <icon type="success" size="47" color="#199095" />  
5 - <view style="font-size: 34rpx;margin-bottom:30rpx;">短信已提交</view>  
6 - <view class="hr-one"></view>  
7 - <view>大约于1个工作日反馈结果</view>  
8 - <view>结果将以短信/电话方式通知您</view>  
9 -</view>  
10 -<block wx:if="{{total>last_num}}">  
11 -<view class="page flex-cc Medium" style="padding-top: 100rpx; padding-bottom: 100rpx;">  
12 - <view>本次群发{{total}}条,当前余额不足,建议</view>  
13 - <formids bindclick="goPay"><text style="color: #199095;font-size: 32rpx;">立即充值</text></formids>  
14 -</view>  
15 -</block>  
16 -<formids bindclick="back">  
17 - <view class="opt-but" >知道了</view>  
18 -</formids>  
1 -/* pages/book/smsbatch/result.wxss */  
2 -page{  
3 - background-color: #F5F5F5;  
4 - font-size: 30rpx;  
5 - color: #353535;  
6 -}  
7 -.page{  
8 - width: 88%;  
9 - margin: 20rpx auto;  
10 - padding: 20rpx 3%;  
11 - background-color: #FEFEFE;  
12 - border-radius: 8rpx;  
13 -}  
14 -.hr-one{  
15 - background-color: #F1F0F4;  
16 - width: 100%;  
17 - height: 2rpx;  
18 - margin-top: 16rpx;  
19 - margin-bottom: 38rpx;  
20 -}  
21 -.Medium{  
22 - line-height: 60rpx;  
23 -}  
24 -.opt-but{  
25 - border: 2rpx solid #199095;  
26 - border-radius: 10rpx;  
27 - color: #199095;  
28 - height: 80rpx;  
29 - line-height: 80rpx;  
30 - width: 240rpx;  
31 - margin: 140rpx auto;  
32 -}  
1 -// pages/book/smsbatch/update.js  
2 -import util from '../../../utils/util';  
3 -import App from '../../../utils/api';  
4 -const {regeneratorRuntime} = global  
5 -const form={  
6 - send_total:0,  
7 - send_msg:'',  
8 - name:'',  
9 - phone:'',  
10 -}  
11 -Page({  
12 -  
13 - /**  
14 - * 页面的初始数据  
15 - */  
16 - data: {  
17 - form:JSON.parse(JSON.stringify(form)),  
18 - options:{  
19 - hasScene:0,  
20 - seller_id:'',  
21 - },  
22 - totalChar:0,  
23 - totalSms:0,  
24 - buttonStatus:false,  
25 - },  
26 - reservePhonesMap:[],  
27 - reservePhones:[],  
28 - note_name:'',  
29 - note_phone:'',  
30 - /**  
31 - * 生命周期函数--监听页面加载  
32 - */  
33 - options:{},  
34 - onLoad: async function (options) {  
35 - this.options=options;  
36 - let enter_params=util.cache('enter_params');  
37 - if(enter_params){  
38 - try{  
39 - let si=await App.Reserve.SellerInfo(enter_params);  
40 - this.note_name=si.data.seller_user.nick_name||si.data.seller_user.nickname;  
41 - this.note_phone=si.data.seller_user.phone;  
42 - }catch (e){}  
43 - }  
44 - App.Reserve.GetReservePhones({sid:options.seller_id}).then(res=>{  
45 - //this.reservePhones=res.data;  
46 - if(res.data.length>0){  
47 - let reservePhonesMap=[];  
48 - let reservePhones=[];  
49 - res.data.forEach(m=>{  
50 - if(/1[3-9]{1}[\d]{9}/.test(m.phone)){  
51 - reservePhonesMap.push(m);  
52 - reservePhones.push(m.phone);  
53 - }  
54 - })  
55 - this.reservePhonesMap=reservePhonesMap;  
56 - this.reservePhones=reservePhones.toString();  
57 - this.setData({  
58 - options:options,  
59 - [`form.send_total`]:reservePhonesMap.length,  
60 - [`form.name`]:this.note_name,  
61 - [`form.phone`]:this.note_phone,  
62 - })  
63 - }  
64 - })  
65 - },  
66 -  
67 - /**  
68 - * 生命周期函数--监听页面初次渲染完成  
69 - */  
70 - onReady: function () {  
71 -  
72 - },  
73 -  
74 - /**  
75 - * 生命周期函数--监听页面显示  
76 - */  
77 - onShow: function () {  
78 -  
79 - },  
80 -  
81 - /**  
82 - * 生命周期函数--监听页面隐藏  
83 - */  
84 - onHide: function () {  
85 -  
86 - },  
87 -  
88 - /**  
89 - * 生命周期函数--监听页面卸载  
90 - */  
91 - onUnload: function () {  
92 -  
93 - },  
94 -  
95 - /**  
96 - * 页面相关事件处理函数--监听用户下拉动作  
97 - */  
98 - onPullDownRefresh: function () {  
99 -  
100 - },  
101 -  
102 - /**  
103 - * 页面上拉触底事件的处理函数  
104 - */  
105 - onReachBottom: function () {  
106 -  
107 - },  
108 -  
109 - /**  
110 - * 用户点击右上角分享  
111 - */  
112 - onShareAppMessage: function () {  
113 -  
114 - },  
115 - formValue(e){  
116 - let key=util.attr(e,'key');  
117 - let form=this.data.form;  
118 - form[key]=util.val(e).trim();  
119 - let obj={  
120 - form:form,  
121 - }  
122 - if(key=='send_msg'){  
123 - obj.totalChar=form[key].length;  
124 - obj.totalSms=Math.ceil((form[key].length+3)/67);  
125 - }  
126 - obj.buttonStatus=false;  
127 - if(this.data.form.send_msg && this.data.form.name && this.data.form.phone){  
128 - obj.buttonStatus=true  
129 - }  
130 - this.setData(obj)  
131 - },  
132 - submit(e){  
133 - if(!this.data.buttonStatus) return;  
134 - if(this.data.form.send_total<1) {  
135 - return util.toast('活动人数为空','none');  
136 - }  
137 - if(!this.data.form.send_msg){  
138 - return util.toast('内容必须填写','none');  
139 - }  
140 - if(!this.data.form.name){  
141 - return util.toast('姓名必须填写','none');  
142 - }  
143 - if(!/^1[3-9]{1}[\d]{9}$/.test(this.data.form.phone)){  
144 - return util.toast('请填写正确手机号码','none');  
145 - }  
146 - let param={  
147 - ...this.data.form,  
148 - send_phones:this.reservePhones,  
149 - sid:this.options.seller_id,  
150 - note_name:this.note_name,  
151 - }  
152 - if(this.options.hasScene==1){  
153 - param.note_name=e.detail.nickName  
154 - }  
155 - App.Reserve.SmsBatchUpdate(param).then(res=>{  
156 - this.options.id=res.data.id;  
157 - console.log('this.options.total',this.data.totalSms,this.reservePhonesMap.length)  
158 - this.options.total=this.data.totalSms*this.reservePhonesMap.length  
159 - wx.redirectTo({  
160 - url:util.http_build_query(this.options,'./result'),  
161 - });  
162 - });  
163 - },  
164 -})  
1 -{  
2 - "backgroundTextStyle":"light",  
3 - "navigationBarBackgroundColor": "#fff",  
4 - "navigationBarTextStyle":"black",  
5 - "usingComponents": {  
6 - "userinfo":"/components/userinfo/userinfo",  
7 - "nav":"/components/nav/nav",  
8 - "formids":"/components/formids/formids"  
9 - }  
10 -  
11 -}  
1 -<!--pages/book/smsbatch/update.wxml-->  
2 -<nav id="nav" hasHome>短信营销</nav>  
3 -<view class="page">  
4 - <textarea class="textarea" bindinput="formValue"  
5 - maxlength="500"  
6 - data-key="send_msg" placeholder="请输入要发送的短信内容"></textarea>  
7 - <view class="sms-tip">  
8 - <block wx:if="{{totalChar>0}}">{{totalChar}}个字符,合{{totalSms}}条短信</block>  
9 - </view>  
10 - <view class="hr-one"></view>  
11 - <view class="sms-total Medium flex-lr">  
12 - <view>活动人数</view>  
13 - <view>{{form.send_total}}人</view>  
14 - </view>  
15 -</view>  
16 -<view class="page Medium linker" style="padding-bottom: 36rpx;">  
17 - <view class="flex-ll linker-title">  
18 - <view>联系方式</view>  
19 - <view style="font-size: 26rpx;">(审核结果会以电话/短信方式通知)</view>  
20 - </view>  
21 - <view class="hr-one"></view>  
22 - <input placeholder="请输入姓名" bindinput="formValue" data-key="name" value="{{form.name}}"/>  
23 - <view class="hr-one"></view>  
24 - <input placeholder="请输入电话" bindinput="formValue" data-key="phone" type="number" value="{{form.phone}}"/>  
25 -</view>  
26 -<view class="button-opt">  
27 - <block wx:if="{{options.hasScene==1}}">  
28 - <userinfo binduserinfo="submit">  
29 - <view class="but {{buttonStatus?'active':''}}">提交审核</view>  
30 - </userinfo>  
31 - </block>  
32 - <block wx:else="">  
33 - <view class="but {{buttonStatus?'active':''}}" bindtap="submit">提交审核</view>  
34 - </block>  
35 -</view>  
1 -/* pages/book/smsbatch/update.wxss */  
2 -page{  
3 - background-color: #F5F5F5;  
4 - font-size: 34rpx;  
5 - color: #353535;  
6 -}  
7 -.page{  
8 - width: 88%;  
9 - margin: 20rpx auto;  
10 - padding: 20rpx 3%;  
11 - background-color: #FEFEFE;  
12 - border-radius: 8rpx;  
13 -}  
14 -.hr-one{  
15 - background-color: #F1F0F4;  
16 - width: 100%;  
17 - height: 2rpx;  
18 - margin-top: 16rpx;  
19 - margin-bottom: 38rpx;  
20 -}  
21 -.sms-tip{  
22 - height: 60rpx;  
23 - line-height: 60rpx;  
24 - font-size: 26rpx;  
25 - margin-top: 42rpx;  
26 -}  
27 -.sms-total{  
28 - height: 48rpx;  
29 - line-height: 48rpx;  
30 - margin-bottom: 36rpx;  
31 -}  
32 -  
33 -.linker-title{  
34 - height: 48rpx;  
35 - line-height: 48rpx;  
36 - margin-top: 16rpx;  
37 -}  
38 -.linker .hr-one{  
39 - margin-top: 36rpx;  
40 - margin-bottom: 36rpx;  
41 -}  
42 -.button-opt{  
43 - width: 90%;  
44 - margin: 98rpx auto 0;  
45 -}  
46 -.button-opt .but{  
47 - text-align: center;  
48 - height: 84rpx;  
49 - border-radius: 10rpx;  
50 - line-height: 84rpx;  
51 - background-color: #5AAEB1;  
52 - color:#FEFEFE;  
53 -}  
54 -.button-opt .but.active{  
55 - background-color: #199095;  
56 -}  
57 -.textarea{  
58 - height: 240rpx;  
59 - width: 100%;  
60 -}  
@@ -4,7 +4,7 @@ import util from '../../utils/util'; @@ -4,7 +4,7 @@ import util from '../../utils/util';
4 import App from '../../utils/api'; 4 import App from '../../utils/api';
5 import TP from '../../utils/tpls'; 5 import TP from '../../utils/tpls';
6 const {regeneratorRuntime} = global 6 const {regeneratorRuntime} = global
7 -import ST from '../book/b_sms_tpls'; 7 +import ST from '../../utils/sms_tpls';
8 Page({ 8 Page({
9 9
10 /** 10 /**
@@ -86,10 +86,10 @@ Page({ @@ -86,10 +86,10 @@ Page({
86 if(res.data.note_openid==this.enter_params.seller_openid && opt.hasSellerShare==1){//不是客户端分享,且是记录人 86 if(res.data.note_openid==this.enter_params.seller_openid && opt.hasSellerShare==1){//不是客户端分享,且是记录人
87 util.cache('enter_params',this.enter_params) 87 util.cache('enter_params',this.enter_params)
88 //url = '/pages/book/b_detail'; 88 //url = '/pages/book/b_detail';
89 - url = '/pages/book/b_invitation'; 89 + url = '/pack-book/pages/book/b_invitation';
90 } 90 }
91 } 91 }
92 - if(url!='/pages/book/b_invitation'){ 92 + if(url!='/pack-book/pages/book/b_invitation'){
93 //设置关系 93 //设置关系
94 App.Reserve.SetRelaOpenid({ 94 App.Reserve.SetRelaOpenid({
95 rid:res.data.id, 95 rid:res.data.id,
@@ -127,7 +127,7 @@ Page({ @@ -127,7 +127,7 @@ Page({
127 if(this.enter_params && this.islove!='customer' && this.islove!='invitation'){ 127 if(this.enter_params && this.islove!='customer' && this.islove!='invitation'){
128 //商户且未手动切换到顾客端或客户经理 128 //商户且未手动切换到顾客端或客户经理
129 wx.reLaunch({ 129 wx.reLaunch({
130 - url:util.http_build_query(this.enter_params,'/pages/book/b_index') 130 + url:util.http_build_query(this.enter_params,'/pack-book/pages/book/b_index')
131 }) 131 })
132 return; 132 return;
133 } 133 }
1 // pages/book/b_sms.js 1 // pages/book/b_sms.js
2 -import App from '../../utils/api';  
3 -import util from '../../utils/util';  
4 -import bcm from '../../utils/bookCommon'; 2 +import App from './api';
  3 +import util from './util';
  4 +import bcm from './bookCommon';
5 const {regeneratorRuntime} = global 5 const {regeneratorRuntime} = global
6 const tpls = { 6 const tpls = {
7 SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!', 7 SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!',