Commit 200a5e5b54bc9014ed4e44d51f427857be842620

Authored by liuxuqinfhp1220
1 parent 6a74097c

no message

... ... @@ -63,7 +63,8 @@
"pages/book/smsbatch/update",
"pages/book/smsbatch/detail",
"pages/book/smsbatch/list",
"pages/book/smsbatch/result"
"pages/book/smsbatch/result",
"pages/book/roomtype/roomtype"
]
}
],
... ...
... ... @@ -58,10 +58,6 @@ Component({
mark:'满'
})
})
marklist=[{
date:'2019-08-20',
mark:'满'
}]
this.setData({
marklist:marklist
})
... ...
import App from '../../../utils/api';
import util from '../../../utils/util';
let dur=['morning','noon','night','midnight']
Component({
properties:{
seller:Object,
... ... @@ -8,59 +9,77 @@ Component({
value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD')
},
section:String,
seletroom:{
type:Array,
value:[]
usecondition:{
type:String,
value:'custom'
}
},
data:{
roomlist:[
{
id:1,
name:'6人间',
mostpnum:8,
lastmoney:3000,
isfull:0,
selectnum:0,
},
{
id:2,
name:'8人间',
mostpnum:8,
lastmoney:3000,
isfull:1,
selectnum:0,
},
{
id:3,
name:'10人间',
mostpnum:8,
lastmoney:3000,
isfull:0,
selectnum:0,
},
{
id:4,
name:'16人间',
mostpnum:8,
lastmoney:3000,
isfull:0,
selectnum:0,
roomlist:[],
},
observers: {
'date,section': function(newdate,newsection) {
console.log('room',newdate,newsection)
if(newdate && newsection){
this.getroomtype();
}
]
}
},
methods:{
getroomtype(){
let parmdata={
sellerid:this.data.seller.id,
day:this.data.date,
interval:dur.indexOf(this.data.section)+1
}
App.Seller.GetSellerTableClass(parmdata).then((json)=>{
console.log('roomlist',json)
if(json.ret==200){
if(json.data.length>0){
if(this.data.usecondition=="custom"){
json.data.forEach((v,i)=>{
v.selectnum=0;
})
}
}
this.setData({
roomlist:json.data
})
}
})
},
selectroom(e){
let _target=e.currentTarget.dataset;
console.log(typeof _target.selectnum)
let setkey='roomlist['+_target.index+'].selectnum';
this.setData({
[setkey]:_target.selectnum+1
})
this.triggerEvent('selectroom',this.data.roomlist[_target.index])
console.log(typeof _target.selectnum,this.data.usecondition)
if(this.data.usecondition=='custom'){
let setkey='roomlist['+_target.index+'].selectnum';
this.setData({
[setkey]:_target.selectnum+1
})
let obj={
id:_target.id,
name:this.data.roomlist[_target.index].name
}
this.triggerEvent('selectroom',obj)
}else{
//////
console.log('置满')
let parmdata={
classid:_target.id,
day:this.data.date,
interval:dur.indexOf(this.data.section)+1
}
if(_target.fid){
parmdata.id=_target.fid;
}
App.Seller.SetTableClassFull(parmdata).then((json)=>{
console.log(json)
if(json.ret==200){
this.triggerEvent('changeroom',{id:_target.id,action:parmdata.id ? 'cancel' : 'confirm'})
this.getroomtype();
}
})
}
},
cancelroom(id){
let roomlist=this.data.roomlist;
... ...
<view class="room-list flex-rs">
<block wx:for="{{roomlist}}" wx:key="{{index}}">
<view class="room-item black-font {{item.isfull==1 ? 'border-gray bg-gray' : 'border-yellow bg-yellow'}} flex-vl" style="justify-content:center;" data-id="{{item.id}}" data-index="{{index}}" data-selectnum="{{item.selectnum}}" catchtap="{{item.isfull==1 ? '' : 'selectroom'}}">
<view class="room-item black-font {{item.isFull && item.isFull==1 ? 'border-gray bg-gray' : 'border-yellow bg-yellow'}} flex-vl" style="justify-content:center;" data-id="{{item.id}}" data-index="{{index}}" data-selectnum="{{item.selectnum ? item.selectnum : 0}}" data-fid="{{item.fid ? item.fid : null}}" catchtap="{{usecondition=='seller' ? 'selectroom' : (item.isFull && item.isFull==1 ? '' : 'selectroom')}}">
<view class="font30r font-bold">{{item.name}}</view>
<view class="font24r room-more">最多可坐8人</view>
<view class="font20r room-consume">最低消费300元</view>
<block wx:if="{{item.isfull==1}}">
<view class="room-full black-font font24r">订满</view>
<block wx:if="{{item.max}}">
<view class="font24r room-more">最多可坐{{item.max}}人</view>
</block>
<block wx:if="{{item.selectnum>0}}">
<view class="room-select white-font font24r flex-cc">已选{{item.selectnum}}</view>
<block wx:if="{{item.low}}">
<view class="font20r room-consume">最低消费{{item.low}}元</view>
</block>
<block wx:if="{{item.selectnum && item.selectnum>0}}">
<view class="room-select white-font font24r flex-cc yellow">已选{{item.selectnum}}</view>
</block>
<block wx:if="{{usecondition=='seller'}}">
<block wx:if="{{item.isFull && item.isFull==1}}">
<view class="room-select black-font font24r flex-cc gray">置满</view>
</block>
</block>
<block wx:else>
<block wx:if="{{(item.isFull && item.isFull==1) || (item.isorderFull && item.isorderFull==1)}}">
<view class="room-full black-font font24r">订满</view>
</block>
</block>
</view>
</block>
... ...
... ... @@ -51,8 +51,13 @@
position: absolute;
right:0;
top:0;
background: #C6A96E;
border-bottom-left-radius: 10rpx;
padding:0 4rpx;
box-sizing: border-box;
}
.room-select.yellow{
background: #C6A96E;
}
.room-select.gray{
background: #E0E0E0;
}
... ...
... ... @@ -10,12 +10,12 @@ Component({
}
},
attached(){
console.log('xxxxx',this.data.seller);
},
observers: {
'date'(newdate){
if(newdate!=''){
//今天日期
console.log('section',this.data.date,newdate)
//今天日期
if(newdate){
let today=util.unixtoTime(new Date()/1000,'YYYY-MM-DD');
this.getsectionlist();
if(today==newdate){
... ... @@ -30,7 +30,6 @@ Component({
this.triggerEvent('selectsection',obj)
}
}
}
},
ready(){
... ...
... ... @@ -9,6 +9,7 @@
}
.section-single{
height:100%;
border-radius:10rpx;
}
.section-single.bg-yellow{
background: -webkit-linear-gradient(top, #F2D190, #C0A369); /* Safari 5.1 - 6.0 */
... ...
... ... @@ -16,6 +16,16 @@ Component({
this.room=this.selectComponent('#room');
console.log('xxxxx',this.data.seller);
},
observers: {
'date,section': function(newdate,newsection) {
console.log('room',newdate,newsection)
if(newdate && newsection){
this.setData({
seletroomlist:[]
})
}
}
},
methods:{
selectroom(e){
console.log(e)
... ...
... ... @@ -9,4 +9,4 @@
</view>
</block>
</view>
<room bindselectroom="selectroom" id="room"></room>
\ No newline at end of file
<room bindselectroom="selectroom" seller="{{seller}}" date="{{date}}" section="{{section}}" id="room"></room>
\ No newline at end of file
... ...
... ... @@ -29,7 +29,7 @@
<view class="line"></view>
<view class="right info Medium" wx:if="{{hasOnlineReserve}}">
<view class="label">包间</view>
<view class="value">{{util.getRoomName(detail.selectroom)}}</view>
<view class="value">{{util.getRoomName(detail.room_demand)}}</view>
</view>
<view class="right info Medium" wx:else="">
<view class="label">包间{{detail.tables.length>1?(" ("+detail.tables.length+"个)"):""}}</view>
... ...
import util from '../../../../utils/util';
import App from '../../../../utils/api';
Component({
properties:{
seller:Object,
date:{
type:String,
value:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'),
},
setroom:{
type:Object,
value:{}
}
},
data:{
marklist:[]
},
attached(){
this.setData({
date:util.unixtoTime(new Date()/1000,'YYYY-MM-DD')
})
this.showYearMonth=this.getshowmonth();
this.gethousefulldate(this.data.seller,this.showYearMonth);
this.getFillDate(this.data.seller,this.showYearMonth);
this.triggerEvent('tellselectdate',{date:util.unixtoTime(new Date()/1000,'YYYY-MM-DD'),action:'defalut'});
},
observers: {
'setroom'(newsetroom){
console.log('calendar-room',newsetroom)
if(newsetroom && newsetroom.id){
this.gethousefulldate(this.data.seller,this.showYearMonth);
this.getFillDate(this.data.seller,this.showYearMonth);
}
}
},
methods:{
//获取当前选中日期
getshowmonth(){
let datearr=this.data.date.split('-');
return{
showyear:Number(datearr[0]),
showmonth:Number(datearr[1]),
}
},
//切换月份
getmonth(e){
console.log('tellmonth',e)
this.showYearMonth=e.detail;
if(e.detail.action='click'){
this.gethousefulldate(this.data.seller,this.showYearMonth);
this.getFillDate(this.data.seller,this.showYearMonth);
}
},
//根据指定年份月份获取当月满房的日期
gethousefulldate(seller,showYearMonth){
let parmdata={
sid:seller.id,
type:'month',
date:showYearMonth.showyear+'-'+(showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth)
}
App.Customer.GetHouseFullDate(parmdata).then((json)=>{
console.log(json)
if(json.ret==200){
if(json.data && json.data.length>0){
let marklist=this.data.marklist;
json.data.forEach((v,i)=>{
marklist.push({
date:v,
mark:'满'
})
})
this.setData({
marklist:marklist
})
}
}
})
},
getFillDate(seller,showYearMonth){
let parmdata={
sid:seller.id,
type:'month',
date:showYearMonth.showyear+'-'+(showYearMonth.showmonth<10 ? '0'+showYearMonth.showmonth : showYearMonth.showmonth)
}
App.Customer.GetTableFillUpDate(parmdata).then((json)=>{
if(json.data && json.data.length>0){
let marklist=this.data.marklist;
json.data.forEach((v,i)=>{
marklist.push({
date:v,
mark:'置'
})
})
this.setData({
marklist:marklist
})
}
})
},
tellselectdate(e){
this.triggerEvent('tellselectdate',e.detail);
}
}
})
\ No newline at end of file
... ...
{
"component": true,
"usingComponents": {
"calendar":"/components/reserve/calendar/calendar"
}
}
\ No newline at end of file
... ...
<view class="calendar-cover">
<calendar seller="{{seller}}" date="{{date}}" marklist="{{marklist}}" bind:tellselectdate="tellselectdate" bind:tellmonth="getmonth"></calendar>
</view>
\ No newline at end of file
... ...
.calendar-cover{
width:100%;
background: #FFFBF2;
}
\ No newline at end of file
... ...
import util from '../../../../utils/util';
import App from '../../../../utils/api';
Page({
enter_params: {},
onLoad(options) {
this.enter_params = util.cache('enter_params');
App.Reserve.SellerInfo(this.enter_params).then(res => {
res.data.seller.daily=JSON.parse(res.data.seller.daily)
this.setData({
seller: res.data.seller,
})
})
},
selectdate(e){//日期改变
console.log('selectdate',e);
this.setData({
reserveDate:e.detail.date,
})
},
//时段改变
selectsection(e){
console.log(e);
let t=setTimeout(()=>{
this.setData({
reserveSection:e.detail.section,
})
clearTimeout(t);
},0)
},
setroom(e){
console.log(e)
this.setData({
reserveRoom:e.detail
})
}
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"calendar":"../../../components/book/calendar/calendar",
"section":"/components/reserve/section/section",
"select-room":"/components/reserve/room/room"
}
}
\ No newline at end of file
... ...
<nav id="nav">订座</nav>
<block wx:if="{{seller && seller.id}}">
<calendar seller="{{seller}}" date="{{reserveDate}}" bindtellselectdate="selectdate" setroom="{{reserveRoom}}"></calendar>
<view style="height:40rpx;"></view>
<section seller="{{seller}}" date="{{reserveDate}}" bind:selectsection="selectsection"></section>
<view style="height:80rpx;"></view>
<select-room seller="{{seller}}" date="{{reserveDate}}" section="{{reserveSection}}" usecondition="seller" bindchangeroom="setroom"></select-room>
</block>
\ No newline at end of file
... ...
... ... @@ -44,6 +44,14 @@
</view>
</view>
</formids>
<formids url="/pack-book/pages/book/roomtype/roomtype">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>在线预订包间置满</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/customer/index?islove=customer">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>切换到顾客模式</view>
... ...
... ... @@ -211,6 +211,8 @@ Page({
rid: this.id
}).then(res => {
let detail=this.formatDatail(res.data)
detail.room_demand=JSON.parse(detail.room_demand);
detail.ddate_solt=Number(detail.ddate_solt);
this.setData({
detail: detail,
hasOnlineReserve:res.data.type==1,
... ...
... ... @@ -80,7 +80,7 @@
</block>
<view style="height: 40rpx;"></view>
<card seller="{{detail.seller}}" detail="{{detail}}" bindevent="cardEvent"></card>
<card seller="{{detail.seller}}" detail="{{detail}}" bindevent="cardEvent" hasOnlineReserve="{{true}}"></card>
<view class="detail-info Medium" style="margin-top: 56rpx;">
<view class="flex-lr">
<view>预订人</view>
... ...
... ... @@ -32,7 +32,8 @@ Page({
pages[pages.length-2].setData({
user:this.data.concatlist[index]
})
wx.navigateBack()
pages[pages.length-2].user=this.data.concatlist[index];
wx.navigateBack();
}else{
let path='setting';
let i=0;
... ...
... ... @@ -289,10 +289,10 @@ Page({
//包间类型改变
selectroom(e){
console.log(e)
this.reserve.selectroom=JSON.stringify(e.detail.selectroom);
this.reserve.room_demand=JSON.stringify(e.detail.selectroom);
},
complete(){
if(!this.reserve.selectroom || (this.reserve.selectroom && this.reserve.selectroom.length==0)){
if(!this.reserve.room_demand || (this.reserve.room_demand && this.reserve.room_demand.length==0)){
return util.toast('请选择包间类型','none');
}
this.reserve.sid=this.options.id
... ... @@ -335,7 +335,6 @@ Page({
reserveDate:e.detail.date,
hasFullHouse:false,
fullHouseMsg:'今日所有包间已订满',
reserveSection:e.detail.section
})
}
})
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@ const _u = {
phone: '',
remark: '',
}
let dur=['morning','noon','night','midnight']
Page({
user: _u,
/**
... ... @@ -24,7 +25,7 @@ Page({
options:null,
onLoad: function (options) {
console.log(options)
options.selectroom=JSON.parse(decodeURIComponent(options.selectroom))
options.room_demand=JSON.parse(decodeURIComponent(options.room_demand))
this.options=options
this.GetSellerDetail();
App.Customer.GetCustomerInfo().then(res=>{
... ... @@ -126,15 +127,20 @@ Page({
return util.toast('请填写手机','none')
}
this.hasSubmit=false;
let roomids=[];
this.options.room_demand.forEach((v,i)=>{
roomids.push(v.id)
})
App.Customer.SetReserveInfo({
sid:this.options.sid,
pnum:this.options.pnum,
ddate:this.options.ddate,
rdate:this.getRdate(),
rname:this.user.name,
sex:this.user.sex,
phone:this.user.phone,
cusdem:this.user.remark||'',
ddate_solt:dur.indexOf(this.options.section)+1,
roomids:roomids.toString(),
}).then(res=>{
if(res.ret!=200){
this.hasSubmit=true;
... ...
... ... @@ -49,14 +49,14 @@
"list": []
},
"miniprogram": {
"current": 55,
"current": 0,
"list": [
{
"id": 0,
"name": "预订本-商家1",
"pathName": "pack-book/pages/book/b_index",
"query": "seller_id=1&seller_openid=o9pcQ0cbjRKnRWczcOJaaSRGP1lE&manager_id=500",
"scene": "1001"
"query": "seller_id=154&seller_openid=o9pcQ0cbjRKnRWczcOJaaSRGP1lE&manager_id=500",
"scene": 1001
},
{
"id": 1,
... ... @@ -487,6 +487,13 @@
"pathName": "pages/me/list",
"query": "id=1017&act=quanzi",
"scene": null
},
{
"id": 59,
"name": "pack-book/pages/roomtype/roomtype",
"pathName": "pack-book/pages/book/roomtype/roomtype",
"query": "seller_id=154",
"scene": null
}
]
}
... ...
... ... @@ -307,6 +307,16 @@ export default {
//根据openid及联系电话删除对应的数据 将其状态改为0
'App.Customer.DelCustomerInfo':{
openid:'openid'
}
},
//在线预订配置-获取商家包间分类
'App.Seller.GetSellerTableClass':null,
//置满包间分类
'App.Seller.SetTableClassFull':null,
//获取包间置满日期
'App.Customer.GetTableFillUpDate':null
}
\ No newline at end of file
... ...
... ... @@ -55,9 +55,9 @@ module.exports = {
reserveTimeSpace:function(enspace){
var names=['早餐','午餐','晚餐','夜宵'];
if(typeof enspace=='string'){
enspace={morning: 0, noon: 1, night: 2}[enspace]
enspace={morning: 1, noon: 2, night: 3}[enspace]
}
return names[enspace]||names[3]
return names[enspace-1]||names[3]
},
getRoomName:function(rooms=[]){
if(rooms.length<1) return ""
... ...