|
@@ -1,13 +1,13 @@
|
|
<template>
|
|
<template>
|
|
- <div class="mianBox" v-if="order">
|
|
|
|
- <van-row class="headerBox">
|
|
|
|
- <van-icon name="arrow-left" @click="fanhuiBtn" class="arrow-left" />
|
|
|
|
|
|
+ <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-col class="return">返回</van-col>
|
|
<van-col class="title">{{title}}</van-col>
|
|
<van-col class="title">{{title}}</van-col>
|
|
</van-row>
|
|
</van-row>
|
|
<van-row class="top">
|
|
<van-row class="top">
|
|
<van-row class="timeType">
|
|
<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>
|
|
<van-row class="RecommendedDishes">
|
|
<van-row class="RecommendedDishes">
|
|
<van-col :span="7" v-for="(item,index) in RecommendedDishes" :key="index" class="dishes" :gutter="20">
|
|
<van-col :span="7" v-for="(item,index) in RecommendedDishes" :key="index" class="dishes" :gutter="20">
|
|
@@ -24,21 +24,20 @@
|
|
<van-image :src="require('../../assets/image/right2.png')" class="right_icon" />
|
|
<van-image :src="require('../../assets/image/right2.png')" class="right_icon" />
|
|
</van-col>
|
|
</van-col>
|
|
</van-row>
|
|
</van-row>
|
|
- <van-row class="orderList" gutter="20">
|
|
|
|
|
|
+ <van-row class="orderList">
|
|
<van-col span="24" v-for="(item,index) in order" :key="index" class="order">
|
|
<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.money}}</van-col>
|
|
|
|
- <van-col span="12" class="orderTimeText">下单时间</van-col>
|
|
|
|
- <van-col span="12" class="orderTime">{{item.createTime}}</van-col>
|
|
|
|
- <van-col span="12" class="statusText">当前状态</van-col>
|
|
|
|
- <van-col span="12" :class="item.status == '4' ? 'status' : 'status1'">
|
|
|
|
- {{item.status == "1" ? "待接单" : item.status == "2" ? "已接单" : item.status == "3" ? "配餐中" : item.status == "4" ? "送餐" : "完成"}}
|
|
|
|
|
|
+ <van-col span="12" class="moneyText">下单金额:</van-col>
|
|
|
|
+ <van-col span="12" class="money">¥{{item.totalMoney}}</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-col>
|
|
- <van-steps :active="item.status" v-if="item.status != '4'" 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-step>配餐中</van-step>
|
|
<van-step>配餐中</van-step>
|
|
- <van-step>送餐</van-step>
|
|
|
|
|
|
+ <van-step>送餐中</van-step>
|
|
</van-steps>
|
|
</van-steps>
|
|
</van-col>
|
|
</van-col>
|
|
<van-col span="24" class="noMore">没有更多数据了</van-col>
|
|
<van-col span="24" class="noMore">没有更多数据了</van-col>
|
|
@@ -49,29 +48,19 @@
|
|
<script>
|
|
<script>
|
|
import axios from "axios";
|
|
import axios from "axios";
|
|
import { Field, NumberKeyboard, Dialog, Toast,Step, Steps } from "vant";
|
|
import { Field, NumberKeyboard, Dialog, Toast,Step, Steps } from "vant";
|
|
-import { returnFloat } from '@/assets/js/common.js'
|
|
|
|
|
|
+import { getNowTime } from "@/assets/js/dataFormate.js";
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ status:false,
|
|
title:"自助点餐",
|
|
title:"自助点餐",
|
|
- type:"晚餐",
|
|
|
|
- time:'15:00-19:00',
|
|
|
|
- RecommendedDishes:[
|
|
|
|
- {name:"香菇肉粉1"},
|
|
|
|
- {name:"香菇肉粉2"},
|
|
|
|
- {name:"香菇肉粉3"},
|
|
|
|
- {name:"香菇肉粉4"},
|
|
|
|
- {name:"香菇肉粉5"},
|
|
|
|
- {name:"香菇肉粉6"},
|
|
|
|
- {name:"香菇肉粉7"},
|
|
|
|
- {name:"香菇肉粉8"},
|
|
|
|
- {name:"香菇肉粉9"},
|
|
|
|
- {name:"香菇肉粉10"},
|
|
|
|
- ],
|
|
|
|
|
|
+ type:undefined,
|
|
|
|
+ time:undefined,
|
|
|
|
+ RecommendedDishes:[],
|
|
order:[
|
|
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}
|
|
|
|
|
|
+ // {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}
|
|
],
|
|
],
|
|
|
|
|
|
};
|
|
};
|
|
@@ -90,104 +79,55 @@ export default {
|
|
[Toast.name]: Toast,
|
|
[Toast.name]: Toast,
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- var url = window.location.href;
|
|
|
|
- localStorage.setItem("amount57",url)
|
|
|
|
- if(url.indexOf("token") > 1){
|
|
|
|
- //("app进入")
|
|
|
|
- if(this.getQueryVariable("token")){
|
|
|
|
- localStorage.removeItem('type');
|
|
|
|
- this.erp = true
|
|
|
|
- this.noerp = false
|
|
|
|
- this.loadingErp = true
|
|
|
|
- this.userQuery()
|
|
|
|
- }else{
|
|
|
|
- //console.log("app进入")
|
|
|
|
- Toast(this.getQueryVariable("无token传入!"))
|
|
|
|
- }
|
|
|
|
|
|
+ let nowTime = getNowTime().split(" ")[1].substring(0,2)
|
|
|
|
+ if(0 < nowTime && nowTime < 9){
|
|
|
|
+ this.type = "早餐"
|
|
|
|
+ this.time = "00:00 - 09:00"
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if(9<= nowTime && nowTime < 13){
|
|
|
|
+ this.type = "午餐"
|
|
|
|
+ this.time = "09:00 - 13:00"
|
|
|
|
+ }
|
|
|
|
+ if(13<= nowTime && nowTime < 19){
|
|
|
|
+ this.type = "晚餐"
|
|
|
|
+ this.time = "13:00 - 19:00"
|
|
|
|
+ }
|
|
|
|
+ if(19< nowTime && nowTime < 24){
|
|
|
|
+ this.type = "宵夜"
|
|
|
|
+ this.time = "19:00 - 24:00"
|
|
|
|
+ }
|
|
|
|
+ //获取菜单
|
|
|
|
+ axios.get(`https://smartpark.caih.com/dxapi/dreMenu/list?current=1&size=500&type=${this.type}&isRecommend=1`).then(res => {
|
|
|
|
+ const data = res.data.data.records
|
|
|
|
+ this.RecommendedDishes = data
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- mouted(){
|
|
|
|
- var url = window.location.href;
|
|
|
|
|
|
+ mounted(){
|
|
|
|
+ document.title = '中国东信智慧园区'
|
|
|
|
+ //历史订单
|
|
|
|
+ axios.post(`https://smartpark.caih.com/dxapi/dreOrder/page`,{
|
|
|
|
+ current:1,
|
|
|
|
+ size:500,
|
|
|
|
+ orderUserName:localStorage.getItem("nickName57")
|
|
|
|
+ }).then(res => {
|
|
|
|
+ const data = res.data.data.records
|
|
|
|
+ this.order = data
|
|
|
|
+ this.status = true
|
|
|
|
+ })
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- diancan(){
|
|
|
|
- this.$router.push({ path: "/orderService"})
|
|
|
|
- },
|
|
|
|
- //用户查询(卡号)
|
|
|
|
- userQuery(){
|
|
|
|
- axios({//查询信息
|
|
|
|
- method: 'get',
|
|
|
|
- url: 'https://smartpark.caih.com/zkxt/api/thirdparty/v1/user/getZkUserByCipher?cipher=' + this.getQueryVariable("token"),
|
|
|
|
- timeout: 10000,
|
|
|
|
- }).then(res =>{
|
|
|
|
- if(res.data?.data?.id){
|
|
|
|
- //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.proportion){
|
|
|
|
- this.proportion = res2.data.data.proportion
|
|
|
|
- }else{
|
|
|
|
- this.proportion = 1
|
|
|
|
- }
|
|
|
|
- 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)
|
|
|
|
- this.cardId = res2.data.data.cardId
|
|
|
|
- this.cardLoading = false
|
|
|
|
- this.Balance()
|
|
|
|
- this.recharge2()
|
|
|
|
- }else{
|
|
|
|
- this.userNoAlert()
|
|
|
|
- }
|
|
|
|
- this.loadingErp = false
|
|
|
|
- })
|
|
|
|
- }else if(res.data?.data?.cardId){
|
|
|
|
- this.loadingErp = false
|
|
|
|
- Toast("用户卡号未绑定")
|
|
|
|
- }else{
|
|
|
|
- this.loadingErp = false
|
|
|
|
- this.userNoAlert()
|
|
|
|
- }
|
|
|
|
- }).catch(err =>{
|
|
|
|
- this.loadingErp = false
|
|
|
|
- this.userNoAlert()
|
|
|
|
- });
|
|
|
|
|
|
+ fanhuiBtn() {
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ //this.$router.push({ path: "/home"})
|
|
},
|
|
},
|
|
- userNoAlert(){
|
|
|
|
- Toast("当前账户初始流程中,请耐心等待或联系管理人员查询")
|
|
|
|
- },
|
|
|
|
- getQueryVariable(variable){//参数获取 设定微信进入参数
|
|
|
|
- //window.location.search.substring(1);
|
|
|
|
- console.log(variable)
|
|
|
|
- var query = window.location.hash.substring(3);
|
|
|
|
- var vars = query.split("&");
|
|
|
|
- if(vars[2]){ //判定微信端进入
|
|
|
|
- localStorage.setItem("passageway","weixin")
|
|
|
|
- }else{
|
|
|
|
- localStorage.removeItem("passageway")
|
|
|
|
- }
|
|
|
|
- for (var i=0;i<vars.length;i++) {
|
|
|
|
- var pair = vars[i].split("=");
|
|
|
|
- if(pair[0] == variable || pair[0] =="mount?token"){
|
|
|
|
-
|
|
|
|
- if(vars[1] != "classify"){
|
|
|
|
- // localStorage.removeItem("classify")
|
|
|
|
- }
|
|
|
|
- if(variable =="token"){
|
|
|
|
- this.user = pair[1]
|
|
|
|
- }else if(variable =="type"){
|
|
|
|
- this.type = pair[1]
|
|
|
|
- }
|
|
|
|
- return pair[1];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return(false);
|
|
|
|
|
|
+ diancan(){
|
|
|
|
+ this.$router.push({ path: "/orderService"})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
handleClose() {
|
|
handleClose() {
|
|
this.money = Number(this.money);
|
|
this.money = Number(this.money);
|
|
this.overlayShow = false;
|
|
this.overlayShow = false;
|
|
@@ -200,7 +140,7 @@ export default {
|
|
|
|
|
|
//返回上级或app目录页
|
|
//返回上级或app目录页
|
|
fanhuiBtn(){
|
|
fanhuiBtn(){
|
|
- this.$router.go(-1)
|
|
|
|
|
|
+ this.$router.push({ path: "/home"})
|
|
// if(localStorage.getItem("passageway")){
|
|
// if(localStorage.getItem("passageway")){
|
|
// this.$router.go(-1)
|
|
// this.$router.go(-1)
|
|
// }else{
|
|
// }else{
|
|
@@ -244,13 +184,12 @@ export default {
|
|
padding:10px 0 2px;
|
|
padding:10px 0 2px;
|
|
text-align: left;
|
|
text-align: left;
|
|
.describe{
|
|
.describe{
|
|
- font-size: 16px;
|
|
|
|
- // font-family: PingFangMedium;
|
|
|
|
|
|
+ font-size: 18px;
|
|
font-weight: 700;
|
|
font-weight: 700;
|
|
width:100%;
|
|
width:100%;
|
|
}
|
|
}
|
|
.time{
|
|
.time{
|
|
- font-size: 14px;
|
|
|
|
|
|
+ font-size: 15px;
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -303,11 +242,15 @@ export default {
|
|
padding:15px 15px 15px;
|
|
padding:15px 15px 15px;
|
|
.moneyText,.orderTimeText,.statusText{
|
|
.moneyText,.orderTimeText,.statusText{
|
|
color:#999999;
|
|
color:#999999;
|
|
|
|
+ text-align: left;
|
|
|
|
+ height:30px;
|
|
|
|
|
|
}
|
|
}
|
|
.money,.orderTime,.status{
|
|
.money,.orderTime,.status{
|
|
color:#333;
|
|
color:#333;
|
|
|
|
+ height:30px;
|
|
text-align: right;
|
|
text-align: right;
|
|
|
|
+
|
|
}
|
|
}
|
|
div{
|
|
div{
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
@@ -319,6 +262,7 @@ export default {
|
|
.status1{
|
|
.status1{
|
|
color:#D7000F;
|
|
color:#D7000F;
|
|
text-align: right;
|
|
text-align: right;
|
|
|
|
+ height:30px;
|
|
}
|
|
}
|
|
.van-steps{
|
|
.van-steps{
|
|
width:100%;
|
|
width:100%;
|
|
@@ -350,10 +294,21 @@ export default {
|
|
<style>
|
|
<style>
|
|
.van-steps__items{
|
|
.van-steps__items{
|
|
margin-top:-10px !important;
|
|
margin-top:-10px !important;
|
|
|
|
+ /* width:100%;
|
|
|
|
+ margin-left:-25%;
|
|
|
|
+ overflow: hidden; */
|
|
}
|
|
}
|
|
.van-step__title{
|
|
.van-step__title{
|
|
position: absolute !important;
|
|
position: absolute !important;
|
|
top:40px;
|
|
top:40px;
|
|
- font-size: 14px !important;
|
|
|
|
|
|
+ font-size: 12px !important;
|
|
|
|
+ margin-left:-50px;
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+.van-step--horizontal:last-child .van-step__title{
|
|
|
|
+ margin-left:-40px;
|
|
|
|
+}
|
|
|
|
+.van-steps__items:nth-child(1){
|
|
|
|
+
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|