Commit f750f45976230f846a7913c1c7d9b55d33a5f4e3

Authored by wangfan
1 parent 2025f457

v2 book

@@ -14,7 +14,8 @@ @@ -14,7 +14,8 @@
14 "pages/me/index", 14 "pages/me/index",
15 "pages/reservr/index", 15 "pages/reservr/index",
16 "pages/me/setting", 16 "pages/me/setting",
17 - "pages/me/list" 17 + "pages/me/list",
  18 + "pages/book/b_addnew"
18 ], 19 ],
19 "window": { 20 "window": {
20 "navigationStyle": "custom", 21 "navigationStyle": "custom",
  1 +// components/book/tabBar/tabBar.js
  2 +import util from '../../../utils/util'
  3 +Component({
  4 + /**
  5 + * 组件的属性列表
  6 + */
  7 + properties: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 组件的初始数据
  13 + */
  14 + data: {
  15 + pi:0,
  16 + },
  17 + attached(){
  18 + let pages=getCurrentPages();
  19 + let p=pages[pages.length-1];
  20 + let pi=['/pages/book/b_addnew','/pages/book/b_index','/pages/book/b_setting'];
  21 + for(let x in pi){
  22 + console.log('tabBar',pi[x],p);
  23 + if(pi[x].indexOf(p.route)>-1){
  24 + this.setData({
  25 + pi:x
  26 + })
  27 + break;
  28 + }
  29 + }
  30 + },
  31 + /**
  32 + * 组件的方法列表
  33 + */
  34 + methods: {
  35 + redirectTo(e){
  36 + let url=util.attr(e,'url');
  37 + let pages=getCurrentPages();
  38 + let p=pages[pages.length-1];
  39 + if(url.indexOf(p.route)<0){
  40 + wx.redirectTo({
  41 + url:url,
  42 + })
  43 + }
  44 + }
  45 + }
  46 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
  1 +<!--components/book/tabBar/tabBar.wxml-->
  2 +<view class="tabBar flex-cc">
  3 +
  4 + <view class="item flex-vc {{pi==0?'checked':''}}" bindtap="redirectTo" data-url="/pages/book/b_addnew">
  5 + <view class="icon reserve"></view>
  6 + <view class="text">
  7 + 订座
  8 + </view>
  9 + </view>
  10 + <view class="item flex-vc {{pi==1?'checked':''}}" bindtap="redirectTo" data-url="/pages/book/b_index">
  11 + <view class="icon book"></view>
  12 + <view class="text">
  13 + 预定本
  14 + </view>
  15 + </view>
  16 + <view class="item flex-vc {{pi==2?'checked':''}}" bindtap="redirectTo" data-url="/pages/book/b_setting">
  17 + <view class="icon setting"></view>
  18 + <view class="text">
  19 + 设置
  20 + </view>
  21 + </view>
  22 +</view>
  1 +/* components/book/tabBar/tabBar.wxss */
  2 +@import "../../../app.wxss";
  3 +.tabBar{
  4 + height: 118rpx;
  5 + background-color: #FEFEFE;
  6 + width:100%;
  7 + position: fixed;
  8 + bottom: 0;
  9 + border-top: 2rpx solid #ccc;
  10 + font-size: 24rpx;
  11 + color:#999999;
  12 + z-index: 9;
  13 +}
  14 +.tabBar .checked{
  15 + color: #353535;
  16 +}
  17 +.tabBar .item{
  18 + width: 33%;
  19 +}
  20 +.tabBar .icon{
  21 + width: 40rpx;
  22 + height: 40rpx;
  23 + margin-bottom: 10rpx;
  24 + background-size: 100%;
  25 +}
  26 +.tabBar .reserve{
  27 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-reserve.png");
  28 +}
  29 +.tabBar .checked .reserve{
  30 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-reserve-checked.png");
  31 +}
  32 +.tabBar .book{
  33 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-book.png");
  34 +}
  35 +.tabBar .book .reserve{
  36 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-book-checked.png");
  37 +}
  38 +.tabBar .setting{
  39 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-setting.png");
  40 +}
  41 +.tabBar .setting .reserve{
  42 + background-image: url("http://qn.colorcun.com/custom/lite-yd/image/seller-tabs-setting-checked.png");
  43 +}
  44 +
  1 +// pages/book/b_addnew.js
  2 +Page({
  3 +
  4 + /**
  5 + * 页面的初始数据
  6 + */
  7 + data: {
  8 +
  9 + },
  10 +
  11 + /**
  12 + * 生命周期函数--监听页面加载
  13 + */
  14 + onLoad: function (options) {
  15 +
  16 + },
  17 +
  18 + /**
  19 + * 生命周期函数--监听页面初次渲染完成
  20 + */
  21 + onReady: function () {
  22 +
  23 + },
  24 +
  25 + /**
  26 + * 生命周期函数--监听页面显示
  27 + */
  28 + onShow: function () {
  29 +
  30 + },
  31 +
  32 + /**
  33 + * 生命周期函数--监听页面隐藏
  34 + */
  35 + onHide: function () {
  36 +
  37 + },
  38 +
  39 + /**
  40 + * 生命周期函数--监听页面卸载
  41 + */
  42 + onUnload: function () {
  43 +
  44 + },
  45 +
  46 + /**
  47 + * 页面相关事件处理函数--监听用户下拉动作
  48 + */
  49 + onPullDownRefresh: function () {
  50 +
  51 + },
  52 +
  53 + /**
  54 + * 页面上拉触底事件的处理函数
  55 + */
  56 + onReachBottom: function () {
  57 +
  58 + },
  59 +
  60 + /**
  61 + * 用户点击右上角分享
  62 + */
  63 + onShareAppMessage: function () {
  64 +
  65 + }
  66 +})
  1 +{
  2 + "backgroundTextStyle":"light",
  3 + "navigationBarBackgroundColor": "#fff",
  4 + "navigationBarTextStyle":"black",
  5 + "usingComponents": {
  6 + "nothingBook":"/components/book/nothing/nothing",
  7 + "bookList":"/components/book/list/list",
  8 + "nav":"/components/nav/nav",
  9 + "tabBar":"/components/book/tabBar/tabBar"
  10 + }
  11 +}
  1 +<!--pages/book/b_addnew.wxml-->
  2 +<nav>录入订座信息</nav>
  3 +<view class="page">
  4 + <form bindsubmit="formSubmit" bindreset="formReset">
  5 + <view class="base-info">
  6 + <view class="section flex-ll">
  7 + <view class="label Medium">日期</view>
  8 + <view class="date">
  9 + 7月13日 周一
  10 + </view>
  11 + </view>
  12 + <view class="section flex-ll">
  13 + <view class="label Medium">时段</view>
  14 + <view class="tab">
  15 + <item class="item">
  16 + 早市
  17 + </item>
  18 + <item class="item">
  19 + 午市
  20 + </item>
  21 + <item class="item">
  22 + 晚市
  23 + </item>
  24 + </view>
  25 + </view>
  26 + <view class="section flex-ll">
  27 + <view class="label Medium">人数</view>
  28 + <view class="tab">
  29 + <item class="item">
  30 + 4人以下
  31 + </item>
  32 + <item class="item">
  33 + 5~9人
  34 + </item>
  35 + <item class="item">
  36 + 10人以上
  37 + </item>
  38 + </view>
  39 + </view>
  40 + <view class="section flex-ll">
  41 + <view class="label Medium">类型</view>
  42 + <view class="tab">
  43 + <item class="item">
  44 + 包间
  45 + </item>
  46 + <item class="item">
  47 + 散座
  48 + </item>
  49 + </view>
  50 + </view>
  51 + </view>
  52 +
  53 + <view class="page-full tables">
  54 +
  55 + </view>
  56 + <view class="book-info">
  57 + <view class="book-info-single flex-lr" style="align-items:flex-start;">
  58 + <input placeholder="请输入预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{name}}" bindinput="changename" bindblur="ifAll"/>
  59 + <view class="book-info-grand flex-rr font28r gray-deep-font">
  60 + <block wx:for="{{grand}}">
  61 + <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>
  62 + </block>
  63 + </view>
  64 + </view>
  65 + <view class="book-info-single flex-lr" style="align-items:flex-start;">
  66 + <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;"/>
  67 + <block wx:if="{{reminder}}">
  68 + <view class="flex-rr" style="height:100rpx;">
  69 + <view style="color:#E14553;" class="font28r">{{reminder}}</view>
  70 + <image src="../image/name-have.png" class="phone-reminder"></image>
  71 + </view>
  72 + </block>
  73 + </view>
  74 + <view class="book-info-single">
  75 + <input placeholder="请输入顾客要求(25字以内,选填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="25" value="{{remark}}" bindinput="changeremark"/>
  76 + </view>
  77 + </view>
  78 + <view class="page-full submit">
  79 + <view class="confirm-button white-font flex-vc font34r {{buttonhide==false ? 'confirm-button-active' : ''}}" bindtap="{{buttonhide==false ? 'formsubmit' : ''}}">确定</view>
  80 + </view>
  81 + </form>
  82 +</view>
  83 +<tabBar></tabBar>
  1 +/* pages/book/b_addnew.wxss */
  2 +.page{
  3 + width: 90%;
  4 + margin: 0 5%;
  5 +}
  6 +.base-info{
  7 +
  8 +}
  9 +.section{
  10 + height: 92rpx;
  11 + line-height: 92rpx;
  12 +
  13 +}
  14 +.section .label{
  15 + width: 60rpx;
  16 + font-size: 30rpx;
  17 + margin-right: 38rpx;
  18 +}
  19 +.section .date{
  20 + color: #199095;
  21 +}
  22 +.section .tab{
  23 + font-size: 34rpx;
  24 + color: #199095;
  25 +}
  26 +.section .tab .item{
  27 + height: 50rpx;
  28 + line-height: 50rpx;
  29 + width: 150rpx !important;
  30 + min-width: 150rpx !important;
  31 + border-radius: 10rpx;
  32 + border: 2rpx solid #199095;
  33 + margin-right: 26rpx;
  34 + text-align: center;
  35 + display: inline-block;
  36 +}
  37 +
  38 +
  39 +/**
  40 +可定桌位
  41 + */
  42 +.page-full{
  43 + width: 112%;
  44 + margin-left: -6%;
  45 + background-color: #F5F5F5;
  46 +}
  47 +.tables{
  48 +
  49 + height: 314rpx;
  50 + margin-top: 10rpx;
  51 +}
  52 +
  53 +
  54 +.book-info{
  55 + width:100%;
  56 + padding-top:20rpx;
  57 + margin:0 auto;
  58 +}
  59 +.book-info-single{
  60 + width:100%;
  61 + height:120rpx;
  62 + padding-top:80rpx;
  63 + border-bottom:1px solid #efeef3;
  64 +}
  65 +.book-info-single>input{
  66 + width:100%;
  67 + height:100rpx;
  68 +}
  69 +.book-info-grand{
  70 + height:50rpx;
  71 + border:1px solid #199095;
  72 + margin-top:20rpx;
  73 +}
  74 +.book-grand{
  75 + width:90rpx;
  76 + height:100%;
  77 + box-sizing:border-box;
  78 +}
  79 +.book-grand-active{
  80 + background:rgba(25,153,149,.8);
  81 +}
  82 +.book-grand-border{
  83 + border-right:1px solid #199095;
  84 +}
  85 +.phone-reminder{
  86 + width:32rpx;
  87 + height:32rpx;
  88 + margin-left:20rpx;
  89 +}
  90 +
  91 +
  92 +/**
  93 +提交按钮
  94 + */
  95 +.submit{
  96 + padding-top: 18rpx;
  97 + padding-bottom: 174rpx;
  98 +}
  99 +.confirm-button{
  100 + width:680rpx;
  101 + height:85rpx;
  102 + background:#199095;
  103 + margin:42rpx auto 0;
  104 + border-radius:10rpx;
  105 + opacity:.6;
  106 +}
  107 +.confirm-button-active{
  108 + opacity:1;
  109 +}
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 "usingComponents": { 5 "usingComponents": {
6 "nothingBook":"/components/book/nothing/nothing", 6 "nothingBook":"/components/book/nothing/nothing",
7 "bookList":"/components/book/list/list", 7 "bookList":"/components/book/list/list",
8 - "actButton":"/components/book/action/action",  
9 - "nav":"/components/nav/nav" 8 + "nav":"/components/nav/nav",
  9 + "tabBar":"/components/book/tabBar/tabBar"
10 } 10 }
11 } 11 }
@@ -35,5 +35,4 @@ @@ -35,5 +35,4 @@
35 </view> 35 </view>
36 </block> 36 </block>
37 </block> 37 </block>
38 -  
39 -<actButton></actButton>  
  38 +<tabBar></tabBar>
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 "list": [] 30 "list": []
31 }, 31 },
32 "miniprogram": { 32 "miniprogram": {
33 - "current": 13, 33 + "current": 14,
34 "list": [ 34 "list": [
35 { 35 {
36 "id": 0, 36 "id": 0,
@@ -143,6 +143,13 @@ @@ -143,6 +143,13 @@
143 "shareName": "8DEbIRpK4pa9mH_QY2vU4ZUKYPuI97WoQ4BQoFej-Q8@cr4dev", 143 "shareName": "8DEbIRpK4pa9mH_QY2vU4ZUKYPuI97WoQ4BQoFej-Q8@cr4dev",
144 "shareKey": "PZhnqMlY2TnRuHhATyGeSamVmBQUDXXr_WtjRSddeeFK17UAiOP-HNOdhxiEN7PFub5S1DjAeUl0IXOdW-VDqg~~" 144 "shareKey": "PZhnqMlY2TnRuHhATyGeSamVmBQUDXXr_WtjRSddeeFK17UAiOP-HNOdhxiEN7PFub5S1DjAeUl0IXOdW-VDqg~~"
145 } 145 }
  146 + },
  147 + {
  148 + "id": -1,
  149 + "name": "预定本-添加预定",
  150 + "pathName": "pages/book/b_addnew",
  151 + "query": "seller_id=1&seller_openid=o9pcQ0cbjRKnRWczcOJaaSRGP1lE&manager_id=500",
  152 + "scene": "1001"
146 } 153 }
147 ] 154 ]
148 } 155 }