wangtao 2 rokov pred
rodič
commit
6c8a9b9a24

BIN
src/assets/image/left.png


+ 38 - 23
src/assets/scss/common.scss

@@ -3,30 +3,45 @@ body {
     font-family: sans-serif;
 }
 
-.headerBox {
-    height: 44px;
-    width: 100%;
-    position: fixed;
-    top: 0;
-    left: 0;
-    box-sizing: border-box;
-    background: rgba(242, 46, 60, 1);
-    text-align: center;
-    line-height: 44px;
-    color: #FFF;
-    font-size: 18px;
-    padding: 0 15px;
-    z-index: 1;
-    .van-icon {
-        float: left;
+.mianBox {
+    .headerBox {
+        height: 44px;
         line-height: 44px;
-    }
-    .img {
-        margin: 4px auto;
-        float: left;
-        img {
-            width: 35px;
-            height: 35px;
+        width: 100%;
+        position: fixed;
+        top: 0;
+        left: 0;
+        box-sizing: border-box;
+        background: rgba(242, 46, 60, 1);
+        text-align: center;
+        color: #FFF;
+        font-size: 18px;
+        padding: 0 15px;
+        z-index: 100;
+        .returnWrap {
+            font-weight: 500;
+            .arrow-left {
+                width: 10px;
+            }
+            .return {
+                // vertical-align: middle;
+                font-size: 15px;
+                line-height: 44px;
+                position: absolute;
+                left: 30px;
+                top: -2px;
+            }
+        }
+        .title {
+            position: absolute;
+            width: calc(100vw - 30px);
+            text-align: center;
+            z-index: -1;
+            font-size: 18px;
         }
     }
+    >.top {
+        background-color: #fff;
+        margin-top: 44px;
+    }
 }

+ 1 - 1
src/main.js

@@ -13,7 +13,7 @@ import './assets/iconfont/iconfont.css'
 import querystring from 'querystring';
 import './plugins/element.js'
 import './plugins/common';
-
+import axios from "axios";
 
 
 import './assets/icons'

+ 0 - 1
src/store/index.js

@@ -22,7 +22,6 @@ export default new Vuex.Store({
     },
     actions: {
         cart({ commit }, value) {
-            console.log(value)
             commit('SET_CART', value)
         },
         user({ commit }, value) {

+ 5 - 3
src/views/amount/index.vue

@@ -1,8 +1,10 @@
 <template>
   <div class="mianBox" v-if="order">
-    <van-row class="headerBox"  >
-      <van-icon name="arrow-left" @click="fanhuiBtn" v-if="erp"/>
-      {{title}}
+    <van-row class="headerBox" >
+      <van-col class="returnWrap" @click="fanhuiBtn" v-if="erp">
+        <van-icon name="arrow-left" class="arrow-left" />
+      </van-col>
+      <van-col class="title">{{title}}</van-col>
     </van-row>
     <template v-if="erp">
       <!-- 充值 -->

+ 140 - 143
src/views/catering/index.vue

@@ -1,8 +1,12 @@
 <template>
   <div class="mianBox" v-if="status">
-    <van-row class="headerBox" @click="fanhuiBtn">
-      <van-icon name="arrow-left" class="arrow-left" />
-      <van-col class="return">返回</van-col>
+    <van-row class="headerBox" >
+      <van-col class="returnWrap" @click="fanhuiBtn">
+        <van-image class="arrow-left"
+          :src="require('../../assets/image/left.png')"
+        />
+        <van-col class="return">返回</van-col>
+      </van-col>
       <van-col class="title">{{title}}</van-col>
     </van-row>
     <van-row class="top">
@@ -15,8 +19,8 @@
     <van-row class="bottom">
         <van-row class="orderList" v-if="active==0">
           <van-col span="24" v-for="(item,index) in order" :key="index" class="order" @click="orderOne(item)">
-              <van-col span="12" class="dcrText">点餐人:</van-col>
-              <van-col span="12" class="dcr">{{item.orderUserName}}</van-col>
+              <van-col span="12" class="dcrText" style="margin-top:0">点餐人:</van-col>
+              <van-col span="12" class="dcr" style="margin-top:0">{{item.orderUserName}}</van-col>
               <van-col span="12" class="scAddressText">送餐地址:</van-col>
               <van-col span="12" class="scAddress">{{item.address}}</van-col>
               <van-col span="12" class="statusText">当前状态:</van-col>
@@ -33,10 +37,10 @@
         </van-row>
         <van-row class="orderList" v-if="active==1">
           <van-col span="24" v-for="(item,index) in order" :key="index" class="order" @click="orderOne(item)">
-              <van-col span="12" class="dcrText">点餐人:</van-col>
-              <van-col span="12" class="dcr">{{item.orderUserName}}</van-col>
-              <van-col span="12" class="scAddressText">送餐地址:</van-col>
-              <van-col span="12" class="scAddress">{{item.address}}</van-col>
+              <van-col span="12" class="dcrText" style="margin-top:0">点餐人:</van-col>
+              <van-col span="12" class="dcr" style="margin-top:0">{{item.orderUserName}}</van-col>
+              <van-col span="12" class="scAddressText" >送餐地址:</van-col>
+              <van-col span="12" class="scAddress">{{item.address || "-"}}</van-col>
               <van-col span="12" class="statusText">当前状态:</van-col>
               <van-col span="12" :class="item.orderStatus == '3' ? 'status' : 'status1'">
                   {{item.orderStatus == "0" ? "待接单" : item.orderStatus == "1" ? "配餐中" : item.orderStatus == "2" ? "送餐中"  : "已完成"}}
@@ -52,17 +56,17 @@
     </van-row>
     <van-dialog v-model="show" class="pcDialog">
        <van-row class="orderDetails">
-           <van-col class="order" >
-              <van-col span="12" class="left">订餐人:</van-col>
-              <van-col span="12" class="right">{{orderDetails.orderUserName || '-'}}</van-col>
-              <van-col span="12" class="left">餐别:</van-col>
-              <van-col span="12" class="right">{{orderDetails.mType || '-'}}</van-col>
-              <van-col span="12" class="left">手机号:</van-col>
-              <van-col span="12" class="right">{{orderDetails.phone || '-'}}</van-col>
-              <van-col span="12" class="left">送餐地址:</van-col>
-              <van-col span="12" class="right">{{orderDetails.address}}</van-col>
-              <van-col span="12" class="left">备注:</van-col>
-              <van-col span="12" class="right">{{orderDetails.remark || '-'}}</van-col>
+           <van-col class="order" span="24">
+              <van-col span="12" style="margin-top:0">订餐人:</van-col>
+              <van-col span="12" style="margin-top:0">{{orderDetails.orderUserName || '-'}}</van-col>
+              <van-col span="12">餐别:</van-col>
+              <van-col span="12">{{orderDetails.mType || '-'}}</van-col>
+              <van-col span="12">手机号:</van-col>
+              <van-col span="12">{{orderDetails.phone || '-'}}</van-col>
+              <van-col span="12">送餐地址:</van-col>
+              <van-col span="12">{{orderDetails.address  || "-"}}</van-col>
+              <van-col span="12">备注:</van-col>
+              <van-col span="12">{{orderDetails.remark || '-'}}</van-col>
            </van-col>
           <van-col class="detailsText">配餐明细</van-col>
           <van-col  span="24"  class="dishes">
@@ -72,13 +76,13 @@
             </van-col>
           </van-col>
           <van-col class="statusSelect">
-            <van-col class="select zt" v-if = "orderDetails.orderStatus == '0'" @click="statusChange(1)">
+            <van-col class="select" :class="orderDetails.orderStatus == '0' ? 'zt' : 'overTime'"   @click="statusChange(orderDetails.orderStatus == '0' ? 1 : undefined)" >
                接单
             </van-col>
-            <van-col class="select zt" v-if = "orderDetails.orderStatus == '1'" @click="statusChange(2)">
+            <van-col class="select" :class="orderDetails.orderStatus == '1' ? 'zt' : 'overTime'" @click="statusChange(orderDetails.orderStatus == '1' ? 2 : undefined)">
                送餐
             </van-col>
-             <van-col class="select zt" v-if = "orderDetails.orderStatus == '2'" @click="statusChange(3)">
+             <van-col class="select" :class="orderDetails.orderStatus == '2' ? 'zt' : 'overTime'"  @click="statusChange(orderDetails.orderStatus == '2' ? 3 : undefined)">
                完成
             </van-col>
              <van-col class="select gb" @click="close">
@@ -91,8 +95,7 @@
   </div>
 </template>
 <script>
-import axios from "axios";
-import { Field, NumberKeyboard, Dialog, Toast,Step, Steps } from "vant";
+import { Toast } from "vant";
 import Cookies from "js-cookie";
 import { getNowTime } from "@/assets/js/dataFormate.js";
 export default {
@@ -110,14 +113,7 @@ export default {
     };
   },
   components: {
-    [Field.name]: Field,
-    [NumberKeyboard.name]: NumberKeyboard,
-    [Dialog.name]: Dialog,
     [Toast.name]: Toast,
-  },
-  created() {
-    
-
   },
   mounted(){
     document.title = '中国东信智慧园区'
@@ -168,6 +164,9 @@ export default {
                 if(this.number == "0"){
                     this.number = undefined
                 }
+                if(data.length>99){
+                    this.number = data.length
+                }
                 this.order  = data
                 this.status = true
             })
@@ -189,12 +188,13 @@ export default {
         this.orderDetails = row
         axios.get(`https://smartpark.caih.com/dxapi/system/config/configKey/dre_urgency_phone`).then(res => { 
             this.orderDetails.jjPhone  = res.data.data
+            //订单详情
+            axios.get(`https://smartpark.caih.com/dxapi/dreOrderDetail/listByOrder?orderId=${row.id}`).then(res => { 
+                const data = res.data.data
+                this.dishes = data
+            })
         })
-        //订单详情
-        axios.get(`https://smartpark.caih.com/dxapi/dreOrderDetail/listByOrder?orderId=${row.id}`).then(res => { 
-            const data = res.data.data
-            this.dishes = data
-        })
+        
     },
     //订单详情
     orderOne(row){
@@ -211,55 +211,62 @@ export default {
     },
     //状态变更
     statusChange(id){
-        let time = getNowTime()
-        let data = {
-            id:this.orderDetails.id,
-            orderStatus:id,
-            receiveUserName:undefined,
-            receiveUserId:undefined,
-            receiveTime:undefined, 
-            sendUserName:undefined,
-            sendUserId:undefined,
-            sendTime:undefined,
-            sendEndTime:undefined,
-        }
-        let sid = undefined
-        axios.get("https://smartpark.caih.com/dxapi/dxtop/staff/one",{
-          params:{
-            id:Cookies.get("userId57")
-          }
-        }).then(res2 =>{
-            sid = res2.data.data.sid
-            if(id == "1"){
-                data.receiveUserName = Cookies.get("nickName57")
-                data.receiveUserId = sid
-                data.receiveTime = time
-            }
-            if(id == "2"){
-                data.sendUserName= Cookies.get("nickName57")
-                data.sendUserId = sid
-                data.sendTime = time
+        if(id){
+            let time = getNowTime()
+            let data = {
+                id:this.orderDetails.id,
+                orderStatus:id,
+                receiveUserName:undefined,
+                receiveUserId:undefined,
+                receiveTime:undefined, 
+                sendUserName:undefined,
+                sendUserId:undefined,
+                sendTime:undefined,
+                sendEndTime:undefined,
             }
-            if(id == "3"){
-                data.sendEndTime = time
+            let sid = undefined
+            axios.get("https://smartpark.caih.com/dxapi/dxtop/staff/one",{
+            params:{
+                id:Cookies.get("userId57")
             }
-            axios.put(`https://smartpark.caih.com/dxapi/dreOrder/`,data).then(res => { 
-                Toast("订单状态变更完成")
+            }).then(res2 =>{
+                sid = res2.data.data.sid
+                if(id == "1"){
+                    data.receiveUserName = Cookies.get("nickName57")
+                    data.receiveUserId = sid
+                    data.receiveTime = time
+                }
+                if(id == "2"){
+                    data.sendUserName= Cookies.get("nickName57")
+                    data.sendUserId = sid
+                    data.sendTime = time
+                }
                 if(id == "3"){
-                    this.active = 1
-                    this.number = this.number - 1
-                    if(this.number == "0"){
-                        this.number = undefined
-                    }
-                    this.orderStatus(3)
-                }else{
-                    this.active = 0
-                    this.orderStatus()
+                    data.sendEndTime = time
                 }
-                
-                this.show = false
+                axios.put(`https://smartpark.caih.com/dxapi/dreOrder/`,data).then(res => { 
+                    console.log(res)
+                    if(res.data.status == "SUCCESS"){
+                        if(id == "3"){
+                            this.active = 1
+                            this.number = this.number - 1
+                            if(this.number == "0"){
+                                this.number = undefined
+                            }
+                            this.orderStatus(3)
+                        }else{
+                            this.active = 0
+                            this.orderStatus()
+                        }
+                    }else{
+                        Toast(res.data.msg)
+                        this.orderStatus()
+                    }
+                    this.show = false
+                })
             })
-        })
+        }
+        
         
     },
     //关闭
@@ -273,27 +280,14 @@ export default {
 .mianBox{
     width:100%;
     height:100%;
+    overflow: scroll;
     background-color: #F9F9F9 !important;
-    .headerBox{
-        position: relative;
-        .arrow-left{
-            font-size: 24px;
-            vertical-align: middle;
-            margin-left:-6px;
-        }
-        .return{
-            vertical-align: middle;
-            font-size: 16px;
-            line-height: 42px;
-        }
-        .title{
-            position: absolute;
-            width:calc(100vw - 30px);
-            text-align: center;
-        }
-    }
     .top{
         position: relative;
+        .pc{
+            height:48px;
+            line-height: 48px;
+        }
         .lineP{
             position: absolute;
             top:12px;
@@ -308,34 +302,28 @@ export default {
         margin-top:10px;
         .orderList{
             .order{
-                padding:15px 15px 15px;
+                padding:15px;
                 .dcrText,.scAddressText,.statusText{
                     color:#999999;
-                    padding:5px 0;
-                    
                 }
                 .dcr,.scAddress,.status{
                     color:#333;
                     text-align: right;
-                    padding:5px 0;
                 }
                 div{
                     font-size: 14px;
-                    padding:5px 0;
+                    margin-top:8px;
+                    line-height: 20px;
                 }
-                // div:nth-child(even){
-                //     text-align: right;
-                // }
                 .status1{
                     color:#D7000F;
                     text-align: right;
-                    padding:5px 0;
                 }
                 .van-steps{
-                    width:100%;
                     background:transparent;
-                    height:50px;
-                    
+                    height:40px;
+                    padding-bottom:20px;
+                    width:100%;
                 }
             }
             .order:nth-child(odd){
@@ -343,27 +331,27 @@ export default {
             }
             .order:nth-child(even){
                 background-color: #F9F9F9;
-            }
-            
+            } 
         }
         .noMore{
-            background-color: #F9F9F9;
+            background-color: #F0F0F0;
             color:#999999;
             text-align: center;
             padding:20px 0;
-            font-size: 14px;
+            font-size: 12px;
         }
     }
     .pcDialog{
-        border-radius: 4px;
+        border-radius: 5px;
         width:85%;
-        padding-bottom:10px;
+        padding:20px 0;
         .orderDetails{
             .order{
-                padding:16px;
+                padding:0px 16px 20px;
                 border-bottom:1px solid #F0F0F0;
                 div{
-                    padding:5px 0;
+                    margin-top:8px;
+                    line-height: 20px;
                 }
                 div:nth-child(odd){
                     text-align: left;
@@ -371,22 +359,25 @@ export default {
                 }
                 div:nth-child(even){
                     text-align: right;
-                    color:#333;
+                    color:#333;  
                 }
             }
         }
         .detailsText,.jjPhone{
-            font-size: 18px;
-            margin:10px 16px;
+            font-size: 15px;
+            margin:20px 16px 8px;
             font-weight: 700;
         }
+        .jjPhone{
+            margin:20px 16px 0;
+        }
         .dishes{
             max-height:calc(100vh - 550px);
             overflow-y: scroll;
             padding:0px 16px;
             .list{
                 color:#333;
-                font-size: 18px;
+                font-size: 15px;
                 height:40px;
                 line-height: 40px;
                 width:100%;
@@ -409,23 +400,19 @@ export default {
             
         }
         .statusSelect{
-            padding:20px 16px 10px;
-            position: relative;
-            float:right;
+            margin:20px 16px 0;
             .select{
-                width:60px;
-                height:40px;
-                line-height: 40px; 
-                font-size: 16px;
+                width:65px;
+                height:44px;
+                line-height: 44px; 
+                font-size: 17px;
                 text-align: center;
-                border-radius: 4px;
-            }
-            .select:nth-child(1){
-                margin-left:155px;
+                border-radius: 5px;
             }
-            .select:nth-child(2){
-               margin-left:10px;
+            .select:nth-child(1),.select:nth-child(2),.select:nth-child(3){
+                margin-right:8.2px;
             }
+            
             .zt{
                 color: #fff;
                 background:#D7000F;
@@ -435,6 +422,10 @@ export default {
                 background:#fff;
                 border:1px solid #D7000F;
             }
+            .overTime{
+                background-color: #ccc;
+                color:#fff;
+            }
         }
     }
     
@@ -446,6 +437,9 @@ export default {
 .van-steps__items{
     margin-top:-10px !important;
 }
+.van-steps--horizontal{
+    padding:0;
+}
 .van-step__title{
     position: absolute !important;
     top:40px;
@@ -458,22 +452,25 @@ export default {
 }
 
 .van-info{
-    width:20px;
-    height:20px;
-    line-height: 20px;
-    top:10px;
-    left:20px;
+    width:18px;
+    height:18px;
+    line-height: 18px;
+    top:8px;
+    left:24px;
     color:#fff;
     margin-left:20px;
     background-color: #D7000F;
+    font-size: 10px;
 }
 .pcDialog .van-dialog__footer{
     display: none;
 }
 .pc .van-tab__text{
-    font-size: 16px;
+    font-size: 15px;
 }
 .pc .van-tabs__line{
-    width:55px;
+    width:45px !important;
 }
+
+
 </style>

+ 1 - 2
src/views/home/index.vue

@@ -6,7 +6,7 @@
     <van-row class="people">
       <van-row class="top">
         <van-row class="left">
-          <van-uploader :after-read="afterRead" class="upload" />
+          <van-uploader :after-read="afterRead" class="upload"  />
           <van-image :src="portrait57" class="portrait" />
         </van-row>
         <van-row class="right">
@@ -589,6 +589,5 @@ export default {
 .tableScroll{
   overflow-x:scroll;
 }
-
 </style>
 

+ 6 - 3
src/views/information/index.vue

@@ -1,9 +1,12 @@
 <template>
   <div class="mianBox">
-    <van-row class="headerBox">
-      <van-icon name="arrow-left" @click="$router.go(-1)" />
-      信息修改
+    <van-row class="headerBox" >
+      <van-col class="returnWrap" @click="$router.go(-1)">
+        <van-icon name="arrow-left" class="arrow-left" />
+      </van-col>
+      <van-col class="title">信息修改</van-col>
     </van-row>
+    
     <van-row class="my" >
       <!-- <van-row class="msg">
         <van-row class="left">

+ 6 - 4
src/views/login/index.vue

@@ -147,7 +147,7 @@ export default {
        return gvalue;
      },
     wx_login(){//微信拉起授权获取code
-      window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd64360a4b8c50006&redirect_uri=https://smartpark.caih.com/vuepay2&response_type=code&scope=snsapi_base&state=123`
+      window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd64360a4b8c50006&redirect_uri=https://smartpark.caih.com/dxapi//vuepay2&response_type=code&scope=snsapi_base&state=123`
       //获取openid
       //https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxd64360a4b8c50006&secret=b758e45c89162542610509dafd9db7c3&code=021Ye8Ha1jvNXC0ckiJa1JtKPF2Ye8Hp&grant_type=authorization_code
     },
@@ -185,8 +185,8 @@ export default {
     },
     login_info() {
       if(Cookies.get("openid57") && Cookies.get("username57") && Cookies.get("password57")){
-        //window.location.href = "https://smartpark.caih.com/vuepay/#/home"
-        this.$router.push({ path: `/home`}) 
+        window.location.href = "https://smartpark.caih.com/vuepay2/#/home"
+        //this.$router.push({ path: `/home`}) 
       }else{
         this.$refs.loginForm.validate(valid => {
           if (valid) {
@@ -216,12 +216,14 @@ export default {
                     Cookies.set("dept57", data.user.dept.name, { expires: 300 });
                     Cookies.set("phone57", data.user.dmUser.contacts, { expires: 300 });
                     Cookies.set("people57", 0, { expires: 300 });
+                    // Cookies.set("orderingFood57", 0, { expires: 300 });
+                    
                     axios.put('/dxtop/staff', {
                       id:data.userId,
                       openId:Cookies.get("openid57")
                     })
                     setTimeout(()=>{
-                      //this.$router.push({ path: `/home`}) 
+                     //this.$router.push({ path: `/home`}) 
                       window.location.href = "https://smartpark.caih.com/vuepay2/#/home"
                     },200)
                   }

+ 71 - 71
src/views/orderingFood/address/index.vue

@@ -1,9 +1,13 @@
 <template>
   <div class="mianBox">
-    <van-row class="headerBox" @click="fanhuiBtn">
-      <van-icon name="arrow-left"  class="arrow-left" />
-      <van-col class="return">返回</van-col>
-      <van-col class="title">{{ title }}</van-col>
+    <van-row class="headerBox" >
+      <van-col class="returnWrap" @click="fanhuiBtn">
+        <van-image class="arrow-left"
+          :src="require('../../../assets/image/left.png')"
+        />
+        <van-col class="return">返回</van-col>
+      </van-col>
+      <van-col class="title">{{title}}</van-col>
     </van-row>
     <van-row class="top" >
       <van-row class="foodType">
@@ -18,15 +22,16 @@
     </van-row>
     <van-row class="middle">
         <van-col :span="24" class="addressWrap">
-          <van-col :span="24" class="address" v-for="(item,index) in addressList" :key="index" @click="change(item.id)">
-              <van-col :span="24" class="name">{{item.name}}</van-col>
+          <van-col :span="24" class="address room" v-for="(item,index) in addressList" :key="index" @click="change(item.id)">
+              <van-col :span="24" class="name" :style="item.id == form.id ? 'color:#d7000f' :''" >{{item.name}}</van-col>
               <van-image v-if="item.id == form.id"
                 :src="require('../../../assets/image/gx.png')"
                 class="gx"
             />
           </van-col>
           <van-col :span="24" v-if="form.id == '自定义送餐地址:'" class="address" >
-              <input type="text" placeholder="请输入送餐地址" v-model="form.address" class="addressInput" maxlength="20">
+              <input type="text" placeholder="请输入送餐地址" v-model="form.address" class="addressInput" maxlength="30" style="height:48px;
+            line-height: 48px;">
           </van-col>
         </van-col>
     </van-row>
@@ -36,7 +41,7 @@
     </van-col>
     <van-col class="remarks">
         <van-col class="remarksText" :span="24">备注信息(非必填):</van-col>
-        <textarea type="text" placeholder="请输入备注信息" v-model="form.remarks" class="remarksInput" rows="3" maxlength="20" />
+        <textarea type="text" placeholder="请输入备注信息" v-model="form.remarks" class="remarksInput" rows="3" maxlength="40" />
     </van-col>
     <van-row class="bottom">
       <van-row class="settlement">
@@ -55,20 +60,12 @@
   </div>
 </template>
 <script>
-import axios from "axios";
 import Cookies from "js-cookie";
-import { mapState, mapActions, ContactList } from "vuex";
+import { mapState } from "vuex";
 import {
-  Field,
-  NumberKeyboard,
   Dialog,
   Toast,
-  DropdownMenu,
-  DropdownItem,
-  Stepper,
 } from "vant";
-import {} from "vant";
-import { returnFloat } from "@/assets/js/common.js";
 export default {
   data() {
     return {
@@ -79,17 +76,12 @@ export default {
           address:undefined,
           id:"自定义送餐地址:",
       },
-      title: "送地址",
+      title: "送地址",
       money: 0,
       addressList: [],
     };
-  },
-  watch: {
-
   },
   components: {
-    [Field.name]: Field,
-    [NumberKeyboard.name]: NumberKeyboard,
     [Dialog.name]: Dialog,
     [Toast.name]: Toast,
   },
@@ -132,7 +124,6 @@ export default {
     diancan() {},
     onConfirm() {
       this.$refs.item.toggle();
-      console.log(this.type, this.$refs.item);
     },
     change(id) {
         this.form.id = id
@@ -158,7 +149,7 @@ export default {
       }
       axios.get("https://smartpark.caih.com/dxapi/dxtop/staff/one",{
           params:{
-            id:Cookies.get("userId57")
+            id: Cookies.get("userId57")
           }
         }).then(res2 =>{
           axios.post(`https://smartpark.caih.com/dxapi/dreOrder/`,
@@ -174,7 +165,8 @@ export default {
             }).then(res => { 
               this.$store.dispatch("cart", [])
               this.$store.dispatch("canbie", undefined)
-              localStorage.clear("canbie57")
+              localStorage.removeItem("canbie57");
+
               Dialog.confirm({
                 title: '系统信息',
                 message: '您的点餐已进入配餐流程,请耐心等候,谢谢!',
@@ -197,40 +189,22 @@ export default {
   height: calc(100vh - 60px);
   overflow-y: scroll;
   background-color: #f9f9f9 !important;
-  .headerBox {
-    position: relative;
-    .arrow-left {
-      font-size: 24px;
-      vertical-align: middle;
-      margin-left: -6px;
-    }
-    .return {
-      vertical-align: middle;
-      font-size: 16px;
-      line-height: 42px;
-    }
-    .title {
-      position: absolute;
-      width: calc(100vw - 30px);
-      text-align: center;
-    }
-  }
   .top {
-    background-color: #fff;
     .foodType {
-      padding: 10px 15px 14px;
+      height:48px;
+      line-height: 48px;
+      padding:0 15px;
       text-align: left;
       border-bottom: 1px solid #e8e8e8;
       .cj {
-        width: 30px;
+        width: 20px;
         vertical-align: middle;
-        margin-left: -10px;
+        margin:0 4px 0  -1px;
       }
       .describe {
-        font-size: 20px;
+        font-size: 18px;
         font-weight: 700;
         vertical-align: middle;
-        margin-left: 10px;
         color: #d7000f;
       }
       .type {
@@ -240,44 +214,57 @@ export default {
   }
   .middle {
     background-color: #fff;
+    margin-top:0px;
     .addressWrap {
         .address {
-          padding: 20px 20px;
-          border-top: 1px solid #e8e8e8;
-          font-size: 16px;
+          height:48px;
+          line-height: 48px;
+          padding: 0 15px;
+          border-bottom: 1px solid #e8e8e8;
+          font-size: 15px;
           position: relative;
             .name {
                 color: #333;
             }
         
             .gx {
-                margin-top: 20px;
+                margin-top: 12px;
                 text-align: right;
                 position: absolute;
                 width:20px;
                 right:20px;
                 top:0px;
             }
-      }
+        }
+        .room:nth-child(4){
+          border:none !important;
+        }
     }
   }
   .tel,.remarks{
         background-color: #fff;
-        margin-top:10px;
-        padding: 20px 20px;
-        font-size: 16px;
+        margin-top:8px;
+        height:48px;
+        line-height: 48px;
+        padding: 0 15px;
+        font-size: 15px;
+        width:100%;
+        position: relative;
         input{
             border:none;
             width:50%;
             display: inline-block;
-            height:20px;
+            height:48px;
+            line-height: 48px;
         }
         textarea{
             width:calc(100% - 20px);
             margin:10px 0 0;
             border:1px solid #ccc;
-            border-radius: 6px;
-            padding:10px;
+            border-radius: 4px;
+            padding:0px 10px;
+            height:83px;
+            border:1px solid rgba(204,204,204,1);
         }
   }
   .bottom {
@@ -289,13 +276,14 @@ export default {
     left: 0;
     height: 60px;
     line-height: 60px;
-    font-size: 18px;
     .settlement {
-      padding: 0 15px;
+      padding-left: 16px;
       .text {
+        font-size: 15px;
         color: #666666;
         .money {
           color: #d7000f;
+          font-size: 18px;
         }
       }
     }
@@ -303,10 +291,11 @@ export default {
       position: absolute;
       right: 0;
       bottom: 0;
-      width: 30%;
+      width: 40%;
       background: #d7000f;
       color: #fff;
       text-align: center;
+      font-size: 16px;
     }
   }
 }
@@ -347,18 +336,18 @@ export default {
 
 
 .van-dialog{
-  border-radius: 4px;
-}
-.van-dialog{
+  border-radius: 5px;
   width:80%;
 }
+
 .van-dialog__header{
   font-weight: 700 !important;
   font-size: 16px;
+  padding-top:24px;
 }
 .van-dialog__message--has-title{
-  letter-spacing: 1px;
-  font-size: 12.5px;
+  font-size: 14px;
+  padding:12px 24px 0;
   line-height: 20px;
 }
 .van-dialog__confirm{
@@ -366,13 +355,24 @@ export default {
   color:#fff;
   font-weight: 700;
   font-size: 16px;
-  margin:20px 7.5%;
+  margin:24px 7.5%;
   width:85%;
-  letter-spacing: 2px;
+  border-radius: 5px;
+  height:44px !important;
+  line-height: 44px !important;
+
   
 }
+
 .addressInput{
   width:100%;
   height:20px;
 }
+::placeholder{
+  color:#CCCCCC;
+}
+[class*=van-hairline]::after{
+  border: none;
+}
+
 </style>

+ 197 - 122
src/views/orderingFood/index.vue

@@ -1,17 +1,22 @@
 <template>
   <div class="mianBox" v-if="status">
-    <van-row class="headerBox" @click="fanhuiBtn">
-      <van-icon name="arrow-left" class="arrow-left" />
-      <van-col class="return">返回</van-col>
+    <van-row class="headerBox" >
+      <van-col class="returnWrap" @click="fanhuiBtn">
+        <van-image class="arrow-left"
+          :src="require('../../assets/image/left.png')"
+        />
+        <van-col class="return">返回</van-col>
+      </van-col>
       <van-col class="title">{{title}}</van-col>
     </van-row>
     <van-row class="top">
         <van-row class="timeType">
-            <van-col class="describe">今日{{type}}菜品:<span class="time">(点餐时间:{{time}})</span></van-col>
+            <van-col class="describe">今日{{type}}菜品推荐:<span class="time">(点餐时间:{{time}})</span></van-col>
         </van-row>
-        <van-row class="RecommendedDishes">
-          <van-col  :span="7" v-for="(item,index) in RecommendedDishes" :key="index" class="dishes" :gutter="20">
-            {{item.name}}
+        <van-row class="RecommendedDishes" gutter="43">
+          <van-col  span="12" v-for="(item,index) in RecommendedDishes" :key="index" class="dishes" >
+            <div class="name">{{item.name}}</div>
+            <div class="price">¥{{item.price}}</div>
           </van-col>
         </van-row>
         <van-button  type="danger" @click="diancan" class="button">去点餐</van-button>
@@ -27,28 +32,30 @@
         <van-row class="orderList">
           <van-col span="24" v-for="(item,index) in order" :key="index" class="order">
               <van-col span="12" class="moneyText">下单金额:</van-col>
-              <van-col span="12" class="money">¥{{item.totalMoney}}</van-col>
+              <van-col span="12" class="money" >¥{{item.totalMoney}}</van-col>
+              <van-col span="12" class="moneyText">已点菜品:</van-col>
+              <van-col span="12" class="money">{{item.dishes}}</van-col>
               <van-col span="12" class="orderTimeText">下单时间:</van-col>
               <van-col span="12" class="orderTime">{{item.orderTime}}</van-col>
               <van-col span="12" class="statusText">当前状态:</van-col>
               <van-col span="12" :class="item.orderStatus == '3' ? 'status' : 'status1'">
                   {{item.orderStatus == "0" ? "待接单" : item.orderStatus == "1" ? "配餐中" : item.orderStatus == "2" ? "送餐中"  : "已完成"}}
               </van-col>
-              <van-steps :active="item.orderStatus == '0' ? '-1' : item.orderStatus" v-if="item.orderStatus != '3'"  active-color="#D7000F" inactive-color="#999999">
+              <van-steps  :active="item.orderStatus == '0' ? '-1' : item.orderStatus" v-if="item.orderStatus != '3'"  active-color="#D7000F" inactive-color="#999999">
                 <van-step>待接单</van-step>
                 <van-step>配餐中</van-step>
                 <van-step>送餐中</van-step>
              </van-steps>
           </van-col>
-          <van-col span="24" class="noMore">没有更多数据了</van-col>
+          <van-col span="24" class="noMore" v-if="over">没有更多数据了</van-col>
+          <van-col span="24" class="noData" v-if="over2">暂无点餐信息</van-col>
         </van-row>
     </van-row>
   </div>
 </template>
 <script>
-import axios from "axios";
-import { Field, NumberKeyboard, Dialog, Toast,Step, Steps } from "vant";
 import { getNowTime } from "@/assets/js/dataFormate.js";
+import Cookies from "js-cookie";
 export default {
   data() {
     return {
@@ -57,28 +64,41 @@ export default {
       type:undefined,
       time:undefined,
       RecommendedDishes:[],
-      order:[
-          // {money:'18.50',createTime:'2022-08-14 00:00:00',status:2},
-          // {money:'20.00',createTime:'2022-08-14 00:00:00',status:3},
-          // {money:'100.00',createTime:'2022-08-14 00:00:00',status:4}
-      ],
+      order:[],
+      over:false,//数据拉载完成
+      over2:false
       
     };
   },
-  watch: {
-    money(val) {
-      if (/^0[1-9]/.test(val)) {
-        this.money = val.substring(1);
-      }
-    },
-  },
-  components: {
-    [Field.name]: Field,
-    [NumberKeyboard.name]: NumberKeyboard,
-    [Dialog.name]: Dialog,
-    [Toast.name]: Toast,
-  },
   created() {
+    var url = window.location.href;
+    if(this.$route.query.token){
+      axios({//查询信息
+        method: 'get',
+        url: 'https://smartpark.caih.com/zkxt/api/thirdparty/v1/user/getZkUserByCipher?cipher=' + this.$route.query.token,
+        timeout: 10000,
+      }).then(res =>{
+        if(res.data?.data?.id){
+          Cookies.set("nickName57", res.data.data.data.user.nickName, { expires: 300 });
+          //axios.get(`/dxtop/staff/one?id=0001T110000000002HBL`).then(res2 => { //测试
+          axios.get(`/dxtop/staff/one?id=${res.data.data.id}`).then(res2 => { //验证充值信息是否同步
+            if(res2.data.data){
+              localStorage.setItem("user_wt", res.data.data.id)
+              // localStorage.setItem("user_wt", "0001T110000000002HBL") //测试id
+              localStorage.setItem("cardId57", res2.data.data.cardId)
+            }else{
+              this.userNoAlert()
+            }
+          })
+        }else if(res.data?.data?.cardId){
+          Toast("用户卡号未绑定")
+        }else{
+          this.userNoAlert()
+        }
+      }).catch(err =>{
+        this.userNoAlert()
+      });
+    }
     let nowTime = getNowTime().split(" ")[1].substring(0,2)
     if(0 < nowTime && nowTime < 9){
       this.type = "早餐"
@@ -104,52 +124,57 @@ export default {
   },
   mounted(){
     document.title = '中国东信智慧园区'
+    let startTime = getNowTime().split(" ")[0] + " 00:00:00"
+    let endTime = getNowTime().split(" ")[0] + " 23:59:59"
     //历史订单
       axios.post(`https://smartpark.caih.com/dxapi/dreOrder/page`,{
         current:1,
         size:500,
-        orderUserName:localStorage.getItem("nickName57")
+        orderUserName:localStorage.getItem("nickName57"),
+        startTime:startTime,
+        endTime:endTime,
       }).then(res => { 
         const data = res.data.data.records
-        this.order  = data
+        const arr = data.slice(0,5)
+        if(arr.length>0){
+          for(let a =0;a<arr.length;a++){
+            arr[a].dishes = ''
+            if(arr[a].dreOrderDetails && arr[a].dreOrderDetails.length>0){
+                for(let i =0;i<arr[a].dreOrderDetails.length;i++){
+                  arr[a].dishes = arr[a].dishes + '、'  + arr[a].dreOrderDetails[i].mName
+                }
+              }
+          }
+          for(let i =0;i<arr.length;i++){
+            arr[i].dishes = arr[i].dishes.substr(1,arr[i].dishes.length - 1)
+          }
+        }
+        this.order = arr
+        if(this.order.length>0){
+          this.over = true
+          this.over2 = false
+        }else{
+          this.over = false
+          this.over2 = true
+        }
         this.status = true
       })
   },
   methods: {
-    fanhuiBtn() {
-       this.$router.go(-1)
-       //this.$router.push({ path: "/home"})
+    userNoAlert(){
+      Toast("当前账户初始流程中,请耐心等待或联系管理人员查询")
     },
+    /**点餐 */
     diancan(){
       this.$router.push({ path: "/orderService"})
     },
-
-
-
-
-
-    handleClose() {
-      this.money = Number(this.money);
-      this.overlayShow = false;
-    },
+    /**所有订单 */
     allOrder(){
       this.$router.push({ path: "/orderList"})
     },
-
-
-
-    //返回上级或app目录页
+    /** 返回上级或app目录页 */
     fanhuiBtn(){
       this.$router.push({ path: "/home"})
-      // if(localStorage.getItem("passageway")){
-      //   this.$router.go(-1)
-      // }else{
-        // setTimeout(()=>{
-        //   this.$router.go(-2)
-        // },10)
-        
-        //window.location.href = "https://smartpark.caih.com/h5/#/home/feature?isApp=true"
-      //}
     }
   },
 };
@@ -158,116 +183,116 @@ export default {
 .mianBox{
     width:100%;
     height:100%;
+    overflow: scroll;
+  
     background-color: #F9F9F9 !important;
-    .headerBox{
-        position: relative;
-        .arrow-left{
-            font-size: 24px;
-            vertical-align: middle;
-            margin-left:-6px;
-        }
-        .return{
-            vertical-align: middle;
-            font-size: 16px;
-            line-height: 42px;
-        }
-        .title{
-            position: absolute;
-            width:calc(100vw - 30px);
-            text-align: center;
-        }
-    }
     .top{
-        padding:0 15px;
-        background-color: #fff;
         .timeType{
-            padding:10px 0 2px;
+            padding:13px 16px;
             text-align: left;
+            box-shadow: inset 0px -1px 0px 0px rgba(232,232,232,1);
             .describe{
-                font-size: 18px;
+                font-size: 15px;
                 font-weight: 700;
                 width:100%;
+                 .time{
+                    font-weight: 400;
+                  }
             }
-            .time{
-                font-size: 15px;
-                font-weight: 400;
-            }
+           
         }
         .RecommendedDishes{
-          margin-top:6px;
+          margin:8px 0 24px;
+          padding:5px 15px 0px;
             .dishes{
-                padding:10px 0;
-                background-color: #F9F9F9;
-                color:#666;
-                text-align: center;
-                border-radius: 6px;
+                height:36px;
+                line-height: 36px;
                 font-size: 14px;
-                margin-top:8px;
+                background-clip:content-box;
+                position: relative;
+                width:calc(50vw - 36px);
+                .name{
+                  color:#666666;
+                  text-align: left;
+                  border-bottom:1px dashed #ccc;
+                  width:66.7% !important;
+                  display: inline-block;
+                  position: absolute;
+                  left:0;
+                }
+                .price{
+                  color:#999999;
+                  text-align: right;
+                  border-bottom:1px dashed #ccc;
+                  width:33.3% !important;
+                  display: inline-block;
+                  position: absolute;
+                  right:0; 
+                }
             }
-            .dishes:nth-child(3n),.dishes:nth-child(3n-1){
-              margin-left:21px;
+            .dishes:nth-child(2n){
+              margin-left:42px;
             }
         }
         .button{
-            width:100%;
-            margin:20px 0;
-            border-radius: 10px;
-            font-size: 16px;
+            width:calc(100% - 30px);
+            margin:0px 15px 24px;
+            border-radius: 5px;
+            font-size: 17px;
+            height:44px;
+            line-height: 44px;
         }
     }
     .bottom{
         background-color: #fff;
-        margin-top:10px;
+        margin-top:8px;
         .title{
-            padding:10px 15px;
-            border-bottom:1px solid #F9F9F9;
+            padding:0px 15px;
+            box-shadow: inset 0px -1px 0px 0px rgba(232,232,232,1);
             text-align: left;
+            height:48px;
+            line-height: 48px;
             .describe{
-                font-size: 16px;
-                // font-family: PingFangMedium;
+                font-size: 15px;
                 font-weight: 700;
             }
             .allOrder{
                 font-size: 14px;
                 font-weight: 400;
                 text-align: right;
+                color:#666;
                 .right_icon{
                     width:6px !important;
-                    margin-left:10px;
+                    margin-left:5px;
                 }
             } 
         }
         .orderList{
             .order{
-                padding:15px 15px 15px;
+                font-size: 14px;
+                padding:14px 15px 20px;
                 .moneyText,.orderTimeText,.statusText{
                     color:#999999;
                     text-align: left;
-                    height:30px;
-                    
                 }
                 .money,.orderTime,.status{
                     color:#333;
-                    height:30px;
                     text-align: right;
-                    
                 }
                 div{
                     font-size: 14px;
-                    padding:5px 0;
+                    margin-top:8px;
+                    line-height: 20px;
                 }
-                // div:nth-child(even){
-                //     text-align: right;
-                // }
                 .status1{
                     color:#D7000F;
                     text-align: right;
-                    height:30px;
                 }
                 .van-steps{
                     width:100%;
                     background:transparent;
-                    height:50px;
+                    height:40px;
+                    padding-bottom:20px;
                     
                 }
             }
@@ -280,11 +305,19 @@ export default {
             
         }
         .noMore{
-            background-color: #F9F9F9;
+            background-color: #F0F0F0;
             color:#999999;
             text-align: center;
             padding:20px 0;
-            font-size: 14px;
+            font-size: 12px;
+        }
+        .noData{
+          height:200px;
+          line-height: 200px;
+          color:#999999;
+          text-align: center;
+          font-size: 12px;
+          background-color: #ffffff;
         }
     }
     
@@ -293,22 +326,64 @@ export default {
 </style>
 <style>
 .van-steps__items{
-    margin-top:-10px !important;
-    /* width:100%;
-    margin-left:-25%;
-    overflow: hidden; */
+    margin-top:-50px !important;
+    padding:0 14px;
 }
 .van-step__title{
     position: absolute !important;
     top:40px;
     font-size: 12px !important;
-    margin-left:-50px;
+    left:-15px;
+    color:#333;
+}
+.van-step--horizontal:nth-child(2) .van-step__title{
+  width:68px;
+  text-align: right;
+}
+.van-step--horizontal:nth-child(3) .van-step__title{
+  width:75px;
+  text-align: center;
+}
+.van-step--finish .van-step__title{
+  margin-left:0px !important;
+}
+.van-step__circle{
+  width:8px;
+  height:8px;
+}
 
+.van-step--horizontal .van-step__circle-container{
+  padding:0;
+  left:0;
 }
 .van-step--horizontal:last-child .van-step__title{
   margin-left:-40px;
 }
-.van-steps__items:nth-child(1){
-
+.van-step__line{
+  background:transparent !important;
+  border-bottom:1px dashed #ccc;
+}
+.van-step--finish .van-step__line{
+  background:#D7000F !important;
+  border:none;
 }
+.van-step--horizontal:last-child .van-step__circle-container{
+  right:14px !important;
+}
+.van-step--horizontal:last-child .van-step__circle-container{
+  right:14px !important;
+}
+.van-step__title--active{
+  color:#333 !important;
+}
+.van-step__icon--active{
+  background: #D7000F;
+  width:8px;
+  height:8px;
+  border-radius: 50% !important;
+}
+.van-step--horizontal .van-step__icon{
+  font-size: 0;
+}
+
 </style>

+ 59 - 75
src/views/orderingFood/orderList/index.vue

@@ -1,56 +1,45 @@
 <template>
   <div class="mianBox" v-if="order">
-    <van-row class="headerBox" @click="fanhuiBtn">
-      <van-icon name="arrow-left"  class="arrow-left" />
-      <van-col class="return" >返回</van-col>
+    <van-row class="headerBox" >
+      <van-col class="returnWrap" @click="fanhuiBtn">
+         <van-image class="arrow-left"
+          :src="require('../../../assets/image/left.png')"
+        />
+        <van-col class="return">返回</van-col>
+      </van-col>
       <van-col class="title">{{title}}</van-col>
     </van-row>
-    <van-row class="bottom">
+    <van-row class="top">
         <van-row class="orderList">
           <van-col span="24" v-for="(item,index) in order" :key="index" class="order">
               <van-col span="12" class="moneyText">下单金额:</van-col>
               <van-col span="12" class="money">¥{{item.totalMoney}}</van-col>
+              <van-col span="12" class="moneyText">已点菜品:</van-col>
+              <van-col span="12" class="money">{{item.dishes}}</van-col>
               <van-col span="12" class="orderTimeText">下单时间:</van-col>
               <van-col span="12" class="orderTime">{{item.orderTime}}</van-col>
               <van-col span="12" class="statusText">当前状态:</van-col>
               <van-col span="12" :class="item.orderStatus == '3' ? 'status' : 'status1'">
                   {{item.orderStatus == "0" ? "待接单" : item.orderStatus == "1" ? "配餐中" : item.orderStatus == "2" ? "送餐中"  : "已完成"}}
               </van-col>
-              <!-- <van-steps :active="item.status" v-if="item.status != '4'"  active-color="#D7000F" inactive-color="#999999">
-                <van-step>待接单</van-step>
-                <van-step>已接单</van-step>
-                <van-step>配餐中</van-step>
-                <van-step>送餐</van-step>
-             </van-steps> -->
           </van-col>
-          <van-col span="24" class="noMore">没有更多数据了</van-col>
+          <van-col span="24" class="noMore" v-if="over">没有更多数据了</van-col>
+          <van-col span="24" class="noData" v-if="over2">暂无点餐信息</van-col>
         </van-row>
     </van-row>
   </div>
 </template>
 <script>
-import axios from "axios";
-import { Field, NumberKeyboard, Dialog, Toast,Step, Steps } from "vant";
-import { returnFloat } from '@/assets/js/common.js'
+import Cookies from "js-cookie";
 export default {
   data() {
     return {
+      status:false,
       title:"点餐记录",
       order:[],
+      over:false,//数据拉载完成
+      over2:false,
     };
-  },
-  watch: {
-    
-  },
-  components: {
-    [Field.name]: Field,
-    [NumberKeyboard.name]: NumberKeyboard,
-    [Dialog.name]: Dialog,
-    [Toast.name]: Toast,
-  },
-  created() {
-    
-
   },
   mounted(){
     document.title = '中国东信智慧园区'
@@ -58,16 +47,35 @@ export default {
       axios.post(`https://smartpark.caih.com/dxapi/dreOrder/page`,{
         current:1,
         size:500,
-        orderUserName:localStorage.getItem("nickName57")
+        // orderUserName:Cookies.get("nickName57")
       }).then(res => { 
         const data = res.data.data.records
-        this.order  = data
+        const arr = data.slice(0,5)
+        if(arr.length>0){
+          for(let a =0;a<arr.length;a++){
+            arr[a].dishes = ''
+            if(arr[a].dreOrderDetails && arr[a].dreOrderDetails.length>0){
+                for(let i =0;i<arr[a].dreOrderDetails.length;i++){
+                  arr[a].dishes = arr[a].dishes + '、'  + arr[a].dreOrderDetails[i].mName
+                }
+              }
+          }
+          for(let i =0;i<arr.length;i++){
+            arr[i].dishes = arr[i].dishes.substr(1,arr[i].dishes.length - 1)
+          }
+        }
+        this.order = arr
+        if(this.order.length>0){
+          this.over = true
+          this.over2 = false
+        }else{
+          this.over = false
+          this.over2 = true
+        }
+        this.status = true
       })
   },
   methods: {
-      diancan(){
-
-      },
       fanhuiBtn(){
         this.$router.push({path:'/orderingFood'})
       }
@@ -78,57 +86,35 @@ export default {
 .mianBox{
     width:100%;
     height:100%;
+    overflow: scroll;
     background-color: #F9F9F9 !important;
-    .headerBox{
-        position: relative;
-        .arrow-left{
-            font-size: 24px;
-            vertical-align: middle;
-            margin-left:-6px;
-        }
-        .return{
-            vertical-align: middle;
-            font-size: 16px;
-            line-height: 42px;
-        }
-        .title{
-            position: absolute;
-            width:calc(100vw - 30px);
-            text-align: center;
-        }
-    }
-
-    .bottom{
-        background-color: #fff;
-
-        .orderList{
+    .top{
+       .orderList{
             .order{
-                padding:15px 15px 15px;
+                font-size: 14px;
+                padding:14px 15px 20px;
                 .moneyText,.orderTimeText,.statusText{
                     color:#999999;
-                    height:30px;
+                    text-align: left;
                 }
                 .money,.orderTime,.status{
                     color:#333;
                     text-align: right;
-                    height:30px;
                 }
                 div{
-                    padding:5px 0;
                     font-size: 14px;
+                    margin-top:8px;
+                    line-height: 20px;
                 }
-                // div:nth-child(even){
-                //     text-align: right;
-                // }
                 .status1{
                     color:#D7000F;
                     text-align: right;
-                    height:30px;
                 }
                 .van-steps{
                     width:100%;
                     background:transparent;
-                    height:50px;
+                    height:40px;
+                    padding-bottom:20px;
                     
                 }
             }
@@ -141,23 +127,21 @@ export default {
             
         }
         .noMore{
-            background-color: #F9F9F9;
+            background-color: #F0F0F0;
             color:#999999;
             text-align: center;
             padding:20px 0;
             font-size: 14px;
         }
+        .noData{
+          height:200px;
+          line-height: 200px;
+          color:#999999;
+          text-align: center;
+          font-size: 12px;
+          background-color: #ffffff;
+        }
     }
     
 }
-
-</style>
-<style>
-.van-steps__items{
-    margin-top:-10px !important;
-}
-.van-step__title{
-    position: absolute !important;
-    top:40px;
-}
 </style>

+ 77 - 87
src/views/orderingFood/orderService/index.vue

@@ -1,9 +1,13 @@
 <template>
   <div class="mianBox">
-    <van-row class="headerBox" @click="fanhuiBtn">
-      <van-icon name="arrow-left"  class="arrow-left" />
-      <van-col class="return">返回</van-col>
-      <van-col class="title">{{ title }}</van-col>
+    <van-row class="headerBox" >
+      <van-col class="returnWrap" @click="fanhuiBtn">
+        <van-image class="arrow-left"
+          :src="require('../../../assets/image/left.png')"
+        />
+        <van-col class="return">返回</van-col>
+      </van-col>
+      <van-col class="title">{{title}}</van-col>
     </van-row>
     <van-row class="top">
       <van-row class="foodType">
@@ -24,7 +28,7 @@
         <van-popup
           v-model="show"
           position="bottom"
-          :style="{ height: '270px;overflow: hidden;' }"
+          :style="{ 'max-height': '260px','overflow-y': 'hidden' }"
           
         >
           <van-col :span="24" class="selectTitle">
@@ -38,13 +42,10 @@
                 确定
               </van-col>
           </van-col>
-          <van-col :span="24" class="typeList" v-for="(item,index) in typeList" :key="index" @click="change(item.name)">
-              <van-col :span="24" :class="item.name == typeColor ? 'nameSelect' : 'name'" >{{item.name}}</van-col>
+          <van-col :span="24" class="typeList" v-for="(item,index) in typeList" :key="index" @click="change(item.name,index)">
+              <van-col :span="24" :class="index >= overTime ? 'name' : 'noName'"  >{{item.name}}</van-col>
           </van-col>
         </van-popup>
-          <!-- <van-dropdown-menu>
-            <van-dropdown-item v-model="type" :options="option" />
-          </van-dropdown-menu> -->
       </van-row>
     </van-row>
     <van-row class="middle">
@@ -57,10 +58,10 @@
         >
           <van-col span="24" class="food">
             <van-col span="12" class="left">
-              <van-col span="24" class="text"
+              <van-col span="24" class="text1"
                 >菜名:<span class="name">{{ item.name }}</span></van-col
               >
-              <van-col span="24" class="text"
+              <van-col span="24" class="text2"
                 >单价:<span class="money">¥{{ item.price }}</span></van-col
               >
             </van-col>
@@ -70,8 +71,8 @@
                 min="0"
                 max="100"
                 theme="round"
-                button-size="30"
-                integer
+                button-size="24"
+                disable-input
                 @change="onChange(item.id,item.num)"
               />
             </van-col>
@@ -96,21 +97,11 @@
   </div>
 </template>
 <script>
-import axios from "axios";
-import { mapState, mapActions } from "vuex";
+import { mapState } from "vuex";
 import { getNowTime } from "@/assets/js/dataFormate.js";
 import {
-  Field,
-  NumberKeyboard,
-  Dialog,
   Toast,
-  DropdownMenu,
-  DropdownItem,
-  Stepper,
 } from "vant";
-import {} from "vant";
-
-
 export default {
   data() {
     return {
@@ -128,12 +119,10 @@ export default {
         { name: "晚餐" },
         { name: "宵夜" },
       ],
+      overTime:undefined,
     };
   },
   components: {
-    [Field.name]: Field,
-    [NumberKeyboard.name]: NumberKeyboard,
-    [Dialog.name]: Dialog,
     [Toast.name]: Toast,
   },
   computed: {
@@ -141,22 +130,22 @@ export default {
        footStoreData:state=>state.cart
     })
    },
-  created() {
-      
-      
-  },
   mounted() {
     document.title = '中国东信智慧园区'
     //时段判断
     let nowTime = getNowTime().split(" ")[1].substring(0,2)
     if(nowTime <= 9){
       this.typeValue = "早餐"
+      this.overTime = 0
     }else if( 9< nowTime  && nowTime < 13){
       this.typeValue = "午餐"
+      this.overTime = 1
     }else if( 13<= nowTime && nowTime < 19){
       this.typeValue = "晚餐"
+      this.overTime = 2
     }else{
       this.typeValue = "宵夜"
+      this.overTime = 3
     }
     if(JSON.stringify(this.footStoreData) != '[]'){
         this.foodList = this.footStoreData
@@ -174,22 +163,16 @@ export default {
     
   },
   methods: {
+    /** 餐别类型状态 */
     downStatus(){
       this.show = true
     },
+    /** 返回 */
     fanhuiBtn() {
       this.$router.push({path:'/orderingFood'})
     },
-    diancan() {},
+    /** 餐别类型状态切换 */
     onChange(id,value) {
-    //   Toast.loading({ forbidClick: true });
-
-    //   clearTimeout(this.timer);
-    //   this.timer = setTimeout(() => {
-    //     Toast.clear();
-    //     // 注意此时修改 value 后会再次触发 change 事件
-    //     this.value = value;
-    //   }, 500);
         this.money = 0;
         let data = this.foodList
         for(let i=0;i<data.length;i++){
@@ -198,6 +181,7 @@ export default {
             }
         }
     },
+    /** 菜品锁定 */
     submit(){
       if(this.money<=0){
           Toast("请添加菜品")
@@ -208,13 +192,17 @@ export default {
         this.$router.push({ path: "/address"})
       }
     },
-    //餐别id选择
-    change(id){
-      this.typeColor = id
+    /** 餐别id选择 */
+    change(name,index){
+      if(index >= this.overTime){
+        this.typeColor = name
+        this.determine()
+      }
+      
     },
+    /** 菜单 */
     foodMenu(id){
       this.foodList  = []
-      //获取菜单
       axios.get(`https://smartpark.caih.com/dxapi/dreMenu/list?current=1&size=500&type=${id}`).then(res => { 
         const data = res.data.data.records
         for(let i = 0;i<data.length;i++){
@@ -223,7 +211,7 @@ export default {
         this.foodList  = data
       })
     },
-    //餐别确定
+    /** 餐别确定 */
     determine(){
       this.money = 0
       if(this.typeColor == undefined){
@@ -240,9 +228,8 @@ export default {
         this.typeSelect = this.typeValue
         this.foodMenu(this.typeValue)
       }
-     
     },
-    //餐别取消
+    /** 餐别取消 */
     cancel(){
       this.show = false
     }
@@ -254,46 +241,27 @@ export default {
   width: 100%;
   height: 100%;
   background-color: #f9f9f9 !important;
-  .headerBox {
-    position: relative;
-    .arrow-left {
-      font-size: 24px;
-      vertical-align: middle;
-      margin-left: -6px;
-      
-    }
-    .return {
-      vertical-align: middle;
-      font-size: 16px;
-      line-height: 42px;
-    }
-    .title {
-      position: absolute;
-      width: calc(100vw - 30px);
-      text-align: center;
-    }
-  }
   .top {
-    background-color: #fff;
     .foodType {
-      padding: 10px 15px 14px;
+      padding: 0 15px;
       text-align: left;
       border-bottom: 1px solid #e8e8e8;
+      height:48px;
+      line-height: 48px;;
       .cj {
-        width: 30px;
+        width: 20px;
         vertical-align: middle;
-        margin-left: -10px;
+        margin:0 4px 0  -1px;
       }
       .describe {
-        font-size: 20px;
+        font-size: 18px;
         font-weight: 700;
         vertical-align: middle;
-        margin-left: 10px;
         color: #d7000f;
       }
       .type {
-        margin-top: -6px;
-        font-size: 16px;
+        margin-top: -12px;
+        font-size: 14px;
         color:#333;
         text-align: right;
         .name{
@@ -303,7 +271,7 @@ export default {
           .xl{
             vertical-align: middle;
             width:20px;
-            margin:-6px -6px 0 0;
+            margin:0px -6px 0 4px;
           }
         }
         
@@ -311,8 +279,8 @@ export default {
       .selectTitle{
           font-size: 16px;
           text-align: center;
-          height:50px;
-          line-height: 50px;
+          height:48px;
+          line-height: 48px;
           color:#666666;
           .determine{
             color:#d7000f;
@@ -321,16 +289,23 @@ export default {
         .typeList{
           font-size: 16px;
           border-top:1px solid #e8e8e8;
-          padding:15px 0;
+          height:48px;
+          line-height: 48px;
           position: relative;
+          .overTime{
+            color:#ccc;
+          }
           .name{
             text-align: center;
           }
-          .nameSelect{
+          .name:hover{
             color:#d7000f;
+          }
+          .noName{
+            cursor:not-allowed;
+            color:#ccc;
             text-align: center;
           }
-          
         }
     }
   }
@@ -342,12 +317,16 @@ export default {
     .foodList {
       .foodWrap {
         .food {
-          padding: 15px 0;
+          // height:78px;
+          // line-height: 78px;
+          padding:16px 0;
           border-bottom: 1px solid #e8e8e8;
           .left {
+            .text2{
+               margin-top:5px;
+            }
             color: #666666;
-            font-size: 16px;
-            line-height: 30px;
+            font-size: 15px;
             vertical-align: middle;
             .name {
               color: #333;
@@ -358,7 +337,7 @@ export default {
             }
           }
           .right {
-            margin-top: 20px;
+            margin-top: 15px;
             text-align: right;
           }
         }
@@ -416,7 +395,18 @@ export default {
 }
 .van-stepper__input {
   border: 1px solid #e8e8e8;
-  width: 40px;
-  margin: 0 10px;
+  width: 48px !important;
+  height:32px !important;
+  margin: 0 12px;
+  border-radius: 5px;
 }
+.van-stepper__minus, .van-stepper__plus{
+  background:transparent !important;
+  border:1px solid #d7000f;
+  
+}
+.van-stepper__minus::after, .van-stepper__minus::before, .van-stepper__plus::after, .van-stepper__plus::before{
+  background-color: #d7000f;
+}
+
 </style>

+ 21 - 1
vue.config.js

@@ -4,6 +4,18 @@ const path = require('path')
 function resolve(dir) {
     return path.join(__dirname, dir)
 }
+
+function getNowDate() {
+    const date = new Date()
+    const year = String(date.getFullYear())
+    const month = String(date.getMonth() + 1)
+    const day = String(date.getDate())
+    return year + month + day
+}
+const nowDate = getNowDate()
+const Timestamp = new Date().getTime()
+
+const params = nowDate + '-' + Timestamp
 module.exports = {
     publicPath: '/vuepay2', //部署路径后缀
     assetsDir: 'static', // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
@@ -49,7 +61,11 @@ module.exports = {
             assetFilter: function(assetFilename) {
                 return assetFilename.endsWith('.js')
             }
-        }
+        },
+        output: { // 输出重构  打包编译后的 文件名称  【模块名称.版本号.时间戳】
+            filename: `js/[name].${params}.js`,
+            chunkFilename: `js/[name].${params}.js`
+        },
     },
     css: {
         loaderOptions: {
@@ -74,6 +90,10 @@ module.exports = {
                     })
                 ]
             }
+        },
+        extract: {
+            filename: `static/css/[name].${params}.css`,
+            chunkFilename: `static/css/[name].${params}.css`
         }
     },
     chainWebpack(config) {