Commit e9e90e089d79e20dd5c9725d50dbff464b93421c

Authored by pengye
1 parent b3c55c16

邀请函新增修改到店时间

Showing 26 changed files with 1148 additions and 37 deletions
... ... @@ -60,6 +60,9 @@ Page({
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
timeList: [],
temp_ddate:'',//展示的到店时间
lite_style:'',//小程序转发卡片样式
},
tablestr: '',
urlsValue: [],
... ... @@ -280,7 +283,9 @@ Page({
tableNum,
tableinfo,
is_user_comments: res.data.is_user_comments,
temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
seller: {
daily: reserev.seller.daily,
name: reserev.seller.sellername,
sid: reserev.sid,
date: dateSmart,
... ... @@ -668,6 +673,16 @@ Page({
themeSixteen = '#fbf6f1'
break;
}
let solt = this.data.detail.ddate_solt;
let lunchDis = this.data.seller.daily;
let timeList = []
var morningStr = lunchDis.morning.split("-");
var morningArr = lunchDis.morning ? this.computeHour(morningStr[0], morningStr[1], 30) : [];
var noonStr = lunchDis.noon.split("-");
var noonArr = lunchDis.noon ? this.computeHour(noonStr[0], noonStr[1], 30) : [];
var nightStr = lunchDis.night.split("-");
var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
this.setData({
chef,
marketing,
... ... @@ -681,6 +696,8 @@ Page({
titleType,
themeColor,
themeSixteen,
lite_style:data.lite_style,
timeList,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -698,7 +715,12 @@ Page({
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
... ... @@ -920,7 +942,95 @@ Page({
this.audioCtx.destroy(); // 释放音频资源
}
},
// 设置虚拟到店时间
bindPickerChange: function(e) {
let index = e.detail.value
let temp_ddate = this.data.timeList[index]
this.setData({
temp_ddate
})
let detailInfo = this.data.detail;
const reserveDate = new Date(detailInfo.ddate*1000);
let reserveTime =
reserveDate.getFullYear() +
"-" +
(reserveDate.getMonth() + 1) +
"-" +
reserveDate.getDate();
let times=new Date(
reserveTime + " " + temp_ddate
).getTime() / 1000
let form = {
rid:this.id,
sid:this.data.seller.sid,
temp_ddate:times,
tid:detailInfo.tid,
rname:detailInfo.rname,
sex:detailInfo.sex,
phone:detailInfo.phone,
rdate:detailInfo.rdate+'-'+detailInfo.edate,
ddate:detailInfo.ddate,
ddate_solt:detailInfo.ddate_solt,
is_set_ddate:detailInfo.ddate_solt,
cusdem:detailInfo.cusdem,
}
App.Reserve.AndroidSetReserveInfo(form).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
}
}
})
},
//根据起始时间(获取时间时间段)
computeHour (time1, time2, interval) {
//time1 开始时间 time2结束时间 interval间隔时长
function getTimeList (time1, time2, interval) {
var timeList = [];
time1 = time1.split(":");
time2 = time2.split(":");
time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
interval = interval * 60 * 1000;
while (time1 <= time2) {
timeList.push(time1.format("hh:mm"));
time1 = new Date(time1.getTime() + interval);
}
return timeList;
}
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(format))
format = format.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in date)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(
RegExp.$1,
RegExp.$1.length == 1
? date[k]
: ("00" + date[k]).substr(("" + date[k]).length)
);
return format;
};
return getTimeList(time1, time2, interval);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
... ...
... ... @@ -29,13 +29,16 @@
<view class="label font28r">【预订贵宾】</view>
<view class="contentData font36r">{{detail.rnameStr}}</view>
</view>
<view class="flex-11" wx:if="{{seller.date}}">
<view class="label font28r">【就餐日期】</view>
<view class="contentData font36r">{{seller.date}}</view>
</view>
<view class="flex-11" wx:if="{{seller.soltName}}">
<view class="label font28r">【就餐时间】</view>
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{seller.dateTime}}</text></view>
<view class="label font28r">【就餐日期】</view>
<view class="arrivalBox">
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{temp_ddate}}</text></view>
<picker wx:if="{{detail && options && options.isOrder != '1' && (detail.status =='1' || detail.status =='2') && options.hasSellerShare == '1'}}" bindchange="bindPickerChange" value="{{index}}" range="{{timeList}}">
<view class="picker">
<button>修改到店时间</button>
</view>
</picker>
</view>
</view>
<view class="flex-11" wx:if="{{detail.actual_pum || tableNum}}">
<view class="label font28r">【就餐人数】</view>
... ...
... ... @@ -706,6 +706,27 @@
width: 100%;
}
.arrivalBox{
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
.arrivalBox button{
display: flex;
font-size: 24rpx;
flex-direction: column;
height: 50rpx;
padding: 0 18rpx;
line-height: 48rpx;
font-family: PingFang SC;
border-radius: 40rpx;
background: transparent;
color: #FFEFC5;
border: 2rpx solid #FFEFC5;
}
/* 黑蓝过渡 */
.blackBlueGradient,
.blackBlueGradient .positioningBox {
... ... @@ -990,7 +1011,8 @@
.pearlWhite .favouredPolicy,
.pearlWhite .paymenBtn,
.pearlWhite .moreBtn,
.pearlWhite .mapBtn {
.pearlWhite .mapBtn,
.pearlWhite .arrivalBox button {
color: #578C69;
border: 2rpx solid #578C69;
}
... ...
... ... @@ -60,6 +60,9 @@ Page({
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
timeList: [],
temp_ddate:'',//展示的到店时间
lite_style:'',//小程序转发卡片样式
},
tablestr: '',
urlsValue: [],
... ... @@ -280,7 +283,9 @@ Page({
tableNum,
tableinfo,
is_user_comments: res.data.is_user_comments,
temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
seller: {
daily: reserev.seller.daily,
name: reserev.seller.sellername,
sid: reserev.sid,
date: dateSmart,
... ... @@ -624,6 +629,16 @@ Page({
if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
let solt = this.data.detail.ddate_solt;
let lunchDis = this.data.seller.daily;
let timeList = []
var morningStr = lunchDis.morning.split("-");
var morningArr = lunchDis.morning ? this.computeHour(morningStr[0], morningStr[1], 30) : [];
var noonStr = lunchDis.noon.split("-");
var noonArr = lunchDis.noon ? this.computeHour(noonStr[0], noonStr[1], 30) : [];
var nightStr = lunchDis.night.split("-");
var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
this.setData({
chef,
marketing,
... ... @@ -636,6 +651,8 @@ Page({
StyleType,
titleType,
themeColor,
lite_style:data.lite_style,
timeList,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -653,7 +670,12 @@ Page({
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
... ... @@ -875,7 +897,95 @@ Page({
this.audioCtx.destroy(); // 释放音频资源
}
},
// 设置虚拟到店时间
bindPickerChange: function(e) {
let index = e.detail.value
let temp_ddate = this.data.timeList[index]
this.setData({
temp_ddate
})
let detailInfo = this.data.detail;
const reserveDate = new Date(detailInfo.ddate*1000);
let reserveTime =
reserveDate.getFullYear() +
"-" +
(reserveDate.getMonth() + 1) +
"-" +
reserveDate.getDate();
let times=new Date(
reserveTime + " " + temp_ddate
).getTime() / 1000
let form = {
rid:this.id,
sid:this.data.seller.sid,
temp_ddate:times,
tid:detailInfo.tid,
rname:detailInfo.rname,
sex:detailInfo.sex,
phone:detailInfo.phone,
rdate:detailInfo.rdate+'-'+detailInfo.edate,
ddate:detailInfo.ddate,
ddate_solt:detailInfo.ddate_solt,
is_set_ddate:detailInfo.ddate_solt,
cusdem:detailInfo.cusdem,
}
App.Reserve.AndroidSetReserveInfo(form).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
}
}
})
},
//根据起始时间(获取时间时间段)
computeHour (time1, time2, interval) {
//time1 开始时间 time2结束时间 interval间隔时长
function getTimeList (time1, time2, interval) {
var timeList = [];
time1 = time1.split(":");
time2 = time2.split(":");
time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
interval = interval * 60 * 1000;
while (time1 <= time2) {
timeList.push(time1.format("hh:mm"));
time1 = new Date(time1.getTime() + interval);
}
return timeList;
}
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(format))
format = format.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in date)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(
RegExp.$1,
RegExp.$1.length == 1
? date[k]
: ("00" + date[k]).substr(("" + date[k]).length)
);
return format;
};
return getTimeList(time1, time2, interval);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
... ...
... ... @@ -44,7 +44,14 @@
</view>
<view class="flex-11" wx:if="{{seller.soltName}}">
<view class="label font28r">【餐段】</view>
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{seller.dateTime}}</text></view>
<view class="arrivalBox">
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{temp_ddate}}</text></view>
<picker wx:if="{{detail && options && options.isOrder != '1' && (detail.status =='1' || detail.status =='2') && options.hasSellerShare == '1'}}" bindchange="bindPickerChange" value="{{index}}" range="{{timeList}}">
<view class="picker">
<button>修改到店时间</button>
</view>
</picker>
</view>
</view>
<view class="flex-11" wx:if="{{detail.actual_pum || tableNum}}">
<view class="label font28r">【人数】</view>
... ...
... ... @@ -737,6 +737,27 @@
width: 100%;
}
.arrivalBox{
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
.arrivalBox button{
display: flex;
font-size: 24rpx;
flex-direction: column;
height: 50rpx;
padding: 0 18rpx;
line-height: 48rpx;
font-family: PingFang SC;
border-radius: 40rpx;
background: transparent;
color: #FFEFC5;
border: 2rpx solid #FFEFC5;
}
/* 黑蓝过渡 */
.blackBlueGradient,
.blackBlueGradient .positioningBox {
... ... @@ -1023,7 +1044,8 @@
.pearlWhite .favouredPolicy,
.pearlWhite .paymenBtn,
.pearlWhite .mapBtn,
.pearlWhite .moreBtn {
.pearlWhite .moreBtn,
.pearlWhite .arrivalBox button {
color: #578C69;
border: 2rpx solid #578C69;
}
... ...
... ... @@ -60,6 +60,9 @@ Page({
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
timeList: [],
temp_ddate:'',//展示的到店时间
lite_style:'',//小程序转发卡片样式
},
tablestr: '',
urlsValue: [],
... ... @@ -280,7 +283,9 @@ Page({
tableNum,
tableinfo,
is_user_comments: res.data.is_user_comments,
temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
seller: {
daily: reserev.seller.daily,
name: reserev.seller.sellername,
sid: reserev.sid,
date: dateSmart,
... ... @@ -624,6 +629,16 @@ Page({
if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
let solt = this.data.detail.ddate_solt;
let lunchDis = this.data.seller.daily;
let timeList = []
var morningStr = lunchDis.morning.split("-");
var morningArr = lunchDis.morning ? this.computeHour(morningStr[0], morningStr[1], 30) : [];
var noonStr = lunchDis.noon.split("-");
var noonArr = lunchDis.noon ? this.computeHour(noonStr[0], noonStr[1], 30) : [];
var nightStr = lunchDis.night.split("-");
var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
this.setData({
chef,
marketing,
... ... @@ -636,6 +651,8 @@ Page({
StyleType,
titleType,
themeColor,
lite_style:data.lite_style,
timeList,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -653,7 +670,12 @@ Page({
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
... ... @@ -875,7 +897,95 @@ Page({
this.audioCtx.destroy(); // 释放音频资源
}
},
// 设置虚拟到店时间
bindPickerChange: function(e) {
let index = e.detail.value
let temp_ddate = this.data.timeList[index]
this.setData({
temp_ddate
})
let detailInfo = this.data.detail;
const reserveDate = new Date(detailInfo.ddate*1000);
let reserveTime =
reserveDate.getFullYear() +
"-" +
(reserveDate.getMonth() + 1) +
"-" +
reserveDate.getDate();
let times=new Date(
reserveTime + " " + temp_ddate
).getTime() / 1000
let form = {
rid:this.id,
sid:this.data.seller.sid,
temp_ddate:times,
tid:detailInfo.tid,
rname:detailInfo.rname,
sex:detailInfo.sex,
phone:detailInfo.phone,
rdate:detailInfo.rdate+'-'+detailInfo.edate,
ddate:detailInfo.ddate,
ddate_solt:detailInfo.ddate_solt,
is_set_ddate:detailInfo.ddate_solt,
cusdem:detailInfo.cusdem,
}
App.Reserve.AndroidSetReserveInfo(form).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
}
}
})
},
//根据起始时间(获取时间时间段)
computeHour (time1, time2, interval) {
//time1 开始时间 time2结束时间 interval间隔时长
function getTimeList (time1, time2, interval) {
var timeList = [];
time1 = time1.split(":");
time2 = time2.split(":");
time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
interval = interval * 60 * 1000;
while (time1 <= time2) {
timeList.push(time1.format("hh:mm"));
time1 = new Date(time1.getTime() + interval);
}
return timeList;
}
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(format))
format = format.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in date)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(
RegExp.$1,
RegExp.$1.length == 1
? date[k]
: ("00" + date[k]).substr(("" + date[k]).length)
);
return format;
};
return getTimeList(time1, time2, interval);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
... ...
... ... @@ -27,7 +27,14 @@
wx:if="{{detail && detail.rnameStr && reserve && reserve.swich_customer == '1'}}"
>{{detail.rnameStr}}</view>
<view class="leftInfo font36r">{{seller.date}}</view>
<view class="leftInfo font36r"> {{seller.soltName}}<text class="marLeft font36r">{{seller.dateTime}}</text></view>
<view class="arrivalBox">
<picker wx:if="{{detail && options && options.isOrder != '1' && (detail.status =='1' || detail.status =='2') && options.hasSellerShare == '1'}}" bindchange="bindPickerChange" value="{{index}}" range="{{timeList}}">
<view class="picker">
<button>修改到店时间</button>
</view>
</picker>
<view class="leftInfo font36r">{{seller.soltName}}<text class="marLeft font36r">{{temp_ddate}}</text></view>
</view>
<view class="leftInfo font36r over">{{seller.tablesText}}</view>
<view class="leftInfo font36r tables" wx:if="{{swich_phone!='0' && seller && seller.tel && seller.tel.length>0}}">预订台<block wx:for="{{seller.tel}}" wx:key="index"><text data-phone="{{item}}" bindtap="call">{{item}}</text>{{index==(seller.tel.length-1)?'':','}}</block></view>
</view>
... ...
... ... @@ -727,6 +727,28 @@
width: 100%;
}
.arrivalBox{
display: flex;
width: 100%;
justify-content: flex-end;
align-items: center;
}
.arrivalBox button{
display: flex;
font-size: 24rpx;
flex-direction: column;
height: 50rpx;
padding: 0 18rpx;
line-height: 48rpx;
font-family: PingFang SC;
border-radius: 40rpx;
background: transparent;
color: #FFEFC5;
border: 2rpx solid #FFEFC5;
margin-right: 20rpx;
}
/* 黑蓝过渡 */
.blackBlueGradient,
.blackBlueGradient .positioningBox {
... ... @@ -1067,7 +1089,8 @@
.pearlWhite .favouredPolicy,
.pearlWhite .paymenBtn,
.pearlWhite .mapBtn,
.pearlWhite .moreBtn {
.pearlWhite .moreBtn,
.pearlWhite .arrivalBox button {
color: #578C69;
border: 2rpx solid #578C69;
}
... ...
... ... @@ -59,6 +59,9 @@ Page({
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
timeList: [],
temp_ddate:'',//展示的到店时间
lite_style:'',//小程序转发卡片样式
},
tablestr: '',
urlsValue: [],
... ... @@ -279,7 +282,9 @@ Page({
tableNum,
tableinfo,
is_user_comments: res.data.is_user_comments,
temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
seller: {
daily: reserev.seller.daily,
name: reserev.seller.sellername,
sid: reserev.sid,
date: dateSmart,
... ... @@ -623,6 +628,16 @@ Page({
if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
let solt = this.data.detail.ddate_solt;
let lunchDis = this.data.seller.daily;
let timeList = []
var morningStr = lunchDis.morning.split("-");
var morningArr = lunchDis.morning ? this.computeHour(morningStr[0], morningStr[1], 30) : [];
var noonStr = lunchDis.noon.split("-");
var noonArr = lunchDis.noon ? this.computeHour(noonStr[0], noonStr[1], 30) : [];
var nightStr = lunchDis.night.split("-");
var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
this.setData({
chef,
marketing,
... ... @@ -635,6 +650,8 @@ Page({
StyleType,
titleType,
themeColor,
lite_style:data.lite_style,
timeList,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -652,7 +669,12 @@ Page({
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
... ... @@ -874,7 +896,95 @@ Page({
this.audioCtx.destroy(); // 释放音频资源
}
},
// 设置虚拟到店时间
bindPickerChange: function(e) {
let index = e.detail.value
let temp_ddate = this.data.timeList[index]
this.setData({
temp_ddate
})
let detailInfo = this.data.detail;
const reserveDate = new Date(detailInfo.ddate*1000);
let reserveTime =
reserveDate.getFullYear() +
"-" +
(reserveDate.getMonth() + 1) +
"-" +
reserveDate.getDate();
let times=new Date(
reserveTime + " " + temp_ddate
).getTime() / 1000
let form = {
rid:this.id,
sid:this.data.seller.sid,
temp_ddate:times,
tid:detailInfo.tid,
rname:detailInfo.rname,
sex:detailInfo.sex,
phone:detailInfo.phone,
rdate:detailInfo.rdate+'-'+detailInfo.edate,
ddate:detailInfo.ddate,
ddate_solt:detailInfo.ddate_solt,
is_set_ddate:detailInfo.ddate_solt,
cusdem:detailInfo.cusdem,
}
App.Reserve.AndroidSetReserveInfo(form).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
}
}
})
},
//根据起始时间(获取时间时间段)
computeHour (time1, time2, interval) {
//time1 开始时间 time2结束时间 interval间隔时长
function getTimeList (time1, time2, interval) {
var timeList = [];
time1 = time1.split(":");
time2 = time2.split(":");
time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
interval = interval * 60 * 1000;
while (time1 <= time2) {
timeList.push(time1.format("hh:mm"));
time1 = new Date(time1.getTime() + interval);
}
return timeList;
}
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(format))
format = format.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in date)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(
RegExp.$1,
RegExp.$1.length == 1
? date[k]
: ("00" + date[k]).substr(("" + date[k]).length)
);
return format;
};
return getTimeList(time1, time2, interval);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
... ...
... ... @@ -28,7 +28,14 @@
wx:if="{{detail && detail.rnameStr && reserve && reserve.swich_customer == '1'}}"
>{{detail.rnameStr}}</view>
<view class="leftInfo font36r">{{seller.date}}</view>
<view class="leftInfo font36r">{{seller.soltName}}<text class="marLeft font36r">{{seller.dateTime}}</text></view>
<view class="arrivalBox">
<view class="leftInfo font36r">{{seller.soltName}}<text class="marLeft font36r">{{temp_ddate}}</text></view>
<picker wx:if="{{detail && options && options.isOrder != '1' && (detail.status =='1' || detail.status =='2') && options.hasSellerShare == '1'}}" bindchange="bindPickerChange" value="{{index}}" range="{{timeList}}">
<view class="picker">
<button>修改到店时间</button>
</view>
</picker>
</view>
<view class="leftInfo font36r over">{{seller.tablesText}}</view>
<view class="leftInfo font36r tables" wx:if="{{swich_phone!='0' && seller && seller.tel && seller.tel.length>0}}">预订台 <block wx:for="{{seller.tel}}" wx:key="index"><text data-phone="{{item}}" bindtap="call">{{item}}</text>{{index==(seller.tel.length-1)?'':','}}</block></view>
</view>
... ...
... ... @@ -726,6 +726,26 @@
width: 100%;
}
.arrivalBox{
display: flex;
justify-content: space-between;
align-items: center;
}
.arrivalBox button{
display: flex;
font-size: 24rpx;
flex-direction: column;
height: 50rpx;
padding: 0 18rpx;
line-height: 48rpx;
font-family: PingFang SC;
border-radius: 40rpx;
background: transparent;
color: #FFEFC5;
border: 2rpx solid #FFEFC5;
}
/* 黑蓝过渡 */
.blackBlueGradient,
.blackBlueGradient .positioningBox {
... ... @@ -1066,7 +1086,8 @@
.pearlWhite .favouredPolicy,
.pearlWhite .paymenBtn,
.pearlWhite .mapBtn,
.pearlWhite .moreBtn {
.pearlWhite .moreBtn,
.pearlWhite .arrivalBox button {
color: #578C69;
border: 2rpx solid #578C69;
}
... ...
... ... @@ -61,6 +61,9 @@ Page({
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
timeList: [],
temp_ddate:'',//展示的到店时间
lite_style:'',//小程序转发卡片样式
},
screenHeight: '',
attentionAnim: {},
... ... @@ -235,7 +238,9 @@ Page({
detail: this.formatDatail(reserev, dateSmart),
tableNum,
is_user_comments: res.data.is_user_comments,
seller: {
temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
seller: {
daily: reserev.seller.daily,
name: reserev.seller.sellername,
sid: reserev.sid,
date: dateSmart,
... ... @@ -578,6 +583,16 @@ Page({
} else {
whiteBj = false
}
let solt = this.data.detail.ddate_solt;
let lunchDis = this.data.seller.daily;
let timeList = []
var morningStr = lunchDis.morning.split("-");
var morningArr = lunchDis.morning ? this.computeHour(morningStr[0], morningStr[1], 30) : [];
var noonStr = lunchDis.noon.split("-");
var noonArr = lunchDis.noon ? this.computeHour(noonStr[0], noonStr[1], 30) : [];
var nightStr = lunchDis.night.split("-");
var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
this.setData({
chef,
marketing,
... ... @@ -591,6 +606,8 @@ Page({
titleType,
themeColor,
whiteBj,
lite_style:data.lite_style,
timeList,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -608,7 +625,12 @@ Page({
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
... ... @@ -830,7 +852,95 @@ Page({
this.audioCtx.destroy(); // 释放音频资源
}
},
// 设置虚拟到店时间
bindPickerChange: function(e) {
let index = e.detail.value
let temp_ddate = this.data.timeList[index]
this.setData({
temp_ddate
})
let detailInfo = this.data.detail;
const reserveDate = new Date(detailInfo.ddate*1000);
let reserveTime =
reserveDate.getFullYear() +
"-" +
(reserveDate.getMonth() + 1) +
"-" +
reserveDate.getDate();
let times=new Date(
reserveTime + " " + temp_ddate
).getTime() / 1000
let form = {
rid:this.id,
sid:this.data.seller.sid,
temp_ddate:times,
tid:detailInfo.tid,
rname:detailInfo.rname,
sex:detailInfo.sex,
phone:detailInfo.phone,
rdate:detailInfo.rdate+'-'+detailInfo.edate,
ddate:detailInfo.ddate,
ddate_solt:detailInfo.ddate_solt,
is_set_ddate:detailInfo.ddate_solt,
cusdem:detailInfo.cusdem,
}
App.Reserve.AndroidSetReserveInfo(form).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
}
}
})
},
//根据起始时间(获取时间时间段)
computeHour (time1, time2, interval) {
//time1 开始时间 time2结束时间 interval间隔时长
function getTimeList (time1, time2, interval) {
var timeList = [];
time1 = time1.split(":");
time2 = time2.split(":");
time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
interval = interval * 60 * 1000;
while (time1 <= time2) {
timeList.push(time1.format("hh:mm"));
time1 = new Date(time1.getTime() + interval);
}
return timeList;
}
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(format))
format = format.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in date)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(
RegExp.$1,
RegExp.$1.length == 1
? date[k]
: ("00" + date[k]).substr(("" + date[k]).length)
);
return format;
};
return getTimeList(time1, time2, interval);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
... ...
... ... @@ -40,7 +40,14 @@
</view>
<view class="flex-11" wx:if="{{seller.soltName}}">
<view class="label font36r">【餐段】</view>
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{seller.dateTime}}</text></view>
<view class="arrivalBox">
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{temp_ddate}}</text></view>
<picker wx:if="{{detail && options && options.isOrder != '1' && (detail.status =='1' || detail.status =='2') && options.hasSellerShare == '1'}}" bindchange="bindPickerChange" value="{{index}}" range="{{timeList}}">
<view class="picker">
<button>修改到店时间</button>
</view>
</picker>
</view>
</view>
<view class="flex-11" wx:if="{{seller.tablesText}}">
<view class="label font36r">【包间】</view>
... ...
... ... @@ -782,6 +782,27 @@
box-sizing: border-box;
}
.arrivalBox{
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
.arrivalBox button{
display: flex;
font-size: 24rpx;
flex-direction: column;
height: 50rpx;
padding: 0 18rpx;
line-height: 48rpx;
font-family: PingFang SC;
border-radius: 40rpx;
background: transparent;
color: #000;
border: 2rpx solid #000;
}
/* 黑蓝过渡 */
.blackBlueGradient .titleImg {
background: linear-gradient(104.24deg, #42a5ff -57.47%, #000000 55.72%, #42a5ff 182.69%);
... ...
... ... @@ -60,6 +60,9 @@ Page({
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
timeList: [],
temp_ddate:'',//展示的到店时间
lite_style:'',//小程序转发卡片样式
},
tablestr: '',
urlsValue: [],
... ... @@ -280,7 +283,9 @@ Page({
tableNum,
tableinfo,
is_user_comments: res.data.is_user_comments,
temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
seller: {
daily: reserev.seller.daily,
name: reserev.seller.sellername,
sid: reserev.sid,
date: dateSmart,
... ... @@ -624,6 +629,16 @@ Page({
if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
let solt = this.data.detail.ddate_solt;
let lunchDis = this.data.seller.daily;
let timeList = []
var morningStr = lunchDis.morning.split("-");
var morningArr = lunchDis.morning ? this.computeHour(morningStr[0], morningStr[1], 30) : [];
var noonStr = lunchDis.noon.split("-");
var noonArr = lunchDis.noon ? this.computeHour(noonStr[0], noonStr[1], 30) : [];
var nightStr = lunchDis.night.split("-");
var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
this.setData({
chef,
marketing,
... ... @@ -636,6 +651,8 @@ Page({
StyleType,
titleType,
themeColor,
lite_style:data.lite_style,
timeList,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -653,7 +670,12 @@ Page({
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
... ... @@ -875,7 +897,95 @@ Page({
this.audioCtx.destroy(); // 释放音频资源
}
},
// 设置虚拟到店时间
bindPickerChange: function(e) {
let index = e.detail.value
let temp_ddate = this.data.timeList[index]
this.setData({
temp_ddate
})
let detailInfo = this.data.detail;
const reserveDate = new Date(detailInfo.ddate*1000);
let reserveTime =
reserveDate.getFullYear() +
"-" +
(reserveDate.getMonth() + 1) +
"-" +
reserveDate.getDate();
let times=new Date(
reserveTime + " " + temp_ddate
).getTime() / 1000
let form = {
rid:this.id,
sid:this.data.seller.sid,
temp_ddate:times,
tid:detailInfo.tid,
rname:detailInfo.rname,
sex:detailInfo.sex,
phone:detailInfo.phone,
rdate:detailInfo.rdate+'-'+detailInfo.edate,
ddate:detailInfo.ddate,
ddate_solt:detailInfo.ddate_solt,
is_set_ddate:detailInfo.ddate_solt,
cusdem:detailInfo.cusdem,
}
App.Reserve.AndroidSetReserveInfo(form).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
}
}
})
},
//根据起始时间(获取时间时间段)
computeHour (time1, time2, interval) {
//time1 开始时间 time2结束时间 interval间隔时长
function getTimeList (time1, time2, interval) {
var timeList = [];
time1 = time1.split(":");
time2 = time2.split(":");
time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
interval = interval * 60 * 1000;
while (time1 <= time2) {
timeList.push(time1.format("hh:mm"));
time1 = new Date(time1.getTime() + interval);
}
return timeList;
}
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(format))
format = format.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in date)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(
RegExp.$1,
RegExp.$1.length == 1
? date[k]
: ("00" + date[k]).substr(("" + date[k]).length)
);
return format;
};
return getTimeList(time1, time2, interval);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
... ...
... ... @@ -34,7 +34,14 @@
</view>
<view class="flex-11" wx:if="{{seller.soltName}}">
<view class="label font28r">【餐段】</view>
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{seller.dateTime}}</text></view>
<view class="arrivalBox">
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{temp_ddate}}</text></view>
<picker wx:if="{{detail && options && options.isOrder != '1' && (detail.status =='1' || detail.status =='2') && options.hasSellerShare == '1'}}" bindchange="bindPickerChange" value="{{index}}" range="{{timeList}}">
<view class="picker">
<button>修改到店时间</button>
</view>
</picker>
</view>
</view>
<view class="flex-11" wx:if="{{detail.actual_pum || tableNum}}">
<view class="label font28r">【人数】</view>
... ...
... ... @@ -719,6 +719,27 @@
width: 100%;
}
.arrivalBox{
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
.arrivalBox button{
display: flex;
font-size: 24rpx;
flex-direction: column;
height: 50rpx;
padding: 0 18rpx;
line-height: 48rpx;
font-family: PingFang SC;
border-radius: 40rpx;
background: transparent;
color: #FFEFC5;
border: 2rpx solid #FFEFC5;
}
/* 黑蓝过渡 */
.blackBlueGradient,
.blackBlueGradient .positioningBox {
... ... @@ -1060,7 +1081,8 @@
.pearlWhite .favouredPolicy,
.pearlWhite .paymenBtn,
.pearlWhite .mapBtn,
.pearlWhite .moreBtn {
.pearlWhite .moreBtn,
.pearlWhite .arrivalBox button {
color: #578C69;
border: 2rpx solid #578C69;
}
... ...
... ... @@ -60,6 +60,9 @@ Page({
wxml: null,
imgSrc:'',//canvas图片地址
couponData: '', //评价赠送优惠券数据
timeList: [],
temp_ddate:'',//展示的到店时间
lite_style:'',//小程序转发卡片样式
},
tablestr: '',
urlsValue: [],
... ... @@ -280,7 +283,9 @@ Page({
tableNum,
tableinfo,
is_user_comments: res.data.is_user_comments,
temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
seller: {
daily: reserev.seller.daily,
name: reserev.seller.sellername,
sid: reserev.sid,
date: dateSmart,
... ... @@ -623,6 +628,16 @@ Page({
if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
let solt = this.data.detail.ddate_solt;
let lunchDis = this.data.seller.daily;
let timeList = []
var morningStr = lunchDis.morning.split("-");
var morningArr = lunchDis.morning ? this.computeHour(morningStr[0], morningStr[1], 30) : [];
var noonStr = lunchDis.noon.split("-");
var noonArr = lunchDis.noon ? this.computeHour(noonStr[0], noonStr[1], 30) : [];
var nightStr = lunchDis.night.split("-");
var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
this.setData({
chef,
marketing,
... ... @@ -635,6 +650,8 @@ Page({
StyleType,
titleType,
themeColor,
lite_style:data.lite_style,
timeList,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -652,7 +669,12 @@ Page({
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
... ... @@ -874,7 +896,95 @@ Page({
this.audioCtx.destroy(); // 释放音频资源
}
},
// 设置虚拟到店时间
bindPickerChange: function(e) {
let index = e.detail.value
let temp_ddate = this.data.timeList[index]
this.setData({
temp_ddate
})
let detailInfo = this.data.detail;
const reserveDate = new Date(detailInfo.ddate*1000);
let reserveTime =
reserveDate.getFullYear() +
"-" +
(reserveDate.getMonth() + 1) +
"-" +
reserveDate.getDate();
let times=new Date(
reserveTime + " " + temp_ddate
).getTime() / 1000
let form = {
rid:this.id,
sid:this.data.seller.sid,
temp_ddate:times,
tid:detailInfo.tid,
rname:detailInfo.rname,
sex:detailInfo.sex,
phone:detailInfo.phone,
rdate:detailInfo.rdate+'-'+detailInfo.edate,
ddate:detailInfo.ddate,
ddate_solt:detailInfo.ddate_solt,
is_set_ddate:detailInfo.ddate_solt,
cusdem:detailInfo.cusdem,
}
App.Reserve.AndroidSetReserveInfo(form).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
}
}
})
},
//根据起始时间(获取时间时间段)
computeHour (time1, time2, interval) {
//time1 开始时间 time2结束时间 interval间隔时长
function getTimeList (time1, time2, interval) {
var timeList = [];
time1 = time1.split(":");
time2 = time2.split(":");
time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
interval = interval * 60 * 1000;
while (time1 <= time2) {
timeList.push(time1.format("hh:mm"));
time1 = new Date(time1.getTime() + interval);
}
return timeList;
}
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(format))
format = format.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in date)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(
RegExp.$1,
RegExp.$1.length == 1
? date[k]
: ("00" + date[k]).substr(("" + date[k]).length)
);
return format;
};
return getTimeList(time1, time2, interval);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
... ...
... ... @@ -31,8 +31,15 @@
</view>
<view class="infoItem" wx:if="{{seller.soltName}}">
<view class="label font28r">【宴会时间】</view>
<view class="contentData font40r">{{seller.soltName}}<text class="marLeft font36r">{{seller.dateTime}}</text></view>
</view>
<view class="arrivalBox">
<view class="contentData font40r">{{seller.soltName}}<text class="marLeft font36r">{{temp_ddate}}</text></view>
<picker wx:if="{{detail && options && options.isOrder != '1' && (detail.status =='1' || detail.status =='2') && options.hasSellerShare == '1'}}" bindchange="bindPickerChange" value="{{index}}" range="{{timeList}}">
<view class="picker">
<button>修改到店时间</button>
</view>
</picker>
</view>
</view>
<view class="infoItem" wx:if="{{detail && detail.rnameStr && reserve && reserve.swich_customer == '1'}}">
<view class="label font28r">【预订贵宾】</view>
<view class="contentData font40r">{{detail.rnameStr}}</view>
... ...
... ... @@ -728,6 +728,25 @@
width: 100%;
}
.arrivalBox{
display: flex;
align-items: center;
}
.arrivalBox button{
display: flex;
font-size: 24rpx;
flex-direction: column;
height: 50rpx;
padding: 0 18rpx;
line-height: 48rpx;
font-family: PingFang SC;
border-radius: 40rpx;
background: transparent;
color: #FFEFC5;
border: 2rpx solid #FFEFC5;
}
/* 黑蓝过渡 */
.blackBlueGradient,
.blackBlueGradient .positioningBox {
... ... @@ -1079,7 +1098,8 @@
.pearlWhite .favouredPolicy,
.pearlWhite .paymenBtn,
.pearlWhite .mapBtn,
.pearlWhite .moreBtn {
.pearlWhite .moreBtn,
.pearlWhite .arrivalBox button {
color: #578C69;
border: 2rpx solid #578C69;
}
... ...
... ... @@ -68,6 +68,9 @@ Page({
imgSrc: '', //canvas图片地址
colors:'',//导航栏颜色
couponData: '', //评价赠送优惠券数据
timeList: [],
temp_ddate:'',//展示的到店时间
lite_style:'',//小程序转发卡片样式
},
tablestr: '',
urlsValue: [],
... ... @@ -297,7 +300,9 @@ Page({
tableNum,
tableinfo,
is_user_comments: res.data.is_user_comments,
temp_ddate:this.data.temp_ddate?this.data.temp_ddate:reserev.temp_ddate?util.unixtoTime(reserev.temp_ddate, 'HH:II'):util.unixtoTime(reserev.ddate, 'HH:II'),
seller: {
daily: reserev.seller.daily,
name: reserev.seller.sellername,
sid: reserev.sid,
date: dateSmart,
... ... @@ -657,6 +662,16 @@ Page({
if (store && store.images && store.images.length > 0) store.images = util.determine(store.images);
if (reserve && reserve.park_info_images && reserve.park_info_images.length > 0) reserve.park_info_images = util.determine(reserve.park_info_images);
if (signboard && signboard.images && signboard.images.length > 0) signboard.images = util.determine(signboard.images);
let solt = this.data.detail.ddate_solt;
let lunchDis = this.data.seller.daily;
let timeList = []
var morningStr = lunchDis.morning.split("-");
var morningArr = lunchDis.morning ? this.computeHour(morningStr[0], morningStr[1], 30) : [];
var noonStr = lunchDis.noon.split("-");
var noonArr = lunchDis.noon ? this.computeHour(noonStr[0], noonStr[1], 30) : [];
var nightStr = lunchDis.night.split("-");
var nightArr = lunchDis.night ? this.computeHour(nightStr[0], nightStr[1], 30) : [];
timeList = solt == '1' ? morningArr : solt == '2' ? noonArr : solt == '3' ? nightArr : []
this.setData({
chef,
marketing,
... ... @@ -672,6 +687,8 @@ Page({
settingUrl,
inviteImgUrl,
colors,
lite_style:data.lite_style,
timeList,
})
// 开启语音播报
if (reserve && reserve.swich_voice == '1') {
... ... @@ -689,7 +706,12 @@ Page({
} else {
let d = detailInfo.ddate_solt;
let time1 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早上' : d == '2' ? '中午' : d == '3' ? '晚上' : '');
let time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
let time2;
if(this.data.temp_ddate){
time2 = util.unixtoTime(detailInfo.ddate, '周WW') + this.data.temp_ddate
}else{
time2 = util.unixtoTime(detailInfo.ddate, '周WW HH:II')
}
let time3 = util.unixtoTime(detailInfo.ddate, '周WW') + ' ' + (d == '1' ? '早餐' : d == '2' ? '午餐' : d == '3' ? '晚餐' : '');
let time = data.lite_style == '1' ? time1 : data.lite_style == '2' ? time2 : data.lite_style == '3' ? time3 : '';
this.painterBtn(
... ... @@ -911,6 +933,95 @@ Page({
this.audioCtx.destroy(); // 释放音频资源
}
},
// 设置虚拟到店时间
bindPickerChange: function(e) {
let index = e.detail.value
let temp_ddate = this.data.timeList[index]
this.setData({
temp_ddate
})
let detailInfo = this.data.detail;
const reserveDate = new Date(detailInfo.ddate*1000);
let reserveTime =
reserveDate.getFullYear() +
"-" +
(reserveDate.getMonth() + 1) +
"-" +
reserveDate.getDate();
let times=new Date(
reserveTime + " " + temp_ddate
).getTime() / 1000
let form = {
rid:this.id,
sid:this.data.seller.sid,
temp_ddate:times,
tid:detailInfo.tid,
rname:detailInfo.rname,
sex:detailInfo.sex,
phone:detailInfo.phone,
rdate:detailInfo.rdate+'-'+detailInfo.edate,
ddate:detailInfo.ddate,
ddate_solt:detailInfo.ddate_solt,
is_set_ddate:detailInfo.ddate_solt,
cusdem:detailInfo.cusdem,
}
App.Reserve.AndroidSetReserveInfo(form).then(res => {
if (res.ret == 200) {
if (this.data.lite_style == '2') {
let time = (util.unixtoTime(detailInfo.ddate, '周WW') + temp_ddate) || (util.unixtoTime(detailInfo.ddate, '周WW') + this.data.timeList[index])
this.painterBtn(
detailInfo.seller.seller_image,
detailInfo.seller.sellername,
util.unixtoTime(detailInfo.ddate, 'MM月DD日'),
time
);
}
}
})
},
//根据起始时间(获取时间时间段)
computeHour (time1, time2, interval) {
//time1 开始时间 time2结束时间 interval间隔时长
function getTimeList (time1, time2, interval) {
var timeList = [];
time1 = time1.split(":");
time2 = time2.split(":");
time1 = new Date(0, 0, 0, time1[0], time1[1], 0);
time2 = new Date(0, 0, 0, time2[0], time2[1], 0);
interval = interval * 60 * 1000;
while (time1 <= time2) {
timeList.push(time1.format("hh:mm"));
time1 = new Date(time1.getTime() + interval);
}
return timeList;
}
Date.prototype.format = function (format) {
var date = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
S: this.getMilliseconds(),
};
if (/(y+)/.test(format))
format = format.replace(
RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (var k in date)
if (new RegExp("(" + k + ")").test(format))
format = format.replace(
RegExp.$1,
RegExp.$1.length == 1
? date[k]
: ("00" + date[k]).substr(("" + date[k]).length)
);
return format;
};
return getTimeList(time1, time2, interval);
},
/**
* 页面相关事件处理函数--监听用户下拉动作
... ...
... ... @@ -33,7 +33,14 @@
</view>
<view class="infoItem" wx:if="{{seller.soltName}}">
<view class="label font28r">用餐时间:</view>
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{seller.dateTime}}</text></view>
<view class="arrivalBox">
<view class="contentData font36r">{{seller.soltName}}<text class="marLeft font36r">{{temp_ddate}}</text></view>
<picker wx:if="{{detail && options && options.isOrder != '1' && (detail.status =='1' || detail.status =='2') && options.hasSellerShare == '1'}}" bindchange="bindPickerChange" value="{{index}}" range="{{timeList}}">
<view class="picker">
<button>修改到店时间</button>
</view>
</picker>
</view>
</view>
<view class="infoItem" wx:if="{{seller.tablesText}}">
<view class="label font28r">用餐位置:</view>
... ...
... ... @@ -488,6 +488,27 @@
width: 100%;
}
.arrivalBox{
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
.arrivalBox button{
display: flex;
font-size: 24rpx;
flex-direction: column;
height: 50rpx;
padding: 0 18rpx;
line-height: 48rpx;
font-family: PingFang SC;
border-radius: 40rpx;
background: transparent;
color: #FFEFC5;
border: 2rpx solid #FFEFC5;
}
.shareItem,
.moreBtn,
.paymenBtn {
... ...
... ... @@ -130,7 +130,8 @@ Page({
} else {
url = '/pack-invitation/pages/detail_owner_invitation9';
}
url += '?id=' + this.data.options.id + '&tplid=' + this.data.options.tplid + '&onlineReserve=' + is_online_reserve;
// is_online_reserve 在线预订开关 hasSellerShare 商家app分享 hasInvitation 受邀人
url += '?id=' + this.data.options.id + '&tplid=' + this.data.options.tplid + '&onlineReserve=' + is_online_reserve + '&hasInvitation=' + this.data.options.hasInvitation + '&hasSellerShare=' + this.data.options.hasSellerShare;
// (过了当前餐段结束时间 || 预订是用餐完成状态) 邀请函显示已结束
url += (isOrder == '1' || status == '3') ? '&isOrder=1' : '';
url+= this.data.options.paymentId?'&paymentId='+this.data.options.paymentId:'&paymentId=' ;
... ...
... ... @@ -756,4 +756,9 @@ export default {
openid:'openid'
},
//录入预订
'App.Reserve.AndroidSetReserveInfo':{
alias:'Android.Reserve.SetReserveInfo',
msgSecCheck:true,
},
}
\ No newline at end of file
... ...