Commit 4870598bc23cba971b6a2fa14fdbbe389eef0edd

Authored by wangfan
1 parent d6cb58c4

fenbao

Showing 81 changed files with 7307 additions and 17 deletions
{
"pages": [
"pages/customer/index",
"pages/book/b_index",
"pages/book/b_detail",
"pages/book/b_invitation",
"pages/book/b_desk",
"pages/customer/detail_owner",
"pages/customer/detail_owner_part",
"pages/customer/detail_customer",
... ... @@ -17,19 +13,6 @@
"pages/me/index",
"pages/me/setting",
"pages/me/list",
"pages/book/b_addnew",
"pages/book/b_sms",
"pages/book/b_setting",
"pages/book/setting/index",
"pages/book/setting/sms",
"pages/book/setting/sms_buy",
"pages/book/crm/index",
"pages/book/remark/index",
"pages/book/smsbatch/index",
"pages/book/smsbatch/update",
"pages/book/smsbatch/detail",
"pages/book/smsbatch/list",
"pages/book/smsbatch/result",
"pages/reserve/search",
"pages/reserve/detail",
"pages/me/follow",
... ... @@ -54,6 +37,29 @@
"pages/success",
"pages/remark"
]
},
{
"root": "pack-book",
"name": "商家端",
"pages": [
"pages/book/b_index",
"pages/book/b_detail",
"pages/book/b_invitation",
"pages/book/b_desk",
"pages/book/b_addnew",
"pages/book/b_sms",
"pages/book/b_setting",
"pages/book/setting/index",
"pages/book/setting/sms",
"pages/book/setting/sms_buy",
"pages/book/crm/index",
"pages/book/remark/index",
"pages/book/smsbatch/index",
"pages/book/smsbatch/update",
"pages/book/smsbatch/detail",
"pages/book/smsbatch/list",
"pages/book/smsbatch/result"
]
}
],
"preloadRule": {
... ...
/**app.wxss**/
@import "icon.wxss";
.hidden {
display: none;
}
page {
font-size: 16px;
line-height: 150%;
font-family: 'PingFang SC','sans-serif','Helvetica Neue','Helvetica','Arial';
height: 100%;
}
.section{ margin-left:4%;margin-right:4%; width:92%;}
.sectionA{ margin-left:8%;margin-right:8%; width:84%; overflow: hidden; }
.sectionW{margin-left:2%;margin-right:2%;width:96%;overflow: hidden;}
.section_p{ padding-left:4%;padding-right:4%; width:92%; overflow: hidden; }
.white{
color: #fff;
}
.green{
color: #22ab39;
}
.black{
color: #000;
}
.gray{
color:#666;
}
.liggray{
color:#9E9A9A;
}
.bg{
background-color:#efeef3;
}
.bg_green{
background-color: #1AAD19;
}
.bg_liggreen{
background-color: #ECF8EE;
}
.bg_red{
background-color: #E14553;
}
.bg_gray{
background-color: #f3f3f3;
}
.bg_white{
background-color: white;
}
.bg_blue{
background-color: #EEF2FB;
}
.bg_pink{
background-color: #FEEFF0;
}
.bg_ligblack{
background-color: #4C4E4F;
}
.mtop10{
margin-top: 10px;
}
.mtop12{
margin-top: 12px;
}
.mtop15{
margin-top: 15px;
}
.mtop20{
margin-top: 20px;
}
.mtop25{
margin-top: 25px;
}
.mtop30{
margin-top: 30px;
}
.mbottom5{
margin-bottom:5px;
}
.mbottom10{
margin-bottom: 10px;
}
.mbottom15{
margin-bottom: 15px;
}
.mbottom20{
margin-bottom: 20px;
}
.mbottom30{
margin-bottom: 30px;
}
.ptop5{
padding-top:5px;
}
.pbottom5{
padding-bottom:5px;
}
.ptop8{
padding-top:8px;
}
.pbottom8{
padding-bottom:8px;
}
.ptop10{
padding-top:10px;
}
.pbottom10{
padding-bottom:10px;
}
.ptop12{
padding-top:12px;
}
.pbottom12{
padding-bottom:12px;
}
.ptop13{
padding-top:13px;
}
.pbottom13{
padding-bottom:13px;
}
.ptop15{
padding-top:15px;
}
.pbottom15{
padding-bottom:15px;
}
.ptop18{
padding-top:18px;
}
.pbottom18{
padding-bottom:18px;
}
.ptop20{
padding-top:20px;
}
.pbottom20{
padding-bottom:20px;
}
.mleft{
margin-left:4%;
}
.mleft6{
margin-left:6px;
}
.mleft10{
margin-left: 10px;
}
.mleft14{
margin-left: 14px;
height: 60px;
}
.mleft16{
margin-left: 16px;
}
.mright20{
margin-right: 20px;
}
.strong,.bold{
font-weight: bold;
}
.overflow{
overflow:hidden;
}
.textoverflow{
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.fsize11{
font-size: 22rpx;
height:11px;
line-height:11px;
}
.fsize12{
font-size: 24rpx;
}
.fsize13{
font-size: 26rpx;
}
.fsize14{
font-size: 28rpx;
}
.fsize15{
font-size: 30rpx;
}
.fsize16{
font-size: 32rpx;
}
.fsize17{
font-size: 34rpx;
}
.fsize18{
font-size: 36rpx;
}
.fsize20{
font-size: 40rpx;
}
.fsize24{
font-size: 48rpx;
}
.black-font{
color:#353535;
}
.white-font{
color:#fff;
}
.gray-light-font{
color:#999;
}
.gray-deenpen-font{
color:#666;
}
.hr-one{
background: #efeef3;
height: 2rpx;
width:auto;
}
.nowrap{white-space:nowrap;}
/*水平方向左右分布*/
.flex-lr{
display: flex;
display: -webkit-flex;
justify-content: space-between;
align-items:center;
flex-direction: row;
-webkit-flex-direction: row;
}
.flex-ll{
display: flex;
display: -webkit-flex;
flex-direction:row;
justfy-content: flex-start;
align-items: center;
-webkit-flex-direction: row;
}
.flex-ll-top{
display: flex;
display: -webkit-flex;
flex-direction:row;
-webkit-flex-direction: row;
}
.flex-ll-bottom{
display: flex;
display: -webkit-flex;
flex-direction:row;
-webkit-flex-direction: row;
justfy-content: flex-end;
align-items: flex-end;
}
.flex-rr{
display: flex;
display: -webkit-flex;
justify-content: flex-end;
align-items: center;
flex-direction: row;
-webkit-flex-direction: row;
}
/*垂直方向居中分布*/
.flex-vc{
display: flex;
display: -webkit-flex;
justify-content: center;
align-items: center;
flex-direction: column;
-webkit-flex-direction: column;
}
/*垂直方向居左分布*/
.flex-vl{
display: flex;
display: -webkit-flex;
justify-content: flex-start;
align-items: left;
flex-direction: column;
-webkit-flex-direction: column;
}
/*垂直方向居右分布*/
.flex-vr{
display: flex;
display: -webkit-flex;
justify-content: flex-end;
align-items: center;
flex-direction: column;
-webkit-flex-direction: column;
}
/*水平方向居中分布*/
.flex-cc{
display: flex;
display: -webkit-flex;
justify-content: center;
align-items: center;
flex-direction: row;
-webkit-flex-direction: row;
}
/*基准线对齐*/
.flex-bc{
display: flex;
display: -webkit-flex;
justify-content: center;
align-items: baseline;
flex-direction: row;
-webkit-flex-direction: row;
}
/*流式布局*/
.flex-auto{
display: flex;
display: -webkit-flex;
justify-content: space-around;
align-content: flex-start;
flex-flow:wrap;
}
.div-v-center {
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
-o-transform: translateY(-50%);
transform: translateY(-50%);
}
.div-h-center {
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
transform: translateX(-50%);
}
.t-align-c{
text-align: center;
}
.t-align-r{
text-align: right;
}
.t-align-j{
text-align: justify;
}
.displaysan{
word-break:break-all;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
overflow:hidden;
}
.linethrough{
text-decoration:line-through
}
image{
background-color: #f4f4f4;
background-repeat: no-repeat;
background-size: 68px 24px;
background-position: center;
}
.opacity{
opacity: 0.4;
}
.opacity2{
opacity: 0.2;
}
.avater{width:50px;height:50px;border-radius:50%;}
.fixed{position:fixed}
.inline{
display:inline-block;
}
.width{
width:50%;
}
.width100{
width:100%;
}
.height100{
height:100px;
}
/*点餐人数 选择口味*/
.choose{
height:32px;
}
.choose .normal{
width:76px;
height:30px;
line-height:30px;
text-align:center;
color:#E14553;
border:1px solid #FB848F;
border-radius:15px;
}
.mleft30{
margin-left:30px;
}
.mleft50{
margin-left:50px;
}
.choose .active{
background-color:#F93E85;
color:#fff;
}
.beginorder{
width:67%;
margin:0 16.5%;
height:40px;
line-height:40px;
border-radius:8px;
bottom:40px;
}
/* 会员卡样式调整 */
.cardSection{ margin: 0 auto; width:84%; overflow: hidden; }
.cardBox {
width: 100%;
background: #EFEEF3;
padding: 30rpx 0;
}
.innerBox {
position: relative;
width: 84%; height: 0;
padding-top: 48%;
}
.cardTitle {
position: absolute;
top:15rpx;
}
.cardInfo {
position: absolute;
bottom:26rpx;
}
.fsizeTitle{
font-size: 30rpx;
}
.fsizeInfo {
font-size: 26rpx;
}
.rightsArea {
padding-top: 25rpx;
}
.imageSize {
width: 44rpx;
height: 44rpx;
overflow: hidden;
margin-right: 15rpx;
float: left;
}
.rightsTitle {
margin: 0 5%;
margin-bottom: 50rpx;
}
.infoSize {
color: #060606;
font-size: 30rpx;
}
.rightsItem {
margin-bottom: 35rpx;
height: 100%;
}
.itemInfo {
flex: 1;
}
.orderSize {
width: 222rpx;
height: 71rpx;
line-height: 71rpx;
font-size: 30rpx;
}
.disabledSize {
bottom: 80rpx;
margin: 0 100rpx;
}
.btnArea {
width: 100%;
display: flex;
justify-content: center;
position: absolute;
bottom: 80rpx;
}
.page {
height: 100%;
}
.fwhite {
color: #fff;
}
.fgray {
color: #efedec;
}
.b-radius{border-radius:6px;}
.bradius8{border-radius:8px;}
.bradius50{border-radius:50%;}
.smooth{
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
image{
display:block;
background:transparent;
}
button:after{
border:0;
}
button{
background:transparent;
}
.button-hover {
background-color: transparent;
}
.food-clear-num{
height:20px;
position:absolute;
right:0;
}
.food-clear-content{
height:100%;
font-size:22rpx;
padding:0 10rpx;
background:rgba(216,30,6,.9);
line-height:40rpx;
}
.food-clear-angel{
width:14rpx;
height:36rpx;
position:relative;
left:1rpx;
}
.angel-reat{
width:12px;
height:100%;
overflow:hidden;
position:relative;
}
.common-angle {
width: 0;
height: 0;
border-top: 12px solid transparent;
border-right: 12px solid rgba(216,30,6,.9);
border-bottom: 12px solid transparent;
position:absolute;
}
.top-angel{
top:-12px;
left:2px;
}
.bottom-angel{
bottom:-12px;
left:2px;
}
.font-bold,.Semibold{
font-weight:bold;
}
.Medium{
font-weight: 400;
}
\ No newline at end of file
... ...
.icon,.icon-s,.icon-m,.icon-l{
background-repeat: no-repeat;
height: 16px;
width:16px;
display: block;
margin: 5px;
background-size: 100%; background-repeat: no-repeat;
}
.icon-jiantou{
width:8px;
height:13px;
margin:0;
margin-left:5px;
}
.icon-12{
height: 12px;
width: 12px;
}
.icon14{
height: 14px;
width: 14px;
}
.icon15{
height: 15px;
width: 15px;
}
.subtractCook{
height: 3px;
width: 15px;
}
.icon-s{
height: 18px;
width:18px;
}
.icon24{
height: 24px;
width:24px;
}
.icon28{
height: 28px;
width:28px;
}
.icon-ml{
height: 26px;
width:26px;
}
.icon-l{
height: 32px;
width:32px;
}
.icon64{
height: 64px;
width:64px;
}
.icon-membercard{
background: url(http://qn.colorcun.com/wechat/app/images/icon_card.jpg);
background-size: 100%; background-repeat: no-repeat;
height:100%;
}
... ...
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
var bookOrder=require('../../utils/bookCommon.js')
Page({
data:{
},
onLoad:function(){
util.setBarTitle('选择用餐时间');
this.getdatelist()
this.getimelist();
wx.removeStorage({
key:'order_pnum',
})
wx.removeStorage({
key:'tabletype',
})
},
onShow:function(){
},
changelist:function(e){
console.log('xxxx',e)
var timelist=this.data.timeList;
timelist.forEach(function(v,i){
v.list.forEach(function(r,n){
r.isselect=false
})
})
this.setData({
timeList:timelist,
time_dur:e.detail
})
},
//日期选择
selectdate:function(e){
var title=e.currentTarget.dataset.title;
var datelist=this.data.dateList;
var selectdate=''
datelist.forEach(function(v,i){
v.isActive=false
if(v.title==title){
v.isActive=true;
selectdate=v.date
}
})
this.setData({
dateList:datelist,
selectdate:selectdate,
time_dur:null
})
this.getimelist();
},
selectOther:function(){
var currentTime=Date.parse(new Date());
var timeobj=bookOrder.changedate(currentTime)
console.log(this.data.selectdate,this.data.time_dur)
wx.navigateTo({
url:'b_info?year='+timeobj.year+'&date='+this.data.selectdate+'&time='+this.data.time_dur
})
},
//获取日期列表
getdatelist:function(){
var currentTime=Date.parse(new Date());
var dur=24*60*60*1000;
var list=[currentTime,currentTime+dur,currentTime+2*dur];
var desklist=[];
for(var i=0;i<list.length;i++){
var dd=bookOrder.changedate(list[i]);
if(i==0){
var title='今天';
var isselect=true
}
if(i==1){
var title='明天';
var isselect=false
}
if(i==2){
var myDate = new Date(list[2]);
var title=bookOrder.getweek(myDate.getDay());
var isselect=false
}
desklist.push({
title:title,
date:'0'+dd.month+(dd.day<10 ? '-0'+dd.day : '-'+dd.day),
isActive:isselect,
year:dd.year
})
}
this.setData({
dateList:desklist,
selectdate:desklist[0].date
})
console.log(this.data.selectdate)
},
//获取时间列表
getimelist:function(){
var currentTime=Date.parse(new Date());
var timeobj=bookOrder.changedate(currentTime)
var timelist=[
{
title:'早市',
time_dur:'6:00-10:00',
list:[
{
time_dur:'6:00',
isselect:false,
time_mask:6
}
],
starttime:6,
endtime:10
},
{
title:'午市',
time_dur:'11:00-15:00',
list:[
{
time_dur:'11:00',
isselect:false,
time_mask:11
}
],
starttime:11,
endtime:15
},
{
title:'晚市',
time_dur:'17:00-22:00',
list:[
{
time_dur:'17:00',
isselect:false,
time_mask:17
}
],
starttime:17,
endtime:22
},
];
var that=this;
timelist.forEach(function(v,i){
var len=(v.endtime-v.starttime)/0.5;
var time=v.starttime;
console.log(len)
for(var j=0;j<len;j++){
time+=0.5;
if(bookOrder.isInteger(time)==true){
v.list.push(
{
time_dur:time+':00',
isselect:false,
time_mask:time
}
)
}else{
v.list.push(
{
time_dur:Math.floor(time)+':30',
isselect:false,
time_mask:time
}
)
}
}
})
var thisdate=0;
if(that.data.selectdate.split('-')[1].length>1){
thisdate=parseInt(that.data.selectdate.split('-')[1][0]=='0' ? that.data.selectdate.split('-')[1].slice(1,2) : that.data.selectdate.split('-')[1])
}else{
thisdate=parseInt(that.data.selectdate.split('-')[1])
}
if(thisdate==timeobj.day){
var thistime=timeobj.hour+timeobj.minute/60;
var dd=[]
timelist.forEach(function(v,i){
if(thistime<v.endtime){
dd.push(v)
}
})
timelist=dd;
timelist.forEach(function(v,i){
if(thistime>=v.starttime && thistime<=v.endtime){
var list=[]
v.list.forEach(function(r,n){
if(thistime<r.time_mask){
list.push(r)
}
})
v.list=list
}
})
}
this.setData({
timeList:timelist
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"timeDuration":"/components/book/time/time",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<nav>点餐商户端</nav>
<!--日期-->
<view style="padding-bottom:160rpx;">
<view class="select-date flex-lr smooth">
<block wx:for="{{dateList}}">
<view class="single-date gray-deep-font flex-vc" bindtap="selectdate" data-title="{{item.title}}">
<view class="font30r {{item.isActive==true ? 'black-font' : ''}}">{{item.title}}</view>
<view class="font34r date-num flex-cc {{item.isActive==true ? 'select-date-active black-font' : ''}}">{{item.date}}</view>
</view>
</block>
<view class="single-date gray-deep-font flex-vc">
<view class="font30r">更多</view>
<view class="date-num flex-vc">
<image src="http://qn.colorcun.com/custom/lite-yd/image/more-dot.png" class="more-dot"></image>
</view>
</view>
</view>
<block wx:for="{{timeList}}">
<timeDuration item="{{item}}" bind:changelist="changelist"></timeDuration>
</block>
</view>
<view class="confirm-button white-font flex-vc font34r {{time_dur ? 'confirm-button-active' : ''}}" bindtap="{{time_dur ? 'selectOther' : ''}}">确定</view>
<date-picker
startTime="{{startTime}}"
endTime="{{endTime}}"
unit="{{unit}}"
reserveUnit="{{reserveUnit}}"
unreserveTime="{{unreserveTime}}"
activedConst="{{activedConst}}"
disabledConst="{{disabledConst}}"
themeColor="#1f78d1"
bind:selectTime="onSelectTime"
/>
\ No newline at end of file
... ...
.select-date{
width:680rpx;
height:180rpx;
margin:0 auto;
}
.more-dot{
width:50rpx;
height:10rpx;
}
.date-num{
padding:0 10rpx;
height:70rpx;
}
.select-date-active{
border-bottom:2px solid #199095;
box-sizing:border-box;
}
.confirm-button{
width:680rpx;
height:85rpx;
background:#74BBBE;
position:fixed;
left:0;
right:0;
bottom:60rpx;
margin:0 auto;
border-radius:10rpx;
}
.confirm-button-active{
background:#199095;
}
\ No newline at end of file
... ...
// 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: [],
}
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:{},//已选中的桌子集合
onLoad: async function (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 || '';
await this.setDateStr();
this.sellerid = util.cache('enter_params')['seller_id'];
let timePickerArray = await comm.getDayTimeSpace();
//判断hasUseDefDtime
let hasUseDefDtime = true;
let mmii = util.unixtoTime(new Date() / 1000, 'HH:II');
if (mmii > this.data.defDtime[this.data.form.time]) {
hasUseDefDtime = false;
}
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();
}
},
/**
*
* @param d
*
*/
async setDateStr(d = new Date() / 1000){
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);
//form.time=await comm.getTimeSpaceIndex(d);
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;
let obj = {
dateStr: dateStr,
form: form,
timePickerIndex: timePickerIndex,
timeOpt: timeObj.timeOpt,
};
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 () {
},
selectedValue(e){
console.log(e);
let key = util.attr(e, 'key');
let val;
let sobj = {};
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;
}
}
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, 'YYYY-' + (this.data.dateStr[val].substr(0, 5)) + ' HH:II:SS');
this.setDateStr(util.timetouUnix(xtime));
}
}
//判断hasUseDefDtime
if ((key == 'time' || key == 'date') && !sobj.timePickerMask) {
sobj.hasUseDefDtime = true
}
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;
}
}
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);
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: rdate,
tid: form.tabid,
rid: this.reserve_id,
}).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
})
})
} 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);
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);
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.Reserve.SetReserveInfo(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.navigateTo({
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)
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'))
this.setDateStr(cktime == day0 ? new Date() / 1000 : cktime)
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);
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
})
},
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,
})
},
/**
* 修改初始化
*/
async initModify(id){
try {
let res = await App.Reserve.Detail({rid: id, openid: ''});
console.log('initModify', res);
//设置日期
let obj = await this.setDateStr(res.data.ddate);
//设置时间
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.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
options.ddate=options.ddate.substr(0,10);
//设置日期
let obj = await this.setDateStr(options.ddate);
//设置时间
let nd = util.unixtoTime(options.ddate, 'HH:II');
let timePickerIndex = this.data.timePickerIndex
console.log('initQuick-', this.data.timePickerArray, obj.form.time, nd)
this.data.timePickerArray[obj.form.time].forEach((dd, ii) => {
console.log('initQuick-', nd, dd)
if (nd == dd) {
timePickerIndex[obj.form.time] = ii;
return true;
}
})
console.log('initQuick-timePickerIndex', timePickerIndex);
obj.form.pnum = options.pnum || 6;
obj.form.rname = "";
obj.form.phone = "";
obj.form.sex = 1;
obj.form.cusdem = "";
obj.form.rid = "";
obj.form.tid = [options.tid];
this.setData({
timePickerIndex: timePickerIndex,
form: obj.form,
hasUseDefDtime: false,
})
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",
"bookList":"/components/book/list/list",
"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",
"a2l":"/components/tips/add-to-lite"
}
}
\ 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="selectedValue" 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="selectedValue" 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="selectedValue" 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" wx:if="{{tablesLength>1}}">
<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:{{reminder ? 400 : 680}}rpx;" cursor-spacing="260"/>
<view bindtap="selectedValue" data-key="time" data-value="{{form.time}}" data-display="block" style="color:#199095">
<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>
</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>
<a2l bgColor="#199095"></a2l>
\ 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
... ...
import util from '../../utils/util';
import comm from '../../utils/bookCommon';
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
data:{
menu_active_id:''
},
checked_tids:[],
desks:[],
onLoad:function(opt){
console.log('onLoad',opt)
util.setBarTitle('选择桌位');
var radio=750/util.getsystem().windowWidth;
var contentHeight=util.getsystem().windowHeight-Math.ceil(350/radio);
if(opt.tid==0){
delete opt.tid
}
if(opt.checked_tids){
this.checked_tids=opt.checked_tids.split(',')
util.cache('tableid',this.checked_tids)
}
this.setData({
sellerid:util.cache('sellerid'),
opt:opt,
hasCheckedTable:this.checked_tids.length>0
})
this.getdesklist();
},
onShow:function(){
this.setData({
height:getApp().system.windowHeight-55
})
},
changedesk:function(e){
let tableid=util.cache('tableid');
this.checked_tids= tableid && tableid.length>0?tableid:[];
this.setData({
hasCheckedTable:this.checked_tids.length>0
})
},
back:function(){
this.setData({
buttonClick:true
})
//wx.removeStorage({key:'tableid'})
wx.navigateBack();
},
getdesklist:function(){
var formdata=this.data.opt;
formdata.sid=this.data.sellerid;
var that=this;
App.Reserve.GetTableList(formdata).then(function (json) {
if(json.ret==200){
console.log('this.checked_tids',that.checked_tids);
that.desks=json.data
that.formatDesklist(true)
}
})
},
formatDesklist(hasFirst=true){
let desks=this.desks;
if(desks.length>0){
desks.forEach((v,i)=>{
v.list.forEach((r,n)=>{
r.isselect=false
if(this.checked_tids._indexOf(r.id)>-1){
r.isselect=true;
}
})
})
let param={
desklist:desks,
}
if(hasFirst){
param.menu_active_id=desks[0].name
}
this.setData(param)
}
return desks;
},
switchMenu(e){
this.formatDesklist(false)
this.setData({
menu_active_id:util.attr(e,'id')
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"selectPeople":"/components/book/people/people",
"orderDesk":"/components/book/desk/desk",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<nav>选择桌位</nav>
<!--桌位状态-->
<view class="flex-lr" style="border-top:1rpx solid #E0E0E0">
<view class="menus" style="height: {{height}}px; overflow-y: auto;overflow-x: hidden;align-self:flex-start ">
<view class="menus-item flex-cc {{item.name==menu_active_id?'active':''}}"
wx:for="{{desklist}}" wx:key="desklist.key"
bindtap="switchMenu" data-id="{{item.name}}">
<view class="name">{{item.name}}</view>
<view class="hip" wx:if="{{item.chenkNum>0}}">{{item.chenkNum}}</view>
</view>
</view>
<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}}" bind:changedesk="changedesk" wx:if="{{item.name==menu_active_id}}"></orderDesk>
</block>
</view>
</view>
<view class="confirm-button white-font flex-vc font34r {{hasCheckedTable ? 'confirm-button-active' : ''}}" bindtap="back">确定</view>
... ...
view{
line-height:1.2;
}
.other-info{
width:100%;
height:220rpx;
padding:20rpx 0;
box-sizing:border-box;
}
.selected-time{
width:375rpx;
height:100%;
border-right:1px solid #efeef3;
box-sizing:border-box;
}
.actual-time{
margin-top:10rpx;
}
.cut{
width:100%;
height:4px;
background:#efeef3;
}
.desk-type{
width:680rpx;
padding:40rpx 0 20rpx;
margin:0 auto;
}
.desk-type-single{
width:160rpx;
height:60rpx;
border:1px solid #199095;
border-radius:30rpx;
background:#EBF8F8;
}
.desk-type-single-active{
background:#199095;
}
.desk-list{
width:100%;
}
.desk-region{
width:680rpx;
padding-top:40rpx;
margin:0 auto;
}
.confirm-button{
width:460rpx;
height:85rpx;
background:#74BBBE;
position:fixed;
left:250rpx;
bottom:40rpx;
margin:0 auto;
border-radius:10rpx;
}
.confirm-button-active{
background:#199095;
}
.menus{
width: 168rpx;
min-width: 168rpx;
background-color: #F5F5F5;
}
.menus-item{
width: 168rpx;
height: 158rpx;
line-height: 158rpx;
font-size: 34rpx;
border: 1rpx solid #E0E0E0;
border-top-width: 0;
border-left-width: 0;
position: relative;
}
.menus-item.active{
background-color: #FEFEFE;
}
.menus-item .name{
width: 140rpx;
max-height: 96rpx;
line-height: 48rpx;
overflow: hidden;
text-align: center;
}
.menus-item .hip{
background-color: #f00;
width: 40rpx;
height: 40rpx;
position: absolute;
border-radius: 50%;
color: #fefefe;
text-align: center;
line-height: 40rpx;
font-size: 22rpx;
top:10rpx;
right: 10rpx;
}
\ No newline at end of file
... ...
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
import App from '../../utils/api';
const {regeneratorRuntime} = global
import TP from '../../utils/tpls';
Page({
data:{
actionSheetHidden:true,
actionSheetItems:['客户取消','客户行程改变']
},
sc:{},
tpls:TP.tpls(),
enter_params:{},
onLoad:async function (opt) {
util.setBarTitle('预定详情');
console.log(opt)
this.getDetail(opt.id);
wx.showShareMenu({
withShareTicket: true,
success:function(res){
console.log(res)
}
})
this.enter_params=util.cache('enter_params');
this.sc=(await App.Reserve.SellerInfo(this.enter_params)).data;
console.log('this.sc',this.sc);
this.chooseManagerInit();
},
onShow:function(){
this.notice=this.selectComponent('#notice');
},
noticeCall:function(){
this.selectComponent('#notice').show();
},
onShareAppMessage: function () {
this.selectComponent('#notice').close();
var obj=this.data.bookInfo;
let path=util.http_build_query({
id:this.data.bookInfo.id,
fromid:getApp().openid,
hasSellerShare:1,
hasInvitation:1,
tplid:1
},'/pages/customer/index')
return {
//title: (nickname||'')+'给你发送了一个订座信息,点击查看详情',
title: this.tpls[0].shareFirstTitle,
path: path,
imageUrl:this.tpls[0].shareFirstImage,
success: function (res) {
console.log(res,666666)
},
fail:function(){
console.log('ccccc')
},
complete:function(){
console.log('ccccc')
}
};
},
getcall:function(){
if(!this.detailData.hasOwner){
return util.toast('只有记录人可以拨打','none');
}
if(this.data.bookInfo.phone.length<3){
return util.toast('号码错误','none');
}
wx.makePhoneCall({
phoneNumber: this.data.bookInfo.phone, //仅为示例,并非真实的电话号码
complete:()=>{
this.selectComponent('#notice').close();
}
})
},
chooseManagerInit(){
try{
let managers=this.sc.manager;
let mans=[];
let mans_role=[];
// let space='';
// for(let i=0;i<50;i++){
// space+=' ';
// }
if(managers.length>0){
managers.forEach(man=>{
let nickname=man.nick_name||man.user_name;
mans.push(nickname);
//mans_role.push('     ['+man.role_name+'] -- '+man.user_name+space);
mans_role.push('['+man.role_name+'] -- '+nickname);
})
}
this.setData({mans:mans,mans_role:mans_role})
}catch(e){
wx.showToast({
title:'无客户经理',
icon:'none'
});
}
},
chooseManager(e){
let mansIndex=util.val(e);
this.setData({mansIndex:mansIndex});
try{
let managers=this.sc.manager;
let man=managers[mansIndex];
if(man){
App.Reserve.SetReserveCusman({
rid:this.data.bookInfo.id,
cusman_id:man.id,
cusman:man.nick_name||man.user_name,
cusman_phone:man.user_phone?man.user_phone:'',
cusman_account:man.user_wechat?man.user_wechat:'',
cusman_openid:man.seat_openid?man.seat_openid:''
}).then(()=>{
this.getDetail(this.data.bookInfo.id,true);
});
}
}catch(e){
console.log(e);
}
},
flushSellerInfo(){
App.Reserve.SellerInfo(util.cache('enter_params'),true);
},
detailData:null,
async getDetail(id,force=false){
let res=await App.Reserve.Detail({rid:id,openid:''},force);
res.data.rdateStr=util.unixtoTime(res.data.ddate,"MM月DD日 HH:II")
res.data.phoneStr=res.data.phone||'';
let enter_params=util.cache('enter_params');
let sc=(await App.Reserve.SellerInfo(enter_params)).data
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.hasOwner){
res.data.phoneStr=res.data.phoneStr.replace(/(\d{2})(.{5})(\d{3})/,function($0,$1,$2,$3){
return $1+'**'+$3;
})
}
if(res.data.status==4 && res.data.cancel){
res.data.cancel.cdateStr=util.unixtoTime(res.data.cancel.cdate,"YYYY.MM.DD HH:II")
}
this.detailData=res.data;
this.setData({
tables:res.data.tables,
bookInfo:res.data,
})
},
gotoModify(){
wx.redirectTo({
url:'./b_addnew?id='+this.data.bookInfo.id
})
},
cancelReserve(){
this.selectComponent('#cancel').show();
},
reserveCancel(e){
console.log('reserveCancel',e.detail);
this.getDetail(this.data.bookInfo.id,true);
},
actionSheetChange(e){
this.setData({
actionSheetHidden:true
})
},
async startDinner(e){
let cause={};
let enter_params=util.cache('enter_params');
let sc=(await App.Reserve.SellerInfo(enter_params)).data
cause={desc:""}
if(enter_params){
cause.uid=enter_params.manager_id;
}
if(sc.seller_user){
cause.uname=(sc.seller_user.nick_name||sc.seller_user.nickname)
}
App.Reserve.SetReserveStatus({
rid:this.data.bookInfo.id,
status:util.attr(e,'status'),
cause:JSON.stringify(cause),
}).then(()=>{
this.getDetail(this.data.bookInfo.id,true);
});
},
showOrder(){
wx.navigateTo({
url:util.http_build_query({rid:this.data.bookInfo.id,oid:this.data.bookInfo.orderid,identity:2},'/pack-cookbook/pages/success')
});
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"noticeCall":"/components/book/notice/notice",
"step":"/components/book/step/step",
"board":"/components/book/board/board",
"cancel":"/components/book/reserveCancel/cancel",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<nav hasHome>订座详情</nav>
<!--订单信息-->
<view class="order-info">
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">到店时间</view>
<view class="black-font font34r">{{bookInfo.rdateStr}}</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">用餐人数</view>
<view class="black-font font34r">{{bookInfo.pnum_str||bookInfo.pnum}}人</view>
</view>
<view class="reserve-status-tip" wx:if="{{bookInfo.status!=null}}">
<image src="http://qn.colorcun.com/custom/lite-yd/image/reserve-status-{{bookInfo.status}}.png"></image>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">预订座位</view>
<view class="black-font font34r">{{tables.length}}个</view>
</view>
<view class="flex-lr order-desk">
<view class="gray-deep-font font30r"></view>
<view class="flex-re" style="width:100%;flex-wrap:wrap;">
<block wx:for="{{tables}}" wx:key="tables.key">
<board width="160" height="180" board="{{item}}" className="noBottom"
style="margin-left:20rpx;zoom: 0.8; margin-bottom: 20rpx;"></board>
</block>
</view>
</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>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">客户电话</view>
<view class="black-font font34r" bindtap="getcall">{{bookInfo.phoneStr||''}}</view>
</view>
<block wx:if="{{bookInfo.cusdem!='' && bookInfo.cusdem!='null'}}">
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">备注信息</view>
<view class="black-font font34r">{{bookInfo.cusdem}}</view>
</view>
</block>
</view>
<view class="order-info">
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">客户经理</view>
<view class="flex-lr black-font font34r" style=" border-bottom: 2rpx solid #999;">
<picker bindchange="chooseManager" catchtap="flushSellerInfo" value="{{mansIndex}}" range="{{mans_role}}">
<view class="picker">
{{mans[mansIndex]?mans[mansIndex]:bookInfo.cusman?bookInfo.cusman:'请选择'}}
</view>
</picker>
</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">记录人</view>
<view class="black-font font34r">{{bookInfo.note_name}}</view>
</view>
</view>
<view class="order-info" wx:if="{{bookInfo.status==4 && bookInfo.cancel}}">
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">取消原因</view>
<view class="flex-lr black-font font34r">
{{bookInfo.cancel.desc}}
</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">取消时间</view>
<view class="black-font font34r">{{bookInfo.cancel.cdateStr}}</view>
</view>
<view class="flex-lr order-detail">
<view class="gray-deep-font font30r">操作人</view>
<view class="black-font font34r">{{bookInfo.cancel.uname}}</view>
</view>
</view>
<view style="height: 250rpx;"></view>
<!--通知预订人-->
<view class="notice-opt" wx:if="{{bookInfo.status==1}}">
<view class="notice-button-border font34r flex-lr">
<view>
<formids bindclick="noticeCall">通知客户</formids>
</view>
<view wx:if="{{bookInfo.order && bookInfo.order.cookbooklist.length>0}}">
<formids bindclick="showOrder">查看菜品</formids>
</view>
</view>
<view class="notice-button-border font34r flex-lr">
<view>
<formids bindclick="gotoModify">变更预订</formids>
</view>
<view >
<formids bindclick="cancelReserve">取消预订</formids>
</view>
<view>
<formids bindclick="startDinner" data-status="2">确认到店</formids>
</view>
</view>
</view>
<view class="notice-opt" wx:if="{{bookInfo.status==2}}">
<formids class="notice-button white-font font34r flex-cc" bindclick="startDinner" data-status="3">客户就餐完毕</formids>
</view>
<noticeCall id="notice" bookInfo="{{bookInfo}}"></noticeCall>
<action-sheet hidden="{{actionSheetHidden}}" bindchange="actionSheetChange" class="flex-ll">
<block wx:for-items="{{actionSheetItems}}" wx:key="actionSheetItems.key">
<action-sheet-item>{{item}}</action-sheet-item>
</block>
<action-sheet-item>
<input placeholder="请输入" style="width:100%"/>
</action-sheet-item>
<action-sheet-cancel >取消</action-sheet-cancel>
</action-sheet>
<cancel id="cancel" bindreserveCancel="reserveCancel" bookInfo="{{bookInfo}}"></cancel>
\ No newline at end of file
... ...
view{
line-height:1.2;
}
/*商家信息*/
.seller-info{
width:680rpx;
height:auto;
padding:40rpx 0;
margin:0 auto;
border-bottom:1px solid #efeef3;
}
.seller-image{
width:60rpx;
height:60rpx;
border-radius:50%;
margin-right:20rpx;
}
.seller-address{
margin-top:10rpx;
}
.seller-location{
width:32rpx;
height:34rpx;
}
/*订单信息*/
.order-info{
width:680rpx;
height:auto;
padding:0 20rpx;
margin:0 auto;
border-bottom:1px solid #efeef3;
box-sizing:border-box;
}
.order-detail{
width:100%;
padding:40rpx 0;
}
.order-desk{
width:100%;
height:auto;
position:relative;
}
.order-status{
width:172rpx;
height:100rpx;
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
margin:auto;
z-index:2;
}
.order-desk-info{
width:120rpx;
height:120rpx;
background:#A9E3E6;
border:1px solid #199095;
border-radius:10rpx;
position:relative;
overflow:hidden;
margin-left:20rpx;
margin-top:20rpx;
}
.order-desk-detail{
width:100%;
height:90rpx;
}
.order-desk-type{
width:100%;
height:30rpx;
background:#199095;
position:absolute;
left:0;
bottom:0;
}
.seller-staff{
width:680rpx;
padding:40rpx 20rpx;
box-sizing:border-box;
margin:0 auto;
}
.notice-opt{
position:fixed;
left:0;
right:0;
bottom: 0;
padding-bottom: 50rpx;
background-color: #fefefe;
}
.notice-button{
height:85rpx;
width:90%;
background:#199095;
border-radius:0;
margin:20rpx auto 0;
}
.notice-button-border{
height:85rpx;
width:90%;
border:solid 2rpx #199095;
border-radius:0;
margin:20rpx auto 0;
color: #199095;
}
.notice-button-border view{
width: 100%;
border-right: 2rpx solid #199095;
text-align: center;
height: 50rpx;
line-height: 50rpx;
}
.notice-button-border view:last-child{
border-right-width: 0;
}
.reserve-status-tip{
position: absolute;
top:300rpx;
right:200rpx;
width: 82rpx;
height: 52rpx;
}
.reserve-status-tip image{
width: 100%;
height: 100%;
}
\ No newline at end of file
... ...
var mta=require('mta-wechat-analysis')
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
var bookOrder=require('../../utils/bookCommon.js')
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
data:{
isloading:false,
pagex:1,
pagey:10,
sort:null,
dateStr:'',
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' }
],
keywords:'',
sort:'',
form:{
time:-1,
},
timePickerArray:[
[],
[],
[],
],
speciallist:[],
ReservesCountMonth:[],
ReservesTotal:0,
timeStrLabel:bookOrder.timeStrLabel
},
sellerid:0,
indexOpt:null,
YYYY:'YYYY',
onLoad:async function(opt){
this.indexOpt=opt;
mta.Page.init({
"appID":"500667280",
"eventID":"500667287",
"statPullDownFresh":true,
"statShareApp":true,
"statReachBottom":true,
"lauchOpts":opt, //渠道分析
});
let d=new Date()/1000;
let dateStr=util.unixtoTime(d,'MM-DD DAY');
var radio=750/util.getsystem().windowWidth;
var contentHeight=util.getsystem().windowHeight-Math.ceil(120/radio)
if(opt.seller_id){
this.sellerid=opt.seller_id;
util.cache('sellerid',opt.seller_id)
util.cache('enter_params',opt)
App.Reserve.SellerInfo(opt)
}else{
this.sellerid=util.cache('sellerid');
}
//this.sellerid=opt.seller_id ? opt.seller_id : util.cache('sellerid');
let timePickerArray= await bookOrder.getDayTimeSpace();
let speciallist=[
{ date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' },
{ date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' },
{ date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },
];
this.setData({
sellerid:this.sellerid,
listHeight:contentHeight-Math.ceil(210/radio),
dateStr:dateStr,
timePickerArray: timePickerArray,
speciallist:speciallist,
})
//util.setBarTitle('预定本');
this.indexOpt=opt;
this.ReservesCountDay(util.unixtoTime(d,'YYYY-MM-DD'));
this.ReservesCountMonth(util.unixtoTime(d,'YYYY-MM'));
},
onShow:function(){
this.setData({
isloading:false,
})
this.getbooklist();
this.selectComponent('#nav').init();
setTimeout(()=>{
this.setData({
calendarMaskLoad:true,
})
let openid=getApp().openid;
if(openid && this.indexOpt.seller_id){
App.Reserve.SellerForOpenid({openid:openid,sedata:JSON.stringify(this.indexOpt)})
//客户经理=>人人都是客户经理
//if(this.indexOpt.manager_id){
App.Reserve.UpdateSellerUser({seat_openid:openid,kid:this.indexOpt.manager_id});
//}
}else{
console.log('index-opt',openid,this.indexOpt);
}
},1000);
},
async getbooklist(isExport=false){
let time=0;
if(this.data.form.time<0){
let sid=await bookOrder.getTimeSpaceIndexData();
time=sid.timeIndex
}else{
time=this.data.form.time;
}
var formdata={};
if(this.data.sort!=''){
formdata.sort=this.data.sort
}
if(this.data.keywords!=''){
formdata.keywords=this.data.keywords
}
formdata.sid=this.sellerid;
formdata.x=1;
formdata.y=200;
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time,null,null,this.YYYY);
formdata.rdate=rdate;
if(isExport){
this.__exportFile(formdata);
}else{
var that=this;
App.Reserve.GetReserveList(formdata).then(function(json){
console.log(json)
if(json.ret==200){
that.setData({
isloading:true,
bookList:json.data.length==0 ? null : json.data,
form:{time:time},
})
that.boolists=that.selectAllComponents('.orderbook');
that.boolists.forEach(function(v,i){
v.changeitem();
})
}
}).catch(e=>{})
}
},
timeorder:function(){
if(this.data.sort==''){
this.data.sort=1;
}else{
this.data.sort='';
}
this.setData({
sort:this.data.sort
})
this.getbooklist();
},
searchinput:function(e){
this.data.keywords=e.detail.value;
this.setData({
keywords:this.data.keywords
})
if(e.detail.value==''){
this.getbooklist();
}
},
calendarShow(){
console.log('xxxxx')
this.setData({
calendarMask:true
})
console.log(this.data.calendarMask)
},
dateChange(event){
this.YYYY=event.detail.date.substr(0,4);
let cktime=util.timetouUnix(event.detail.date)
console.log('cktime',cktime,this.YYYY)
let clickDay = event.detail.date.substr(8,2);
let changeDay = `dayStyle[1].day`;
let changeBg = `dayStyle[1].background`;
this.setData({
dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),
[changeDay]: clickDay,
[changeBg]: "#84e7d0"
})
this.getbooklist();
this.calendarClose();
this.ReservesCountDay(event.detail.date);
},
calendarClose(){
this.setData({
calendarMask:false
})
},
selectedValue:function (e) {
this.setData({
form:{time:e.currentTarget.dataset.value}
})
this.getbooklist();
},
searchbook:function(e){
console.log(this.data.form)
this.getbooklist();
},
__exportFile(formdata){
App.Reserve.ExportReserve(formdata).then(res=>{
let url=res.data;
if(!url){
return util.toast('没有预订数据','none')
}
wx.downloadFile({
url: url,
success: function(res) {
const filePath = res.tempFilePath;
console.log('filePath',filePath);
wx.previewImage({
current: filePath,
urls: [filePath]
})
wx.saveImageToPhotosAlbum({
filePath:filePath,
fail (res) {
util.toast('保存失败','none')
}
})
}
})
});
},
exportFile(){
this.getbooklist(true);
},
ReservesCountDay(day){
App.Reserve.ReservesCountDay({
sid:this.sellerid,
day:day
}).then(res=>{
let ReservesTotal=0;
let ReservesCountDay={};
if(res.ret==200){
ReservesCountDay=res.data;
Object.keys(res.data).forEach(k=>{
if(res.data[k]!=-1){
ReservesTotal+=parseInt(res.data[k])
}
})
}
this.setData({
ReservesTotal:ReservesTotal,
ReservesCountDay:ReservesCountDay,
})
})
},
ReservesCountMonth(month){
App.Reserve.ReservesCountMonth({
sid:this.sellerid,
month:month
}).then(res=>{
let ReservesCountMonth=[];
if(res.ret==200){
res.data.forEach(v=>{
ReservesCountMonth.push(v>=1?1:0)
})
}
this.setData({
ReservesCountMonth:ReservesCountMonth,
})
})
},
clickMonth(e){
this.ReservesCountMonth(e.detail.currentYear+'-'+e.detail.currentMonth);
},
gotoday(e){
this.ReservesCountMonth(e.detail.date.substr(0,7));
}
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nothingBook":"/components/book/nothing/nothing",
"bookList":"/components/book/list/list",
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"calendar": "plugin://bmCalendar/calendar",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<nav id="nav">订座</nav>
<view class="page">
<block wx:if="{{isloading==true}}">
<view class="book-page bg_white">
<view class="book-search flex-lr">
<view class="flex-ll book-search-left">
<image src="http://qn.colorcun.com/custom/lite-yd/image/search.png" class="search-icon"></image>
<input placeholder="桌位/客户姓名/手机号" placeholder-class="font30r gray-font smooth" class="font30r black-font smooth search-input" value="{{keywords}}" bindinput="searchinput" confirm-type="search" bindconfirm="searchbook"/>
</view>
<view bindtap="exportFile" class="exportFile flex-vc">
<image src="http://qn.colorcun.com/custom/lite-yd/image/export.png" class="search-icon"></image>
<view>导出</view>
</view>
</view>
<view class="search-easy flex-lr">
<formids class="block flex-vc" bindtap="calendarShow">
<view class="flex-vc" >
<view class="green-font font34r font-bold flex-cc">{{dateStr}}</view>
</view>
</formids>
<view class="block section flex-vc">
<view class="tab flex-cc">
<formids class="item flex-vc {{form.time==0?'checked':''}}"
wx:if="{{timePickerArray[0].length>0}}"
bindtap="selectedValue" data-key="time" data-value="0">早市</formids>
<formids class="item flex-cc {{form.time==1?'checked':''}}"
wx:if="{{timePickerArray[1].length>0}}"
bindtap="selectedValue" data-key="time" data-value="1">午市</formids>
<formids class="item flex-cc {{form.time==2?'checked':''}}"
wx:if="{{timePickerArray[2].length>0}}"
bindtap="selectedValue" data-key="time" data-value="2">晚市</formids>
</view>
</view>
</view>
</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>
</view>
<block wx:if="{{!bookList}}">
<nothingBook height="{{listHeight}}"></nothingBook>
</block>
<block wx:else>
<view bindcsroll="onPullDownRefresh" class="bg_white">
<view class="book-list-thead flex-lr font34r black-font">
<view>桌号</view>
<view class="flex-cc">客户姓名</view>
<view class="flex-cc" bindtap="timeorder">时间<image src="http://qn.colorcun.com/custom/lite-yd/image/direction.png" class="icon22-26" background-size="cover"></image></view>
<view class="flex-rr">操作</view>
</view>
<view class="book-list" style="padding-bottom:118rpx;">
<view class="book-list-body">
<block wx:for="{{bookList}}" wx:key="bookList.key">
<bookList item="{{item}}" class="orderbook"></bookList>
</block>
</view>
</view>
</view>
</block>
</block>
</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="clickMonth"
bindprevMonth="clickMonth"
bindselectDate="dateChange"
bindgotoday="gotoday"
colored="#199095"
circle_show="{{true}}"
mystatus="{{ReservesCountMonth}}"
dotcolor-o="dotcolor-o"
dotcolor-t="dotcolor-t"
allshow="{{true}}"
></calendar>
</view>
</view>
\ No newline at end of file
... ...
page{
background:#efeef3;
}
.page{
width: 100%;
margin: 0;
overflow: hidden;
}
.book-page{
width:100%;
padding-top:20rpx;
}
.book-search{
width:675rpx;
height:80rpx;
margin:0 auto;
}
.book-search-left{
width:590rpx;
height:80rpx;
border-radius:40rpx;
box-shadow: 0 0 8px #ccc;
margin:0 auto;
margin-bottom:10rpx;
}
.search-icon{
width:40rpx;
height:40rpx;
margin-left:30rpx;
}
.search-input{
width:520rpx;
height:100%;
padding:10rpx;
box-sizing:border-box;
}
.book-list-thead{
width:100%;
height:120rpx;
padding:0 40rpx;
box-sizing:border-box;
font-weight:400;
border-bottom: 2rpx solid #F1F0F4;
}
.book-list-thead>view{
width:25%;
}
.icon22-26{
width:22rpx;
height:26rpx;
margin-left:8rpx;
}
.book-list-body{
width:100%;
height:auto;
box-sizing:border-box;
}
.book-list-cut{
height:66rpx;
background:#F5F5F5;
padding-left:44rpx;
font-size: 26rpx;
line-height: 66rpx;
}
.book-list-cut text{
margin-right: 50rpx;
}
.border-line{
width:670rpx;
height:1px;
background:#efeef3;
margin:0 auto;
}
.search-easy{
height:80rpx;
padding:20rpx 0;
}
.search-easy .block{
width: 50%;
min-width: 50%;
height: 100%;
}
.search-easy .block:first-child{
border-right: 1px solid #E0E0E0;
}
.section .tab{
font-size: 34rpx;
color: #199095;
height: 50rpx;
}
.section .tab .item{
height: 50rpx;
line-height: 49rpx;
width: 94rpx !important;
min-width: 94rpx !important;
border-radius: 10rpx;
border: 2rpx solid #199095;
margin-right: 16rpx;
text-align: center;
display: block;
}
.section .tab .item:after{
padding-right: 5rpx;
}
.section .tab .checked{
background-color:#199095;
color: #FEFEFE;
}
.exportFile{
font-size: 26rpx;
color:#353535;
}
.exportFile image{
width: 32rpx;
height: 32rpx;
margin: 0 auto 8rpx;
}
@import "common/calendar.wxss";
\ No newline at end of file
... ...
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
var bookOrder=require('../../utils/bookCommon.js')
const {regeneratorRuntime} = global
Page({
data:{
grand:[
{
sex:1,
grand_title:'先生',
isselect:true
},
{
sex:2,
grand_title:'女士',
isselect:false
}
],
name:'',
sex:1,
phone:'',
remark:'',
buttonhide:true,
pnum:'6'
},
onLoad:function(opt){
wx.removeStorage({
key:'tableid',
})
wx.removeStorage({
key:'tabletype',
})
util.setBarTitle('录入订座信息');
var selectmonth=opt.date.split('-')[0][0]=='0' ? opt.date.split('-')[0][1] : opt.date.split('-')[0];
var selectday=opt.date.split('-')[1][0]=='0' ? opt.date.split('-')[1][1] : opt.date.split('-')[1];
console.log(opt)
var stringTime =opt.year+'-'+opt.date+' ' +opt.time+':00';
console.log(stringTime)
var time=bookOrder.gettimestamp(stringTime);
console.log(time)
this.setData({
thisyear:opt.year,
selectdate:selectmonth+'月'+selectday+'日',
time_dur:opt.time,
sellerid:util.cache('sellerid'),
time:time,
pnum:util.cache('order_pnum') ? util.cache('order_pnum') : this.data.pnum,
})
this.getdesklist();
},
onShow:function(){
var that=this;
if(util.cache('tableid')){
var tables=util.cache('tableid');
var templist=this.data.templist;
var showdesk=[];
for(var i=0;i<tables.length;i++){
templist.forEach(function(r,n){
if(tables[i]==r.id){
r.isselect=true;
if(r.tid==2){
r.name=r.name.length>4 ? r.name.slice(0,3)+'...' : r.name;
showdesk.unshift(r);
}else {
r.name=r.name.length>4 ? r.name.slice(0,3)+'...' : r.name;
showdesk.push(r);
}
}
})
}
this.setData({
showdesk:showdesk.slice(0,2)
})
}
if(util.cache('tableid') && util.cache('tableid').length>0){
if(this.data.name!='' && this.data.phone!='' && !this.data.reminder){
this.setData({
buttonhide:false
})
}
}
util.postSuccessFun=function(json,uri_code){
switch (uri_code) {
case uri.CGI_USER_SETRESERVEINFO__CODE:
wx.hideLoading()
if(json.ret==200){
wx.reLaunch({
url:util.http_build_query(json.data,'b_detail')
})
}
break;
case uri.CGI_USER_GETTABLELIST__CODE:
console.log('xxxx',json.data);
var list=json.data;
var templist=[];
for(var key in list){
if(key!='typex' && key!='typey'){
list[key].list.forEach(function(v,i){
templist.push(v)
})
}
}
var tempsan=[];
var tempbao=[];
var showdesk=[];
var temp={};
templist.forEach(function(v,i){
v.name=v.name.length>4 ? v.name.slice(0,3)+'...' : v.name;
if(!v.r_status){
if(v.tid==2){
tempbao.push(v);
v.isselect=false;
showdesk.unshift(v);
}else{
tempsan.push(v);
v.isselect=false;
showdesk.push(v);
}
}
if(v.tid==2){
if(!temp.hasOwnProperty("tabletype_2")){
temp['tabletype_2']=true
}
}else{
if(!temp.hasOwnProperty("tabletype_1")){
temp['tabletype_1']=true
}
}
})
util.cache('tabletype',temp);
console.log(showdesk)
that.setData({
sancount:list.typex, //typex散座
baocount:list.typey, //typey包间
showdesk:showdesk.slice(0,2),
templist:templist
})
break;
}
}
},
changetime:function(){
wx.navigateBack()
},
selectgrand:function(e){
var sex=e.currentTarget.dataset.sex;
console.log(sex)
var grandlist=this.data.grand;
grandlist.forEach(function(v,i){
v.isselect=false;
if(v.sex==sex){
v.isselect=true;
}
})
this.setData({
grand:grandlist,
sex:sex
})
},
condition:function(e){
var name=this.data.name;
var phone=e.detail.value;
var regExp = /^(86)?((13\d{9})|(15[0,1,2,3,5,6,7,8,9]\d{8})|(18[0,5,6,7,8,9]\d{8}))$/
if(!(regExp.test(phone))){
this.setData({
reminder:'手机格式不正确'
})
}else{
this.setData({
reminder:null
})
}
if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){
this.setData({
buttonhide:false
})
}
},
changename:function(e){
this.setData({
name:e.detail.value
})
},
changephone:function(e){
this.setData({
phone:e.detail.value
})
},
changeremark:function(e){
this.setData({
remark:e.detail.value
})
},
ifAll:function(){
var name=this.data.name;
var phone=this.data.phone;
if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){
this.setData({
buttonhide:false
})
}
},
formsubmit:async function(){
wx.showLoading({
title:'正在预定',
mask:true
});
console.log(this.data.time)
var formData={
sid:this.data.sellerid,
tid:util.cache('tableid').toString(),
rname:this.data.name, //姓名
phone:this.data.phone, //手机号
sex:this.data.sex, //性别
pnum:this.data.pnum, //人数
rdate:this.data.time, //时间
cusdem:this.data.remark //备注
}
try{
let enter_params=util.cache('enter_params');
let manager_id=enter_params.manager_id;
if(manager_id){
let sc=(await App.Reserve.SellerInfo(enter_params)).data
let managers=sc.manager;
managers.forEach(man=>{
if(manager_id==man.id){
formData.cusman_id=man.id;
formData.cusman=man.user_name;
formData.cusman_phone=man.user_phone?man.user_phone:'';
formData.cusman_account=man.user_wechat?man.user_wechat:'';
}
})
}
let man=managers[mansIndex];
if(man){
App.Reserve.SetReserveCusman({
rid:this.data.bookInfo.id,
cusman_id:man.id,
cusman:man.user_name,
cusman_phone:man.user_phone?man.user_phone:'158777556369',
cusman_account:man.user_wechat?man.user_wechat:'',
});
}
}catch (e){}
console.log(formData)
util.post(uri.CGI_USER_SETRESERVEINFO,formData,uri.CGI_USER_SETRESERVEINFO__CODE)
},
changepnum:function(e){
console.log(e)
this.setData({
pnum:e.detail
})
this.getdesklist();
},
selectdesk:function(){
wx.navigateTo({
url:'b_desk?pnum='+this.data.pnum+'&year='+this.data.thisyear+'&date='+this.data.selectdate+'&time_dur='+this.data.time_dur
})
},
getdesklist:function(){
util.post(uri.CGI_USER_GETTABLELIST,{sid:this.data.sellerid,pnum:parseInt(this.data.pnum),rdate:this.data.time},uri.CGI_USER_GETTABLELIST__CODE)
},
binddesk:function(e){
var id=e.currentTarget.dataset.id;
var tables=util.cache('tableid') ? util.cache('tableid') : [];
var showdesk=this.data.showdesk;
showdesk.forEach(function(v,i){
if(v.id==id){
if(v.isselect==true){
var thisindex=tables.indexOf(id);
tables.splice(thisindex,1)
}else{
tables.push(id)
}
v.isselect=!v.isselect
}
})
util.cache('tableid',tables);
this.setData({
showdesk:showdesk
})
var name=this.data.name;
var phone=this.data.phone;
if(name!='' && !this.data.reminder && phone!='' && util.cache('tableid')){
this.setData({
buttonhide:false
})
}
}
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"selectPeople":"/components/book/people/people",
"step":"/components/book/step/step",
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<nav>点餐商户端</nav>
<step step="1"></step>
<view class="other-info flex-lr">
<view class="selected-time flex-vc" bindtap="changetime">
<view class="font30r black-font">时间</view>
<view class="actual-time green-font font34r">{{selectdate}} {{time_dur}}</view>
</view>
<selectPeople bind:changepnum="changepnum" pnum="{{pnum}}"></selectPeople>
</view>
<view class="border-line"></view>
<view class="advice-desk flex-lr">
<view class="black-font font30r">桌位</view>
<view>
<view class="font26r gray-deep-font flex-rr">(包间余{{baocount}}个,散座余{{sancount}}个)</view>
<view class="advice-desk-detail flex-rr">
<block wx:for="{{showdesk}}">
<block wx:if="{{item.tid==2}}">
<view class="order-desk-info {{item.isselect==true ? 'desk-active' : ''}}" bindtap="binddesk" data-id="{{item.id}}" data-type="{{item.tid}}">
<view class="flex-vc order-desk-detail">
<view class="font28r black-font smooth">{{item.name}}</view>
<view class="font26r black-font" style="margin-top:6rpx;">{{item.table_pnum}}人</view>
</view>
<view class="order-desk-type flex-cc white-font font20r">包间</view>
</view>
</block>
<block wx:else>
<view class="order-desk-info {{item.isselect==true ? 'desk-active' : ''}}" bindtap="binddesk" data-id="{{item.id}}" data-type="{{item.tid}}">
<view class="flex-vc order-desk-detail" style="height:100%;">
<view class="font28r black-font smooth">{{item.name}}</view>
<view class="font26r black-font" style="margin-top:6rpx;">6人</view>
</view>
</view>
</block>
</block>
<view class="flex-rr advice-more" bindtap="selectdesk">
<view style="padding-right:30rpx;" 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>
</view>
<view class="cut"></view>
<view class="book-info" style="margin-bottom: 205rpx;">
<view class="book-info-single flex-lr" style="align-items:flex-start;">
<input placeholder="请输入预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{name}}" bindinput="changename" bindblur="ifAll"/>
<view class="book-info-grand flex-rr font28r gray-deep-font">
<block wx:for="{{grand}}">
<view class="book-grand flex-cc {{index==0 ? 'book-grand-border' : ''}} {{item.isselect==true ? 'book-grand-active white-font' : ''}}" bindtap="selectgrand" data-sex="{{item.sex}}">{{item.grand_title}}</view>
</block>
</view>
</view>
<view class="book-info-single flex-lr" style="align-items:flex-start;">
<input placeholder="请输入预订人手机号码(必填)" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11" bindblur="condition" bindinput="changephone" value="{{phone}}" style="color:{{reminder ? '#E14553' : '#353535'}};width:{{reminder ? 400 : 680}}rpx;"/>
<block wx:if="{{reminder}}">
<view class="flex-rr" style="height:100rpx;">
<view style="color:#E14553;" class="font28r">{{reminder}}</view>
<image src="http://qn.colorcun.com/custom/lite-yd/image/name-have.png" class="phone-reminder"></image>
</view>
</block>
</view>
<view class="book-info-single">
<input placeholder="请输入顾客要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{remark}}" bindinput="changeremark"/>
</view>
</view>
<view class="zhanwei">
<view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view>
</view>
\ No newline at end of file
... ...
view{
line-height:1.2;
}
.other-info{
width:100%;
height:220rpx;
padding:20rpx 0;
box-sizing:border-box;
}
.selected-time{
width:375rpx;
height:100%;
border-right:1px solid #efeef3;
box-sizing:border-box;
}
.actual-time{
margin-top:30rpx;
}
.border-line{
width:680rpx;
height:1px;
background:#efeef3;
margin:0 auto;
}
.advice-desk{
width:680rpx;
height:auto;
padding:40rpx 0;
margin:0 auto;
}
.advice-desk-detail{
margin-top:30rpx;
}
.order-desk-info{
width:120rpx;
height:120rpx;
background:#EBF8F8;
border:1px solid #199095;
border-radius:10rpx;
position:relative;
overflow:hidden;
margin-right:40rpx;
}
.desk-active{
background:#A9E3E6;
}
.order-desk-detail{
width:100%;
height:90rpx;
}
.order-desk-type{
width:100%;
height:30rpx;
background:#199095;
position:absolute;
left:0;
bottom:0;
}
.advice-more{
padding:20rpx 0;
padding-left:30rpx;
}
.cut{
width:100%;
height:4px;
background:#efeef3;
}
.book-info{
width:680rpx;
padding-top:20rpx;
margin:0 auto;
}
.book-info-single{
width:100%;
height:120rpx;
padding-top:80rpx;
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;
}
.phone-reminder{
width:32rpx;
height:32rpx;
margin-left:20rpx;
}
.zhanwei{
width:100%;
height:170rpx;
background:#efeef3;
position:fixed;
left:0;
right:0;
bottom:0;
z-index: 99;
}
.confirm-button{
width:680rpx;
height:85rpx;
background:#199095;
margin:42rpx auto 0;
border-radius:10rpx;
opacity:.6;
}
.confirm-button-active{
opacity:1;
}
\ No newline at end of file
... ...
// pages/manager-invitation/review.js
import util from '../../utils/util';
import App from '../../utils/api';
import TP from '../../utils/tpls';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
height: 667,
current: 0,
tpls: TP.tpls(),
seller:{
name:'',
room:'',
date:util.unixtoTime(new Date()/1000,'YYYY/MM/DD 星期WW HH:II'),
addr:'',
hasOwner:true,
},
options:{},
},
detail:{},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
options.tplid=options.tplid||1;
let param={
options:options,
}
if(true){
param.tpls=[TP.tpls(options.tplid)]
}
this.setData(param)
this.initData(options);
},
initData(options){
App.Reserve.Detail({rid:options.id,openid:''}).then(res=>{
this.detail=res.data;
let tables=[];
res.data.tables.forEach(t=>{
tables.push(t.name);
})
this.setData({
seller:{
name:res.data.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,
hasOwner:true,
}
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//导航栏自适应
let systemInfo = wx.getSystemInfoSync();
let reg = /ios/i;
let pt = 20;//导航状态栏上内边距
let h = 44;//导航状态栏高度
if (reg.test(systemInfo.system)) {
pt = systemInfo.statusBarHeight;
h = 44;
} else {
pt = systemInfo.statusBarHeight;
h = 48;
}
this.setData({
statusBarHeight: pt,
titleBarHeight: h,
height: systemInfo.windowHeight
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
let path=util.http_build_query({
...this.data.options,
fromid:getApp().openid,
hasSellerShare:1,
hasInvitation:1,
},'/pages/customer/index')
return {
title: this.data.tpls[this.data.current].shareFirstTitle,
path: path,
imageUrl:this.data.tpls[this.data.current].shareFirstImage,
}
},
swiperChange(e){
let current=e.detail.current
this.setData({
current:current,
[`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
})
},
switchTabs(e){
let current=util.attr(e,'current')
this.setData({
current:current,
[`seller.date`]:util.unixtoTime(new Date()/1000,this.data.tpls[current].timeStr)
})
},
sendmsg(){
if (!this.detail.phone) {
util.toast('未填写手机号码', 'none')
return;
} else if (!/^1\d{10}$/.test(this.detail.phone)) {
util.toast('手机号码错误', 'none')
return;
}
wx.navigateTo({
url: '/pages/book/b_sms?id=' + this.detail.id
});
},
gotoDetail(){
wx.redirectTo({
url: '/pages/book/b_detail?id=' + this.detail.id
});
}
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"userinfo-share": "/components/userinfo/share"
}
}
\ No newline at end of file
... ...
<import src="../tpl/invitation"></import>
<swiper
indicator-dots="{{false}}"
autoplay="{{false}}"
duration="{{500}}"
bindchange="swiperChange"
current="{{current}}"
style="height:{{height}}px;"
>
<block wx:for="{{tpls}}" wx:key="tpls.key">
<swiper-item>
<view class="pages bg-{{item.id}} flex-vc" style="height:{{height}}px;width:100%;">
<template is="tpl-{{item.id}}" data="{{seller,options}}"></template>
</view>
</swiper-item>
</block>
</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 style="min-width: 100rpx;" class="flex-ll">
<image class="back-image"
src="http://qn.colorcun.com/custom/lite-yd/image/back-light.png"></image>
</view>
</formids>
<block wx:if="{{false}}" wx:for="{{tpls}}" wx:key="tpls.key">
<view class="item {{index==current?'active':''}}" bindtap="switchTabs" data-current="{{index}}">{{item.name}}</view>
</block>
</view>
</view>
<view class="bottom flex-lr">
<formids bindclick="sendmsg" class="sendmsg">
发短信
</formids>
<userinfo-share binduserinfo="share" class="share Semibold">
通知客户
</userinfo-share>
</view>
<!--//商务-->
<template name="tpl-1">
<view class="flex-vc shangwu" bindtap="{{options.rid?'goEditor':''}}">
<template is="tpl-shangwu" data="{{...seller,options}}"></template>
</view>
</template>
<!--//温馨-->
<template name="tpl-2">
<template is="tpl-wenxin" data="{{...seller,options}}"></template>
</template>
\ No newline at end of file
... ...
@import "../manager-invitation/tpls.wxss";
.pages{
background-size: 100%;
font-size: 34rpx;
}
.tabs{
}
.tabs .item{
font-size: 32rpx;
color:#999999;
margin-left: 20rpx;
padding: 0 10rpx;
height: 66rpx;
line-height: 66rpx;
}
.tabs .item.active{
font-size: 36rpx;
font-weight: bold;
color: #E9D9B7;
border-bottom: 2rpx solid #E9D9B7;
}
image{
width: 100%;
height: 100%;
}
.buts-share{
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E5%8F%91%E9%82%80%E8%AF%B7%E5%87%BD.png");
}
.buts-share.customer{
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E7%A1%AE%E8%AE%A4%E6%94%B6%E5%88%B0.png");
}
.shangwu{
margin-top: 52rpx;
}
.shangwu .seller{
margin-bottom: 42rpx;
}
.shangwu .invit-logo.owner{
width: 380rpx;
height: 200rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92.png");
}
.shangwu .invit-logo.customer{
width: 352rpx;
height: 164rpx;
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/invit-logo.png");
}
.wenxin-mask{
margin-top: 20rpx;
}
.wenxin-baitou{
margin-top: 20rpx;
}
.wenxin .seller{
margin-bottom: 22rpx;
}
.wenxin .invit-logo.owner{
width: 340rpx;
height: 184rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx2/%E9%A2%84%E8%AE%A2%E5%AE%89%E6%8E%92-%E6%B8%A9%E9%A6%A8.png");
}
.wenxin .invit-logo.customer{
width: 344rpx;
height: 198rpx;
background-image: url("http://qn.colorcun.com/manager-invitation/wx/%E9%82%80%E8%AF%B7%E5%87%BD.png");
}
.back{
margin-left: 40rpx;
}
.back-image{
height: 32rpx;
width: 18rpx;
}
.bottom{
position: fixed;
bottom: 0;
height: 98rpx;
line-height: 98rpx;
border-top: 2rpx solid #ECD9B7;
background-color: #ECD9B7;
width: 100%;
}
.bottom .sendmsg{
background-color: #262628;
width: 30%;
min-width: 30%;
color: #ECD9B7;
font-size: 30rpx;
}
.bottom .share{
text-align: center;
width: 70%;
font-size: 36rpx;
color: #794F28;
}
\ No newline at end of file
... ...
// pages/book/b_setting.js
var util = require('../../utils/util.js')
var bookOrder=require('../../utils/bookCommon.js')
import App from '../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
dateStr:'',
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' }
],
regions:[],
regions_active:'',
time:-1,
speciallist:[],
calendar:{
nextNum:0,
},
rdate:'',
},
regions:[],
sellerid:0,
timePickerArray:[
[],
[],
[],
],
/**
* 生命周期函数--监听页面加载
*/
onLoad: async function (options) {
let d=new Date()/1000;
let dateStr=util.unixtoTime(d,'MM-DD DAY');
let timePickerArray= await bookOrder.getDayTimeSpace();
let speciallist=[
{ date: util.unixtoTime(d,'YYYY-MM-DD'), background: '', text:'今 天' },
{ date: util.unixtoTime(d+86400,'YYYY-MM-DD'), background: '', text: '明 天' },
{ date: util.unixtoTime(d+86400*2,'YYYY-MM-DD'), background: '', text: '后 天' },
];
this.setData({
dateStr:dateStr,
timePickerArray:timePickerArray,
speciallist:speciallist,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: async function () {
this.setData({
height:getApp().system.windowHeight-170,
})
setTimeout(()=>{
this.setData({
calendarMaskLoad:true,
})
},1000);
this.selectComponent('#nav').init();
this.sellerid=util.cache('sellerid');
App.Tables.GetTableListsBySellerId({
sellerid:this.sellerid
}).then((res)=>{
this.regions=res.data[0];
this.getbooklist();
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
calendarShow(){
console.log('xxxxx')
this.setData({
calendarMask:true
})
console.log(this.data.calendarMask)
},
dateChange(event){
let cktime=util.timetouUnix(event.detail.date)
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({
dateStr:util.unixtoTime(cktime,'MM-DD `DAY/周WW`'),
[changeDay]: clickDay,
[changeBg]: "#84e7d0",
})
this.getbooklist();
this.calendarClose();
},
calendarClose(){
this.setData({
calendarMask:false
})
},
async getbooklist(){
let obj={};
let formdata={};
formdata.sid=this.sellerid;
formdata.x=1;
formdata.y=200;
let time=0;
if(this.data.time<0){
let sid=await bookOrder.getTimeSpaceIndexData();
time=sid.timeIndex
obj.time=time;
}else{
time=this.data.time;
}
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time);
formdata.rdate=rdate;
formdata.status='1,2';
obj.rdate=rdate;
let tids={};
let reserves=await App.Reserve.GetReserveList(formdata);
if(reserves.data.length>0){
reserves.data.forEach(r=>{
let ts=r.tid.split(',');
ts.forEach(tid=>{
let rname='';
if(r.sex==3){
rname=r.rname.substr(0,10)
}else{
rname=r.rname.substr(0,1)+(r.sex==1?'先生':'女士')
}
tids[tid]={
rdate:r.rdate,
id:r.id,
status:r.status,
rname:rname,
}
})
})
}
console.log('tids',tids);
let regions=[];
this.regions.forEach(region=>{
if(region.list.length>0){
let list_num=0;
region.list.forEach(tb=>{
tb.status_str='';
tb.status_classname='enabled'
tb.reserve_name=''
tb.reserve_id=''
if(tb.status!=0 && tb.status!=""){
tb.status_str='用餐中';
tb.status_classname='highlight';
tb.reserve_name=tb.spell==1?'拼桌':'堂食';
}else if(tids[tb.id]){
console.log('tids',region.name,tb.name);
tb.status_str=tids[tb.id].status==2?'用餐中':'已预订';
tb.status_classname='highlight';
tb.reserve_id=tids[tb.id].id;
tb.reserve_name=tids[tb.id].rname;
}
if(tb.enable!=1){
if(tb.status_str){
tb.status_classname='disabled-highlight';
}else{
tb.status_str='已停用';
tb.status_classname='disabled';
}
}
if(!tb.status_str){
list_num++;
}
region.list_num=list_num;
})
regions.push(region);
}
})
obj.regions=regions
if(!this.data.regions_active){
obj.regions_active=this.regions[0].name
}
this.setData(obj)
},
chooseRegion(e){
this.setData({
regions_active:util.attr(e,'name')
})
},
selectedValue(e){
this.setData({
time:util.attr(e,'value')
})
this.getbooklist();
},
boardEvent(e){
console.log(e);
App.Tables.GetTableListsBySellerId({
sellerid:this.sellerid
},true).then((res)=>{
this.regions=res.data[0];
this.getbooklist();
})
},
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
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"calendar": "plugin://bmCalendar/calendar",
"board":"/components/book/board/board",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/b_setting.wxml-->
<nav id="nav">桌位</nav>
<view class="page">
<view class="search-easy flex-lr">
<formids class="block flex-vc" bindtap="calendarShow">
<view class="flex-vc">
<view class="green-font font34r font-bold flex-cc">{{dateStr}}</view>
</view>
</formids>
<view class="block section flex-vc">
<view class="tab flex-cc">
<formids class="item {{time==0?'checked':''}} flex-cc"
wx:if="{{timePickerArray[0].length>0}}"
bindtap="selectedValue" data-key="time" data-value="0">早市</formids>
<formids class="item {{time==1?'checked':''}} flex-cc"
wx:if="{{timePickerArray[1].length>0}}"
bindtap="selectedValue" data-key="time" data-value="1">午市</formids>
<formids class="item {{time==2?'checked':''}} flex-cc"
wx:if="{{timePickerArray[2].length>0}}"
bindtap="selectedValue" data-key="time" data-value="2">晚市</formids>
</view>
</view>
</view>
<view class="flex-lr disks">
<view class="menus Medium" style="height: {{height}}px;">
<view class="menu flex-cc {{regions_active==item.name?'active':''}}"
wx:for="{{regions}}" wx:key="regions.key"
bindtap="chooseRegion" data-name="{{item.name}}">
<view class="menu-text">{{item.name}}</view>
<view class="last-num {{item.list_num>0?'':'full'}}">{{item.list_num>0?'余'+item.list_num:'满座'}}</view>
</view>
</view>
<view class="items" style="height: {{height}}px;">
<block wx:for="{{regions}}" wx:key="regions.key">
<view class="items-disks flex-ll" style="flex-wrap: wrap"
wx:if="{{regions_active==item.name}}">
<board width="160" height="180" board="{{item}}"
ddate="{{rdate}}"
style="margin: 20rpx 0 0 20rpx"
bindboardEvent="boardEvent"
event="boardOpt"
wx:for="{{item.list}}" wx:key="item.key" ></board>
</view>
</block>
</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>
... ...
/* pages/book/b_setting.wxss */
.page{
width: 100%;
margin: 20rpx 0 0;
overflow: hidden;
}
.search-easy{
height:80rpx;
}
.search-easy .block{
width: 50%;
min-width: 50%;
height: 100%;
}
.search-easy .block:first-child{
border-right: 1px solid #E0E0E0;
}
.section .tab{
font-size: 34rpx;
color: #199095;
height: 50rpx;
}
.section .tab .item{
height: 50rpx;
line-height: 49rpx;
width: 94rpx !important;
min-width: 94rpx !important;
border-radius: 10rpx;
border: 2rpx solid #199095;
margin-right: 16rpx;
text-align: center;
display: block;
}
.section .tab .checked{
background-color:#199095;
color: #FEFEFE;
}
@import "common/calendar.wxss";
.disks{
width: 100%;
border-top: 1rpx solid #E0E0E0;
margin-top: 14rpx;
background-color: #F5F5F5;
}
.disks .menus,.disks .items{
overflow-y: auto;
}
.disks .menus{
background-color: #fefefe;
width: 168rpx;
min-width: 168rpx;
color: #999999;
}
.disks .menu{
height: 160rpx;
overflow: hidden;
border-left: 4rpx solid #fefefe;
border-bottom: 1rpx solid #F5F5F5;
position: relative;
}
.disks .menu.active{
background-color: #F5F5F5;
border-left: 4rpx solid #199095;
color: #199095;
}
.disks .menu-text{
font-size: 30rpx;
width: 120rpx;
margin: 0 auto;
max-height: 84rpx;
line-height: 42rpx;
overflow: hidden;
}
.disks .items{
width: 100%;
}
.disks .items-disks{
margin: 0 auto;
width: 570rpx;
padding-bottom: 80rpx;
}
.disks .menu .last-num{
position: absolute;
right: 0rpx;
top:0rpx;
width: 78rpx;
height: 30rpx;
line-height: 30rpx;
font-size: 24rpx;
color: #FEFEFE;
background-color: #61A5D1;
text-align: center;
}
.disks .menu .last-num.full{
background-color: #999999;
}
\ No newline at end of file
... ...
// 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 './b_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({
/**
* 页面的初始数据
*/
tplsIndex: 'SMS_163050401',
data: {
bookInfo: {},
tplMsg: ''
},
sc:{},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (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);
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
bookInfo: null,
async getDetail(id){
let res=await App.Reserve.Detail({rid: id, openid: ''});
this.bookInfo=res.data
let tplMsg=await ST.getTplMsg(res.data,this.sc.setting.template_code,this.sc)
this.setData({
bookInfo: res.data,
tplMsg: tplMsg
})
},
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) => {
if (res.ret != 200) {
return util.toast(res.msg, 'none');
}
util.toast('短信已发送');
this.setData({
hideSendsms: true,
})
App.Reserve.SmsInfo({seller_id: this.bookInfo.seller.id}, 'clear')
})
},
copysms(){
wx.setClipboardData({
data: this.data.tplMsg
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nav":"/components/nav/nav"
}
}
\ No newline at end of file
... ...
<!--pages/book/b_sms.wxml-->
<nav>发送短信</nav>
<view class="page">
<view class="tip">已自动生成通知短信,可直接发送</view>
<textarea class="tpl" auto-height value="{{tplMsg}}" maxlength="-1" disabled>
</textarea>
<button class="sms-but send" bindtap="sendsms" hidden="{{hideSendsms}}">直接发送</button>
<button class="sms-but copy" plain bindtap="copysms">复制短信</button>
</view>
... ...
/* pages/book/b_sms.wxss */
.page{
width: 90%;
margin: 60rpx 5% 0;
font-size: 30rpx;
}
.tip{
margin-bottom: 34rpx;
}
.tpl{
border: solid 2rpx #999999;
border-radius: 10rpx;
width: 90%;
padding: 5%;
margin-bottom: 200rpx;
}
.sms-but,.sms-but[plain]{
margin-bottom: 18rpx;
border: solid 2rpx #199095;
font-size: 34rpx;
height: 84rpx;
line-height: 84rpx;
}
.sms-but.send{
background-color: #199095;
color:#fff;
}
.sms-but.copy{
color:#199095;
}
\ No newline at end of file
... ...
// pages/book/b_sms.js
import App from '../../utils/api';
import util from '../../utils/util';
import bcm from '../../utils/bookCommon';
const {regeneratorRuntime} = global
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}期待您的光临!',
SMS_164277855:'贵宾您好!${seller_name}为您预留${date}的${region_room_name};\n电话:${seller_phone},预祝用餐愉快!',
SMS_164268239:'贵宾您好!${seller_name}为您预留${date}的${region_room_name};\n地址:${seller_addr},电话:${seller_phone},预祝用餐愉快!',
};
module.exports ={
tpls:tpls,
getTableName(tables){
let bao = [], san = [];
tables.forEach(t => {
if (t.tid == 2) {
bao.push(t.name);
} else {
san.push(t.name);
}
})
let str = '';
if (bao.length > 0) {
str = '包厢(' + bao.join('、') + ')';
}
if (san.length > 0) {
str += san.join('、');
}
str = str.substr(0, 20);
if (str.indexOf('(') > -1 && str.indexOf(')') < 0) {
str = str.substr(0, 19) + ')';
}
return str;
},
getTableNameBSK(tables){
let bsk={
1:'散座',
2:'包间',
3:'卡台',
}
let ts={};
tables.forEach(t => {
ts[t.tid]=typeof ts[t.tid]=='undefined'?[]:ts[t.tid];
ts[t.tid].push(t.name);
})
let str = '';
Object.keys(ts).forEach(tid => {
str += bsk[tid]+'('+ts[tid].join('、')+')、';
});
let mxl=str.length-1;
str=str.substr(0,mxl>20?20:mxl);
return str;
},
getTableNameOne(tables){
let bao = [];
tables.forEach(t => {
bao.push(t.name);
})
return bao.join('、');
},
getTableNameShort(tables){//短桌位
let str=tables[0].name;
if(tables.length>1){
str+='等'+tables.length+'个';
}
return str;
},
async getTplMsg(bookInfo,tplcode='SMS_163050401',sc=null){
let smsData = {}
let txa=['早上','中午','晚上']
let tx=await bcm.getTimeSpaceIndexData(bookInfo.rdate,sc);
if(!bookInfo.rdateStr){
bookInfo.rdateStr=util.unixtoTime(bookInfo.ddate, "MM月DD日 HH:II")
}
switch (tplcode) {
//尊敬的贵宾,您好!(4月6日)(中午)的用餐,为您安排在(好又多复兴路店)(202)房间,(王丽娜)期待您的光临,预祝就餐愉快!
case 'SMS_162733710':
smsData = {
reserve_date: util.unixtoTime(bookInfo.rdate,'MM月DD日')
.replace(/0(\d)/g,function($0,$1){
return $1;
})+' '+txa[tx.timeIndex],
seller_name_addr_room: sc.seller.selleralias+this.getTableNameShort(bookInfo.tables).substr(0, 20),
cusman: (bookInfo.cusman || bookInfo.seller.sellername).substr(0, 20),
}
break;
case 'SMS_163050401':
smsData = {
seller_name: bookInfo.seller.sellername.substr(0, 20),
date: bookInfo.rdateStr.replace('日','日'+txa[tx.timeIndex]),
region_room_name: this.getTableNameOne(bookInfo.tables).substr(0, 20),
seller_addr: (bookInfo.seller.real_address || bookInfo.seller.map_address).substr(0, 20),
seller_phone: bookInfo.seller.phone.substr(0, 20),
cusman: (bookInfo.cusman||'').substr(0, 20),
}
break;
case 'SMS_164277855'://短店名+无地址
smsData = {
seller_name: sc.seller.selleralias.substr(0, 20),
date: bookInfo.rdateStr.replace('日','日'+txa[tx.timeIndex]),
region_room_name: this.getTableNameBSK(bookInfo.tables),
seller_phone: bookInfo.seller.phone.substr(0, 20),
}
break;
case 'SMS_164268239'://店名+地址
smsData = {
seller_name: bookInfo.seller.sellername.substr(0, 20),
date: bookInfo.rdateStr.replace('日','日'+txa[tx.timeIndex]),
region_room_name: this.getTableNameBSK(bookInfo.tables),
seller_addr: (bookInfo.seller.real_address || bookInfo.seller.map_address).substr(0, 20),
seller_phone: bookInfo.seller.phone.substr(0, 20),
}
break;
default:
let guest = '';
if (bookInfo.sex == 3) {
guest = '贵宾'
} else {
guest = bookInfo.rname.substr(0, 1) + (bookInfo.sex == 1 ? '先生' : '女士')
}
smsData = {
guest: guest,
seller_name: bookInfo.seller.sellername.substr(0, 20),
date: bookInfo.rdateStr,
region_room_name: this.getTableName(bookInfo.tables),
reserve_pnum: (bookInfo.pnum || bookInfo.pnum_str) + '人',
seller_addr: (bookInfo.seller.real_address || bookInfo.seller.map_address).substr(0, 20),
seller_phone: bookInfo.seller.phone.substr(0, 20),
cusman: (bookInfo.cusman || bookInfo.seller.sellername).substr(0, 20),
cusman_phone: (bookInfo.cusman_phone || bookInfo.seller.phone).substr(0, 20),
code: bookInfo.code,
}
break;
}
let tpl = this.tpls[tplcode];
this.smsData = smsData;
tpl = tpl.replace(/\${([^}]+)}/ig, function ($0, $1) {
//console.log($0, $1);
return smsData[$1];
})
return tpl
},
}
\ No newline at end of file
... ...
.calendar-mask{
position: fixed;
z-index: 99;
width: 100%;
height: 100%;
left:0;
top:0;
background-color: rgba(0,0,0,.5);
}
.calendar {
background-color: #fefefe;
position: absolute;
bottom: 0;
width: 100%;
height: 720rpx;
}
.calendar-header{
background: #199095 ;
color: #fff;
}
.weektitle-style {
background-color: #199095;
color: #4fcfcf;
}
.restcolor-style{
color:orange !important;
}
.active-coloro {
color: #fff!important;
background: #199095;
}
.active-colort {
color: #fff!important;
background: #b8d5eb;
}
.txt-style{
margin-top: -24rpx;
color: #199095;
}
.datefont-style{
color: #199095;
}
.todaybtn-style{
line-height: 30rpx!important;
width: 60rpx!important;
height: 60rpx!important;
padding: 20rpx;
color: #fff!important;
background-color: #199095!important;
position: absolute;
bottom: 10rpx; right: 60rpx;
}
/* 出勤 */
.dotcolor-o{
background-color: #ff3333!important;
top: 20rpx!important;
left: 70%!important;
width: 10rpx!important;
height: 10rpx!important;
}
/* 未出勤 */
.dotcolor-t{
background-color: #fefefe!important;
}
\ No newline at end of file
... ...
// pages/book/setting/index.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
import PubSub from '../../../utils/PubSub'
Page({
offset: 0,
limit: 10,
hasMore: true,
list:{},
/**
* 页面的初始数据
*/
data: {
list:[],
hasMore:true,
hasSalesman:false,
},
/**
* 生命周期函数--监听页面加载
*/
enter_params: {},
onLoad: function (options) {
this.enter_params = util.cache('enter_params');
if(this.enter_params){
App.Reserve.SellerInfo(this.enter_params).then(res=>{
this.setData({
hasSalesman:res.data.hasSalesman==1
})
})
}
this.seller_id=options.seller_id||this.enter_params.seller_id;
this.getMembers();
App.Reserve.GetNewCustomerTotal({},'clean');
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
onUnload(){
PubSub.emit(
'flushNewCustomer',
[]
)
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.getMembers(true);
}
},
getMembers(hasReachBottom=false){
App.Reserve.Members({
sid: this.seller_id||'xxxx',
//manager_id:this.enter_params.manager_id,
//manager_openid:this.enter_params.seller_openid,
offset: this.offset,
limit: this.limit,
}).then(res => {
let list = this.data.list;
let dl=res.data.length;
if (dl > 0) {
res.data.forEach(r => {
//r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II')
list.push(r)
this.list[r.id] = r;
})
}
let obj={list:list};
if(dl<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}else{
this.offset+=this.limit;
}
this.setData(obj)
})
},
sendSalesmanMsg(e){
let openid=util.attr(e,'openid')
App.Reserve.OperationalMessagePush({
openid:openid
}).then(res=>{
if(res.ret!=200){
return util.toast(res.msg,'none')
}
util.toast('已发送')
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/setting/index.wxml-->
<nav id="nav" backgroundColor="#199095" color="#fefefe">我的客户</nav>
<view class="pages">
<block wx:if="{{list.length>0}}">
<view class="row flex-lr" wx:for="{{list}}" wx:key="list.key" >
<view class="flex-ll">
<view class="avatar">
<image src="{{item.headimgurl}}"></image>
</view>
<view class="nickname">{{item.nickname||''}}</view>
</view>
<view class="flex-rr optmsg" wx:if="{{hasSalesman}}" bindtap="sendSalesmanMsg" data-openid="{{item.openid}}">
<view>发送消息</view>
<view class="more"></view>
</view>
</view>
</block>
<view wx:else="" class="history-is-empty flex-vc Medium">
<image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image>
<view>暂时还没有客户</view>
</view>
<view wx:if="{{!hasMore}}" class="row flex-vc">已经到底了</view>
</view>
... ...
/* pages/book/setting/index.wxss */
/*
http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
*/
.pages{
width: 90%;
margin: 0 auto 50rpx;
color: #353535;
overflow-y: auto;
}
.row{
font-size: 34rpx;
height: 106rpx;
border-bottom: 2rpx solid #F1F0F4;
padding-top: 34rpx;
}
.row .right{
font-size: 30rpx;
color:#999999;
}
.row .more{
margin-left: 20rpx;
}
.row:last-child{
border-bottom-width: 0;
}
.history-is-empty{
margin: 200rpx auto;
font-size: 34rpx;
}
.history-is-empty image{
width: 376rpx;
height: 310rpx;
margin-bottom: 122rpx;
}
.avatar{
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
}
.avatar image{
width: 100%;
height: 100%;
}
.nickname{
margin-left: 40rpx;
font-size: 34rpx;
}
.optmsg{
font-size: 30rpx;
color:#199095;
}
\ No newline at end of file
... ...
import util from '../../../utils/util';
import App from '../../../utils/api';
Page({
data:{
alllabel:[
],
},
onLoad:function(){
this.getlabellist();
},
onShow:function(){
},
inputremark:function(e){
this.setData({
defineremark:util.trim(e.detail.value)
})
},
//选择常用备注
taplabel:function(e){
var _target=e.currentTarget.dataset;
var oftenlabel=0,alllabel=this.data.alllabel;
alllabel.forEach(function(v,i){
if(v.often_use!=''){
oftenlabel++;
}
})
if(_target.type=='often'){
this.setlabel(_target.id,_target.type);
}else{
if(oftenlabel<10){
this.setlabel(_target.id,_target.type);
}else{
wx.showToast({
title:'最多可添加10个',
icon:'none',
duration:2000
})
}
}
},
getlabellist:function(){
App.User.GetCustomRemark({
uid:util.cache('enter_params')['manager_id']
}).then(res=>{
console.log(res)
this.setData({
alllabel:res.data,
})
this.setData({
focus:true,
})
})
},
setlabel:function(id,flag){
App.User.GetCustomRemark({
uid:util.cache('enter_params')['manager_id'],
kid:id,
flag:flag,
}).then(res=>{
console.log(res)
this.setData({
alllabel:res.data
})
})
},
addinputlabel:function(e){
this.setData({
focus:false
})
if(util.trim(e.detail.value)!=''){
this.addlabel(util.trim(e.detail.value))
}
},
//添加自定义标签
addlabel:function(custom){
App.User.AddCustomRemark({
uid:util.cache('enter_params')['manager_id'],
custom:custom,
}).then(res=>{
console.log(res)
if(res.ret==200){
this.setData({
defineremark:null,
})
this.getlabellist();
}else{
this.setData({
defineremark:null,
})
wx.showToast({
title:'最多可添加20个备注',
icon:'none',
duration:2000
})
}
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<nav id="nav">常用备注</nav>
<view class="cut"></view>
<view class="label">
<view class="label-title black-font font30r smooth" style="padding-bottom:40rpx;">我的常用备注<text class="font24r smooth gray-deep-font">(最多添加10个)</text></view>
<view class="label-list flex-rs me-label-list">
<block wx:for="{{alllabel}}">
<block wx:if="{{item.often_use!=''}}">
<view class="label-single-all flex-ll bg_green" data-id="{{item.id}}" data-type="often" bindtap="taplabel">
<view class="white-font label-single flex-cc font28r smooth">{{item.custom}}</view>
<view style="height:40rpx;border-left:1px solid rgba(255,255,255,.3);padding:0 8rpx;" class="flex-cc"><image src="../../image/close.svg" class="close"></image></view>
</view>
</block>
</block>
<view style="min-width:176rpx;"><input class="black-font flex-cc font28r smooth label-input flex-cc" placeholder="添加备注" maxlength="10" style="width:{{defineremark && defineremark.length>4 ? (defineremark.length-4)*28+160 : 160}}rpx;" value="{{defineremark}}" bindinput="inputremark" focus="{{focus}}" cursor-spacing="160" bindblur="addinputlabel" placeholder-style="color:#999;font-size:28rpx;text-align:center;"/></view>
</view>
<view class="label-title black-font font30r smooth">所有备注<text class="font24r smooth gray-deep-font">(最多添加20个)</text></view>
<view class="label-list flex-rs">
<block wx:for="{{alllabel}}">
<view class="label-single flex-cc font28r smooth {{item.often_use!='' ? 'bg_green white-font' : 'all-label green-font'}}" data-id="{{item.id}}" data-type="{{item.often_use!='' ? 'often' : 'custom'}}" bindtap="taplabel" style="margin:0 16rpx 20rpx 0;">{{item.custom}}</view>
</block>
</view>
</view>
\ No newline at end of file
... ...
.label{
width:100%;
padding:0 30rpx;
box-sizing: border-box;
}
.label-title{
width:100%;
padding:30rpx 0;
}
.me-label-list{
padding-bottom: 10rpx;
border-bottom:1px solid #eee;
margin-bottom:40rpx;
}
.label-single-all{
height:56rpx;
margin:0 16rpx 20rpx 0;
border-radius:8rpx;
overflow:hidden;
}
.label-single{
height:56rpx;
padding:0 24rpx;
border-radius:8rpx;
}
.label-input{
width:160rpx;
height:56rpx;
box-sizing: border-box;
border:1px solid #ccc;
max-width:400rpx;
min-width:140rpx;
margin:0 16rpx 20rpx 0;
border-radius:8rpx;
text-align:center;
padding:0 10rpx;
}
.all-label{
box-sizing: border-box;
border:1px solid rgba(25,144,149,.3);
}
.close{
width:18rpx;
height:18rpx;
}
\ No newline at end of file
... ...
// pages/book/setting/index.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
import PubSub from '../../../utils/PubSub'
Page({
/**
* 页面的初始数据
*/
data: {
NewCustomerTotal:0,
},
/**
* 生命周期函数--监听页面加载
*/
enter_params: {},
onLoad: function (options) {
this.enter_params = util.cache('enter_params');
App.Reserve.SellerInfo(this.enter_params).then(res => {
this.setData({
seller: res.data.seller,
user: res.data.seller_user
})
})
PubSub.on(
'flushNewCustomer',
data=>{
console.log('flushNewCustomer',data)
this.selectComponent('#tabBar').hasDot();
}
)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Reserve.SmsInfo({seller_id: this.enter_params.seller_id}).then(res => {
if (res.ret == 404) {
res.data = {
last_num: 100,
meals: [
{id: 1, total: 550, price_ave: 0.09, price_old: 50, price: 50, discount: 0},
{id: 2, total: 1200, price_ave: 0.083, price_old: 100, price: 100, discount: 0},
{id: 3, total: 3650, price_ave: 0.082, price_old: 328, price: 300, discount: 9.1},
],
};
}
this.setData({
sms: res.data,
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
NewCustomer(e){
this.setData({
NewCustomerTotal:e.detail.total
})
}
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/setting/index.wxml-->
<nav id="nav" backgroundColor="#199095" color="#fefefe">订座</nav>
<view class="header">
<view class="info">
<view class="nick">{{user.nick_name || user.nickname}}</view>
<view class="seller Medium">{{seller.sellername}} | {{user.role_name||''}}</view>
</view>
</view>
<view class="page">
<formids url="/pages/book/setting/sms">
<view class="row flex-lr">
<view>短信管理</view>
<view class="flex-rr">
<view class="right lastNum">剩余{{sms.last_num||0}}条</view>
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/book/smsbatch/index">
<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/book/crm/index">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>我的客户</view>
<view class="flex-rr">
<text class="right" wx:if="{{NewCustomerTotal>0}}" style="color: #F05522;">新增{{NewCustomerTotal}}位</text>
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/book/remark/index">
<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>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
<formids url="/pages/manager-invitation/index">
<view class="row flex-lr" style="padding-top: 34rpx;">
<view>切换到客户经理模式</view>
<view class="flex-rr">
<view class="more"></view>
</view>
</view>
</formids>
</view>
<tabBar bindNewCustomer="NewCustomer" id="tabBar"></tabBar>
... ...
/* pages/book/setting/index.wxss */
/*
http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
*/
.header{
height: 302rpx;
background-color: #199095;
margin-top: -2rpx;
}
.header .info{
color:#FEFEFE;
width: 90%;
padding-top: 86rpx;
margin: 0 auto;
}
.header .info .nick{
font-size: 44rpx;
font-weight: bold;
margin-bottom: 28rpx;
}
.header .info .seller{
font-size: 34rpx;
}
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 34rpx;
padding-bottom: 120rpx;
}
.row{
font-size: 34rpx;
height: 106rpx;
line-height: 106rpx;
border-bottom: 2rpx solid #F1F0F4;
}
.row .right{
font-size: 30rpx;
color:#999999;
height: 42rpx;
line-height: 42rpx;
}
.row .more{
margin-left: 20rpx;
}
\ No newline at end of file
... ...
// pages/book/setting/sms.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
seller_id:'',
},
/**
* 生命周期函数--监听页面加载
*/
seller_id:0,
onLoad: function (options) {
if(!options.seller_id){
let enter_params=util.cache('enter_params');
options.seller_id=enter_params.seller_id;
}
this.seller_id=options.seller_id;
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
App.Reserve.SmsInfo({seller_id:this.seller_id}).then(res=>{
if(res.ret==404){
res.data={
last_num:100,
meals:[
{id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0},
{id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0},
{id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1},
],
};
}
this.setData({
seller_id:this.seller_id,
sms:res.data,
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/setting/sms.wxml-->
<nav id="nav" backgroundColor="#199095" color="#fefefe" hasHome>短信管理</nav>
<view class="header">
<view class="info flex-vc">
<view class="nick">短信余量</view>
<view class="last flex-lr">
<view class="lastNum">{{sms.last_num||0}}</view>
<view class="lastNum-txt">条</view>
</view>
<formids class="button" url="/pages/book/setting/sms_buy?seller_id={{seller_id}}">
<view class="txt Semibold">立即充值</view>
<view class="icon-cz">特惠</view>
</formids>
</view>
</view>
<view class="page">
<view class="line">
<view>常见问题说明</view>
</view>
<view class="action">
<view class="tip Medium">1.短信计费</view>
<view class="item">短信计费统一根据三大运营商标注计算;</view>
<view class="item">当短信内容字符数≤70,短信按照一条计费;</view>
<view class="item">当短信内容字符数>70个字符时,按照每70个字符 为一条短信;</view>
</view>
<view class="action">
<view class="tip Medium">2.短信统计</view>
<view class="item">短信统计只统计计费短信,与订单数量无关,一个订 单可能会发送多条短信,则计费时按照多条短信计费;</view>
</view>
<view class="action">
<view class="tip Medium">3.充值说明</view>
<view class="item">短信统一在订座商户小程序上进行充值,充值记录和 详细使用情况统一在小程序上查看;</view>
</view>
</view>
... ...
/* pages/book/setting/sms.wxss */
/*
http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png
http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png
*/
.header{
height: 402rpx;
background-color: #199095;
margin-top: -2rpx;
}
.header .info{
color:#FEFEFE;
width: 90%;
padding-top: 86rpx;
margin: 0 auto;
}
.header .info .nick{
font-size: 34rpx;
margin-bottom: 10rpx;
}
.header .info .last{
height: 66rpx;
line-height: 66rpx;
}
.header .info .last .lastNum{
font-size: 48rpx;
font-weight: bold;
margin-right: 10rpx;
}
.header .info .last .lastNum-txt{
font-size: 30rpx;
}
.header .info .button{
margin-top: 76rpx;
position: relative;
background-color: #FEFEFE;
height: 80rpx;
width: 240rpx;
line-height: 75rpx;
border-radius: 10rpx;
color:#199095;
text-align: center;
}
.header .info .button .icon-cz{
width: 74rpx;
height: 40rpx;
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/icon-cz.png");
background-size: 100%;
position: absolute;
top:-10rpx;
right:-6rpx;
font-size: 24rpx;
color: #FEFEFE;
line-height: 35rpx;
text-align: center;
}
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 28rpx;
font-size: 28rpx;
color: #353535;
}
.action{
padding-bottom: 30rpx;
border-bottom: 2rpx solid #F1F0F4;
margin-bottom: 30rpx;
}
.action .tip{
margin-bottom: 22rpx;
}
.action .item:before{
content: '·';
padding: 10rpx;
}
.action:last-child{
border-bottom-width: 0;
}
.line{
height: 40rpx;
width: 80%;
margin: 42rpx auto 0;
border-top: 2rpx solid #E0E0E0;
position: relative;
}
.line view{
background-color: #FEFEFE;
width: 248rpx;
margin: -22rpx auto 0;
text-align: center;
}
\ No newline at end of file
... ...
// pages/book/setting/sms_buy.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
form:{},
},
/**
* 生命周期函数--监听页面加载
*/
hasScene:false,
onLoad: function (options) {
//转化场景值到 options
if(options.scene){//扫码进入
let query=decodeURIComponent(options.scene);
query.split('&').forEach(q=>{
let _q=q.split('=');
options[_q[0]]=_q[1];
})
this.hasScene=true
}
if(!options.seller_id){
let enter_params=util.cache('enter_params');
options.seller_id=enter_params.seller_id;
}
App.Reserve.SmsInfo({seller_id:options.seller_id}).then(res=>{
if(res.ret==404){
res.data={
last_num:100,
meals:[
{id:1,total:550,price_ave:0.09,price_old:50,price:50,discount:0},
{id:2,total:1200,price_ave:0.083,price_old:100,price:100,discount:0},
{id:3,total:3650,price_ave:0.082,price_old:328,price:300,discount:9.1},
],
};
}
this.setData({
seller_id:options.seller_id,
sms:res.data,
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
chooseMeal(e){
this.setData({
form:{
meal_id:util.attr(e,'id'),
price:util.attr(e,'price'),
seller_id:this.data.seller_id
}
})
},
buy(){
if(!this.data.form.meal_id) return;
let prarms={
sellerid: this.data.form.seller_id,
//price:this.data.form.price,
price:0.01,
meal_id:this.data.form.meal_id,
openid:getApp().openid,
}
App.Reserve.SmsBuy(prarms).then(res=>{
let pay=res.data;
wx.requestPayment({
'timeStamp': pay.timeStamp,
'nonceStr': pay.nonceStr,
'package': pay.package,
'signType': 'MD5',
'paySign': pay.paySign,
'success':(payRes)=>{
if(payRes){
App.Reserve.SmsInfo({seller_id:prarms.sellerid},'clear');
wx.showToast({
title: '支付成功',
icon: 'loading',
duration: 1000,
mask:true,
success:()=> {
setTimeout(()=>{
if(this.hasScene){
wx.redirectTo({
url:'/pages/book/setting/sms?seller_id='+prarms.sellerid
});
}else{
wx.navigateBack();
}
},1500)
}
})
}
},
'fail':function(res){
wx.showToast({
title: '已取消支付',
icon: 'loading',
duration: 1000,
mask:true,
})
}
})
});
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/setting/sms_buy.wxml-->
<nav id="nav" hasHome>短信充值</nav>
<view class="page">
<view class="title Medium">短信套餐</view>
<view class="subtitle">购买套餐,使用更划算</view>
<block wx:for="{{sms.meals}}" wx:key="sms.meals.key">
<view class="block {{form.meal_id==item.id?'checked':''}} flex-vc"
data-id="{{item.id}}" data-price="{{item.price}}"
bindtap="chooseMeal">
<view class="flex-lr info">
<view class="left">
<view class="count Medium">{{item.total}}条</view>
<view class="price-pre">约{{item.price_ave}}元/条</view>
</view>
<view class="right">
<view class="price Medium">¥{{item.price}}</view>
<view class="price-old" wx:if="{{item.price_old && item.price_old>item.price}}">¥{{item.price_old}}</view>
</view>
</view>
<view class="icon-zk Medium" wx:if="{{item.discount>0 && item.discount<10}}">{{item.discount}}折</view>
</view>
</block>
</view>
<view class="button-view flex-vc {{form.price>0?'active':''}}">
<view class="page flex-lr" style="padding-top: 0;">
<view class="tip" wx:if="{{form.price>0}}">{{form.price}}元</view>
<view class="tip" wx:else="">剩余{{sms.last_num}}条短信,请及时充值以保证正常使用</view>
<view class="button Medium" bindtap="buy">购买</view>
</view>
</view>
... ...
/* pages/book/setting/sms_buy.wxss */
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 28rpx;
font-size: 30rpx;
color: #353535;
}
.title{
font-size: 40rpx;
height: 56rpx;
line-height: 56rpx;
margin-bottom: 20rpx;
}
.subtitle{
font-size: 30rpx;
margin-bottom: 30rpx;
}
.block{
border: 2rpx solid #999999;
border-radius: 10rpx;
height: 172rpx;
position: relative;
margin-bottom: 38rpx;
}
.block .icon-zk{
width: 104rpx;
height: 54rpx;
background-image: url("http://qn.colorcun.com/custom/lite-yd/image/icon-zk.png");
background-size: 100%;
position: absolute;
top:-10rpx;
right:-6rpx;
font-size: 34rpx;
color: #FEFEFE;
line-height: 48rpx;
text-align: center;
}
.block .info{
width: 90%;
}
.block .count{
font-size: 40rpx;
height: 56rpx;
line-height: 56rpx;
margin-bottom: 10rpx;
}
.block .price-pre{
font-size: 34rpx;
height: 48rpx;
line-height: 48rpx;
}
.block .price{
font-size: 40rpx;
height: 56rpx;
line-height: 56rpx;
font-weight: bold;
}
.block .price-old{
font-size: 34rpx;
height: 48rpx;
line-height: 48rpx;
color: #999999;
text-decoration: line-through;
margin-top: -10rpx;
position: absolute;
}
.block .info .right{
position: relative;
width: 150rpx;
}
.block.checked{
border: 2rpx solid #199095;
background-color: #199095;
color:#FEFEFE;
}
.block.checked .price-old{
color:#efefef;
}
.button-view{
position: fixed;
bottom: 0;
height: 144rpx;
border-top: 2rpx solid #F1F0F4;
line-height: 144rpx;
width: 100%;
}
.button-view .button{
width: 190rpx;
min-width: 190rpx;
height: 80rpx;
line-height: 80rpx;
background-color: #75BCBF;
color:#FEFEFE;
font-size: 34rpx;
border-radius: 10rpx;
text-align: center;
}
.button-view .tip{
width: 100%;
height: 84rpx;
line-height: 42rpx;
}
.button-view.active .button{
background-color: #199095;
}
.button-view.active .tip{
font-size: 40rpx;
line-height: 84rpx;
font-weight: bold;
}
\ No newline at end of file
... ...
// pages/book/smsbatch/detail.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options',options)
this.getInfo(options.id)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
getInfo(id,flag=false){
App.Reserve.SmsBatchInfo({id: id},flag).then(res => {
this.setData({
item:res.data,
...res.data,
addtimeStr: util.unixtoTime(res.data.addtime, 'YYYY-MM-DD HH:II'),
sendertimeStr: util.unixtoTime(res.data.stime || '', 'YYYY-MM-DD HH:II'),
});
})
},
sendoff(){
this.getInfo(this.data.id,true)
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"service":"/components/book/smsbatch/service",
"sendsms":"/components/book/smsbatch/sendsms"
}
}
\ No newline at end of file
... ...
<!--pages/book/smsbatch/detail.wxml-->
<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">短信详情</nav>
<view class="page">
<view class="send_msg">{{send_msg}}</view>
<view class="rows flex-ll">
<view class="label">活动人数</view>
<view class="value Medium">{{send_total}}</view>
</view>
<view class="rows flex-ll">
<view class="label">创建时间</view>
<view class="value Medium">{{addtimeStr}}</view>
</view>
<view class="rows flex-ll">
<view class="label">创 建 人</view>
<view class="value Medium">{{note_name}}</view>
</view>
<view class="rows flex-ll">
<view class="label">联系姓名</view>
<view class="value Medium">{{name}}</view>
</view>
<view class="rows flex-ll">
<view class="label">联系电话</view>
<view class="value Medium">{{phone}}</view>
</view>
<block wx:if="{{sender}}">
<view class="rows rows-border"></view>
<view class="rows flex-ll">
<view class="label">发 放 人</view>
<view class="value Medium">{{sender||''}}</view>
</view>
<view class="rows flex-ll">
<view class="label">发放时间</view>
<view class="value Medium">{{sendertimeStr}}</view>
</view>
</block>
<view class="rows flex-ll">
<view class="label">短信状态</view>
<view class="value Medium">
<view class="sms-status{{status}}"></view>
</view>
</view>
<view class="rows flex-ll"></view>
<service wx:if="{{status==-1}}">
<view class="opt-but">联系客服</view>
</service>
<sendsms wx:if="{{status==1}}" bindsend="sendoff" item="{{item}}">
<view class="opt-but">立即发放</view>
</sendsms>
</view>
... ...
/* pages/book/smsbatch/detail.wxss */
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 28rpx;
font-size: 34rpx;
color: #353535;
}
.send_msg{
border: 1rpx solid #E0E0E0;
border-radius: 8rpx;
box-shadow: 0 2rpx 8rpx 0 #E0E0E0;
padding: 32rpx;
margin-bottom: 40rpx;
}
.rows{
height: 88rpx;
line-height: 88rpx;
}
.rows .label{
width: 180rpx;
color:#666;
}
.rows .value{}
.rows-border{
width: 100%;
background-color: #F1F0F4;
height: 2rpx;
margin: 43rpx 0;
}
.opt-but{
background-color: #199095;
height: 84rpx;
line-height: 84rpx;
color:#FEFEFE;
text-align: center;
border-radius: 10rpx;
}
.sms-status0:before{
content: '审核中';
color:#09BB07;
}
.sms-status1:before{
content: '已通过';
color:#353535;
}
.sms-status2:before{
content: '已发放';
color:#353535;
}
.sms-status-1:before{
content: '未通过';
color:#D0021B;
}
\ No newline at end of file
... ...
// pages/book/smsbatch/index.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
offset:0,
limit:30,
hasMore:true,
/**
* 页面的初始数据
*/
data: {
hasScene:0,
seller_id:'',
list:[],
hasMore:true,
height:350,
hiddenQuestion:true,
},
/**
* 生命周期函数--监听页面加载
*/
hasScene:0,
seller_id:'',
list:{},
onLoad: function (options) {
//转化场景值到 options
if(options.scene){//扫码进入
let query=decodeURIComponent(options.scene);
query.split('&').forEach(q=>{
let _q=q.split('=');
options[_q[0]]=_q[1];
})
this.hasScene=1
}
if(!options.seller_id){
let enter_params=util.cache('enter_params');
options.seller_id=enter_params.seller_id;
}
this.seller_id=options.seller_id;
this.setData({
hasScene:this.hasScene,
seller_id:this.seller_id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.SmsBatchList();
console.log('getApp().system',getApp().system);
this.setData({
height:getApp().system.windowHeight-370,
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.SmsBatchList(true);
}
},
SmsBatchList(hasReachBottom=false){
App.Reserve.SmsBatchList({
sid: this.seller_id,
offset: this.offset,
limit: this.limit,
status:'-1,0,1',
}).then(res => {
let list = [];
let dl=res.data.length;
if (dl > 0) {
res.data.forEach(r => {
r.addtimeStr=util.unixtoTime(r.addtime,'YYYY.MM.DD')
list.push(r)
this.list[r.id] = r;
})
}
let obj={list:list};
if(dl<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}
this.setData(obj)
})
},
showQuestion(){
this.setData({
hiddenQuestion:false,
})
},
hideQuestion(){
this.setData({
hiddenQuestion:true,
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"rows":"/components/book/smsbatch/rows",
"service":"/components/book/smsbatch/service"
}
}
\ No newline at end of file
... ...
<!--pages/book/smsbatch/index.wxml-->
<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">短信营销</nav>
<view class="header flex-vc">
<view class="info">
<view>流失客户召回,新老客户回馈</view>
<view style="margin-top: 10rpx;">沉默客户激活</view>
</view>
<formids url="./update?seller_id={{seller_id}}&hasScene={{hasScene}}">
<view class="button-create Semibold">立即创建</view>
</formids>
</view>
<view class="page" style="padding-top: 60rpx;">
<view class="title Medium flex-lr">
<view>短信记录</view>
<formids url="./list?seller_id={{seller_id}}&hasScene={{hasScene}}">
<view style="color: #999999;font-size: 30rpx;">历史记录</view>
</formids>
</view>
<view class="flex-vc">
<block wx:if="{{list.length>0}}">
<scroll-view
scroll-y
style="height: {{height}}px;"
bindscrolltoupper="upper"
bindscrolltolower="lower"
bindscroll="scroll"
scroll-into-view=""
scroll-top="0"
>
<view class="list-rows" wx:for="{{list}}" wx:key="list.key" style="width: 100%;">
<rows item="{{item}}" bindsendoff="SmsBatchList"></rows>
</view>
</scroll-view>
</block>
<view wx:else="" class="list-rows" style="font-size: 34rpx; margin-top: 35rpx;">暂无记录</view>
<view wx:if="{{!hasMore}}" class="list-rows">已经到底了</view>
</view>
</view>
<view class="bottom-opt flex-lr">
<view class="bottom-opt-but flex-cc">
<image src="http://qn.colorcun.com/custom/lite-yd/image/service.png" style="width: 40rpx;"></image>
<service><view class="txt">电话咨询</view></service>
</view>
<view class="bottom-opt-but flex-cc" bindtap="showQuestion">
<image src="http://qn.colorcun.com/custom/lite-yd/image/question.png"></image>
<view class="txt">常见问题</view>
</view>
</view>
<view class="question-mask" hidden="{{hiddenQuestion}}">
<view class="question page Medium">
<view class="que-title flex-vc Semibold">
<view>常见问题说明</view>
</view>
<view class="que-content">
<view class="block">
<view class="block-title">
1.营销攻略
</view>
<view class="block-desc">
<view>
· 短信营销步骤:第一步创建营销内容,第二步提交审核,第三步审核通过投放;
</view>
</view>
</view>
<view class="block">
<view class="block-title">
2.短信计费
</view>
<view class="block-desc">
<view>
· 短信字数=短信模版内容字数 + 签名字数;
</view>
<view>
<text decode="{{true}}">· 短信字数&lt;=70个字数,按照70个字数一条短信计算;</text>
</view>
<view>
<text decode="{{true}}">· 短信字数&gt;70个字数,即为长短信,按照67个字数记为一条短信计算;</text>
</view>
</view>
</view>
<view class="block">
<view class="block-title">
3.短信审核
</view>
<view class="block-desc">
<view>
· 应国家监管要求,短信营销内容需要进行审核,审核记过将以短信/电话的方式通知到您;
</view>
<view>
· 预计1个工作日完成审核;
</view>
<view>
· 审核工作时间:周一至周五9:00-23:00(法定节日顺延);
</view>
</view>
</view>
<view class="block">
<view class="block-title">
4.短信发放
</view>
<view class="block-desc">
<view>
· 短信发放时,需要有充足的短信余量,如果短信余量不足,将无法发送;
</view>
</view>
</view>
</view>
<view class="que-bottom">
<view class="opt-but Semibold" bindtap="hideQuestion">
关闭
</view>
</view>
</view>
</view>
... ...
/* pages/book/smsbatch/index.wxss */
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 28rpx;
font-size: 30rpx;
color: #353535;
}
.header{
height: 380rpx;
background-color: #199095;
margin-top: -2rpx;
color:#FEFEFE;
font-size: 34rpx;
}
.header .info view{
text-align: center;
}
.button-create{
height: 80rpx;
line-height: 80rpx;
width: 240rpx;
margin-top: 52rpx;
border-radius: 10rpx;
background-color: #fefefe;
color: #199095;
}
.history{
width: 100%;
background-color: #fefefe;
margin-top: 20rpx;
height: 340rpx;
}
.history .title{
height: 40rpx;
line-height: 40rpx;
}
.history .lists{
height: 300rpx;
}
.list-rows{
height: 140rpx;
line-height: 140rpx;
border-bottom: 2rpx solid #F1F0F4;
}
.list-rows:last-child{
border-bottom-width: 0;
}
.bottom-opt{
position: fixed;
bottom: 0;
height: 140rpx;
line-height: 140rpx;
background-color: #fefefe;
color:#199095;
width: 100%;
font-size: 28rpx;
}
.bottom-opt-but {
width: 50%;
line-height: 40rpx;
height: 40rpx;
text-align: center;
}
.bottom-opt-but:last-child{
border-left: 2rpx solid #199095;
}
.bottom-opt-but image{
width: 34rpx;
height: 34rpx;
}
.bottom-opt-but .txt{
margin-left: 18rpx;
}
.question-mask{
position: fixed;
bottom: 0;
top:0;
left: 0;
right:0;
background-color: rgba(13,13,13,0.5);
z-index: 9999;
}
.question{
background-color: #fefefe;
border-radius: 10rpx;
bottom: 190rpx;
position: fixed;
left:5%;
height: 834rpx;
font-size: 30rpx;
padding: 4%;
width: 82%;
}
.que-title{
font-size: 34rpx;
height: 100rpx;
}
.que-title view{
margin-top: 40rpx;
}
.que-bottom{
height: 160rpx;
}
.opt-but{
width: 300rpx;
background-color: #199095;
height: 80rpx;
line-height: 80rpx;
font-size: 34rpx;
color:#FFFFFF;
margin: 34rpx auto 0;
border-radius: 10rpx;
text-align: center;
}
.que-content{
height: 574rpx;
overflow-y: auto;
padding-top: 24rpx;
color:#666666;
font-size: 30rpx;
}
.block-title{
height: 42rpx;
line-height: 42rpx;
margin-bottom: 22rpx;
}
.block-desc{
line-height: 42rpx;
margin-bottom: 44rpx;
}
.block:last-child{
margin-bottom: 88rpx;
}
\ No newline at end of file
... ...
// pages/book/smsbatch/list.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
offset:0,
limit:10,
hasMore:true,
seller_id:0,
hasScene:0,
list:{},
/**
* 页面的初始数据
*/
data: {
list:[],
hasMore:true,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.seller_id=options.seller_id;
this.hasScene=options.hasScene;
this.SmsBatchList();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if(this.hasMore){
this.SmsBatchList(true);
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
SmsBatchList(hasReachBottom=false){
App.Reserve.SmsBatchList({
sid: this.seller_id,
offset: this.offset,
limit: this.limit,
status:'2',
}).then(res => {
let list = this.data.list;
let dl=res.data.length;
if (dl > 0) {
res.data.forEach(r => {
r.addtimeStr = util.unixtoTime(r.addtime, 'MM/DD HH:II')
list.push(r)
this.list[r.id] = r;
})
}
let obj={list:list};
if(dl<this.limit && hasReachBottom){
this.hasMore=false;
obj.hasMore=false;
}
this.setData(obj)
})
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids",
"rows":"/components/book/smsbatch/rows"
}
}
\ No newline at end of file
... ...
<!--pages/book/smsbatch/list.wxml-->
<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">历史记录</nav>
<view class="page">
<block wx:if="{{list.length>0}}">
<view class="list-rows" wx:for="{{list}}" wx:key="list.key" >
<rows item="{{item}}"></rows>
</view>
</block>
<view wx:else="" class="history-is-empty flex-vc Medium">
<image src="http://qn.colorcun.com/custom/lite-yd/image/history-is-empty.png"></image>
<view>暂时还没有历史记录</view>
</view>
<view wx:if="{{!hasMore}}" class="list-rows">已经到底了</view>
</view>
... ...
/* pages/book/smsbatch/list.wxss */
.page{
width: 90%;
margin: 0 auto;
color: #353535;
padding-top: 28rpx;
font-size: 30rpx;
color: #353535;
}
.list-rows{
height: 140rpx;
line-height: 140rpx;
border-bottom: 2rpx solid #F1F0F4;
}
.list-rows:last-child{
border-bottom-width: 0;
}
.title{
height: 48rpx;
line-height: 48rpx;
}
.history-is-empty{
margin: 200rpx auto;
font-size: 34rpx;
}
.history-is-empty image{
width: 376rpx;
height: 310rpx;
margin-bottom: 122rpx;
}
\ No newline at end of file
... ...
// pages/book/smsbatch/result.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
Page({
/**
* 页面的初始数据
*/
data: {
total: 0,
last_num:0,
},
/**
* 生命周期函数--监听页面加载
*/
options:{},
onLoad: function (options) {
console.log('options',options);
this.options=options
App.Reserve.SmsInfo({seller_id: options.seller_id}, true).then(res => {
this.setData({
total: parseInt(options.total),
last_num:parseInt(res.data.last_num),
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
goPay(){
wx.navigateTo({
url:'/pages/book/setting/sms_buy?scene='+encodeURI('seller_id='+this.options.seller_id)
})
},
back(){
wx.navigateBack();
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"white",
"usingComponents": {
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/smsbatch/result.wxml-->
<nav id="nav" hasHome backgroundColor="#199095" color="#fefefe">提交审核</nav>
<view class="page flex-vc Medium" style="padding-top: 24rpx; padding-bottom: 20rpx;">
<icon type="success" size="47" color="#199095" />
<view style="font-size: 34rpx;margin-bottom:30rpx;">短信已提交</view>
<view class="hr-one"></view>
<view>大约于1个工作日反馈结果</view>
<view>结果将以短信/电话方式通知您</view>
</view>
<block wx:if="{{total>last_num}}">
<view class="page flex-cc Medium" style="padding-top: 100rpx; padding-bottom: 100rpx;">
<view>本次群发{{total}}条,当前余额不足,建议</view>
<formids bindclick="goPay"><text style="color: #199095;font-size: 32rpx;">立即充值</text></formids>
</view>
</block>
<formids bindclick="back">
<view class="opt-but" >知道了</view>
</formids>
\ No newline at end of file
... ...
/* pages/book/smsbatch/result.wxss */
page{
background-color: #F5F5F5;
font-size: 30rpx;
color: #353535;
}
.page{
width: 88%;
margin: 20rpx auto;
padding: 20rpx 3%;
background-color: #FEFEFE;
border-radius: 8rpx;
}
.hr-one{
background-color: #F1F0F4;
width: 100%;
height: 2rpx;
margin-top: 16rpx;
margin-bottom: 38rpx;
}
.Medium{
line-height: 60rpx;
}
.opt-but{
border: 2rpx solid #199095;
border-radius: 10rpx;
color: #199095;
height: 80rpx;
line-height: 80rpx;
width: 240rpx;
margin: 140rpx auto;
}
\ No newline at end of file
... ...
// pages/book/smsbatch/update.js
import util from '../../../utils/util';
import App from '../../../utils/api';
const {regeneratorRuntime} = global
const form={
send_total:0,
send_msg:'',
name:'',
phone:'',
}
Page({
/**
* 页面的初始数据
*/
data: {
form:JSON.parse(JSON.stringify(form)),
options:{
hasScene:0,
seller_id:'',
},
totalChar:0,
totalSms:0,
buttonStatus:false,
},
reservePhonesMap:[],
reservePhones:[],
note_name:'',
note_phone:'',
/**
* 生命周期函数--监听页面加载
*/
options:{},
onLoad: async function (options) {
this.options=options;
let enter_params=util.cache('enter_params');
if(enter_params){
try{
let si=await App.Reserve.SellerInfo(enter_params);
this.note_name=si.data.seller_user.nick_name||si.data.seller_user.nickname;
this.note_phone=si.data.seller_user.phone;
}catch (e){}
}
App.Reserve.GetReservePhones({sid:options.seller_id}).then(res=>{
//this.reservePhones=res.data;
if(res.data.length>0){
let reservePhonesMap=[];
let reservePhones=[];
res.data.forEach(m=>{
if(/1[3-9]{1}[\d]{9}/.test(m.phone)){
reservePhonesMap.push(m);
reservePhones.push(m.phone);
}
})
this.reservePhonesMap=reservePhonesMap;
this.reservePhones=reservePhones.toString();
this.setData({
options:options,
[`form.send_total`]:reservePhonesMap.length,
[`form.name`]:this.note_name,
[`form.phone`]:this.note_phone,
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
formValue(e){
let key=util.attr(e,'key');
let form=this.data.form;
form[key]=util.val(e).trim();
let obj={
form:form,
}
if(key=='send_msg'){
obj.totalChar=form[key].length;
obj.totalSms=Math.ceil((form[key].length+3)/67);
}
obj.buttonStatus=false;
if(this.data.form.send_msg && this.data.form.name && this.data.form.phone){
obj.buttonStatus=true
}
this.setData(obj)
},
submit(e){
if(!this.data.buttonStatus) return;
if(this.data.form.send_total<1) {
return util.toast('活动人数为空','none');
}
if(!this.data.form.send_msg){
return util.toast('内容必须填写','none');
}
if(!this.data.form.name){
return util.toast('姓名必须填写','none');
}
if(!/^1[3-9]{1}[\d]{9}$/.test(this.data.form.phone)){
return util.toast('请填写正确手机号码','none');
}
let param={
...this.data.form,
send_phones:this.reservePhones,
sid:this.options.seller_id,
note_name:this.note_name,
}
if(this.options.hasScene==1){
param.note_name=e.detail.nickName
}
App.Reserve.SmsBatchUpdate(param).then(res=>{
this.options.id=res.data.id;
console.log('this.options.total',this.data.totalSms,this.reservePhonesMap.length)
this.options.total=this.data.totalSms*this.reservePhonesMap.length
wx.redirectTo({
url:util.http_build_query(this.options,'./result'),
});
});
},
})
\ No newline at end of file
... ...
{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle":"black",
"usingComponents": {
"userinfo":"/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
}
}
\ No newline at end of file
... ...
<!--pages/book/smsbatch/update.wxml-->
<nav id="nav" hasHome>短信营销</nav>
<view class="page">
<textarea class="textarea" bindinput="formValue"
maxlength="500"
data-key="send_msg" placeholder="请输入要发送的短信内容"></textarea>
<view class="sms-tip">
<block wx:if="{{totalChar>0}}">{{totalChar}}个字符,合{{totalSms}}条短信</block>
</view>
<view class="hr-one"></view>
<view class="sms-total Medium flex-lr">
<view>活动人数</view>
<view>{{form.send_total}}人</view>
</view>
</view>
<view class="page Medium linker" style="padding-bottom: 36rpx;">
<view class="flex-ll linker-title">
<view>联系方式</view>
<view style="font-size: 26rpx;">(审核结果会以电话/短信方式通知)</view>
</view>
<view class="hr-one"></view>
<input placeholder="请输入姓名" bindinput="formValue" data-key="name" value="{{form.name}}"/>
<view class="hr-one"></view>
<input placeholder="请输入电话" bindinput="formValue" data-key="phone" type="number" value="{{form.phone}}"/>
</view>
<view class="button-opt">
<block wx:if="{{options.hasScene==1}}">
<userinfo binduserinfo="submit">
<view class="but {{buttonStatus?'active':''}}">提交审核</view>
</userinfo>
</block>
<block wx:else="">
<view class="but {{buttonStatus?'active':''}}" bindtap="submit">提交审核</view>
</block>
</view>
\ No newline at end of file
... ...
/* pages/book/smsbatch/update.wxss */
page{
background-color: #F5F5F5;
font-size: 34rpx;
color: #353535;
}
.page{
width: 88%;
margin: 20rpx auto;
padding: 20rpx 3%;
background-color: #FEFEFE;
border-radius: 8rpx;
}
.hr-one{
background-color: #F1F0F4;
width: 100%;
height: 2rpx;
margin-top: 16rpx;
margin-bottom: 38rpx;
}
.sms-tip{
height: 60rpx;
line-height: 60rpx;
font-size: 26rpx;
margin-top: 42rpx;
}
.sms-total{
height: 48rpx;
line-height: 48rpx;
margin-bottom: 36rpx;
}
.linker-title{
height: 48rpx;
line-height: 48rpx;
margin-top: 16rpx;
}
.linker .hr-one{
margin-top: 36rpx;
margin-bottom: 36rpx;
}
.button-opt{
width: 90%;
margin: 98rpx auto 0;
}
.button-opt .but{
text-align: center;
height: 84rpx;
border-radius: 10rpx;
line-height: 84rpx;
background-color: #5AAEB1;
color:#FEFEFE;
}
.button-opt .but.active{
background-color: #199095;
}
.textarea{
height: 240rpx;
width: 100%;
}
\ No newline at end of file
... ...