Commit 4c70d029359c1207520e7300fb2766aa62fb11d5

Authored by liuxuqinfhp1220
2 parents ffa1f323 d5fff0b7

Merge branch 'master' of http://123.56.79.57/xt/xcx-book

# By vking
# Via vking
* 'master' of http://123.56.79.57/xt/xcx-book: (52 commits)
  fix unionid
  fixbug 回退早市
  fixbug 早市不能选中
  fixbug 早市不能选中
  history
  history
  history
  history
  history
  history
  history
  对接商户端跳入
  网络优化并发bug
  网络优化并发bug
  隐藏号码
  隐藏号码
  隐藏号码
  隐藏号码
  fix fenli bug
  更换短信逻辑
  ...
Showing 54 changed files with 2439 additions and 182 deletions
... ... @@ -16,11 +16,12 @@ Array.prototype.remove = function(val) {
this.splice(index, 1);
}
};
import log from 'utils/realTimeLog'
//import log from 'utils/realTimeLog'
App({
openid:"",
system:{},
shareTicket:"",
isAdmin:false,//是否运营人员
onLaunch: async function (opt) {
console.log('onLaunch',opt,wx.env);
wx.removeStorage({key: 'formids'});//清理历史formids
... ...
... ... @@ -30,7 +30,8 @@
"pages/reserve/discount",
"pages/reserve/indexList",
"pages/reserve/share",
"pages/reserve/submit"
"pages/reserve/submit",
"pages/me/history"
],
"subpackages": [
{
... ... @@ -52,6 +53,7 @@
"pages/book/b_invitation",
"pages/book/b_desk",
"pages/book/b_addnew",
"pages/book/online_update",
"pages/book/b_sms",
"pages/book/b_setting",
"pages/book/setting/index",
... ...
<!--components/actionSheet/index.wxml-->
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="action-sheet">
<view class="tip" wx:if="{{hasTip}}"><slot></slot></view>
<block wx:for="{{items}}" wx:key="items.key">
<block wx:for="{{items}}" wx:key="itemskey">
<action-sheet-item bindtap="bindItemTap" data-value="{{item}}" data-index="{{index}}">{{item}}</action-sheet-item>
</block>
<action-sheet-cancel bindtap="bindItemTap">取消</action-sheet-cancel>
... ...
... ... @@ -43,7 +43,7 @@ Component({
if (e.type = "getuserinfo") {
if (e.detail.errMsg == 'getUserInfo:ok') {
var userInfo = e.detail.userInfo //avatarUrl nickName gender;
console.log('xxxxx', userInfo)
console.log('getUserInfo:ok', e.detail)
util.cache('userInfo', userInfo);
App.Reserve.AddUser({
openid: getApp().openid,
... ... @@ -51,6 +51,7 @@ Component({
nickname: userInfo.nickName,
gender: userInfo.gender
})
getApp()._getOpenid();
this.triggerEvent("userinfo", userInfo);
} else if (e.detail.errMsg == 'getUserInfo:fail auth deny') {
wx.showModal({
... ...
... ... @@ -73,7 +73,7 @@ Component({
this.boardEnable(0)
break;
case '订座':
wx.navigateTo({
wx.redirectTo({
url:'b_addnew?hasQuick=1&tid='+board.id
+'&tname='+board.name
+'&pnum='+(board.most_pnum>board.table_pnum?board.most_pnum:board.table_pnum)
... ...
... ... @@ -7,6 +7,10 @@ Component({
type:String,
value:"",
},
reserveId:{
type:String,
value:"",
},
hasPubSub:{
type:Boolean,
value:false
... ... @@ -20,10 +24,16 @@ Component({
var list = this.data.list;
if(this.data.hasPubSub){
let checkedTids=this.data.checkedTids.split(',');
list.forEach(function (v, i) {
list.forEach( (v, i)=>{
if (v.id == tebleid) {
console.log('click.board',v);
if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
if(this.data.reserveId){
if(v.reserve_id!=this.data.reserveId){
if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
}
}else{
if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
}
if (v.isselect == true) {
var thisindex = tables.indexOf(tebleid);
tables.splice(thisindex, 1)
... ... @@ -37,10 +47,16 @@ Component({
var pages = getCurrentPages();
var addnewPage=pages[pages.length - 2];
let checkedTids=this.data.checkedTids.split(',');
list.forEach(function (v, i) {
list.forEach( (v, i) =>{
if (v.id == tebleid) {
console.log('click.board',v);
if(v.status_str && checkedTids._indexOf(v.id)<0) return util.toast('不能预订该桌位','none');
if(this.data.reserveId){
if(v.reserve_id!=this.data.reserveId) {
if (v.status_str && checkedTids._indexOf(v.id) < 0) return util.toast('不能预订该桌位', 'none');
}
}else{
if (v.status_str && checkedTids._indexOf(v.id) < 0) return util.toast('不能预订该桌位', 'none');
}
if (v.isselect == true) {
var thisindex = tables.indexOf(tebleid);
tables.splice(thisindex, 1)
... ...
... ... @@ -41,11 +41,16 @@ Component({
})
}
if(item.sex==3){
item.rname_mask=item.rname.substr(0,10)
if(item.rname){
if(item.sex==3){
item.rname_mask=item.rname.substr(0,10)
}else{
item.rname_mask=item.rname.substr(0,3)+(item.sex==1?'先生':'女士')
}
}else{
item.rname_mask=item.rname.substr(0,3)+(item.sex==1?'先生':'女士')
item.rname_mask=''
}
item.order_time=util.unixtoTime(item.ddate,'HH:II')
item.status_str=reserveStatus[item.status]||'';
this.setData({vitem:item})
... ...
<wxs src="../../../../utils/util.wxs" module="util" />
<view class="book-list-tds flex-lr font30r black-font reserve-status-{{vitem.status}}">
<formids bindtap="detail" class="book-list-td flex-vc">
<view class="flex-vc">
... ... @@ -12,7 +13,14 @@
</view>
</formids>
<formids bindtap="detail" class="book-list-td flex-vc">
<view class="flex-vc">{{vitem.order_time}}</view>
<view class="flex-vc">
<block wx:if="{{vitem.type==1}}">
{{vitem.is_set_ddate==1?vitem.order_time:util.reserveTimeSpace(vitem.ddate_solt)}}
</block>
<block wx:else="">
{{vitem.order_time}}
</block>
</view>
</formids>
<formids bindtap="{{(vitem.status==1 || vitem.status==5)?'invitation':'detail'}}" class="book-list-td flex-vc">
<view class="flex-rr green-font">
... ...
... ... @@ -14,9 +14,9 @@
width:100%;
line-height:1.2;
}
.reserve-status-4,.reserve-status-3{
.reserve-status-4,.reserve-status-3,.reserve-status-6{
color:#999999;
}
.reserve-status-4 .green-font,.reserve-status-3 .green-font{
.reserve-status-4 .green-font,.reserve-status-3 .green-font,.reserve-status-6 .green-font{
color:#999999;
}
\ No newline at end of file
... ...
... ... @@ -61,7 +61,7 @@ Component({
});
break;
case 2:
if (!this.data.bookInfo.hasOwner) {
if (!this.data.bookInfo.hasOwner && this.data.bookInfo.type==0) {
return util.toast('只有记录人可以拨打', 'none');
}
console.log('this.data.bookInfo', this.data.bookInfo);
... ...
... ... @@ -81,15 +81,28 @@ Component({
if(sc.seller_user){
cause.uname=(sc.seller_user.nick_name||sc.seller_user.nickname)
}
App.Reserve.SetReserveStatus({
rid:this.data.bookInfo.id,
status:4,
cause:JSON.stringify(cause),
}).then(()=>{
this.hide()
this.triggerEvent('reserveCancel',{hasCancel:true});
//this.getDetail(this.data.bookInfo.id,true);
})
if(1==this.data.bookInfo.type){
App.Customer.SetReserveStatus({
rid:this.data.bookInfo.id,
status:4,
cause:JSON.stringify(cause),
}).then(()=>{
this.hide()
this.triggerEvent('reserveCancel',{hasCancel:true});
//this.getDetail(this.data.bookInfo.id,true);
})
}else{
App.Reserve.SetReserveStatus({
rid:this.data.bookInfo.id,
status:4,
cause:JSON.stringify(cause),
}).then(()=>{
this.hide()
this.triggerEvent('reserveCancel',{hasCancel:true});
//this.getDetail(this.data.bookInfo.id,true);
})
}
}
}
})
... ...
... ... @@ -41,7 +41,7 @@ Component({
let pages = getCurrentPages();
let p = pages[pages.length - 1];
if (url.indexOf(p.route) < 0) {
wx.redirectTo({
wx.reLaunch({
url: url,
})
}
... ...
... ... @@ -20,6 +20,7 @@ module.exports = {
let enter_params = util.cache('enter_params');
let res = await App.Seller.VerificationIsAdmin({openid:enter_params.seller_openid})
if (res.data && res.data.status==1) {
getApp().isAdmin=true
success()
} else {
fail()
... ...
... ... @@ -93,28 +93,20 @@ Page({
];
this.reserve_id = options.id || '';
let rev_time=parseInt(nt)
if(options.hasQuick==1){
let rdate=options.ddate.split('-')
if(!(rev_time>=rdate[0] && rev_time<=rdate[1])){
rev_time=rdate[0]
}
await this.setDateStr(rev_time);
}
//判断hasUseDefDtime
let hasUseDefDtime = true;
let mmii = util.unixtoTime(rev_time, 'HH:II');
if (mmii > this.data.defDtime[this.data.form.time]) {
hasUseDefDtime = false;
}
console.log('initLoad::setDateStr',util.unixtoTime(rev_time,'YYYY-MM-DD HH:II'),this.data.defDtime[this.data.form.time])
await this.setDateStr(rev_time,hasUseDefDtime);
this.sellerid = util.cache('enter_params')['seller_id'];
let timePickerArray = await comm.getDayTimeSpace();
this.setData({
timePickerArray: timePickerArray,
speciallist: speciallist,
hasUseDefDtime: hasUseDefDtime,
//hasUseDefDtime: hasUseDefDtime,
})
if(options.hasQuick==1){
let rdate=options.ddate.split('-')
if(!(rev_time>=rdate[0] && rev_time<=rdate[1])){
rev_time=rdate[0]
}
}
await this.setDateStr(rev_time);
if (this.reserve_id > 0) {
this.initModify(this.reserve_id);
} else if(options.hasQuick==1){
... ... @@ -123,17 +115,25 @@ Page({
this.getTables();
}
},
/**
*
* @param d
*
*/
async setDateStr(d = new Date() / 1000,hasUseDefDtime=false){
hasInTimeSpace(hhii,timeIndex){
console.log('hasInTimeSpace',this.data.timePickerArray)
if(this.data.timePickerArray.length<1)return false
let timePickerArray=this.data.timePickerArray[timeIndex];
let tl=timePickerArray.length
if(tl<1) return false
console.log('hasInTimeSpace',hhii,timePickerArray[0],timePickerArray[tl-1],hhii>=timePickerArray[0] && hhii<=timePickerArray[tl-1])
if(hhii>=timePickerArray[0] && hhii<=timePickerArray[tl-1]) return true
return false
},
async setDateStr(d = new Date() / 1000,hasUseDefDtime=false,fouceTime=-1){
fouceTime=fouceTime>-1?fouceTime:this.data.form.time
hasUseDefDtime=this.hasInTimeSpace(this.data.defDtime[fouceTime],fouceTime)
if(hasUseDefDtime){//
let timestr=util.unixtoTime(d,'YYYY-MM-DD '+this.data.defDtime[this.data.form.time])
let timestr=util.unixtoTime(d,'YYYY-MM-DD '+this.data.defDtime[fouceTime])
d=util.timetouUnix(timestr)
}
console.log('setDateStr',util.unixtoTime(d,'YYYY-MM-DD HH:II'),hasUseDefDtime)
console.log('setDateStr',util.unixtoTime(d,'YYYY-MM-DD HH:II'),hasUseDefDtime,fouceTime)
this.year=util.unixtoTime(d,'YYYY');
let ns = new Date() / 1000;
let dateStr = [
... ... @@ -144,13 +144,20 @@ Page({
let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`')
let form = this.data.form;
let timeObj = await comm.getTimeSpaceIndexData(d);
let timeObj = await comm.getTimeSpaceIndexData(d,null,fouceTime);
if(fouceTime!=timeObj.timeIndex && fouceTime>0){
timeObj.timeIndex=fouceTime
}
//form.time=await comm.getTimeSpaceIndex(d);
//如果小于默认时间,使用默认时间
let mmii = util.unixtoTime(d,'HH:II')
console.log('setDateStr-timeObj',timeObj,mmii,this.data.defDtime[timeObj.timeIndex])
if (mmii < this.data.defDtime[timeObj.timeIndex]) {
let str=util.unixtoTime(d, 'YYYY-MM-DD '+this.data.defDtime[timeObj.timeIndex]+':00')
timeObj = await comm.getTimeSpaceIndexData(util.timetouUnix(str));
hasUseDefDtime=this.hasInTimeSpace(this.data.defDtime[timeObj.timeIndex],timeObj.timeIndex)
if(hasUseDefDtime){
let str=util.unixtoTime(d, 'YYYY-MM-DD '+this.data.defDtime[timeObj.timeIndex]+':00')
timeObj = await comm.getTimeSpaceIndexData(util.timetouUnix(str));
}
}
form.time = timeObj.timeIndex;
... ... @@ -168,6 +175,7 @@ Page({
form: form,
timePickerIndex: timePickerIndex,
timeOpt: timeObj.timeOpt,
hasUseDefDtime:hasUseDefDtime
};
this.setData(obj)
... ... @@ -330,8 +338,9 @@ Page({
sobj.hasUseDefDtime=false
}
}
this.setDateStr(xtime,sobj.hasUseDefDtime);
this.setDateStr(xtime,sobj.hasUseDefDtime,sobj.form.time);
}
if (this.data.form.date == 0) {//
let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) {
... ... @@ -349,7 +358,6 @@ Page({
this.setDateStr(util.timetouUnix(xtime),sobj.hasUseDefDtime);
}
}
this.setData(sobj)
},
selectedValue(e){
... ... @@ -422,7 +430,7 @@ Page({
//console.log(e.type,key,val,form);
sobj.form = form;
sobj.buttonhide = this.data.buttonhide;
if (form.tid.length > 0 && form.rname.length > 0) {
if (form.tid.length > 0 && form.rname.length > 0 && this.data.timePickerArray[form.time].length>0){
sobj.buttonhide = false;
}else{
sobj.buttonhide = true;
... ... @@ -481,9 +489,10 @@ Page({
sid: util.cache('enter_params')['seller_id'],
//pnum_str:form.pnum_str,
pnum: form.pnum,
rdate: rdate,
rdate: util.unixtoTime(rdate.substr(0,10),'YYYYMMDD'),
tid: form.tabid,
rid: this.reserve_id,
ddate_solt:parseInt(form.time)+1
}).then(res => {
let tables = [];
let tablesLength = 0;
... ... @@ -572,6 +581,9 @@ Page({
let tid = new Set(form.tid);//tid 去重
form.tid = [...tid].toString();
}
if(this.data.timePickerArray[form.time].length<1){
return util.toast('请选择时段', 'none');
}
if (!form.tid) {
return util.toast('请选择桌子', 'none');
}
... ... @@ -598,6 +610,8 @@ Page({
let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00");
form.ddate = util.timetouUnix(ddateStr);
}
form.ddate_solt=parseInt(form.time)+1
form.is_set_ddate=1
App.Reserve.SetReserveInfo(form).then(res => {
if (res.ret == 200) {
this.getCustomRemark()
... ... @@ -687,6 +701,7 @@ Page({
+ '&pnum=' + this.data.form.pnum
+ '&checked_tids=' + this.data.form.tid
+ '&rid=' + this.reserve_id
+ '&ddate_solt='+(parseInt(this.data.form.time)+1)
})
},
conditionInfo: function () {
... ... @@ -723,7 +738,7 @@ Page({
console.log('initModify', res);
//设置日期
let obj = await this.setDateStr(res.data.ddate);
let obj = await this.setDateStr(res.data.ddate,null,res.data.ddate_solt-1);
//设置时间
let nd = util.unixtoTime(res.data.ddate, 'HH:II');
let timePickerIndex = this.data.timePickerIndex
... ...
... ... @@ -62,7 +62,7 @@
<view class="section" style="height: 90rpx;">
<view class="tab flex-lr">
<view class="tab flex-ll">
<formids class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key"
<formids class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnumkey"
bindtap="selectedValue" data-key="pnum" data-value="{{item}}">
<view class="pnum">{{item}}</view>
</formids>
... ... @@ -129,7 +129,7 @@
</view>
</view>
<view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}">
<block wx:for="{{tablesed||tables}}" wx:key="tables.key">
<block wx:for="{{tablesed||tables}}" wx:key="tableskey">
<board width="160" height="180" board="{{item}}"
style="margin: 20rpx 0 0 20rpx"
event="boardChoose" className="noBottom"
... ... @@ -167,7 +167,7 @@
bindblur="inputFocus"
data-key="rname"/>
<view class="book-info-grand flex-rr font28r gray-deep-font">
<block wx:for="{{grand}}" wx:key="grand.key">
<block wx:for="{{grand}}" wx:key="grandkey">
<view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}"
bindtap="selectedValue"
data-value="{{item.sex}}"
... ...
... ... @@ -12,8 +12,9 @@ Page({
sellerid:'',
options:null,
onLoad: function (opt) {
//rdate=1574910000-1574924400&tid=0&pnum=6&checked_tids=&rid=44038&ddate_solt=2
console.log('onLoad', opt)
wx.removeStorageSync({key: 'tableid'})
wx.removeStorageSync('tableid')
this.options=opt;
var radio = 750 / util.getsystem().windowWidth;
var contentHeight = util.getsystem().windowHeight - Math.ceil(350 / radio);
... ... @@ -112,13 +113,13 @@ Page({
},
async getbooklist(){
let obj={};
let formdata={};
formdata.sid=this.sellerid;
formdata.x=1;
formdata.y=200;
formdata.rdate=this.options.rdate;
formdata.status='1,2,5';
formdata.rdate=util.unixtoTime(this.options.rdate.substr(0,10),"YYYYMMDD");
formdata.ddate_solt=this.options.ddate_solt
let tids={};
let reserves=await App.Reserve.GetReserveList(formdata);
if(reserves.data.length>0){
... ... @@ -126,10 +127,14 @@ Page({
let ts=r.tid.split(',');
ts.forEach(tid=>{
let rname='';
if(r.sex==3){
rname=r.rname.substr(0,10)
if(r.rname){
if(r.sex==3){
rname=r.rname.substr(0,10)
}else{
rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')
}
}else{
rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')
rname=" "
}
tids[tid]={
rdate:r.rdate,
... ...
... ... @@ -12,6 +12,7 @@
<view style="height: {{height-80}}px;overflow-y: auto;padding-bottom: 160rpx;overflow-x: hidden;width: 100%;">
<block wx:for="{{desklist}}" wx:key="desklist.key">
<orderDesk list="{{item.list}}" checkedTids="{{opt.checked_tids}}"
reserveId="{{opt.rid}}"
bind:changedesk="changedesk" hasPubSub="{{hasPubSub}}"
wx:if="{{item.name==menu_active_id}}"></orderDesk>
</block>
... ...
... ... @@ -17,6 +17,7 @@ Page({
sc: {},
tpls: TP.tpls(),
enter_params: {},
hasCallPhone:false,
onLoad: async function (opt) {
util.setBarTitle('预订详情');
console.log(opt)
... ... @@ -30,6 +31,9 @@ Page({
this.enter_params = util.cache('enter_params');
this.sc = (await App.Reserve.SellerInfo(this.enter_params)).data;
console.log('this.sc', this.sc);
if(getApp().isAdmin || this.sc.seller.is_call_tel==1){
this.hasCallPhone=true;
}
this.chooseManagerInit();
PubSub.on('arrangeDesk',(desk)=>{
this.arrangeDesk(desk)
... ... @@ -76,9 +80,21 @@ Page({
};
},
getcall: function () {
if (!this.detailData.hasOwner) {
return util.toast('只有记录人可以拨打', 'none');
let bi=this.data.bookInfo
if(bi.type==0){
if (!this.detailData.hasOwner && !this.hasCallPhone) {
return util.toast('只有记录人可以拨打', 'none');
}
}else{
//getApp().isAdmin
if(!this.hasCallPhone){//在线预订
if((bi.status==0 || bi.status==6)){
return;
}
}
}
if (this.data.bookInfo.phone.length < 3) {
return util.toast('号码错误', 'none');
}
... ... @@ -149,9 +165,11 @@ Page({
let note_openid = enter_params.seller_openid;
res.data.hasOwner = false;
if (note_openid == res.data.note_openid || sc.seller_user.role_name == '管理员') {
res.data.hasOwner = true;
if(res.data.type==0){
res.data.hasOwner = true;
}
}
if (!res.data.hasOwner) {
if(!res.data.hasOwner && !this.hasCallPhone){
res.data.phoneStr = res.data.phoneStr.replace(/(\d{2})(.{5})(\d{3})/, function ($0, $1, $2, $3) {
return $1 + '**' + $3;
})
... ... @@ -178,8 +196,12 @@ Page({
})
},
gotoModify() {
let url='./b_addnew'
if(this.detailData.type==1){
url='./online_update'
}
wx.redirectTo({
url: './b_addnew?id=' + this.data.bookInfo.id
url: url+'?id=' + this.data.bookInfo.id
})
},
cancelReserve() {
... ... @@ -195,13 +217,23 @@ Page({
})
},
async startDinner(e) {
App.Reserve.SetReserveStatus({
rid: this.data.bookInfo.id,
status: util.attr(e, 'status'),
cause: await this.getCause(),
}).then(() => {
this.getDetail(this.data.bookInfo.id, true);
});
if(this.detailData.type==1){
App.Customer.SetReserveStatus({
rid: this.data.bookInfo.id,
status: util.attr(e, 'status'),
cause: await this.getCause(),
}).then(() => {
this.getDetail(this.data.bookInfo.id, true);
});
}else{
App.Reserve.SetReserveStatus({
rid: this.data.bookInfo.id,
status: util.attr(e, 'status'),
cause: await this.getCause(),
}).then(() => {
this.getDetail(this.data.bookInfo.id, true);
});
}
},
showOrder() {
wx.navigateTo({
... ... @@ -229,7 +261,7 @@ Page({
status:6,
cause:await this.getCause('拒绝订单'),
}
App.Reserve.SetReserveStatus(params).then(()=>{
App.Customer.SetReserveStatus(params).then(()=>{
this.getDetail(this.data.bookInfo.id,true);
PubSub.emit('fulshReseveList')
})
... ... @@ -242,7 +274,7 @@ Page({
arrangeOrder(){
let bi=this.data.bookInfo
let checked_tids=''
//rdate=1568023200-1568041200&tid=0&pnum=6&checked_tids=&rid=&hasPubsub=1
//rdate=1574848800-1574866800&tid=0&pnum=6&checked_tids=&rid=&hasPubSub=1&ddate_solt=3
wx.navigateTo({
url:util.http_build_query({
rdate:bi.rdate+'-'+bi.edate,
... ... @@ -251,6 +283,7 @@ Page({
checked_tids:checked_tids,
rid:'',
hasPubSub:1,
ddate_solt:bi.ddate_solt
},'./b_desk')
})
},
... ... @@ -262,13 +295,19 @@ Page({
cause:await this.getCause('安排包间'),
tid:res.tableid.toString()
}
App.Reserve.SetReserveStatus(params).then(()=>{
App.Customer.SetReserveStatus(params).then(()=>{
this.getDetail(this.data.bookInfo.id,true);
PubSub.emit('fulshReseveList')
})
},
easyCall(e){
let bi=this.data.bookInfo
//getApp().isAdmin
if(bi.type==1 && !this.hasCallPhone){//在线预订
if((bi.status==0 || bi.status==6)){
return;
}
}
let phone=bi.phone
if(util.attr(e,'key')=='seller'){
phone=bi.seller.phone
... ...
<wxs src="../../../utils/util.wxs" module="util" />
<nav hasHome>订座详情</nav>
<a2l bindshow="a2lshow" bindhide="a2lshow" key="BOOK-DETAIL" type="black" hitStr="通知客户"></a2l>
<!--订单信息-->
<view class="order-info">
<view class="order-info" wx:if="{{bookInfo}}" >
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">用餐时段</view>
<view class="black-font font34r">
{{util.unixtoTime(bookInfo.ddate,'YYYY年MM月DD日 ')}}
{{util.reserveTimeSpace(bookInfo.ddate_solt)}}
</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">到店时间</view>
<view class="black-font font34r">{{bookInfo.rdateStr}}</view>
<view class="gray-deep-font font30r">用餐时间</view>
<view class="black-font font34r" wx:if="{{bookInfo.type==1}}">
{{bookInfo.is_set_ddate==1?util.unixtoTime(bookInfo.ddate,'HH:II'):''}}
</view>
<view class="black-font font34r" wx:else="">
{{util.unixtoTime(bookInfo.ddate,'HH:II')}}
</view>
</view>
<view class="flex-lr order-detail" wx:if="{{bookInfo.type==1}}">
<view class="gray-deep-font font30r">包间需求</view>
... ... @@ -44,7 +57,7 @@
</view>
<view class="flex-lr order-detail">
<text class="gray-deep-font font30r" space="true" decode="true">客户姓名</text>
<view class="black-font font34r">{{bookInfo.rname}} {{bookInfo.sex==1?'先生':(bookInfo.sex==2?'女士':'')}}</view>
<view class="black-font font34r" wx:if="{{bookInfo.rname}}">{{bookInfo.rname}} {{bookInfo.sex==1?'先生':(bookInfo.sex==2?'女士':'')}}</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">客户电话</view>
... ...
... ... @@ -124,15 +124,12 @@ view{
}
.reserve-status-tip{
position: absolute;
top:200rpx;
right:140rpx;
top:220rpx;
right:240rpx;
width: 82rpx;
height: 52rpx;
z-index: 99;
}
.reserve-status-tip.online{
top:150rpx;
}
.reserve-status-tip .text{
font-weight: bold;
font-size: 32rpx;
... ...
... ... @@ -40,6 +40,10 @@ Page({
this.reserveId=opt.rid
delete opt.rid
}
if(opt.goPath){//商户端跳入带入的参数
this.goPath=opt.goPath
delete opt.goPath
}
this.indexOpt=opt;
mta.Page.init({
"appID":"500667280",
... ... @@ -108,6 +112,11 @@ Page({
url:url
})
}
if(this.goPath){
return wx.reLaunch({
url:'./'+this.goPath
})
}
},
async getbooklist(isExport=false){
let time=0;
... ... @@ -128,7 +137,8 @@ Page({
formdata.x=1;
formdata.y=200;
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY);
formdata.rdate=rdate;
formdata.rdate=util.unixtoTime(rdate.substr(0,10),"YYYYMMDD");
formdata.ddate_solt=parseInt(time)+1
if(isExport){
this.__exportFile(formdata);
}else{
... ... @@ -240,7 +250,7 @@ Page({
ReservesCountDay(day){
App.Reserve.ReservesCountDay({
sid:this.sellerid,
day:day
day:day.replace(/\-/g,'')
}).then(res=>{
let ReservesTotal=0;
... ...
... ... @@ -36,7 +36,7 @@
</view>
<view class="book-list-cut flex-ll font26r black-font">
<text>已订 {{ReservesTotal}}</text>
<text wx:for="{{ReservesCountDay}}" wx:if="{{item>-1}}" wx:key="ReservesCountDay.key">{{timeStrLabel[index]}} {{item}}</text>
<text wx:for="{{ReservesCountDay}}" wx:if="{{item>-1}}" wx:key="ReservesCountDaykey">{{timeStrLabel[index]}} {{item}}</text>
</view>
<block wx:if="{{!bookList}}">
<nothingBook height="{{listHeight}}"></nothingBook>
... ... @@ -53,7 +53,7 @@
</view>
<view class="book-list" style="padding-bottom:118rpx;">
<view class="book-list-body">
<block wx:for="{{bookList}}" wx:key="bookList.key">
<block wx:for="{{bookList}}" wx:key="bookListkey">
<bookList item="{{item}}" class="orderbook"></bookList>
</block>
</view>
... ...
... ... @@ -2,6 +2,7 @@
import util from '../../../utils/util';
import App from '../../../utils/api';
import TP from '../../../utils/tpls';
import RS from '../../../utils/reserveStatus'
const {regeneratorRuntime} = global
Page({
... ... @@ -44,11 +45,24 @@ Page({
res.data.tables.forEach(t=>{
tables.push(t.name);
})
let reserev=RS.reserve(res.data)
console.log('reserev',reserev)
let dateSmart
if(res.data.type==1){
dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[0])
if(res.data.is_set_ddate==1){
dateSmart+=' '+util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[1])
}else{
dateSmart+=' '+reserev.soltName
}
}else{
dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStr)
}
this.setData({
seller:{
name:res.data.seller.sellername,
room:tables.join('、'),
date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr),
date:dateSmart,
addr:res.data.seller.real_address||res.data.seller.map_address,
image:res.data.image_url,
hasOwner:true,
... ...
... ... @@ -17,8 +17,8 @@
</swiper>
<view class="flex-vc"
style="position:fixed;top:{{statusBarHeight}}px;left:0;height: {{titleBarHeight}}px; line-height: {{titleBarHeight}}px;">
<view class="tabs flex-ll">
<formids class="back" bindclick="gotoDetail" >
<view class="tabs flex-ll" bindtap="gotoDetail" >
<formids class="back" >
<view style="min-width: 100rpx;" class="flex-ll">
<image class="back-image"
src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image>
... ...
... ... @@ -74,18 +74,15 @@ Page({
getMembers(hasReachBottom=false){
let params={
sid:this.seller_id,
x:this.offset,
y:this.limit,
rdate:'1234567890-9999999999',
sort:1,
type:1,
page:this.offset,
size:this.limit,
}
if(this.data.activeType==1){
params.status='0,0'
params.flag='0'
}else{
params.status='1,2,3,4,5,6'
params.flag='1'
}
App.Reserve.GetReserveList(params).then((res)=>{
App.Reserve.GetOnlineReserveList(params).then((res)=>{
let list = res.data
if(list.length>0){
list.forEach((r,i)=>{
... ...
... ... @@ -17,7 +17,13 @@
</view>
<view class="flex-ll">
<view class="label">就餐时间:</view>
<view class="content">{{util.unixtoTime(item.ddate,'YYYY-MM-DD HH:II')}}</view>
<view class="content" wx:if="{{item.is_set_ddate==1}}">
{{util.unixtoTime(item.ddate,'YYYY-MM-DD '+util.reserveTimeSpace(item.ddate_solt)+' HH:II')}}
</view>
<view class="content" wx:else="">
{{util.unixtoTime(item.ddate,'YYYY-MM-DD')}}
{{util.reserveTimeSpace(item.ddate_solt)}}
</view>
</view>
<view class="flex-lr">
<view class="flex-ll">
... ...
... ... @@ -143,8 +143,10 @@ Page({
time=this.data.time;
}
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.year);
formdata.rdate=rdate;
//formdata.rdate=rdate;
formdata.status='1,2,5';
formdata.rdate=util.unixtoTime(rdate.substr(0,10),"YYYYMMDD");
formdata.ddate_solt=parseInt(time)+1
obj.rdate=rdate;
let tids={};
let reserves=await App.Reserve.GetReserveList(formdata);
... ... @@ -153,10 +155,14 @@ Page({
let ts=r.tid.split(',');
ts.forEach(tid=>{
let rname='';
if(r.sex==3){
rname=r.rname.substr(0,10)
if(r.rname){
if(r.sex==3){
rname=r.rname.substr(0,10)
}else{
rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')
}
}else{
rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')
rname=" "
}
tids[tid]={
rdate:r.rdate,
... ...
// pages/book/b_sms.js
var util = require('../../../utils/util.js')
import App from '../../../utils/api';
import bcm from '../../../utils/bookCommon';
const {regeneratorRuntime} = global
import ST from '../../../utils/sms_tpls';
const tpls = {
SMS_154587043: '${guest},您好!${seller_name}已为您预订${date}的桌位:${region_room_name};地址:${seller_addr},电话:${seller_phone}\n客户经理${cusman},期待您的光临!',
SMS_162733710: '尊敬的贵宾,您好!${reserve_date}的用餐,为您安排在${seller_name_addr_room}房间,${cusman}期待您的光临,预祝就餐愉快!',
SMS_163050401: '尊敬的贵宾,您好!\n ${seller_name}已为您安排${date}的用餐,房间:${region_room_name}; \n地址:${seller_addr}; \n电话:${seller_phone} \n预祝用餐愉快,${cusman}期待您的光临!',
};
Page({
/**
... ... @@ -24,16 +16,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.options=options;
this.enter_params=util.cache('enter_params');
App.Reserve.SellerInfo(this.enter_params).then(res=>{
this.sc=res.data;
try{
this.tplsIndex=res.data.setting.template_code
}catch(e){}
this.getDetail(options.id);
});
this.getDetail();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -62,28 +48,18 @@ Page({
},
bookInfo: null,
async getDetail(id){
let res=await App.Reserve.Detail({rid: id, openid: ''});
this.bookInfo=res.data
if(res.data.operator_openid==2){//运营处理订单,强制使用运营短信
this.tplsIndex='SMS_173950289'
}
let tplMsg=await ST.getTplMsg(res.data,this.tplsIndex,this.sc)
async getDetail(){
let msg=await App.SendSMS.GetSmsContent({rid: this.options.id});
console.log('tplMsg',msg.data.content)
this.setData({
bookInfo: res.data,
tplMsg: tplMsg
tplMsg: msg.data.content
})
},
sendsms(){
App.SendSMS.Message({
phone: this.bookInfo.phone,
sign_name: '周到安排',
template_code: this.tplsIndex,
template_param: JSON.stringify(ST.smsData),
rid: this.bookInfo.id,
len:this.data.tplMsg.length
}).then((res) => {
App.SendSMS.NewMessage({
rid: this.options.id,
sid:this.enter_params.seller_id,
}).then(res=>{
if (res.ret != 200) {
return util.toast(res.msg, 'none');
}
... ... @@ -91,7 +67,7 @@ Page({
this.setData({
hideSendsms: true,
})
App.Reserve.SmsInfo({seller_id: this.bookInfo.seller.id}, 'clear')
App.Reserve.SmsInfo({seller_id: this.enter_params.seller_id}, 'clear')
})
},
copysms(){
... ...
// pages/book/b_addnew.js
import util from '../../../utils/util';
import comm from '../../../utils/bookCommon';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
const formTpl = {
rid: '',
date: 0,
time: 0,
//pnum_str:'1-4',
pnum: 6,
tabid: 0,
rname: '',
phone: '',
sex: 1,
cusdem: '',
tid: [],
is_set_ddate:0,
}
Page({
/**
* 页面的初始数据
*/
data: {
dateStr: [],
form: JSON.parse(JSON.stringify(formTpl)),
tables: [],
grand: [
{
sex: 1,
grand_title: '先生',
isselect: true
},
{
sex: 2,
grand_title: '女士',
isselect: false
},
{
sex: 3,
grand_title: '公司',
isselect: false
}
],
buttonhide: true,
calendarMaskLoad: false,
calendarMask: false,
dayStyle: [
{month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'},
{month: 'current', day: new Date().getDate(), color: 'white', background: '#AAD4F5'}
],
timePickerArray: [
[],
[],
[],
],
timePickerIndex: [0, 0, 0],
tablesLength: 0,
timePickerMask: false,
pnumInputFocus: false,
pageMarginBottom: 0,
speciallist: [],
calendar: {
nextNum: 0,
},
defDtime: ['', '12:00', '18:30'],
hasUseDefDtime: true,
CustomRemark:[],
CustomRemarkMoreMask:false,
},
/**
* 生命周期函数--监听页面加载
*/
reserve_id: '',
checkedTables:{},//已选中的桌子集合
year:util.unixtoTime(new Date() / 1000,'YYYY'),
onLoad: async function (options) {
this.options=options
this.initLoad(options)
this.getCustomRemark();
},
async initLoad(options = {}){
let nt = new Date() / 1000;
let speciallist = [
{date: util.unixtoTime(nt, 'YYYY-MM-DD'), background: '', text: '今 天'},
{date: util.unixtoTime(nt + 86400, 'YYYY-MM-DD'), background: '', text: '明 天'},
{date: util.unixtoTime(nt + 86400 * 2, 'YYYY-MM-DD'), background: '', text: '后 天'},
];
this.reserve_id = options.id || '';
let rev_time=parseInt(nt)
if(options.hasQuick==1){
let rdate=options.ddate.split('-')
if(!(rev_time>=rdate[0] && rev_time<=rdate[1])){
rev_time=rdate[0]
}
await this.setDateStr(rev_time);
}
//判断hasUseDefDtime
let hasUseDefDtime = true;
let mmii = util.unixtoTime(rev_time, 'HH:II');
if (mmii > this.data.defDtime[this.data.form.time]) {
hasUseDefDtime = false;
}
console.log('initLoad::setDateStr',util.unixtoTime(rev_time,'YYYY-MM-DD HH:II'),this.data.defDtime[this.data.form.time])
await this.setDateStr(rev_time,hasUseDefDtime);
this.sellerid = util.cache('enter_params')['seller_id'];
let timePickerArray = await comm.getDayTimeSpace();
this.setData({
timePickerArray: timePickerArray,
speciallist: speciallist,
hasUseDefDtime: hasUseDefDtime,
})
if (this.reserve_id > 0) {
this.initModify(this.reserve_id);
} else if(options.hasQuick==1){
this.initQuick(options);
} else {
this.getTables();
}
},
hasInTimeSpace(hhii,timeIndex){
if(this.data.timePickerArray.length)return false
let timePickerArray=this.data.timePickerArray[timeIndex];
let tl=timePickerArray.length
if(tl<1) return false
console.log('hasInTimeSpace',hhii,timePickerArray[0],timePickerArray[tl-1],hhii>=timePickerArray[0] && hhii<=timePickerArray[tl-1])
if(hhii>=timePickerArray[0] && hhii<=timePickerArray[tl-1]) return true
return false
},
async setDateStr(d = new Date() / 1000,hasUseDefDtime=false,fouceTime=-1){
fouceTime=fouceTime>-1?fouceTime:this.data.form.time
hasUseDefDtime=this.hasInTimeSpace(this.data.defDtime[fouceTime],fouceTime)
if(hasUseDefDtime){//
let timestr=util.unixtoTime(d,'YYYY-MM-DD '+this.data.defDtime[this.data.form.time])
d=util.timetouUnix(timestr)
}
console.log('setDateStr',util.unixtoTime(d,'YYYY-MM-DD HH:II'),hasUseDefDtime)
this.year=util.unixtoTime(d,'YYYY');
let ns = new Date() / 1000;
let dateStr = [
util.unixtoTime(ns, 'MM-DD `DAY/周WW`'),
util.unixtoTime(parseInt(ns) + 86400, 'MM-DD `DAY/周WW`'),
];
//let dateStr=this.data.dateStr;
let nowStr = util.unixtoTime(d, 'MM-DD `DAY/周WW`')
let form = this.data.form;
let timeObj = await comm.getTimeSpaceIndexData(d);
if(fouceTime!=timeObj.timeIndex && fouceTime>0){
timeObj.timeIndex=fouceTime
}
//form.time=await comm.getTimeSpaceIndex(d);
//如果小于默认时间,使用默认时间
let mmii = util.unixtoTime(d,'HH:II')
if (mmii < this.data.defDtime[timeObj.timeIndex]) {
hasUseDefDtime=this.hasInTimeSpace(this.data.defDtime[timeObj.timeIndex],timeObj.timeIndex)
if(hasUseDefDtime) {
let str = util.unixtoTime(d, 'YYYY-MM-DD ' + this.data.defDtime[timeObj.timeIndex] + ':00')
timeObj = await comm.getTimeSpaceIndexData(util.timetouUnix(str));
}
}
form.time = timeObj.timeIndex;
let ind = dateStr._indexOf(nowStr);
if (ind > -1) {
form.date = ind
} else {
dateStr.push(nowStr.substr(0, 5));
form.date = 2;
}
let timePickerIndex = this.data.timePickerIndex;
timePickerIndex[timeObj.timeIndex] = timeObj.timeMatchIndex;
form.is_set_ddate = this.is_set_ddate
let obj = {
dateStr: dateStr,
form: form,
timePickerIndex: timePickerIndex,
timeOpt: timeObj.timeOpt,
hasUseDefDtime:hasUseDefDtime
};
this.setData(obj)
return obj;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//if(!this.reserve_id || util.cache('tableid').length>0){
//if (util.cache('tableid').length > 0) {
this.getTables();
//}
setTimeout(() => {
this.setData({
calendarMaskLoad: true,
})
}, 1000);
this.conditionInfo()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
async selectedValueAsync(e){
console.log(e);
let key = util.attr(e, 'key');
let val;
let sobj = {};
if (key == 'date') {
this.year=util.unixtoTime(new Date() / 1000,'YYYY');
}
if (e.type == 'input' || e.type == 'confirm') {
val = util.val(e);
if (key == 'phone') {
var that = this;
if (e.detail.value != '' && e.detail.value.length >= 3) {
App.Reserve.GetReserveUser(
{
keywords: e.detail.value,
sid: this.sellerid
}
).then(function (json) {
if (json.ret == 200 && json.data.length > 0) {
that.setData({
searchlist: json.data
})
} else {
that.setData({
searchlist: null
})
}
})
} else {
this.setData({
searchlist: null
})
}
}
if (key == 'pnum') {
sobj.pnumInputFocus = true;
}
} else {
val = util.attr(e, 'value');
}
if (key == 'time') {
if (this.data.timeOpt[val]) return;
}
if ((key == 'time' && this.data.form.time == val) || (key == 'date' && this.data.form.date == val)) {
if (util.attr(e, 'display') != 'block') {
return;
}
}
let form = this.data.form;
if (key == 'tid') {
let ts = this.data.tables;
if (ts[val].isselect) {
ts[val].isselect = false;
form.tid.remove(ts[val].id);
delete this.checkedTables[ts[val].id]
} else {
ts[val].isselect = true;
form.tid.push(ts[val].id);
this.checkedTables[ts[val].id]=ts[val].name
}
sobj.tables = ts;
} else {
form[key] = val;
}
console.log('ts', sobj.tables,this.checkedTables);
//console.log(e.type,key,val,form);
sobj.form = form;
sobj.buttonhide = this.data.buttonhide;
if (form.tid.length > 0 && form.rname.length > 0) {
sobj.buttonhide = false;
}else{
sobj.buttonhide = true;
}
let displayTimes = false;
if (key == 'time') {
if (util.attr(e, 'display') == 'block') {
displayTimes = true;
sobj.timePickerMask = true;
}
}
//判断hasUseDefDtime
if ((key == 'time' || key == 'date') && !sobj.timePickerMask) {
sobj.hasUseDefDtime = true
let ntime = parseInt(new Date() / 1000)
let xtime =ntime
if(key == 'time'){
xtime=util.unixtoTime(new Date() / 1000, this.year+'-' + (this.data.dateStr[this.data.form.date].substr(0, 5)) + ' HH:II:SS');
xtime=util.timetouUnix(xtime)
//if 当前时间在区间内 hasUseDefDtime 为 false
let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
this.data.form.time, null,null,this.year);
d_rdate=d_rdate.split('-');
if(d_rdate[0] <= ntime && ntime<=d_rdate[1]){
sobj.hasUseDefDtime=false
}
}
this.setDateStr(xtime,sobj.hasUseDefDtime,sobj.form.time);
}
if (this.data.form.date == 0) {//
let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) {
sobj.hasUseDefDtime = false;
}
}
if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
if (!displayTimes) {
//sobj.form.tid = []; //切换日期时间清空桌位
//sobj.buttonhide = true;
this.getTables();
}
if (key == 'date') {
let xtime = util.unixtoTime(new Date() / 1000, this.year+'-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');
this.setDateStr(util.timetouUnix(xtime),sobj.hasUseDefDtime);
}
}
this.setData(sobj)
},
selectedValue(e){
console.log(e);
let key = util.attr(e, 'key');
let val;
let sobj = {};
if (key == 'date') {
this.year=util.unixtoTime(new Date() / 1000,'YYYY');
}
if (e.type == 'input' || e.type == 'confirm') {
val = util.val(e);
if (key == 'phone') {
var that = this;
if (e.detail.value != '' && e.detail.value.length >= 3) {
App.Reserve.GetReserveUser(
{
keywords: e.detail.value,
sid: this.sellerid
}
).then(function (json) {
if (json.ret == 200 && json.data.length > 0) {
that.setData({
searchlist: json.data
})
} else {
that.setData({
searchlist: null
})
}
})
} else {
this.setData({
searchlist: null
})
}
}
if (key == 'pnum') {
sobj.pnumInputFocus = true;
}
} else {
val = util.attr(e, 'value');
}
if (key == 'time') {
if (this.data.timeOpt[val]) return;
}
if ((key == 'time' && this.data.form.time == val) || (key == 'date' && this.data.form.date == val)) {
if (util.attr(e, 'display') != 'block') {
return;
}
}
let form = this.data.form;
if (key == 'tid') {
let ts = this.data.tables;
if (ts[val].isselect) {
ts[val].isselect = false;
form.tid.remove(ts[val].id);
delete this.checkedTables[ts[val].id]
} else {
ts[val].isselect = true;
form.tid.push(ts[val].id);
this.checkedTables[ts[val].id]=ts[val].name
}
sobj.tables = ts;
} else {
form[key] = val;
}
console.log('ts', sobj.tables,this.checkedTables);
//console.log(e.type,key,val,form);
sobj.form = form;
sobj.buttonhide = this.data.buttonhide;
if (form.tid.length > 0 && form.rname.length > 0) {
sobj.buttonhide = false;
}else{
sobj.buttonhide = true;
}
let displayTimes = false;
if (key == 'time') {
if (util.attr(e, 'display') == 'block') {
displayTimes = true;
sobj.timePickerMask = true;
}
}
//判断hasUseDefDtime
if ((key == 'time' || key == 'date') && !sobj.timePickerMask) {
sobj.hasUseDefDtime = true
let ntime = parseInt(new Date() / 1000)
let xtime =ntime
if(key == 'time'){
xtime=util.unixtoTime(new Date() / 1000, this.year+'-' + (this.data.dateStr[this.data.form.date].substr(0, 5)) + ' HH:II:SS');
xtime=util.timetouUnix(xtime)
}
this.setDateStr(xtime,sobj.hasUseDefDtime);
}
if (this.data.form.date == 0) {//
let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
if (mmii > this.data.defDtime[key == 'time' ? val : this.data.form.time]) {
sobj.hasUseDefDtime = false;
}
}
if ('date,time,pnum,pnum_str,tabid'.indexOf(key) > -1) {
if (!displayTimes) {
//sobj.form.tid = []; //切换日期时间清空桌位
//sobj.buttonhide = true;
this.getTables();
}
if (key == 'date') {
let xtime = util.unixtoTime(new Date() / 1000, this.year+'-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');
this.setDateStr(util.timetouUnix(xtime),sobj.hasUseDefDtime);
}
}
this.setData(sobj)
},
async getTables(){
let form = this.data.form;
let tableid = util.cache('tableid');
console.log('getTables-tableid', tableid.length, this.reserve_id);
//if (tableid.length < 1 && this.reserve_id) {
if (tableid.length < 1) {
tableid = this.data.form.tid;
}
console.log('getTables-tableid', tableid, tableid.length);
try {
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time,null,null,this.year);
console.log('rdate', this.data.dateStr[this.data.form.date], rdate);
App.Reserve.GetTableList({
sid: util.cache('enter_params')['seller_id'],
//pnum_str:form.pnum_str,
pnum: form.pnum,
rdate: util.unixtoTime(rdate.substr(0,10),'YYYYMMDD'),
tid: form.tabid,
rid: this.reserve_id,
ddate_solt:parseInt(form.time)+1
}).then(res => {
let tables = [];
let tablesLength = 0;
if (tableid.length > 0) {
let toastTables={...this.checkedTables}
let resData=res.data.slice(1,res.data.length);
console.log('resData',resData)
resData.forEach(p => {
//if(tables.length>=3) return true;
p.list.forEach(t => {
delete toastTables[t.id]
tablesLength++;
if (tables.length >= 3) return true;
if (tableid._indexOf(t.id) > -1) {
t.isselect = true;
tables.push(t);
}
})
})
console.log('toastTables',toastTables,this.data.form.tid,this.checkedTables);
//清理已选中的桌位
let toastTablesInfo=[];
let tid=this.data.form.tid
Object.keys(this.checkedTables).forEach(ckid=>{
if(toastTables[ckid]){
delete this.checkedTables[ckid]
tid.remove(ckid);
toastTablesInfo.push(toastTables[ckid]);
}
})
if(toastTablesInfo.length>0){
this.setData({
[`form.tid`]:tid,
})
util.toast(toastTablesInfo.toString()+'已被占用啦','none');
}
wx.removeStorage({key: 'tableid'})
}
console.log('tables-first',tables);
if(tables.length<1){
tablesLength=0;
let fortids=[];
res.data.forEach((p,ri) => {
p.list.forEach(t => {
if(fortids._indexOf(t.id)<0) {
tablesLength++;
tables.push(t);
fortids.push(t.id);
}
})
})
if (tables.length >= 3) {
tables = tables.slice(0, 3);
}
}
this.tablesLength = tablesLength;
this.setData({
tables: tables,
tablesLength: tablesLength
})
this.conditionInfo();
})
} catch (e) {
this.setData({
tables: []
})
}
},
async formsubmit(){
if (this.data.buttonhide) return;
try {
let d_stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]];
let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
this.data.form.time, d_stimestr,null,this.year);
let stimestr = this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[0]];
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
this.data.form.time, stimestr,null,this.year);
console.log('stimestr', stimestr, this.data.form.time, this.data.timePickerIndex);
console.log('rdate', rdate);
this.setData({
buttonhide: true,
})
let form = JSON.parse(JSON.stringify(this.data.form));
console.log('typeof form.tid', typeof form.tid);
if (typeof form.tid == 'object') {
let tid = new Set(form.tid);//tid 去重
form.tid = [...tid].toString();
}
if (!form.tid) {
return util.toast('请选择桌子', 'none');
}
if (!form.rname) {
return util.toast('请填写预订人', 'none');
}
form.sid = this.sellerid;
form.rdate = rdate
try {
let enter_params = util.cache('enter_params');
let sc = (await App.Reserve.SellerInfo(enter_params)).data
let note_openid = enter_params.seller_openid;
let note_name = sc.seller_user.nick_name || sc.seller_user.nickname;
form.note_openid = note_openid || '';
if (form.rid) {//修改时传递uid
form.note_openid = enter_params.manager_id || '';
}
form.note_name = note_name || '';
} catch (e) {}
form.ddate = d_rdate.substr(0, 10);
if (this.data.hasUseDefDtime && this.data.form.time > 0) {//转为默认时间
let ddateStr = util.unixtoTime(form.ddate, "YYYY-MM-DD " + this.data.defDtime[this.data.form.time] + ":00");
form.ddate = util.timetouUnix(ddateStr);
}
//App.Customer.SetReserveInfoById
form.ddate_solt=parseInt(form.time)+1
App.Customer.SetReserveInfoById(form).then(res => {
if (res.ret == 200) {
this.getCustomRemark()
let _id = (res.data.id || res.data)
this.setData({
form: JSON.parse(JSON.stringify(formTpl)),
tables: [],
timePickerIndex: [0, 0, 0],
})
this.initLoad();
this.checkedTables={};
App.Reserve.Detail({rid: _id, openid: ''}, 'clear')
wx.redirectTo({
url: util.http_build_query({id:_id,tplid:1},'b_invitation'),
});
} else {
util.toast(res.msg, 'none')
}
})
} catch (e) {
}
},
selectphone: function (e) {
this.data.form.phone = e.detail.phone;
this.data.form.rname = e.detail.rname;
this.data.form.cusdem = e.detail.cusdem;
var form = this.data.form
this.data.form.sex = e.detail.sex;
this.setData({
form: this.data.form,
searchlist: null
})
this.conditionInfo();
},
calendarShow(){
this.setData({
calendarMask: true
})
},
dateChange(event){
console.log(event);
//let cktime=util.timetouUnix(event.detail.year+'/'+event.detail.month+'/'+event.detail.day)
let cktime = util.timetouUnix(event.detail.date)
this.year=event.detail.date.substr(0, 4);
console.log('this.year',this.year);
let day0 = parseInt(new Date(new Date().setHours(0, 0, 0, 0)) / 1000);
// if (cktime < day0) {
// util.toast('请选择有效日期', 'none');
// return;
// }
let clickDay = event.detail.date.substr(8, 2);
let changeDay = `dayStyle[1].day`;
let changeBg = `dayStyle[1].background`;
this.setData({
[changeDay]: clickDay,
[changeBg]: "#84e7d0",
//[`form.tid`]: [], //切换日期时间清空桌位
//buttonhide: true,
})
console.log('cktime',cktime,util.unixtoTime(cktime,'YYYY-MM-DD'))
if(cktime == day0){//今天
this.setDateStr( new Date() / 1000 )
}else{
let xtime=util.unixtoTime(new Date() / 1000, event.detail.date + ' HH:II:SS');
xtime=util.timetouUnix(xtime)
this.setDateStr(xtime,true)
}
this.calendarClose();
setTimeout(res=>{
this.getTables();
},10)
},
calendarClose(){
this.setData({
calendarMask: false,
timePickerMask: false,
})
},
async selectdesk(){
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date], this.data.form.time,null,null,this.year);
console.log(this.data.form)
wx.navigateTo({
url: 'b_desk?rdate=' + rdate + '&tid=' + this.data.form.tabid
//+'&pnum_str='+this.data.form.pnum_str
+ '&pnum=' + this.data.form.pnum
+ '&checked_tids=' + this.data.form.tid
+ '&rid=' + this.reserve_id
+ '&ddate_solt='+(this.data.form.time+1)
})
},
conditionInfo: function () {
var form = this.data.form
if (form.tid.length > 0 && form.rname.length > 0) {
this.data.buttonhide = false;
}
this.setData({
buttonhide: this.data.buttonhide
})
},
/**
* 选中时间区域
*/
bindTimePickerChange(e){
let timeIndex = util.attr(e, 'timeIndex');
if (timeIndex < 0) return;
let timePickerIndex = this.data.timePickerIndex;
//timePickerIndex[timeIndex]=util.val(e);
timePickerIndex[timeIndex] = util.attr(e, 'val');
console.log(e, timeIndex, util.attr(e, 'val'));
this.setData({
timePickerIndex: timePickerIndex,
hasUseDefDtime: false,
[`form.is_set_ddate`]:1,
})
},
/**
* 修改初始化
*/
is_set_ddate:0,
async initModify(id){
try {
let res = await App.Reserve.Detail({rid: id, openid: ''});
this.is_set_ddate=res.data.is_set_ddate
console.log('initModify', res);
//设置日期
let obj = await this.setDateStr(res.data.ddate,null,res.data.ddate_solt-1);
//设置时间
let nd = util.unixtoTime(res.data.ddate, 'HH:II');
let timePickerIndex = this.data.timePickerIndex
console.log('initModify-', this.data.timePickerArray, obj.form.time, nd)
this.data.timePickerArray[obj.form.time].forEach((dd, ii) => {
console.log('initModify-', nd, dd)
if (nd == dd) {
timePickerIndex[obj.form.time] = ii;
return true;
}
})
console.log('initModify-timePickerIndex', timePickerIndex);
//obj.form.pnum_str=res.data.pnum_str;
obj.form.pnum = res.data.pnum || 6;
obj.form.rname = res.data.rname;
obj.form.phone = res.data.phone || "";
obj.form.sex = res.data.sex;
obj.form.cusdem = res.data.cusdem;
obj.form.is_set_ddate=res.data.is_set_ddate
obj.form.rid = id;
obj.form.tid = [];
let tablesed = [];
res.data.tables.forEach((t, ti) => {
obj.form.tid.push(t.id)
if (ti >= 3) return;
t.isselect = true
t["isselected"] = 1
tablesed.push(t);
this.checkedTables[t.id]=t.name;
})
this.setData({
timePickerIndex: timePickerIndex,
form: obj.form,
//tablesed:tablesed,
hasUseDefDtime: false,
})
setTimeout(() => {
this.getTables();
}, 300)
} catch (e) {
console.log('initModify', e)
}
},
pnumInputFocusEvent(e){
console.log(e);
this.setData({
pnumInputFocus: 'focus' == e.type
})
},
inputFocusTime: 0,
blurTime: 0,
inputFocus(e){
console.log(e, this.inputFocusTime);
return;
if (e.timeStamp > this.inputFocusTime) {
this.inputFocusTime = e.timeStamp;
if (e.type == 'focus' && this.data.pageMarginBottom == 0) {
this.setData({
pageMarginBottom: 300
})
setTimeout(res => {
this.pageScrollToBottom();
}, 100)
} else {
if (this.blurTime > 5) {
this.blurTime = 0;
this.setData({
pageMarginBottom: 0
})
} else {
setTimeout(res => {
this.blurTime += 1;
this.inputFocus(e);
}, 300)
}
}
}
},
pageScrollToBottom: function () {
wx.createSelectorQuery().select('#j_page').boundingClientRect(function (rect) {
// 使页面滚动到底部
wx.pageScrollTo({
scrollTop: rect.bottom
})
}).exec()
},
gotoday(e){
this.setData({
[`calendar.nextNum`]: 0
})
},
nextMonth(e){
this.setData({
[`calendar.nextNum`]: this.data.calendar.nextNum + 1
})
},
prevMonth(e){
this.setData({
[`calendar.nextNum`]: this.data.calendar.nextNum - 1
})
},
/**
* 快速预订初始化
* tid
* tname
* ddate
* pnum
*/
async initQuick(options){
try {
console.log('initQuick', options);
this.checkedTables[options.tid]=options.tname
this.year=util.unixtoTime(options.ddate.substr(0,10),'YYYY');
let form=this.data.form
form.tid=[options.tid]
this.setData({
form: form,
})
setTimeout(() => {
this.getTables();
}, 300)
} catch (e) {
console.log('initQuick', e)
}
},
getCustomRemark(){
App.User.GetCustomRemark({
uid:util.cache('enter_params')['manager_id'],
}).then(res=>{
let CustomRemark=[];
res.data.forEach(r=>{
if(r.often_use){
CustomRemark.push(r);
}
})
this.setData({
CustomRemark:CustomRemark,
})
})
},
oftenUse(e){
let id=util.attr(e,'id');
let val=util.attr(e,'value');
let CustomRemark=this.data.CustomRemark;
let form=this.data.form;
CustomRemark.forEach(r=>{
if(id==r.id){
if(r.active){
form.cusdem=form.cusdem.replace(val+'、','')
}
r.active=!r.active
if(r.active){
form.cusdem+=val+'、'
}
}
})
this.setData({
CustomRemark:CustomRemark,
form:form,
})
this.conditionInfo()
},
CustomRemarkMore(){
this.setData({
CustomRemarkMoreMask:!this.data.CustomRemarkMoreMask
})
}
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nothingBook":"../../components/book/nothing/nothing",
"nav":"/components/nav/nav",
"tabBar":"../../components/book/tabBar/tabBar",
"searchList":"/components/searchlist/searchlist",
"calendar": "plugin://bmCalendar/calendar",
"board":"../../components/book/board/board",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/b_addnew.wxml-->
<nav>录入订座信息</nav>
<view class="page" style="margin-bottom: {{pageMarginBottom}}rpx;" id="j_page">
<view class="base-info">
<!--
<view class="section flex-lr date">
<view class="flex-rr" style="width:100%;">
<item class="date-item {{form.date==0?'checked':''}}"
bindtap="selectedValue" data-key="date" data-value="0">
<view class="date-item-text">{{dateStr[0]}}</view>
</item>
<item class="date-item {{form.date==1?'checked':''}}"
bindtap="selectedValue" data-key="date" data-value="1">
<view class="date-item-text">{{dateStr[1]}}</view>
</item>
</view>
<view class="more flex-ll" bindtap="calendarShow">
<view></view>
<view></view>
<view></view>
</view>
</view>
-->
<view class="section">
<view class="tab flex-ll">
<formids class="item {{form.date==0?'checked':''}}"
bindtap="selectedValue" data-key="date" data-value="0">
{{dateStr[0]}}
</formids>
<formids class="item {{form.date==1?'checked':''}}"
bindtap="selectedValue" data-key="date" data-value="1">
{{dateStr[1]}}
</formids>
<view class="item {{form.date==2?'checked':''}} flex-lr"
bindtap="selectedValue" data-key="date" data-value="2" bindtap="calendarShow">
<view style="width: 80%" class="item-text">{{dateStr[2]||'其他'}}</view>
<image
src="http://qn.colorcun.com/custom/lite-yd/image/date{{dateStr[2]?'.selected':''}}.png"
style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image>
</view>
</view>
</view>
<view class="section ">
<view class="tab flex-ll">
<formids class="item {{form.time==0?'checked':''}} {{timeOpt[0]}}"
wx:if="{{timePickerArray[0].length>0}}"
bindtap="selectedValueAsync" data-key="time" data-value="0">
<view class="picker">早市</view>
</formids>
<formids class="item {{form.time==1?'checked':''}} {{timeOpt[1]}}"
wx:if="{{timePickerArray[1].length>0}}"
bindtap="selectedValueAsync" data-key="time" data-value="1">
<view class="picker">午市</view>
</formids>
<formids class="item {{form.time==2?'checked':''}} {{timeOpt[2]}}"
wx:if="{{timePickerArray[2].length>0}}"
bindtap="selectedValueAsync" data-key="time" data-value="2">
<view class="picker">晚市</view>
</formids>
</view>
</view>
<view class="section" style="height: 90rpx;">
<view class="tab flex-lr">
<view class="tab flex-ll">
<formids class="item-pnum {{form.pnum==item?'checked':''}}" wx:for="{{[6,7,8,9,10]}}" wx:key="pnum.key"
bindtap="selectedValue" data-key="pnum" data-value="{{item}}">
<view class="pnum">{{item}}</view>
</formids>
</view>
<view class="tab" style="margin-left: 20rpx;">
<view class="item {{form.pnum<6 || form.pnum>10?'checked':''}} flex-lr"
data-key="pnum" data-value="{{form.pnum}}">
<view style="width: 80%" class="pnum">
<input
bindinput="selectedValue" bindconfirm="selectedValue"
bindblur="pnumInputFocusEvent"
data-key="pnum" value="{{(form.pnum<6 || form.pnum>10) || pnumInputFocus?form.pnum:''}}"
placeholder-class="placeholder-class-pnum"
maxlength="3" type="number"
placeholder="{{form.pnum<6 || form.pnum>10?form.pnum:''}} 更多"/>
</view>
<image
src="http://qn.colorcun.com/custom/lite-yd/image/pnum{{form.pnum<6 || form.pnum>10?'.selected':''}}.png"
style="min-width: 36rpx;width: 36rpx;height: 36rpx; margin-right: 22rpx;"></image>
</view>
</view>
</view>
</view>
<!--
<view class="section ">
<view class="tab flex-ll">
<view class="item {{form.pnum_str=='1-4'?'checked':''}}"
bindtap="selectedValue" data-key="pnum_str" data-value="1-4">
4人以下
</view>
<view class="item {{form.pnum_str=='5-9'?'checked':''}}"
bindtap="selectedValue" data-key="pnum_str" data-value="5-9">
5~9人
</view>
<view class="item {{form.pnum_str=='10-99'?'checked':''}}"
bindtap="selectedValue" data-key="pnum_str" data-value="10-99">
10人以上
</view>
</view>
</view>
<view class="section ">
<view class="tab flex-ll">
<view class="item {{form.tabid=='2'?'checked':''}}"
bindtap="selectedValue" data-key="tabid" data-value="2">
包间
</view>
<view class="item {{form.tabid=='1'?'checked':''}}"
bindtap="selectedValue" data-key="tabid" data-value="1">
散台
</view>
</view>
</view>
-->
</view>
<view class="page-full tables">
<view class="page" style="margin-top: 0">
<view class="title flex-lr">
<view>可订桌位<text wx:if="{{tables.length>0}}"> ({{tablesLength}})</text></view>
<view class="flex-rr advice-more" bindtap="selectdesk">
<view style="padding-right:20rpx;" class="gray-deep-font font26r">更多</view>
<image src="http://qn.colorcun.com/custom/lite-yd/image/click.png" class="icon12-22"></image>
</view>
</view>
<view class="advice-desk-detail flex-rr" wx:if="{{tables.length>0}}">
<block wx:for="{{tablesed||tables}}" wx:key="tables.key">
<board width="160" height="180" board="{{item}}"
style="margin: 20rpx 0 0 20rpx"
event="boardChoose" className="noBottom"
data-value="{{index}}"
bindtap="selectedValue"
data-key="tid"></board>
</block>
</view>
<view class="advice-desk-detail flex-cc" wx:else="">
没有符合条件的桌位!
</view>
</view>
</view>
<view class="book-info">
<view class="book-info-single flex-lr" style="align-items:flex-start;position:relative;z-index:10;">
<input placeholder="客户电话" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11"
bindinput="selectedValue"
bindconfirm="selectedValue"
data-key="phone"
value="{{form.phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:400rpx;" cursor-spacing="260"/>
<view bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block" style="color:#199095">
<block wx:if="{{form.is_set_ddate==1}}">
<view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:if="{{hasUseDefDtime && form.time>0}}">{{defDtime[form.time]}}</view>
<view style="font-size: 34rpx;height: 100rpx;line-height: 100rpx;" wx:else="">{{timePickerArray[form.time][timePickerIndex[form.time]]}}</view>
</block>
<view wx:else="" style="height: 100rpx;line-height: 100rpx;color:rgba(53,53,53,1);">未设置到店时间</view>
</view>
<block wx:if="{{searchlist}}">
<searchList searchlist="{{searchlist}}" bind:selectphone="selectphone"></searchList>
</block>
</view>
<view class="book-info-single flex-lr" style="align-items:flex-start;">
<input placeholder="客户姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r"
maxlength="12" style="width:450rpx;" value="{{form.rname}}"
bindinput="selectedValue"
bindconfirm="selectedValue"
bindfocus="inputFocus"
bindblur="inputFocus"
data-key="rname"/>
<view class="book-info-grand flex-rr font28r gray-deep-font">
<block wx:for="{{grand}}" wx:key="grand.key">
<view class="book-grand flex-cc book-grand-border {{form.sex==item.sex ? 'book-grand-active white-font' : ''}}"
bindtap="selectedValue"
data-value="{{item.sex}}"
data-key="sex">{{item.grand_title}}</view>
</block>
</view>
</view>
<view class="book-info-single flex-lr">
<input placeholder="客户要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{form.cusdem}}"
bindinput="selectedValue"
bindconfirm="selectedValue"
bindfocus="inputFocus"
bindblur="inputFocus"
data-key="cusdem"/>
<view class="CustomRemarkMore flex-rr">
<view bindtap="CustomRemarkMore">快速备注</view>
</view>
</view>
<view wx:if="{{CustomRemark.length>0}}" class="book-info-single last" style="padding-top: 14rpx; height: 60rpx;">
<view class="flex-lr CustomRemark">
<view class="CustomRemarks">
<view class="CustomRemarksView">
<view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"
bindtap="oftenUse"
data-id="{{item.id}}"
data-value="{{item.often_use}}">{{item.often_use}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="page-full submit">
<view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">完成预订</view>
</view>
</view>
<tabBar></tabBar>
<view class="calendar-mask" bindtap="calendarClose"
style="height:{{calendarMask?'100%':0}};" wx:if="{{calendarMaskLoad}}">
<view style="width: 100%; height:{{calendarMask?'100%':0}};overflow: hidden;position: relative;">
<calendar catchtap="catchtap"
isTodaybtn="{{true}}" todaybtn_txt="回到今天"
custom="{{false}}"
switchover="{{['上一月','下个月']}}"
active-coloro="active-coloro"
active-colort="active-colort"
speciallist="{{speciallist}}"
txt_style="txt-style"
calendar-style="calendar"
header-style="calendar-header"
weektitle-style="weektitle-style"
restcolor-style="restcolor-style"
txt_type="cn-d"
datefont-style="datefont-style"
todaybtn-style="todaybtn-style"
bindnextMonth="nextMonth"
bindprevMonth="prevMonth"
bindselectDate="dateChange"
bindgotoday="gotoday"
prev="{{true||calendar.nextNum>0}}"
circle_show="{{false}}"
closelaststyle="{{true}}"
></calendar>
</view>
</view>
<view class="calendar-mask" bindtap="calendarClose"
style="height:100%;" wx:if="{{timePickerMask}}">
<view class="timePicker">
<view class="flex-rr">
<image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="calendarClose"></image>
</view>
<view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;">
<view bindtap="calendarClose">{{form.time==1?'午市':form.time==2?'晚市':'早市'}}</view>
</view>
<view class="flex-ll" style="flex-wrap:wrap">
<view class="time-item {{timePickerIndex[form.time]==index?'checked':''}}"
style="{{(index+1)%3==0?'margin-right:0;':''}}"
wx:for="{{timePickerArray[form.time]}}" wx:key=""
bindtap="bindTimePickerChange"
data-time-index="{{form.time}}"
data-val="{{index}}"
>{{item}}</view>
</view>
</view>
</view>
<view class="calendar-mask" bindtap="CustomRemarkMore"
style="height:100%;" wx:if="{{CustomRemarkMoreMask}}">
<view class="timePicker" catchtap="catchtap">
<view class="flex-rr">
<image class="close" src="http://qn.colorcun.com/custom/lite-yd/image/add-act.png" bindtap="CustomRemarkMore"></image>
</view>
<view class="flex-cc" style="margin-bottom: 56rpx; font-size: 30rpx;">
<view bindtap="calendarClose">更多标签</view>
</view>
<view class="flex-ll" style="flex-wrap:wrap;width: 110%; margin-left: -5%; max-height: 700rpx;overflow-y: auto;">
<view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"
wx:if="{{item.often_use}}" bindtap="oftenUse"
data-id="{{item.id}}"
data-value="{{item.often_use}}">{{item.often_use}}</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/book/b_addnew.wxss */
.page{
width: 90%;
margin: 20rpx 4% 0;
}
.base-info{
}
.section{
height: 110rpx;
}
.section .label{
width: 60rpx;
font-size: 30rpx;
margin-right: 38rpx;
}
.date{
color:#199095;
width: 100%;
font-size: 38rpx;
font-weight: bold;
}
.date-item{
width: 50%;
}
.date-item-text{
height: 60rpx;
line-height: 60rpx;
border-bottom: 4rpx solid rgba(0,0,0,0);
width: 200rpx;
text-align: center;
color: #666666;
}
.checked .date-item-text{
border-bottom: 4rpx solid #199095;
color: #199095;
}
.date .more{
width: 65rpx;
min-width: 65rpx;
height: 60rpx;
}
.date .more view{
width: 12rpx;
height: 12rpx;
border-radius: 50%;
margin-right: 12rpx;
background-color: #999;
}
.section .tab{
font-size: 34rpx;
color: #199095;
}
.section .tab .item{
height: 50rpx;
line-height: 49rpx;
width: 210rpx !important;
min-width: 210rpx !important;
border-radius: 10rpx;
border: 2rpx solid #199095;
margin-right: 20rpx;
text-align: center;
}
.section .tab .item .item-text,.section .tab .item .picker{
height: 46rpx;
line-height: 46rpx;
}
.section .tab .item .picker{
width:210rpx;
text-align: center;
}
.section .tab .item-pnum{
height: 50rpx;
line-height: 50rpx;
width: 60rpx !important;
min-width: 60rpx !important;
border-radius: 10rpx;
border: 2rpx solid #199095;
margin-right: 32rpx;
text-align: center;
}
.section .tab .item-pnum .pnum,.section .tab .item .pnum input{
height: 46rpx;
line-height: 46rpx;
font-size: 34rpx;
}
.section .tab .item:last-child{
margin-right: 0;
}
.section .tab .item-pnum:last-child{
margin-right: 0;
}
.section .tab .checked{
background-color:#199095;
color: #FEFEFE;
border: 2rpx solid #199095;
}
.section .tab .disabled{
background-color:#999999;
color: #efefef;
border: 2rpx solid #999999;
}
/**
可定桌位
*/
.page-full{
width: 112%;
margin-left: -6%;
background-color: #F5F5F5;
}
.tables{
height: 314rpx;
font-size: 30rpx;
}
.tables .title{
padding-top: 36rpx;
height: 42rpx;
line-height: 42rpx;
}
.advice-desk-detail{
height: 220rpx;
width:100%;
}
.order-desk-info{
width:160rpx;
min-width: 160rpx;
height:160rpx;
background:#A9E3E6;
border:1px solid #A9E3E6;
border-radius:10rpx;
position:relative;
overflow:hidden;
margin-left:22rpx;
}
.desk-checked{
border:1px solid #199095;
}
.advice-desk-detail .order-desk-info:first-child{
margin-left:0;
}
.desk-active{
position: absolute;
top: -2rpx;
right: -2rpx;
}
.order-desk-type{
height:30rpx;
line-height: 30rpx;
background:#61A5D1;
position:absolute;
left:0;
top:0;
font-size: 26rpx;
padding: 0 12rpx 4rpx 8rpx;
border-radius: 0 16rpx 16rpx 0;
}
.advice-more{
padding:20rpx 0;
padding-left:30rpx;
}
.cut{
width:100%;
height:4px;
background:#efeef3;
}
/**
预订人信息
*/
.book-info{
width:100%;
padding-top:20rpx;
margin:0 auto;
padding-bottom: 300rpx;
}
.book-info-single{
width:100%;
height:120rpx;
padding-top:40rpx;
border-bottom:1px solid #efeef3;
}
.book-info-single>input{
width:100%;
height:100rpx;
}
.book-info-grand{
height:50rpx;
border:1px solid #199095;
margin-top:20rpx;
}
.book-grand{
width:90rpx;
height:100%;
box-sizing:border-box;
}
.book-grand-active{
background:rgba(25,153,149,.8);
}
.book-grand-border{
border-right:1px solid #199095;
}
.book-grand-border:last-child{
border-width: 0;
}
.phone-reminder{
width:32rpx;
height:32rpx;
margin-left:20rpx;
}
/**
提交按钮
*/
.submit{
position: fixed;
bottom: 120rpx;
left: 0;
right: 0;
height: 150rpx;
background-color: #fefefe;
z-index: 9;
}
.confirm-button{
width:680rpx;
height:85rpx;
background:#199095;
margin:42rpx auto 0;
border-radius:10rpx;
opacity:.6;
}
.confirm-button-active{
opacity:1;
}
@import "common/calendar.wxss";
.placeholder-class-pnum{
color:#199095;
font-size: 34rpx;
}
.timePicker{
width: 80%;
overflow: hidden;
position: absolute;
bottom: 0;
border-top: 2rpx solid #ccc;
background-color: #FEFEFE;
padding: 20rpx 10% 80rpx;
}
.timePicker .time-item{
width: 150rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 40rpx;
font-weight: bold;
color:#199095;
border: 2rpx solid #199095;
border-radius: 10rpx;
text-align: center;
margin-right: 66rpx;
margin-bottom: 60rpx;
}
.timePicker .time-item.checked{
background-color: #199095;
color:#fefefe;
}
.timePicker .close{
width: 50rpx;
height: 50rpx;
transform:rotate(45deg);
margin-top: -10rpx;
margin-right: -10%;
}
.CustomRemark{
line-height: 60rpx;
overflow: hidden;
}
.CustomRemarks{
width: 100%;
}
.CustomRemarksView{
height: 60rpx;
overflow: hidden;
}
.CustomRemarkMore{
width: 200rpx;
min-width: 200rpx;
color:#199095;
font-size: 30rpx;
}
.CustomRemarkItem{
height: 48rpx;
line-height: 48rpx;
padding: 4rpx 14rpx;
background-color: #F5F5F5;
font-size: 30rpx;
color: #999999;
border-radius: 10rpx;
margin-right: 20rpx;
float: left;
margin-bottom: 40rpx;
}
.CustomRemarkItem:last-child{
margin-right: 0;
}
.CustomRemarkMore .CustomRemarkItem{
padding: 4rpx 24rpx;
}
.book-info-single.last{
border-width: 0;
}
.CustomRemarkItem.active{
background-color: #6AB6B9;
color: #FFFFFF;
}
\ No newline at end of file
... ...
... ... @@ -121,7 +121,7 @@ Page({
}
if(key=='send_msg'){
obj.totalChar=form[key].length;
obj.totalSms=Math.ceil((form[key].length+3)/67);
obj.totalSms=Math.ceil((form[key].length+4)/67);
}
obj.buttonStatus=false;
if(this.data.form.send_msg && this.data.form.name && this.data.form.phone){
... ...
// pages/customer/detail_owner.js
import util from '../../utils/util';
import App from '../../utils/api';
import RS from '../../utils/reserveStatus'
const {regeneratorRuntime} = global
import TP from '../../utils/tpls';
Page({
... ... @@ -67,8 +68,9 @@ Page({
openid: getApp().openid,
rid: this.id
},fouce).then(res => {
let reserev=RS.reserve(res.data)
this.setData({
detail:this.formatDatail(res.data)
detail:this.formatDatail(reserev)
})
})
},
... ...
... ... @@ -3,6 +3,7 @@ var mta = require('mta-wechat-analysis')
import util from '../../utils/util';
import App from '../../utils/api';
import TP from '../../utils/tpls';
import RS from '../../utils/reserveStatus'
const {regeneratorRuntime} = global
Page({
... ... @@ -106,20 +107,33 @@ Page({
res.data.tables.forEach(t=>{
tables.push(t.name);
})
let reserev=RS.reserve(res.data)
console.log('reserev',reserev)
let dateSmart
if(res.data.type==1){
dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[0])
if(res.data.is_set_ddate==1){
dateSmart+=' '+util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[1])
}else{
dateSmart+=' '+reserev.soltName
}
}else{
dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStr)
}
this.setData({
detail: this.formatDatail(res.data),
detail: this.formatDatail(res.data,dateSmart),
seller:{
name:res.data.seller.sellername,
room:tables.join('、'),
date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr),
date:dateSmart,
addr:res.data.seller.real_address||res.data.seller.map_address,
image:res.data.image_url,
}
})
})
},
formatDatail(detail){
detail.rdateStr = util.unixtoTime(detail.ddate, 'YYYY/MM/DD 星期WW HH:II');
formatDatail(detail,dateSmart){
detail.rdateStr = dateSmart;
detail.tableFirst = detail.tables[0].name;
if (detail.tables.length > 1) {
detail.tableSubInfo = '等' + (detail.tables.length) + '个'
... ... @@ -200,7 +214,13 @@ Page({
util.toast('赴约成功', 'none')
let url='/pages/customer/list'
if(parseInt(this.data.detail.ddate)-(new Date()/1000)>3600){
url='/pages/customer/list?hasRelaTip=1'
if(this.data.detail.type==1){
if(this.data.detail.is_set_ddate==1){
url='/pages/customer/list?hasRelaTip=1'
}
}else{
url='/pages/customer/list?hasRelaTip=1'
}
}
wx.reLaunch({
url: url
... ...
... ... @@ -109,27 +109,47 @@ Page({
res.data.tables.forEach(t=>{
tables.push(t.name);
})
let reserev=RS.reserve(res.data)
console.log('reserev',reserev)
let dateSmart
if(res.data.type==1){
dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[0])
if(res.data.is_set_ddate==1){
dateSmart+=' '+util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStrSmart[1])
}else{
dateSmart+=' '+reserev.soltName
}
}else{
dateSmart=util.unixtoTime(reserev.ddate,this.data.tpls[this.data.current].timeStr)
}
this.setData({
detail: this.formatDatail(res.data),
detail: this.formatDatail(reserev,dateSmart),
seller:{
name:res.data.seller.sellername,
name:reserev.seller.sellername,
room:tables.join('、'),
date:util.unixtoTime(res.data.ddate,this.data.tpls[this.data.current].timeStr),
addr:res.data.seller.real_address||res.data.seller.map_address,
image:res.data.image_url,
date:dateSmart,
addr:reserev.seller.real_address||reserev.seller.map_address,
image:reserev.image_url,
hasOwner:true,
type:res.data.type,
is_set_ddate:res.data.is_set_ddate
type:reserev.type,
is_set_ddate:reserev.is_set_ddate,
hasUpTime:reserev.type==1 && reserev.hasRunning && reserev.status!=2,
}
})
App.Reserve.SellerInfo({seller_id:res.data.seller.id}).then(async sc=>{
this.msgTpl=await ST.getTplMsg(res.data,sc.data.setting.template_code,sc.data)
/*
App.Reserve.SellerInfo({seller_id:reserev.seller.id}).then(async sc=>{
this.msgTpl=await ST.getTplMsg(reserev,sc.data.setting.template_code,sc.data)
console.log('this.msgTpl',this.msgTpl);
})
})*/
})
App.SendSMS.GetSmsContent({
rid:this.data.options.id,
}).then(res=>{
this.msgTpl=res.data.content
})
},
formatDatail(detail){
detail.rdateStr = util.unixtoTime(detail.ddate, 'YYYY/MM/DD 星期WW HH:II');
formatDatail(detail,dateSmart){
detail.rdateStr = dateSmart;
detail.tableFirst = detail.tables[0].name;
if (detail.tables.length > 1) {
detail.tableSubInfo = '等' + (detail.tables.length) + '个'
... ... @@ -153,7 +173,7 @@ Page({
// detail.cusman_phone='15877556369';
// detail.cusman_account='wx:vking';
// }
detail=RS.reserve(detail);
//detail=RS.reserve(detail);
return detail;
},
showManager(){
... ...
// pages/customer/list.js
import util from '../../utils/util';
import App from '../../utils/api';
import RS from '../../utils/reserveStatus'
const {regeneratorRuntime} = global
import TP from '../../utils/tpls';
... ... @@ -90,6 +91,7 @@ Page({
row.hasOwner = getApp().openid == row.openid
let d = util.unixtoTime(row.rdate, 'MM月DD日 DAY 星期WW');
typeof dlist[d] == 'undefined' ? dlist[d] = [] : '';
row=RS.reserve(row)
dlist[d].push(row);
this.ids.push(row.id);
})
... ...
// pages/me/history.js
import util from '../../utils/util';
import App from '../../utils/api';
Page({
/**
* 页面的初始数据
*/
data: {
sellers:{},
hasMore:false,
hasFirstShow:true,
sellersLength:0,
},
sellers:[],
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
formatSellers(data){
let sellers=[];
let hasChange=false
this.sellers.forEach(seller=>{
if(seller.id==data.sid){
hasChange=true
seller.hasFollow=data.hasFollow
}
if(seller.hasFollow){
sellers.push(seller)
}
})
if(!hasChange){
sellers=[]
}
this.setData({
sellers:sellers
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
hasOnShow:true,
onShow: function () {
if(this.data.sellers.length==0){
wx.showLoading({
title: '加载中',
})
this.setData({
hasFirstShow:true,
})
}
if(this.hasMore || this.data.sellers.length==0){
this.sellers=[]
this.offset=1
// this.setData({
// sellers:[]
// })
this.hasOnShow=true;
this.selectComponent('#getpos').getPos();
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function (e) {
console.log(e)
if(this.hasMore){
this.GetCollectionSellerList();
}
},
offset:1,
size:200,
hasMore:true,
GetCollectionSellerList(){
App.Customer.GetHistoryList().then(res=>{
let sellers=res.data;
let sellersLength=sellers.length;
this.hasMore=sellersLength>=this.size
if(this.hasMore){
this.offset+=1
}
let group={}
sellers.forEach((seller,si) => {
let day=util.unixtoTime(seller.cdate,"`DAY/MM月DD日`")
if(!group[day]){
group[day]={
day:day,
sellers:[]
}
}
group[day].sellers.push(seller)
})
if(!this.hasOnShow){
sellers=[...this.data.sellers,...sellers]
}
this.hasOnShow=false;
this.setData({
sellers:group,
sellersLength:sellersLength,
hasFirstShow:false,
})
this.sellers=group
wx.hideLoading()
if(res.data.length==0 && this.offset==1){
this.GetRecommendSellerLists()
}
})
},
gotoDetail(e){
wx.navigateTo({
url:'/pages/reserve/detail?id='+util.attr(e,'sid')
})
},
onpos(e){
console.log(e);
this.location=e.detail
this.GetCollectionSellerList();
},
hasRecommend:true,
GetRecommendSellerLists(){
if(!this.hasRecommend) return
let param={}
if(this.location){
param={
lat:this.location.latitude,
lng:this.location.longitude
}
}
App.Customer.GetRecommendSellerLists(param).then(res=>{
this.setData({
rsl:res.data
})
})
},
hasGoto:false,
bindtransition(e){
console.log(e)
if('change'==e.type){
this.hasGoto=false
}
if('animationfinish'==e.type){
if(this.hasGoto && (e.detail.current+1)==this.data.rsl.length){
wx.switchTab({
url: '/pages/reserve/index'
})
return;
}else{
this.hasGoto=true
}
}
},
goHome(){
wx.switchTab({
url: '/pages/reserve/index'
})
},
clean(){
wx.showModal({
title: '                  '+'确定清空浏览记录?',
cancelColor:'#999999',
confirmColor:'',
success: (res)=> {
if (res.confirm) {
App.Customer.ClearHistory();
this.setData({
sellers:[],
sellersLength:0,
})
this.GetRecommendSellerLists();
}
}
})
},
})
\ No newline at end of file
... ...
{
"usingComponents": {
"formids":"/components/formids/formids",
"getpos":"/components/userinfo/getpos",
"sb-tr":"/components/reserve/seller-box-transverse/seller-box",
"nav":"/components/nav/nav",
"hr":"/components/hr"
}
}
\ No newline at end of file
... ...
<!--pages/me/history.wxml-->
<nav>订好座,就用周到安排</nav>
<view class="pages">
<view class="flex-vc empty" wx:if="{{sellersLength<1}}">
<block wx:if="{{!hasFirstShow}}">
<image src="http://qn.colorcun.com/custom/lite-online/image/follow-empty.png"></image>
<view class="text">您还没有留下足迹哦~</view>
<view class="goHome" bindtap="goHome">去首页逛逛</view>
</block>
</view>
<block wx:else="">
<view class="clean flex-rr" bindtap="clean">
<view class="clean-img"></view>
<view class="clean-text">清空</view>
</view>
<view class="follow" >
<view class="seller-group" wx:for="{{sellers}}" wx:key="sellerskey" wx:for-item="group">
<view class="timeline">{{group.day}}</view>
<view class="seller-item flex-ll" wx:for="{{group.sellers}}" wx:key="groupSellerskey" wx:for-item="seller"
bindtap="gotoDetail" data-sid="{{seller.id}}">
<image mode="aspectFill" class="image"
src="{{seller.seller_image?seller.seller_image+'?imageView2/2/w/320/interlace/0/q/100':'http://qn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png'}}"></image>
<view class="seller-item-info">
<view class="seller-item-name">{{seller.sellername}}</view>
<view class="seller-item-price" wx:if="{{seller.average>0}}">¥{{seller.average}}元/人</view>
</view>
<view class="seller-item-line"></view>
</view>
</view>
<hr class="seller flex-vc" bgColor="#f5f5f5" wx:if="{{!hasMore}}" style="margin-top: 20rpx;">我是有底线的</hr>
</view>
</block>
</view>
<block wx:if="{{!hasFirstShow && sellersLength<1}}">
<view class="rsl-block">
<view class="line-push">为你推荐</view>
<view class="transverse-list">
<swiper
indicator-dots="{{false}}" autoplay="{{false}}" circular="{{false}}" vertical="{{false}}"
interval="2000" duration="500"
previous-margin="{{15}}px" next-margin="{{15}}px" style="height: 350rpx;"
current="{{current}}" bindchange="bindtransition" bindanimationfinish="bindtransition">
<block wx:for="{{rsl}}" wx:key="rsl.key">
<swiper-item bindtap="gotoDetail" data-sid="{{item.id}}" id="{{item.id}}">
<view class="seller" id="seller-{{item.id}}">
<sb-tr seller="{{item}}"
hasActivityTags="{{false}}"
hasActivityShort="{{true}}"
hasBrand="true" hasActivityTese="true"
hasSlogan="{{false}}"></sb-tr>
</view>
</swiper-item>
</block>
</swiper>
</view>
</view>
</block>
<getpos bindpos="onpos" id="getpos" hasAllowFail></getpos>
... ...
/* pages/me/history.wxss */
page{
background-color: #F5F5F5;
}
.pages{
width: 100%;
margin: 0 auto;
font-size: 30rpx;
}
.seller-group{
background-color: #ffff;
margin-bottom: 10rpx;
}
.empty{margin-top: 160rpx;}
.empty image{
width: 191px;
height: 158px;
}
.empty .text{
font-size: 28rpx;
margin-top: 60rpx;
}
.follow {
padding-bottom: 50rpx;
padding-top: 50rpx;
}
.clean{
background-color: #fff;
height: 50rpx;
line-height: 50rpx;
padding-top: 10rpx;
position: fixed;
right: 0rpx;
width: 100%;
z-index: 10;
}
.clean-img{
background-image: url("http://qn.colorcun.com/reserve/images/20191224153853.png");
background-size: 100% 100%;
width: 24rpx;
height: 24rpx;
}
.clean-text{
margin:0 40rpx 0 10rpx;
font-size:24rpx;
color:rgba(53,53,53,1);
}
.rsl-block{
position: fixed;
bottom: 0rpx;
width: 100%;
}
.transverse-list{
background-color: #fefefe;
width: 100%;
}
.transverse-list .seller{
width: 98%;
margin: 0 auto;
}
.line-push{
background-image: url("http://qn.colorcun.com/reserve/images/line-push.png");
width: 328rpx;
height: 42rpx;
background-size: 100% 24rpx;
margin: 0 auto;
font-size:30rpx;
color: #C0A369;
line-height: 24rpx;
background-repeat: no-repeat;
text-align: center;
margin-bottom: 60rpx;
}
.goHome{
width:200rpx;
height:60rpx;
border-radius:30rpx;
border:2rpx solid rgba(192,163,105,1);
font-size:28rpx;
font-weight:500;
color:rgba(192,163,105,1);
line-height:60rpx;
text-align: center;
margin-top: 40rpx;
}
.timeline{
height: 80rpx;
line-height: 80rpx;
box-sizing: border-box;
font-size:36rpx;
font-weight:600;
color:rgba(53,53,53,1);
padding-left: 20rpx;
border-bottom: 2rpx solid #f5f5f5;
}
.seller-item{
box-sizing: border-box;
width: 100%;
height: 280rpx;
padding: 20rpx;
position: relative;
}
.seller-item-line{
position: absolute;
width: calc(100% - 200rpx);
height: 2rpx;
right:0;
bottom: 0;
background-color: #f5f5f5;
}
.seller-item .image{
width: 160rpx;
height: 240rpx;
background-color: #4C4E4F;
min-width: 160rpx;
margin-right: 20rpx;
}
.seller-item-info{
flex-direction: row;
justify-content: space-around;
height:240rpx;
width: calc(100% - 200rpx);
}
.seller-item-name{
height:44rpx;
font-size:32rpx;
font-weight:600;
color:rgba(53,53,53,1);
line-height:44rpx;
margin-top: 28rpx;
overflow: hidden;
white-space:nowrap;
text-overflow: ellipsis;
}
.seller-item-price{
height:40rpx;
font-size:28rpx;
font-weight:600;
color:rgba(53,53,53,1);
line-height:40rpx;
margin-top: 60rpx;
}
\ No newline at end of file
... ...
... ... @@ -46,6 +46,10 @@
<view class="icon picon p1"></view>
<view class="text">常用联系人</view>
</navigator>
<navigator class="flex-vc" url="/pages/me/history">
<view class="icon picon p4"></view>
<view class="text">浏览记录</view>
</navigator>
<view class="flex-vc" bindtap="gotoSellerBook" wx:if="{{hasSellerBook}}">
<view class="icon picon p2"></view>
<view class="text">商户模式</view>
... ...
... ... @@ -96,6 +96,9 @@ image{
.picon.p3{
background-image: url("http://qn.colorcun.com/custom/me/image/p3.png");
}
.picon.p4{
background-image: url("http://qn.colorcun.com/reserve/images/201912241538531.png");
}
.block-rev .width3{
width: 75%;
}
... ...
... ... @@ -42,6 +42,7 @@ Page({
})
})
this.SetRelaOpenid();
App.Customer.BindClicks({sid:options.id})
},
GetSellerDetail(){
let options=this.options
... ...
... ... @@ -290,7 +290,7 @@
padding: 28rpx 0;
}
.activity-left{
width: 100%;
width: calc(100% - 120rpx);
}
.activity-right{
min-width: 120rpx;
... ... @@ -327,9 +327,12 @@
}
.discount{
margin-right: 20rpx;
white-space:nowrap;
}
.discount:last-child{
margin-right: 0;
overflow: hidden;
text-overflow: ellipsis;
}
.discount .discount-left{
background-image: url("http://qn.colorcun.com/reserve/images/%E5%B7%A6%E8%BE%B9.png");
... ...
... ... @@ -20,9 +20,9 @@
时间
<view class="title-right"></view>
</view>
<view class="content flex-cc">
<view class="content flex-cc date-time">
{{date}}
<view class="upTime" bindtap="upTime" wx:if="{{is_set_ddate==0 && type==1}}">修改时间</view>
<view class="upTime" bindtap="upTime" wx:if="{{hasUpTime}}">{{is_set_ddate==0?'添加时间':'修改时间'}}</view>
</view>
<view class="title title-addr-view flex-cc" bindtap="lookLocation">
<view class="title-addr"></view>
... ...
... ... @@ -255,6 +255,11 @@
height: 40rpx;
line-height: 40rpx;
}
.date-time{
position: relative;
height: 50rpx;
line-height: 50rpx;
}
.upTime{
width: 92rpx;
height: 34rpx;
... ... @@ -262,5 +267,7 @@
font-size: 20rpx;
background-color: #ECD9B7;
color: #794F28;
margin-left: 20rpx;
position: absolute;
right:0;
top:8rpx;
}
\ No newline at end of file
... ...
... ... @@ -220,7 +220,7 @@
"id": 21,
"name": "预订本-80商家",
"pathName": "pack-book/pages/book/b_index",
"query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&rid=33354",
"query": "seller_id=80&seller_openid=oGefL4qKBWIh5xwyg3LVfkMbDumA&manager_id=763&goPath=b_addnew",
"scene": 1001
},
{
... ... @@ -352,14 +352,14 @@
"id": 39,
"name": "pages/reserve/detail 在线订座 ",
"pathName": "pages/reserve/detail",
"query": "id=1009&fromid=&activeTab=",
"query": "id=1",
"scene": null
},
{
"id": 40,
"name": "邀请Ren pages/customer/index ",
"pathName": "pages/customer/detail_owner_invitation",
"query": "id=25569&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1",
"query": "id= 45539&fromid=test&hasInvitation=1&hasSellerShare=1&tplid=1",
"scene": null
},
{
... ... @@ -522,6 +522,48 @@
"pathName": "pages/customer/list",
"query": "hasRelaTip=1",
"scene": null
},
{
"id": 64,
"name": "pack-book/pages/book/b_addnew 桌位进入",
"pathName": "pack-book/pages/book/b_addnew",
"query": "id=43844",
"scene": null
},
{
"id": 65,
"name": "pack-book/pages/book/online_update",
"pathName": "pack-book/pages/book/online_update",
"query": "id=45016",
"scene": null
},
{
"id": -1,
"name": "pages/customer/detail_owner_invitation",
"pathName": "pages/customer/detail_owner_invitation",
"query": "id=43762&hasInvitation=1&hasSellerShare=1&tplid=1",
"scene": null
},
{
"id": -1,
"name": "pack-book/pages/book/b_sms",
"pathName": "pack-book/pages/book/b_sms",
"query": "id=44178",
"scene": null
},
{
"id": -1,
"name": "新建内部预订",
"pathName": "pack-book/pages/book/b_addnew",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/me/history",
"pathName": "pages/me/history",
"query": "",
"scene": null
}
]
}
... ...
... ... @@ -102,7 +102,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr
mask: true
})
}
if (RMT.check(cache_key)) return RMT.get(cache_key)
if (RMT.check(cache_key) && !api.hasDisabledRMT) return RMT.get(cache_key)
RMT.set(cache_key)
return new Promise(async(success, fail) => {
if(api.msgSecCheck){//数据安全检查
... ...
... ... @@ -8,11 +8,13 @@ export default {
//ximing http://www.dzapi.com/index.php?s=
alias: 'App.TestManagement.TestReal', //真实接口名称,默认为空
msgSecCheck:true, //进行内容安全检查
hasDisabledRMT:true, //默认false进行网络并发管理, true不进行并发管理
},
//预订信息详情
'App.Reserve.Detail': {
cachetime: 30,
openid:'openid',
},
//建立预订关系
... ... @@ -56,6 +58,7 @@ export default {
//预订列表
'App.Reserve.GetReserveList': {
silence: false,
alias:'App.Reserve.NewGetReserveList'
},
//地图页-商家
... ... @@ -73,10 +76,24 @@ export default {
cachetime: 60,
},
//获得推荐桌位
'App.Reserve.GetTableList':{
alias:'App.Reserve.NewGetTableList'
},
//录入预订
'App.Reserve.SetReserveInfo':{
alias:'App.Reserve.NewSetReserveInfo'
},
// 修改当前预订状态 0:待确认,1:已定座,2:确认到店,3:用餐完成
'App.Reserve.SetReserveStatus': {
silence: false,
},
//分离后的在线预订专用修改当前预订
'App.Customer.SetReserveStatus': {
silence: false,
},
//修改当前桌子是否启用 0:未启用,1:启用
'App.Reserve.SetSwitchStatus': {
... ... @@ -94,6 +111,7 @@ export default {
//导出
'App.Reserve.ExportReserve': {
silence: false,
alias:'App.Reserve.NewExportReserve'
},
//查询短信剩余及套餐
... ... @@ -126,7 +144,9 @@ export default {
silence: false,
},
//统计某个商家某天预订总数
'App.Reserve.ReservesCountDay':null,
'App.Reserve.ReservesCountDay':{
alias:'App.Reserve.NewReservesCountDay',
},
//统计某个商家某月预订总数
'App.Reserve.ReservesCountMonth':{
cachetime: 300,
... ... @@ -135,15 +155,20 @@ export default {
/**提前点餐**/
'App.Advance.CreateOrder':{
//silence: false,
hasDisabledRMT:true,//可并发
},
//菜品列表
'App.Advance.GetCookbookByClass': null,
//菜品规格
'App.Advance.GetCookbookSelBySpecsId': null,
//添加到购物车
'App.Advance.AddCart': null,
'App.Advance.AddCart': {
hasDisabledRMT:true,//可并发
},
//减菜
'App.Advance.ReduceOrder': null,
'App.Advance.ReduceOrder': {
hasDisabledRMT:true,//可并发
},
//设置人数,设置备注
'App.Advance.SetOrderById':null,
//清空购物车
... ... @@ -347,7 +372,31 @@ export default {
openid:'openid',
cachetime: -1,
},
//查看短信内容
'App.SendSMS.GetSmsContent':null,
//发送短信
'App.SendSMS.NewMessage':null,
//商户修改在线预定
'App.Customer.SetReserveInfoById':null,
//生成小程序码
'App.System.GetWxLiteCode':null,
//获取在线预定列表
'App.Reserve.GetOnlineReserveList':null,
//绑定关系(用户浏览记录)
'App.Customer.BindClicks':{
openid:'openid',
},
//清空浏览记录(用户浏览记录)
'App.Customer.ClearHistory':{
openid:'openid',
},
//获取用户浏览记录(用户浏览记录)
'App.Customer.GetHistoryList':{
openid:'openid',
},
}
\ No newline at end of file
... ...
... ... @@ -143,7 +143,13 @@ module.exports ={
return 0;
},
//获得时间戳在早中晚的索引等
async getTimeSpaceIndexData(d=new Date()/1000,sc=null){
/**
* @param d
* @param sc
* @param fouceTime 强制使用timeIndex
* @returns {Promise.<{timeIndex: number, timeMatchIndex: number, timeOpt: [string,string,string]}>}
*/
async getTimeSpaceIndexData(d=new Date()/1000,sc=null,fouceTime=0){
let day0 = new Date(new Date().setHours(0, 0, 0, 0)) / 1000 ;
let day1 = day0 + 86400;
let isDay=false;//是否今天
... ... @@ -157,10 +163,10 @@ module.exports ={
timeMatchIndex:0,
timeOpt:['','','']
};
for(let i=0;i<times.length;i++) {
for(let i=fouceTime;i<times.length;i++) {
let flag = false;
for (let j = 0; j < times[i].length; j++) {
//console.log('times', nd, times[i][j], i, j);
console.log('times', nd, times[i][j], i, j);
if (nd <= times[i][j]) {
obj.timeIndex = i;
obj.timeMatchIndex = j;
... ... @@ -176,7 +182,7 @@ module.exports ={
obj.timeOpt[i] = 'disabled';
}
}
//console.log('times',obj);
console.log('times',obj);
return obj;
},
timeStrLabel:{'morning':'早市','noon':'午市','night':'晚市'},
... ...
... ... @@ -146,6 +146,16 @@ module.exports ={
break;
}
let tpl = this.tpls[tplcode];
if(bookInfo.type==1 && smsData.date){
if(bookInfo.is_set_ddate!=1){
if(tplcode=='SMS_154587043'){
smsData.date=smsData.date.replace(/[\d]{2}:[\d]{2}/,txa[tx.timeIndex])
}else{
smsData.date=smsData.date.replace(/[\d]{2}:[\d]{2}/,'')
}
}
}
this.smsData = smsData;
tpl = tpl.replace(/\${([^}]+)}/ig, function ($0, $1) {
//console.log($0, $1);
... ...
... ... @@ -6,6 +6,7 @@ let tpls=[
name: '商务',
hasImage:false,
timeStr:'YYYY/MM/DD 星期WW HH:II',
timeStrSmart:['YYYY/MM/DD 星期WW','HH:II'],
shareFirstImage:'http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg',
shareImage:'http://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148573.jpg',
shareFirstTitle:'用餐已为您安排,点击查看详情',
... ... @@ -17,6 +18,7 @@ let tpls=[
name: '温馨',
hasImage:true,
timeStr:'YYYY年MM月DD日HH时II分',
timeStrSmart:['YYYY年MM月DD日','HH时II分'],
shareFirstImage:'http://qn.colorcun.com/manager-invitation/wx3/wx1.jpg',
shareImage:'http://qn.colorcun.com/manager-invitation/wx3/wx2.jpg',
shareFirstTitle:'用餐已为您安排,点击查看详情',
... ...
... ... @@ -74,7 +74,7 @@ function unixtoTime(ns,format) {
}
}
}
if(format.indexOf('`')>0){
if(format.indexOf('`')>-1){
result=result.replace(/`(.*)\/(.*)`/ig,function($0,$1,$2){
return $1||$2;
});
... ...