|
@@ -1,12 +1,12 @@
|
|
|
<template>
|
|
|
- <el-col :span="24" class="restaurant modular" style="padding:10px 20px 0;">
|
|
|
+ <el-col :span="24" class="restaurant modular" style="padding:10px 20px 0;" v-loading="loading">
|
|
|
<el-col class="title" style="margin-left:0">智慧餐饮</el-col>
|
|
|
<el-col class="restaurantLeft">
|
|
|
<el-col :span="24" class="nh">
|
|
|
<el-image :src="restaurant1" fit="scale-down" />
|
|
|
<el-col class="name"
|
|
|
>今日营业额<el-col class="num"
|
|
|
- >{{num[0]}}<span class="unit">元</span></el-col
|
|
|
+ >{{ data.consumerNowNumber || 0 }}<span class="unit">元</span></el-col
|
|
|
></el-col
|
|
|
>
|
|
|
</el-col>
|
|
@@ -14,7 +14,7 @@
|
|
|
<el-image :src="restaurant1" fit="scale-down" />
|
|
|
<el-col class="name"
|
|
|
>今日销售人/次<el-col class="num"
|
|
|
- >{{num[1]}}<span class="unit">份</span></el-col
|
|
|
+ >{{ data.nowIncome || 0 }}<span class="unit">份</span></el-col
|
|
|
></el-col
|
|
|
>
|
|
|
</el-col>
|
|
@@ -26,10 +26,10 @@
|
|
|
<el-image :src="restaurant3" fit="scale-down" class="rightImg" />
|
|
|
</el-col>
|
|
|
<el-col class="bottom">
|
|
|
- <div class="dish" v-for="(item,index) in list2" :key="index" @click="canyin(index + 1)">
|
|
|
- <el-col :span="8"><el-image :src="item.id" fit="scale-down" class="leftImg"/></el-col>
|
|
|
+ <div class="dish" v-for="(item,index) in data.countTheTopThree" :key="index">
|
|
|
+ <el-col :span="8"><el-image :src="item.img" fit="scale-down" class="leftImg"/></el-col>
|
|
|
<el-col :span="8" class="dishName">{{item.name}}</el-col>
|
|
|
- <el-col :span="8" class="fs">{{item.num}}份</el-col>
|
|
|
+ <el-col :span="8" class="fs">{{item.countPid}}份</el-col>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -48,23 +48,14 @@ export default {
|
|
|
name: "restaurant",
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading:true,
|
|
|
restaurant1: restaurant1,
|
|
|
restaurant2: restaurant2,
|
|
|
restaurant3: restaurant3,
|
|
|
num1: num1,
|
|
|
num2: num2,
|
|
|
num3: num3,
|
|
|
- data:{
|
|
|
- total:undefined,
|
|
|
- list:{}
|
|
|
- },
|
|
|
- list2:[
|
|
|
- {id:num1,name:"清炒时蔬",num:412},
|
|
|
- {id:num2,name:"柠檬鸭",num:315},
|
|
|
- {id:num3,name:"番茄炒蛋",num:267},
|
|
|
- ],
|
|
|
- num:[38155,15642],
|
|
|
- tapNo:false,
|
|
|
+ data:{},
|
|
|
};
|
|
|
},
|
|
|
created(){
|
|
@@ -75,7 +66,7 @@ export default {
|
|
|
{id:num2,name:"未营业",num:0},
|
|
|
{id:num3,name:"未营业",num:0},
|
|
|
]
|
|
|
- this.num = [0,0]
|
|
|
+ // this.num = [0,0]
|
|
|
this.tapNo = true
|
|
|
}
|
|
|
if(getWeekDate() == "周六" || getWeekDate() == "周日"){
|
|
@@ -88,27 +79,23 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
init(){
|
|
|
+ this.loading = true
|
|
|
axios({
|
|
|
method: 'get',
|
|
|
- url: 'https://smartpark.caih.com/zhcy/api/thirdparty/v1/open/countOrderAmt',
|
|
|
+ url: 'https://smartpark.caih.com/zhcy/api/thirdparty/v1/open/getCanYinData',
|
|
|
timeout: 3000,
|
|
|
}).then(res =>{
|
|
|
- this.data.total = res.data
|
|
|
- }).catch(err =>{
|
|
|
- })
|
|
|
-
|
|
|
- axios({
|
|
|
- method: 'get',
|
|
|
- url: 'https://smartpark.caih.com/zhcy/api/thirdparty/v1/open/hyFood',
|
|
|
- timeout: 3000,
|
|
|
- }).then(res =>{
|
|
|
- if(res.data){
|
|
|
- this.data.list = res.data
|
|
|
- this.data.list[0].id = this.num1
|
|
|
- this.data.list[1].id = this.num2
|
|
|
- this.data.list[2].id = this.num3
|
|
|
+ this.data = res.data.data
|
|
|
+ if(this.data.countTheTopThree.length>0){
|
|
|
+ this.data.countTheTopThree[0].img= this.num1
|
|
|
+ this.data.countTheTopThree[1].img= this.num2
|
|
|
+ this.data.countTheTopThree[2].img= this.num3
|
|
|
+ }else{
|
|
|
+ this.data.countTheTopThree[0] = {img:this.num1,name:"暂未营业",countPid:0}
|
|
|
+ this.data.countTheTopThree[1] = {img:this.num2,name:"暂未营业",countPid:0}
|
|
|
+ this.data.countTheTopThree[2] = {img:this.num3,name:"暂未营业",countPid:0}
|
|
|
}
|
|
|
- }).catch(err =>{
|
|
|
+ this.loading= false
|
|
|
})
|
|
|
},
|
|
|
timing(){
|
|
@@ -116,14 +103,14 @@ export default {
|
|
|
this.init()
|
|
|
},1000 * 60 * 5)
|
|
|
},
|
|
|
- canyin(id){
|
|
|
- if(this.tapNo == true){
|
|
|
- //禁止跳转(周六周日休业)
|
|
|
- }else{
|
|
|
- this.$emit("canyinClick",id)
|
|
|
- }
|
|
|
+ // canyin(id){
|
|
|
+ // if(this.tapNo == true){
|
|
|
+ // //禁止跳转(周六周日休业)
|
|
|
+ // }else{
|
|
|
+ // this.$emit("canyinClick",id)
|
|
|
+ // }
|
|
|
|
|
|
- }
|
|
|
+ // }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -204,11 +191,14 @@ export default {
|
|
|
background-color: $modularHoverBackGround;
|
|
|
text-align: center;
|
|
|
vertical-align: middle;
|
|
|
- cursor: pointer;
|
|
|
+ // cursor: pointer;
|
|
|
.el-image {
|
|
|
width: 24px;
|
|
|
margin: 4.5px 0;
|
|
|
}
|
|
|
+ .dishName{
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
.dishName,
|
|
|
.fs {
|
|
|
font-size: 16px;
|