Browse Source

修改报餐

zs 1 year ago
parent
commit
b7b41379cc

+ 0 - 6
app.json

@@ -65,12 +65,6 @@
                 "selectedIconPath": "image/reserve2.png",
                 "text": "订餐"
             },
-            {
-                "pagePath": "pages/news/index",
-                "iconPath": "image/news1.png",
-                "selectedIconPath": "image/news2.png",
-                "text": "新闻"
-            },
             {
                 "pagePath": "pages/my/index",
                 "iconPath": "image/my1.png",

+ 0 - 6
custom-tab-bar/index.js

@@ -16,12 +16,6 @@ Component({
       "selectedIconPath": "/image/reserve2.png",
       "text": "报餐"
     },
-    {
-      "pagePath": "/pages/news/index",
-      "iconPath": "/image/news1.png",
-      "selectedIconPath": "/image/news2.png",
-      "text": "新闻"
-    },
     {
       "pagePath": "/pages/my/index",
       "iconPath": "/image/my1.png",

+ 1 - 1
pages/basic/index.js

@@ -36,7 +36,7 @@ Page({
     const data = e.detail.value
     let url;
     if (data._id) url = `/user/${data._id}`;
-    else{
+    else {
       data.openid = app.globalData.wxInfo.openid
       url = `/user`;
     }

+ 99 - 0
pages/reserve/index copy.wxml

@@ -0,0 +1,99 @@
+<nav-bar navbar-data='{{navbarData}}' needBack="{{false}}"></nav-bar>
+<view class="main" style="padding-top:{{height}}px;height:{{windowHeight-height}}px">
+  <view class="one">
+   <!-- <view class="one_1">您的绑定餐厅为:{{tenant}}</view> -->
+    <view class="one_2">
+      <view>请您在前一天21点前报餐</view>
+      <view>
+        <picker mode="date" value="{{today}}" start="{{picker.start}}" end="{{picker.end}}" bindchange="bindDateChange">
+          <view class="picker">{{today}}</view>
+        </picker>
+      </view>
+    </view>
+  </view>
+  <view class="two">
+    <view class="swiper-tab">
+      <view class="swiper-tab-item {{currentTab==0?'active':''}}" data-current="0" bindtap="clickTab">点餐</view>
+      <!-- <view class="swiper-tab-item {{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">评价</view> -->
+    </view>
+    <swiper current="{{currentTab}}" style="height:{{windowHeight-height-138}}px">
+      <swiper-item catchtouchmove="stopTab">
+        <view class="two_1" style="height:{{windowHeight-height-200}}px">
+          <view class="info" style="height:{{windowHeight-height-240}}px">
+            <view class="info_left" style="height:{{windowHeight-height-240}}px">
+              <view class="infoTab {{infoTab==0?'infoActive':''}}" data-current="0" bindtap="infoClickTab">早餐</view>
+              <view class="infoTab {{infoTab==1?'infoActive':''}}" data-current="1" bindtap="infoClickTab">午餐</view>
+              <view class="infoTab {{infoTab==2?'infoActive':''}}" data-current="2" bindtap="infoClickTab">晚餐</view>
+            </view>
+            <view class="info_right">
+              <swiper current="{{infoTab}}" style="height:{{windowHeight-height-188}}px">
+                <swiper-item catchtouchmove="stopTab">
+                  <view class="info_right1" style="height:{{windowHeight-height-188}}px">
+                   
+                  </view>
+                </swiper-item>
+                <swiper-item catchtouchmove="stopTab">
+                  <view class="info_right1" style="height:{{windowHeight-height-188}}px">
+                    <view class="list" wx:key="item" wx:for="{{lunchList}}">
+                      <view class="image">
+                        <image src='{{item.url}}'></image>
+                      </view>
+                      <view class="other">
+                        <view class="other_1">{{item.name}}</view>
+                        <view class="other_2">
+                          <view class="other_2num">已售:<text>{{item.order}}</text></view>
+                          <view class="other_2btn">
+                            <van-stepper value="{{ item.num }}" min="0" bind:plus="onePlus" bind:minus="oneMinus"
+                              disable-input="true" bind:change="oneChange" data-data="{{item}}" data-type="lunch"
+                              input-width="28px" button-size="20px" />
+                          </view>
+                        </view>
+                        <view class="other_3">热量:{{item.reserve}}卡</view>
+                      </view>
+                      <view>
+                      </view>
+                    </view>
+                  </view>
+                </swiper-item>
+                <swiper-item catchtouchmove="stopTab">
+                  <view class="info_right1" style="height:{{windowHeight-height-188}}px">
+                    <view class="list" wx:key="item" wx:for="{{dinnerList}}">
+                      <view class="image">
+                        <image src='{{item.url}}'></image>
+                      </view>
+                      <view class="other">
+                        <view class="other_1">{{item.name}}</view>
+                        <view class="other_2">
+                          <view class="other_2num">已售:<text>{{item.order}}</text></view>
+                          <view class="other_2btn">
+                            <van-stepper value="{{ item.num }}" min="0" bind:plus="onePlus" bind:minus="oneMinus"
+                              disable-input="true" bind:change="oneChange" data-data="{{item}}" data-type="dinner"
+                              input-width="28px" button-size="20px" />
+                          </view>
+                        </view>
+                        <view class="other_3">热量:{{item.reserve}}卡</view>
+                      </view>
+                      <view>
+                      </view>
+                    </view>
+                  </view>
+                </swiper-item>
+              </swiper>
+            </view>
+          </view>
+          <view class="btn">
+            <view class="btn_1">
+              卡路里:{{totalReserve}}
+            </view>
+            <view class="btn_2">
+              <button type="primary" bindtap="onSubmit">完成</button>
+            </view>
+          </view>
+        </view>
+      </swiper-item>
+      <swiper-item catchtouchmove="stopTab">
+        <view>评价</view>
+      </swiper-item>
+    </swiper>
+  </view>
+</view>

+ 191 - 0
pages/reserve/index copy.wxss

@@ -0,0 +1,191 @@
+.main .one {
+  float: left;
+  width: 95%;
+  height: 50px;
+  overflow: hidden;
+  padding: 0 20rpx;
+}
+
+.main .one .one_1 {
+  float: left;
+  width: 100%;
+  font-size: 28rpx;
+  font-weight: bold;
+  padding: 5px 0;
+}
+
+.main .one .one_2 {
+  float: left;
+  width: 100%;
+}
+
+.main .one .one_2 view {
+  float: left;
+  width: 50%;
+  font-size: 22rpx;
+  color: #666;
+}
+
+.main .one .one_2 view:nth-child(2) view {
+  width: 100%;
+  text-align: right;
+  color: #000000;
+  font-weight: bold;
+}
+
+.main .two {
+  float: left;
+  width: 100%;
+}
+
+.main .two .two_1 {
+  width: 100%;
+}
+
+.main .two .two_1 .info {
+  float: left;
+  width: 100%;
+}
+
+.main .two .two_1 .info .info_left {
+  float: left;
+  width: 20%;
+  background-color: #f0f0f0;
+}
+
+.main .two .two_1 .info .info_left .infoTab {
+  text-align: center;
+  padding: 10px 0px;
+  border-bottom: 1px dashed #ccc;
+  font-size: 13px;
+  font-weight: bold;
+}
+
+.main .two .two_1 .info .info_left .infoActive {
+  color: #409eff;
+}
+
+.main .two .two_1 .info .info_right {
+  float: left;
+  width: 80%;
+}
+
+.main .two .two_1 .info .info_right .info_right1 {
+  float: left;
+  width: 100%;
+  overflow-y: auto;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list {
+  float: left;
+  width: 93%;
+  padding: 8px;
+  border-bottom: 1px solid #f1f1f1;
+
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .image {
+  float: left;
+  width: 30%;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .image image {
+  width: 100%;
+  height: 66px;
+  border-radius: 10px;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .other {
+  float: left;
+  width: 68%;
+  padding: 0 0 0 5px;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .other .other_1 {
+  float: left;
+  width: 100%;
+  font-size: 15px;
+  font-weight: bold;
+  color: #000000;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .other .other_2 {
+  float: left;
+  width: 100%;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .other .other_2 .other_2num {
+  float: left;
+  width: 45%;
+  font-size: 12px;
+  padding: 5px 0;
+  color: #666;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .other .other_2 .other_2num text {
+  color: #ff0000;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .other .other_2 .other_2btn {
+  float: left;
+  width: 55%;
+}
+
+.main .two .two_1 .info .info_right .info_right1 .list .other .other_3 {
+  float: left;
+  width: 100%;
+  color: #ff0000;
+  font-size: 15px;
+}
+
+.main .two .two_1 .btn {
+  float: left;
+  width: 100%;
+  height: 50px;
+  line-height: 50px;
+  background-color: #ffffff;
+}
+
+.main .two .two_1 .btn .btn_1 {
+  float: left;
+  width: 64%;
+  padding: 0 10px;
+  color: #ff0000;
+  font-size: 20px;
+}
+
+.main .two .two_1 .btn .btn_2 {
+  float: left;
+  width: 30%;
+  text-align: center;
+}
+
+.main .two .two_1 .btn .btn_2 button {
+  height: 50px;
+  background-color: #409eff;
+}
+
+.main .two .swiper-tab {
+  width: 100%;
+  border-bottom: 1rpx solid #f1f1f1;
+  text-align: center;
+  height: 39px;
+  line-height: 39px;
+  display: flex;
+  flex-flow: row;
+  justify-content: space-between;
+}
+
+.main .two .swiper-tab-item {
+  width: 50%;
+  color: #434343;
+}
+
+.main .two .active {
+  color: #409eff;
+  border-bottom: 2rpx solid #409eff;
+}
+
+.van-stepper {
+  float: right;
+}

+ 71 - 90
pages/reserve/index.wxml

@@ -1,7 +1,7 @@
 <nav-bar navbar-data='{{navbarData}}' needBack="{{false}}"></nav-bar>
-<view class="main" style="padding-top:{{height}}px;height:{{windowHeight-height}}px">
+<view class="main" style="padding-top:{{height}}px;height:{{windowHeight-height-100}}px">
   <view class="one">
-   <!-- <view class="one_1">您的绑定餐厅为:{{tenant}}</view> -->
+    <!-- <view class="one_1">您的绑定餐厅为:{{tenant}}</view> -->
     <view class="one_2">
       <view>请您在前一天21点前报餐</view>
       <view>
@@ -11,107 +11,88 @@
       </view>
     </view>
   </view>
-  <view class="two">
-    <view class="swiper-tab">
-      <view class="swiper-tab-item {{currentTab==0?'active':''}}" data-current="0" bindtap="clickTab">点餐</view>
-      <!-- <view class="swiper-tab-item {{currentTab==1?'active':''}}" data-current="1" bindtap="clickTab">评价</view> -->
-    </view>
-    <swiper current="{{currentTab}}" style="height:{{windowHeight-height-138}}px">
-      <swiper-item catchtouchmove="stopTab">
-        <view class="two_1" style="height:{{windowHeight-height-200}}px">
-          <view class="info" style="height:{{windowHeight-height-240}}px">
-            <view class="info_left" style="height:{{windowHeight-height-240}}px">
-              <view class="infoTab {{infoTab==0?'infoActive':''}}" data-current="0" bindtap="infoClickTab">早餐</view>
-              <view class="infoTab {{infoTab==1?'infoActive':''}}" data-current="1" bindtap="infoClickTab">午餐</view>
-              <view class="infoTab {{infoTab==2?'infoActive':''}}" data-current="2" bindtap="infoClickTab">晚餐</view>
-            </view>
-            <view class="info_right">
-              <swiper current="{{infoTab}}" style="height:{{windowHeight-height-188}}px">
-                <swiper-item catchtouchmove="stopTab">
-                  <view class="info_right1" style="height:{{windowHeight-height-188}}px">
-                    <view class="list" wx:key="item" wx:for="{{breakfastList}}">
-                      <view class="image">
-                        <image src='{{item.url}}'></image>
-                      </view>
-                      <view class="other">
-                        <view class="other_1">{{item.name}}</view>
-                        <view class="other_2">
-                          <view class="other_2num">已售:<text>{{item.order}}</text></view>
-                          <view class="other_2btn">
-                            <van-stepper value="{{ item.num }}" min="0" bind:plus="onePlus" bind:minus="oneMinus"
-                              disable-input="true" bind:change="oneChange" data-data="{{item}}" data-type="breakfast"
-                              input-width="28px" button-size="20px" />
-                          </view>
+  <view class="info">
+    <scroll-view scroll-y="true" class="scroll-view">
+      <view class="list-scroll-view">
+        <view class="two">
+          <view class="two_1">
+            <view class="infoTab {{infoTab==0?'infoActive':''}}" data-current="0" bindtap="infoClickTab">早餐</view>
+            <view class="infoTab {{infoTab==1?'infoActive':''}}" data-current="1" bindtap="infoClickTab">午餐</view>
+            <view class="infoTab {{infoTab==2?'infoActive':''}}" data-current="2" bindtap="infoClickTab">晚餐</view>
+          </view>
+          <view class="two_2">
+            <scroll-view scroll-y="true" class="scroll-view">
+              <view class="list-scroll-view">
+                <view wx:if="{{infoTab==0}}">
+                  <view class="list" wx:key="item" wx:for="{{breakfastList}}">
+                    <view class="image">
+                      <image src='{{item.url}}'></image>
+                    </view>
+                    <view class="other">
+                      <view class="other_1">{{item.name}}</view>
+                      <view class="other_2">
+                        <view class="other_2num">已售:<text>{{item.order}}</text></view>
+                        <view class="other_2btn">
+                          <van-stepper value="{{ item.num }}" min="0" bind:plus="onePlus" bind:minus="oneMinus" disable-input="true" bind:change="oneChange" data-data="{{item}}" data-type="breakfast" input-width="28px" button-size="20px" />
                         </view>
-                        <view class="other_3">热量:{{item.reserve}}卡</view>
-                      </view>
-                      <view>
                       </view>
+                      <view class="other_3">热量:{{item.reserve}}卡</view>
+                    </view>
+                    <view>
                     </view>
                   </view>
-                </swiper-item>
-                <swiper-item catchtouchmove="stopTab">
-                  <view class="info_right1" style="height:{{windowHeight-height-188}}px">
-                    <view class="list" wx:key="item" wx:for="{{lunchList}}">
-                      <view class="image">
-                        <image src='{{item.url}}'></image>
-                      </view>
-                      <view class="other">
-                        <view class="other_1">{{item.name}}</view>
-                        <view class="other_2">
-                          <view class="other_2num">已售:<text>{{item.order}}</text></view>
-                          <view class="other_2btn">
-                            <van-stepper value="{{ item.num }}" min="0" bind:plus="onePlus" bind:minus="oneMinus"
-                              disable-input="true" bind:change="oneChange" data-data="{{item}}" data-type="lunch"
-                              input-width="28px" button-size="20px" />
-                          </view>
+                </view>
+                <view wx:if="{{infoTab==1}}">
+                  <view class="list" wx:key="item" wx:for="{{lunchList}}">
+                    <view class="image">
+                      <image src='{{item.url}}'></image>
+                    </view>
+                    <view class="other">
+                      <view class="other_1">{{item.name}}</view>
+                      <view class="other_2">
+                        <view class="other_2num">已售:<text>{{item.order}}</text></view>
+                        <view class="other_2btn">
+                          <van-stepper value="{{ item.num }}" min="0" bind:plus="onePlus" bind:minus="oneMinus" disable-input="true" bind:change="oneChange" data-data="{{item}}" data-type="breakfast" input-width="28px" button-size="20px" />
                         </view>
-                        <view class="other_3">热量:{{item.reserve}}卡</view>
-                      </view>
-                      <view>
                       </view>
+                      <view class="other_3">热量:{{item.reserve}}卡</view>
+                    </view>
+                    <view>
                     </view>
                   </view>
-                </swiper-item>
-                <swiper-item catchtouchmove="stopTab">
-                  <view class="info_right1" style="height:{{windowHeight-height-188}}px">
-                    <view class="list" wx:key="item" wx:for="{{dinnerList}}">
-                      <view class="image">
-                        <image src='{{item.url}}'></image>
-                      </view>
-                      <view class="other">
-                        <view class="other_1">{{item.name}}</view>
-                        <view class="other_2">
-                          <view class="other_2num">已售:<text>{{item.order}}</text></view>
-                          <view class="other_2btn">
-                            <van-stepper value="{{ item.num }}" min="0" bind:plus="onePlus" bind:minus="oneMinus"
-                              disable-input="true" bind:change="oneChange" data-data="{{item}}" data-type="dinner"
-                              input-width="28px" button-size="20px" />
-                          </view>
+                </view>
+                <view wx:if="{{infoTab==2}}">
+                  <view class="list" wx:key="item" wx:for="{{dinnerList}}">
+                    <view class="image">
+                      <image src='{{item.url}}'></image>
+                    </view>
+                    <view class="other">
+                      <view class="other_1">{{item.name}}</view>
+                      <view class="other_2">
+                        <view class="other_2num">已售:<text>{{item.order}}</text></view>
+                        <view class="other_2btn">
+                          <van-stepper value="{{ item.num }}" min="0" bind:plus="onePlus" bind:minus="oneMinus" disable-input="true" bind:change="oneChange" data-data="{{item}}" data-type="breakfast" input-width="28px" button-size="20px" />
                         </view>
-                        <view class="other_3">热量:{{item.reserve}}卡</view>
-                      </view>
-                      <view>
                       </view>
+                      <view class="other_3">热量:{{item.reserve}}卡</view>
+                    </view>
+                    <view>
                     </view>
                   </view>
-                </swiper-item>
-              </swiper>
-            </view>
-          </view>
-          <view class="btn">
-            <view class="btn_1">
-              卡路里:{{totalReserve}}
-            </view>
-            <view class="btn_2">
-              <button type="primary" bindtap="onSubmit">完成</button>
-            </view>
+                </view>
+              </view>
+            </scroll-view>
           </view>
         </view>
-      </swiper-item>
-      <swiper-item catchtouchmove="stopTab">
-        <view>评价</view>
-      </swiper-item>
-    </swiper>
+      </view>
+    </scroll-view>
+  </view>
+  <view class="btn">
+    <view class="btn_1">
+      卡路里:{{totalReserve}}
+    </view>
+    <view class="btn_2">
+      <button type="primary" bindtap="onSubmit">完成</button>
+    </view>
   </view>
 </view>

+ 54 - 61
pages/reserve/index.wxss

@@ -1,9 +1,14 @@
+.main {
+  display: flex;
+  flex-direction: column;
+  width: 100vw;
+}
+
 .main .one {
   float: left;
   width: 95%;
-  height: 50px;
   overflow: hidden;
-  padding: 0 20rpx;
+  padding: 20rpx;
 }
 
 .main .one .one_1 {
@@ -33,27 +38,26 @@
   font-weight: bold;
 }
 
-.main .two {
-  float: left;
-  width: 100%;
+.main .info {
+  position: relative;
+  flex-grow: 1;
 }
 
-.main .two .two_1 {
-  width: 100%;
-}
-
-.main .two .two_1 .info {
-  float: left;
-  width: 100%;
+.main .info .two {
+  height: 62vh;
+  display: flex;
+  flex-direction: row;
 }
 
-.main .two .two_1 .info .info_left {
-  float: left;
-  width: 20%;
-  background-color: #f0f0f0;
+.main .info .two .two_1 {
+  position: relative;
+  width: 25vw;
+  background-color: #fafafa;
+  display: flex;
+  flex-direction: column;
 }
 
-.main .two .two_1 .info .info_left .infoTab {
+.main .info .two .two_1 .infoTab {
   text-align: center;
   padding: 10px 0px;
   border-bottom: 1px dashed #ccc;
@@ -61,22 +65,24 @@
   font-weight: bold;
 }
 
-.main .two .two_1 .info .info_left .infoActive {
+.main .info .two .two_1 .infoActive {
   color: #409eff;
 }
 
-.main .two .two_1 .info .info_right {
-  float: left;
-  width: 80%;
+.main .info .two .two_2 {
+  flex-grow: 1;
+  position: relative;
+  display: flex;
+  flex-direction: column;
 }
 
-.main .two .two_1 .info .info_right .info_right1 {
+.main .info .two .two_1 .info .info_right .info_right1 {
   float: left;
   width: 100%;
   overflow-y: auto;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list {
+.main .info .two .two_2 .list {
   float: left;
   width: 93%;
   padding: 8px;
@@ -84,24 +90,24 @@
 
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .image {
+.main .info .two .two_2 .list .image {
   float: left;
   width: 30%;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .image image {
+.main .info .two .two_2 .list .image image {
   width: 100%;
-  height: 66px;
+  height: 70px;
   border-radius: 10px;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .other {
+.main .info .two .two_2 .list .other {
   float: left;
   width: 68%;
   padding: 0 0 0 5px;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .other .other_1 {
+.main .info .two .two_2 .list .other .other_1 {
   float: left;
   width: 100%;
   font-size: 15px;
@@ -109,12 +115,12 @@
   color: #000000;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .other .other_2 {
+.main .info .two .two_2 .list .other .other_2 {
   float: left;
   width: 100%;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .other .other_2 .other_2num {
+.main .info .two .two_2 .list .other .other_2 .other_2num {
   float: left;
   width: 45%;
   font-size: 12px;
@@ -122,31 +128,30 @@
   color: #666;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .other .other_2 .other_2num text {
+.main .info .two .two_2 .list .other .other_2 .other_2num text {
   color: #ff0000;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .other .other_2 .other_2btn {
+.main .info .two .two_2 .list .other .other_2 .other_2btn {
   float: left;
   width: 55%;
 }
 
-.main .two .two_1 .info .info_right .info_right1 .list .other .other_3 {
+.main .info .two .two_2 .list .other .other_3 {
   float: left;
   width: 100%;
   color: #ff0000;
   font-size: 15px;
 }
 
-.main .two .two_1 .btn {
-  float: left;
+.main .btn {
+  display: flex;
+  align-items: center;
   width: 100%;
-  height: 50px;
-  line-height: 50px;
   background-color: #ffffff;
 }
 
-.main .two .two_1 .btn .btn_1 {
+.main .btn .btn_1 {
   float: left;
   width: 64%;
   padding: 0 10px;
@@ -154,38 +159,26 @@
   font-size: 20px;
 }
 
-.main .two .two_1 .btn .btn_2 {
+.main .btn .btn_2 {
   float: left;
   width: 30%;
   text-align: center;
 }
 
-.main .two .two_1 .btn .btn_2 button {
+.main .btn .btn_2 button {
   height: 50px;
   background-color: #409eff;
 }
 
-.main .two .swiper-tab {
-  width: 100%;
-  border-bottom: 1rpx solid #f1f1f1;
-  text-align: center;
-  height: 39px;
-  line-height: 39px;
-  display: flex;
-  flex-flow: row;
-  justify-content: space-between;
-}
-
-.main .two .swiper-tab-item {
-  width: 50%;
-  color: #434343;
+.scroll-view {
+  position: absolute;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
 }
 
-.main .two .active {
-  color: #409eff;
-  border-bottom: 2rpx solid #409eff;
-}
-
-.van-stepper {
-  float: right;
+.scroll-view .list-scroll-view {
+  display: flex;
+  flex-direction: column;
 }