wangtao 2 éve
szülő
commit
84b4fe5d2d

+ 2 - 2
package.json

@@ -1,5 +1,5 @@
 {
-    "version": "0.1.0",
+    "version": "0.1.1",
     "private": true,
     "scripts": {
         "dev": "vue-cli-service serve",
@@ -63,4 +63,4 @@
         "last 2 versions",
         "not dead"
     ]
-}
+}

+ 1 - 1
src/assets/scss/common.scss

@@ -12,7 +12,7 @@ body {
         top: 0;
         left: 0;
         box-sizing: border-box;
-        background: rgba(242, 46, 60, 1);
+        background: #FF4747;
         text-align: center;
         color: #FFF;
         font-size: 18px;

+ 17 - 6
src/views/amount/index.vue

@@ -5,6 +5,7 @@
         <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>
@@ -178,7 +179,7 @@
                   <van-col span="16" class="jlName">{{ item.shopName }}</van-col>
                   <van-col span="8" class="jlBalance2" v-if="item.type==1">- {{ item.amt }}元</van-col>
                   <van-col span="8" class="jlMoney just" v-if="item.type==3">+ {{ item.amt }}元</van-col>
-                  <van-col span="8" class="jlBalance2" v-if="item.type==1001">+ {{ Math.abs(item.amt) }}元</van-col>
+                  <van-col span="8" class="jlBalance2" v-if="item.type==1001">+ {{ item.amt }}元</van-col>
                   <van-col span="16" class="jlTime">时间:{{ item.createTime }}</van-col>
                   <van-col span="8" class="jlBalance">余额:{{ item.balance }} 元</van-col>
                 </van-col>
@@ -501,7 +502,14 @@ export default {
           let data = res.data.data.records
           for(let i =0;i<data.length;i++){
             arr.push(data[i])
-            arr[i].balance = returnFloat(data[i].balance)
+            arr[i].balance = data[i].balance.toFixed(2)
+            if(arr[i].type == "1001"){
+              arr[i].amt = Math.abs(data[i].amt)
+              arr[i].amt = arr[i].amt.toFixed(2)
+            }else{
+              arr[i].amt = data[i].amt.toFixed(2)
+            }
+            
           }
           this.more = true
           this.noMore = false
@@ -984,7 +992,7 @@ export default {
       .jg{
         position: relative;
         .jgLabel{
-          color: rgba(242, 46, 60, 1) ;
+          color: #D7000F ;
           font-size: 16px;
           position: absolute;
           top:11px;
@@ -1005,7 +1013,7 @@ export default {
         margin-top: 20px;
         float: left;
         width: 28%;
-        border:1px solid rgba(242, 46, 60, 1) !important;
+        border:1px solid #D7000F!important;
       }
       // & > .van-col.active {
       //   background: #F22E3C;
@@ -1025,7 +1033,7 @@ export default {
       }
       .right {
         text-align: right;
-        color: rgba(242, 46, 60, 1);
+        color: #D7000F;
       }
     }
     .tip {
@@ -1151,7 +1159,7 @@ export default {
 }
 /*特殊处理 */
 /deep/ .van-field__control{
-  color: rgba(242, 46, 60, 1) !important;
+  color: #D7000F !important;
   margin-left:0;
   margin-top:2px;
 }
@@ -1176,4 +1184,7 @@ export default {
 .el-loading-spinner .path{
   stroke:rgb(255, 255, 255)!important
 }
+.van-key--blue{
+  background: #D7000F;
+}
 </style>

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

@@ -121,15 +121,15 @@ export default {
     document.title = '中国东信智慧园区'
     this.orderStatus()
     if(this.$route.query.id){
-        console.log(this.$route.query.id)
         this.orderStatus()
         setTimeout(()=>{
             for(let i =0;i<this.order.length;i++){
-                if(this.order[i].id = this.$route.query.id){
+                console.log(this.order[i].id)
+                if(this.order[i].id == this.$route.query.id){
                     this.orderOne(this.order[i])
                 }
             }
-        },50)
+        },1000)
         
     }else{
         this.orderStatus()
@@ -307,6 +307,7 @@ export default {
                 padding:15px;
                 .dcrText,.scAddressText,.statusText{
                     color:#999999;
+                    
                 }
                 .dcr,.scAddress,.status{
                     color:#333;
@@ -315,7 +316,7 @@ export default {
                 div{
                     font-size: 14px;
                     margin-top:8px;
-                    line-height: 20px;
+                    height:21px;
                 }
                 .status1{
                     color:#D7000F;
@@ -354,6 +355,7 @@ export default {
                 div{
                     margin-top:8px;
                     line-height: 20px;
+                    height:21px;
                 }
                 div:nth-child(odd){
                     text-align: left;

+ 32 - 18
src/views/home/index.vue

@@ -85,7 +85,7 @@
             <el-table-column label="食堂设备" align="left" prop="termName" show-overflow-tooltip min-width="30%"/>
             <el-table-column label="金额" align="left" prop="amt" show-overflow-tooltip min-width="20%">
                <template slot-scope="scop">
-                {{scop.row.amt}}元
+                {{scop.row.amt.toFixed(2)}}元
               </template>
             </el-table-column>
             <el-table-column label="时间" align="left" prop="createTime" show-overflow-tooltip min-width="50%"/>
@@ -316,7 +316,6 @@ export default {
       }else{
         this.loading2 = false
       }
-      console.log(this.adminList2[0])
     })
     //访客查询
     
@@ -530,10 +529,9 @@ export default {
             margin-bottom:6px;
             margin-top:-2px;
             font-size: 13px;
+            width:240px; //要加宽度 ,若是span等行内元素,加个display:inline-block;
             white-space: nowrap;
-            /* 超出隐藏 */
             overflow: hidden;
-            /* 文本超出显示成... */
             text-overflow: ellipsis;
           }
           .arrowRight{
@@ -635,44 +633,60 @@ export default {
 
 </style>
 <style>
-.recordTable  .cell{
+.recordTable.el-table  .cell{
   color:#999999 !important;
 }
 
-.el-table td{
+.recordTable.el-table td{
   padding:0;
 }
-.el-table td, .el-table th{
+.recordTable.el-table td, .el-table th{
   padding:0 !important;
 }
-.recordTable th>.cell{
-  /* height:48px;
-  line-height: 48px; */
+.recordTable.el-table th>.cell{
   font-size: 15px;
   color:#999999;
-  padding:0 15px;
+  padding:0 16px;
   font-weight: 400;
+  text-align: center;
+  height:40px;
+  line-height: 40px;
+}
+.recordTable.el-table th:nth-child(1)>.cell{
+  text-align: left;
 }
-th{
+.recordTable.el-table th{
   height:40px;
   line-height: 40px;
 
 }
-
-.el-table__body-wrapper tr td>.cell{
-  padding:0 15px;
+.recordTable.el-table .el-table__body-wrapper tr td>.cell{
+  padding:0;
   box-sizing: border-box;
 }
-tr:nth-child(even){
+.recordTable.el-table .el-table__body-wrapper tr td:first-child>.cell{
+  padding-left:15px;
+}
+.recordTable.el-table tr:nth-child(even){
   background-color: #fff;
 }
-tr:nth-child(odd){
+.recordTable.el-table tr:nth-child(odd){
   background-color: #F9F9F9;
 }
-.el-table td .cell{
+.recordTable.el-table td .cell{
   color:#666666 !important;
   height:48px;
   line-height:48px;
+  text-align: center;
+}
+.recordTable.el-table td:first-child .cell{
+  text-align: left;
+}
+.recordTable th .cell{
+  padding:0 !important;
+}
+.recordTable th:nth-child(1) .cell{
+  padding-left:16px !important;
 }
 .el-loading-mask{
   background-color: transparent !important;

+ 3 - 2
src/views/login/index.vue

@@ -209,6 +209,7 @@ export default {
                     Cookies.set("password57", encrypt(this.loginForm.password), { expires: 300 });
                     Cookies.set("portrait57", data.user.dmUser.faceid, { expires: 300 });
                     Cookies.set("userId57", data.userId, { expires: 300 });
+                    // localStorage.setItem("user_wt",data.userId)
                     Cookies.set("token57", data.token, { expires: 300 });
                     Cookies.set("nonce57", data.nonce, { expires: 300 });
                     Cookies.set("timestamp57", data.timestamp, { expires: 300 });
@@ -393,8 +394,8 @@ export default {
     width:100%;
     margin-top:10px;
     color: #fff;
-    background-color: rgba(242, 46, 60, 1);;
-    border-color: rgba(242, 46, 60, 1);;
+    background-color: #D7000F;
+    border-color: #D7000F;
     border-radius: 4px;
   }
 

+ 52 - 31
src/views/orderingFood/address/index.vue

@@ -79,6 +79,7 @@ export default {
       title: "送餐地址",
       money: 0,
       addressList: [],
+      text:undefined
     };
   },
   components: {
@@ -118,11 +119,22 @@ export default {
   },
   methods: {
     fanhuiBtn() {
-      this.$router.go(-2)
+      this.$router.go(-1)
     },
     change(id) {
         this.form.id = id
     },
+    checkBlankSpace(str){
+      this.text = undefined
+      while(str.lastIndexOf(" ")>=0){
+        str = str.replace(" ","");
+      }
+      if(str.length == 0){
+        Toast("输入不能全为空");
+        this.text = 1
+        return
+      }
+    },
     submit(){
       //获取默认地址
       let data = this.store.cart
@@ -135,44 +147,53 @@ export default {
           select.totalPrice = (data[i].price * data[i].num).toFixed(2)
           select.mCount = data[i].num
           arr.push(select)
-
         }
       }
       if(this.form.id == "" && !this.form.address){
         Toast("送菜地址不能为空")
         return
       }
+      if(this.form.id == "自定义送餐地址:" && !this.form.address){
+        Toast("送菜地址不能为空")
+        return
+      }
+      if(this.form.id == "自定义送餐地址:"){
+        this.checkBlankSpace(this.form.address)
+        if(this.text){
+          return
+        }
+      }
       axios.get("https://smartpark.caih.com/dxapi/dxtop/staff/one",{
-          params:{
-            id: localStorage.getItem("user_wt")
-          }
-        }).then(res2 =>{
-          axios.post(`https://smartpark.caih.com/dxapi/dreOrder/`,
-            {
-              orderUserName:Cookies.get("nickName57"),
-              address:this.form.id == "自定义送餐地址:" ? this.form.address : this.form.id,
-              totalMoney:this.money.toFixed(2),
-              mType:localStorage.getItem("canbie57"),
-              phone:this.form.tel,
-              remark:this.form.remarks,
-              dreOrderDetails:arr,
-              orderUserId:res2.data.data.sid
-            }).then(res => { 
-              this.$store.dispatch("cart", [])
-              this.$store.dispatch("canbie", undefined)
-              localStorage.removeItem("canbie57");
+        params:{
+          id: localStorage.getItem("user_wt")
+        }
+      }).then(res2 =>{
+        axios.post(`https://smartpark.caih.com/dxapi/dreOrder/`,
+          {
+            orderUserName:Cookies.get("nickName57"),
+            address:this.form.id == "自定义送餐地址:" ? this.form.address : this.form.id,
+            totalMoney:this.money.toFixed(2),
+            mType:localStorage.getItem("canbie57"),
+            phone:this.form.tel,
+            remark:this.form.remarks,
+            dreOrderDetails:arr,
+            orderUserId:res2.data.data.sid
+          }).then(res => { 
+            this.$store.dispatch("cart", [])
+            this.$store.dispatch("canbie", undefined)
+            localStorage.removeItem("canbie57");
 
-              Dialog.confirm({
-                title: '系统信息',
-                message: '您的点餐已进入配餐流程,请耐心等候,谢谢!',
-              }).then(() => {
-                this.$router.go(-2)
-              });
-              setTimeout(()=>{
-                document.getElementsByClassName("van-button__text")[1].innerHTML = "关闭"
-              },1)
-          })  
-        })
+            Dialog.confirm({
+              title: '系统信息',
+              message: '您的点餐已进入配餐流程,请耐心等候,谢谢!',
+            }).then(() => {
+              this.$router.go(-2)
+            });
+            setTimeout(()=>{
+              document.getElementsByClassName("van-button__text")[1].innerHTML = "关闭"
+            },1)
+        })  
+      })
       
     },
   },

+ 6 - 2
src/views/orderingFood/index.vue

@@ -114,7 +114,7 @@ export default {
   },
   created() {
     let nowTime = getNowTime().split(" ")[1].substring(0,2)
-    if(0 < nowTime && nowTime < 9){
+    if(0 <= nowTime && nowTime < 9){
       this.type = "早餐"
       this.time = "00:00 - 09:00"
     }
@@ -126,7 +126,7 @@ export default {
       this.type = "晚餐"
       this.time = "13:00 - 19:00"
     }
-    if(19< nowTime && nowTime < 24){
+    if(19<= nowTime && nowTime < 24){
       this.type = "宵夜"
       this.time = "19:00 - 24:00"
     }
@@ -267,6 +267,10 @@ export default {
                   display: inline-block;
                   position: absolute;
                   left:0;
+                  //width:60px; //要加宽度 ,若是span等行内元素,加个display:inline-block;
+                  white-space: nowrap;
+                  overflow: hidden;
+                  text-overflow: ellipsis;
                 }
                 .price{
                   color:#999999;

+ 33 - 12
src/views/orderingFood/orderService/index.vue

@@ -134,24 +134,39 @@ export default {
     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
+    console.log(this.$store.state.canbie)
+    if(this.$store.state.canbie){
+      this.typeValue = this.$store.state.canbie
+      if(nowTime <= 9){
+        this.overTime = 0
+      }else if( 9< nowTime  && nowTime < 13){
+        this.overTime = 1
+      }else if( 13<= nowTime && nowTime < 19){
+        this.overTime = 2
+      }else{
+        this.overTime = 3
+      }
     }else{
-      this.typeValue = "宵夜"
-      this.overTime = 3
+      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
     }else{
       this.foodMenu(this.typeValue)
     }
+   
     //餐单信息判断
     this.money = 0;
     let data = this.foodList
@@ -169,6 +184,8 @@ export default {
     },
     /** 返回 */
     fanhuiBtn() {
+      this.$store.dispatch("cart", [])
+      this.$store.dispatch("canbie", undefined)
       this.$router.go(-1)
     },
     /** 餐别类型状态切换 */
@@ -183,7 +200,11 @@ export default {
     },
     /** 菜品锁定 */
     submit(){
-      if(this.money<=0){
+      let num = 0
+      for(let i=0;i<this.foodList.length;i++){
+        num = this.foodList[i].num + num
+      }
+      if(num<1){
           Toast("请添加菜品")
       }else{
         this.$store.dispatch("cart", this.foodList)

+ 8 - 6
src/views/record/index.vue

@@ -5,6 +5,7 @@
         <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>
@@ -72,7 +73,7 @@
                 <div class="jlTime">时间:{{ item.createTime }}</div>
               </van-col>
               <van-col span="9">
-                <div class="jlMoney negative">  {{ item.amt>0 ? '-'  + item.amt : '+' + Math.abs(item.amt)}}元</div>
+                <div class="jlMoney negative">  {{ item.amt>0 ? '-'  + item.amt : '+' +  Math.abs(item.amt)}}元</div>
                 <div class="jlBalance">余额:{{ item.balance }} 元</div>
               </van-col>
             </van-row>
@@ -378,12 +379,12 @@ export default {
           let data = res.data.data.records
           for(let i =0;i<data.length;i++){
             if(data[i].type == "31") {//减帐
-              data[i].amt = "- " + data[i].amt
+              data[i].amt = "- " + data[i].amt.toFixed(2)
             }else{
-              data[i].amt = "+ " + data[i].amt
+              data[i].amt = "+ " + data[i].amt.toFixed(2)
             }
             this.recharge.push(data[i])
-            this.recharge[i].balance = returnFloat(data[i].balance)
+            this.recharge[i].balance = data[i].balance.toFixed(2)
           }
           this.page1 ++
           this.isref = true
@@ -420,7 +421,8 @@ export default {
           let data = res.data.data.records
           for(let i =0;i<data.length;i++){
             this.consumption.push(data[i])
-            this.consumption[i].balance = returnFloat(data[i].balance)
+            this.consumption[i].balance = data[i].balance.toFixed(2)
+            this.consumption[i].amt = data[i].amt.toFixed(2)
           }
           this.page2 ++
           this.isref = true
@@ -515,7 +517,7 @@ export default {
         margin-left:5px;
       }
       .search{
-        background-color: rgba(242, 46, 60, 1);
+        background-color: #D7000F;
         border-radius: 6px;
         margin-top:-2px;
         color:#fff;

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

@@ -5,6 +5,7 @@
             <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>
@@ -26,7 +27,7 @@ export default {
   data() {
     return {
       result:undefined,
-      title:"充值结果"
+      title:"支付结果"
     };
   },