|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="mianBox" v-if="status">
|
|
|
+ <div class="mianBox">
|
|
|
<van-row class="headerBox" >
|
|
|
<van-col class="returnWrap" @click="fanhuiBtn">
|
|
|
<van-image class="arrow-left"
|
|
@@ -30,35 +30,71 @@
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
<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'">
|
|
|
+ <van-row span="24" v-for="(item,index) in order" :key="index" class="order" @click="orderOne(item)">
|
|
|
+ <van-col span="5" class="moneyText">下单金额:</van-col>
|
|
|
+ <van-col offset="1" span="18" class="money" >¥{{item.totalMoney}}</van-col>
|
|
|
+ <van-col span="5" class="moneyText">已点菜品:</van-col>
|
|
|
+ <van-col offset="1" span="18" class="money">{{item.dishes}}</van-col>
|
|
|
+ <van-col span="5" class="orderTimeText">下单时间:</van-col>
|
|
|
+ <van-col offset="1" span="18" class="orderTime">{{item.orderTime}}</van-col>
|
|
|
+ <van-col span="5" class="statusText">当前状态:</van-col>
|
|
|
+ <van-col offset="1" span="18" :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-step>待接单</van-step>
|
|
|
- <van-step>配餐中</van-step>
|
|
|
- <van-step>送餐中</van-step>
|
|
|
+ <van-step>{{ item.orderStatus == 0 ? '待接单' : item.orderStatus == 1 ? '已接单' : item.orderStatus == 2 ? '已接单' : '接单' }}</van-step>
|
|
|
+ <van-step>{{ item.orderStatus == 1 ? '配餐中' : item.orderStatus == 2 ? '已配餐' : '配餐' }}</van-step>
|
|
|
+ <van-step>{{ item.orderStatus == 2 ? '送餐中' : '送餐' }}</van-step>
|
|
|
</van-steps>
|
|
|
- </van-col>
|
|
|
- <van-col span="24" class="noMore" v-if="over">没有更多数据了</van-col>
|
|
|
+ </van-row>
|
|
|
+ <!-- <van-col span="24" class="noMore" v-if="over">{{dd}}</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>
|
|
|
+ <van-dialog v-model="open" class="pcDialog">
|
|
|
+ <van-row class="orderDetails">
|
|
|
+ <van-col class="detailsTitle">点餐明细</van-col>
|
|
|
+ <van-col class="order" span="24">
|
|
|
+ <van-col span="7" style="margin-top:0">订餐人:</van-col>
|
|
|
+ <van-col offset="1" span="16" style="margin-top:0">{{orderDetails.orderUserName || '-'}}</van-col>
|
|
|
+ <van-col span="7">餐别:</van-col>
|
|
|
+ <van-col offset="1" span="16">{{orderDetails.mType || '-'}}</van-col>
|
|
|
+ <van-col span="7">手机号:</van-col>
|
|
|
+ <van-col offset="1" span="16">{{orderDetails.phone || '-'}}</van-col>
|
|
|
+ <van-col span="7">送餐地址:</van-col>
|
|
|
+ <van-col offset="1" span="16">{{orderDetails.address || "-"}}</van-col>
|
|
|
+ <van-col span="7">备注:</van-col>
|
|
|
+ <van-col offset="1" span="16">{{orderDetails.remark || '-'}}</van-col>
|
|
|
+ </van-col>
|
|
|
+ <van-col class="detailsText">已点菜品</van-col>
|
|
|
+ <van-col span="24" class="dishes">
|
|
|
+ <van-col span="24" v-for="(item,index) in dishes" :key="index" class="list">
|
|
|
+ <van-col span="12" class="name">{{item.mName}}</van-col>
|
|
|
+ <van-col span="12" class="num">{{item.mCount}}份</van-col>
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+ <van-col class="statusSelect">
|
|
|
+ <van-col class="select gb" @click="close">
|
|
|
+ 关闭
|
|
|
+ </van-col>
|
|
|
+ </van-col>
|
|
|
+
|
|
|
+ </van-row>
|
|
|
+ </van-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import { getNowTime } from "@/assets/js/dataFormate.js";
|
|
|
import Cookies from "js-cookie";
|
|
|
+import {
|
|
|
+ Dialog,
|
|
|
+ Toast,
|
|
|
+} from "vant";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ dd:undefined,
|
|
|
status:false,
|
|
|
title:"自助点餐",
|
|
|
type:undefined,
|
|
@@ -66,39 +102,17 @@ export default {
|
|
|
RecommendedDishes:[],
|
|
|
order:[],
|
|
|
over:false,//数据拉载完成
|
|
|
- over2:false
|
|
|
-
|
|
|
+ over2:false,
|
|
|
+ open:false,
|
|
|
+ orderDetails:{},
|
|
|
+ dishes:[],
|
|
|
};
|
|
|
},
|
|
|
+ components: {
|
|
|
+ [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 = "早餐"
|
|
@@ -116,13 +130,23 @@ export default {
|
|
|
this.type = "宵夜"
|
|
|
this.time = "19:00 - 24:00"
|
|
|
}
|
|
|
+ if(localStorage.getItem("tokenERP")){
|
|
|
+
|
|
|
+ }else if(this.$route.query.token){
|
|
|
+ this.getToken()
|
|
|
+ }else{
|
|
|
+ Toast("没有获取token信息")
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted(){
|
|
|
//获取菜单
|
|
|
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
|
|
|
})
|
|
|
- },
|
|
|
- mounted(){
|
|
|
+
|
|
|
document.title = '中国东信智慧园区'
|
|
|
let startTime = getNowTime().split(" ")[0] + " 00:00:00"
|
|
|
let endTime = getNowTime().split(" ")[0] + " 23:59:59"
|
|
@@ -130,7 +154,7 @@ export default {
|
|
|
axios.post(`https://smartpark.caih.com/dxapi/dreOrder/page`,{
|
|
|
current:1,
|
|
|
size:500,
|
|
|
- orderUserName:localStorage.getItem("nickName57"),
|
|
|
+ orderUserName:Cookies.get("nickName57"),
|
|
|
startTime:startTime,
|
|
|
endTime:endTime,
|
|
|
}).then(res => {
|
|
@@ -161,6 +185,21 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ getToken(){
|
|
|
+ localStorage.setItem("tokenERP",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.name, { expires: 300 });
|
|
|
+ localStorage.setItem("user_wt", res.data.data.id)
|
|
|
+ }
|
|
|
+ }).catch(err =>{
|
|
|
+ this.userNoAlert()
|
|
|
+ });
|
|
|
+ },
|
|
|
userNoAlert(){
|
|
|
Toast("当前账户初始流程中,请耐心等待或联系管理人员查询")
|
|
|
},
|
|
@@ -174,7 +213,17 @@ export default {
|
|
|
},
|
|
|
/** 返回上级或app目录页 */
|
|
|
fanhuiBtn(){
|
|
|
- this.$router.push({ path: "/home"})
|
|
|
+ //this.$router.back()
|
|
|
+ this.$router.go(-1)
|
|
|
+ //this.$router.push({ path: "/home"})
|
|
|
+ },
|
|
|
+ orderOne(row){
|
|
|
+ this.open = true
|
|
|
+ this.orderDetails = row
|
|
|
+ this.dishes = row.dreOrderDetails
|
|
|
+ },
|
|
|
+ close(){
|
|
|
+ this.open = false
|
|
|
}
|
|
|
},
|
|
|
};
|
|
@@ -278,6 +327,11 @@ export default {
|
|
|
.money,.orderTime,.status{
|
|
|
color:#333;
|
|
|
text-align: right;
|
|
|
+ white-space: nowrap;
|
|
|
+ /* 超出隐藏 */
|
|
|
+ overflow: hidden;
|
|
|
+ /* 文本超出显示成... */
|
|
|
+ text-overflow: ellipsis;
|
|
|
}
|
|
|
div{
|
|
|
font-size: 14px;
|
|
@@ -320,6 +374,92 @@ export default {
|
|
|
background-color: #ffffff;
|
|
|
}
|
|
|
}
|
|
|
+ .pcDialog{
|
|
|
+ border-radius: 5px;
|
|
|
+ width:85%;
|
|
|
+ padding:20px 0;
|
|
|
+ .orderDetails{
|
|
|
+ .detailsTitle{
|
|
|
+ font-size: 18px;
|
|
|
+ margin-top:0px;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: 700;
|
|
|
+ width:100%;
|
|
|
+ }
|
|
|
+ .order{
|
|
|
+ padding:0px 16px 20px;
|
|
|
+ border-bottom:1px solid #F0F0F0;
|
|
|
+ div{
|
|
|
+ margin-top:8px;
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
+ div:nth-child(odd){
|
|
|
+ text-align: left;
|
|
|
+ color:#999999;
|
|
|
+ }
|
|
|
+ div:nth-child(even){
|
|
|
+ text-align: right;
|
|
|
+ color:#333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .detailsText,.jjPhone{
|
|
|
+ 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: 15px;
|
|
|
+ height:40px;
|
|
|
+ line-height: 40px;
|
|
|
+ width:100%;
|
|
|
+ div:nth-child(odd){
|
|
|
+ text-align: left;
|
|
|
+ padding-left:10px;
|
|
|
+ }
|
|
|
+ div:nth-child(even){
|
|
|
+ text-align: right;
|
|
|
+ padding-right:10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .list:nth-child(odd){
|
|
|
+ background: #F9F9F9;
|
|
|
+ }
|
|
|
+ .list:nth-child(even){
|
|
|
+ background: #F0F0F0;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ .statusSelect{
|
|
|
+ margin:20px 0 0;
|
|
|
+ width:100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding:0 16px;
|
|
|
+ .select{
|
|
|
+ height:44px;
|
|
|
+ line-height: 44px;
|
|
|
+ font-size: 17px;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 5px;
|
|
|
+ width:100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .gb{
|
|
|
+ color: #fff;
|
|
|
+ background:#D7000F;
|
|
|
+ border-radius: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -355,6 +495,7 @@ export default {
|
|
|
.van-step--horizontal .van-step__circle-container{
|
|
|
padding:0;
|
|
|
left:0;
|
|
|
+ margin-top:1px;
|
|
|
}
|
|
|
.van-step--horizontal:last-child .van-step__title{
|
|
|
margin-left:-40px;
|
|
@@ -368,10 +509,10 @@ export default {
|
|
|
border:none;
|
|
|
}
|
|
|
.van-step--horizontal:last-child .van-step__circle-container{
|
|
|
- right:14px !important;
|
|
|
+ right:12px !important;
|
|
|
}
|
|
|
.van-step--horizontal:last-child .van-step__circle-container{
|
|
|
- right:14px !important;
|
|
|
+ right:12px !important;
|
|
|
}
|
|
|
.van-step__title--active{
|
|
|
color:#333 !important;
|