commit
5f1710b927
@ -39,6 +39,7 @@
|
||||
<div v-else>
|
||||
<span :style="{ color: '#8c8c8c' }">{{ con.title }}:</span>
|
||||
<el-image
|
||||
v-if="data[con.value]"
|
||||
title="点击大图预览"
|
||||
fit="contain"
|
||||
style="width: auto; height: 80px"
|
||||
|
@ -164,7 +164,7 @@ export default {
|
||||
: item[1];
|
||||
return {
|
||||
type: "text",
|
||||
top: idx * 20,
|
||||
top: idx * 24,
|
||||
right: 10,
|
||||
style: {
|
||||
text: `${item[0]}:${data.toFixed(1)}${
|
||||
|
@ -5,7 +5,6 @@
|
||||
:data="nutritionSource"
|
||||
type="nutrition"
|
||||
width="364px"
|
||||
|
||||
:subTitle="subTitle"
|
||||
/>
|
||||
<pie-chart
|
||||
@ -65,13 +64,25 @@ export default {
|
||||
["晚餐", data.calories5],
|
||||
];
|
||||
if (data.calories2) {
|
||||
source.push(["早加餐", data.calories2]);
|
||||
const tarIdx = source.findIndex((obj) => obj[0] === "早餐");
|
||||
source.splice(tarIdx > -1 ? tarIdx + 1 : source.length, 0, [
|
||||
"早加餐",
|
||||
data.calories2,
|
||||
]);
|
||||
}
|
||||
if (data.calories4) {
|
||||
source.push(["午加餐", data.calories4]);
|
||||
const tarIdx = source.findIndex((obj) => obj[0] === "午餐");
|
||||
source.splice(tarIdx > -1 ? tarIdx + 1 : source.length, 0, [
|
||||
"午加餐",
|
||||
data.calories4,
|
||||
]);
|
||||
}
|
||||
if (data.calories6) {
|
||||
source.push(["晚加餐", data.calories6]);
|
||||
const tarIdx = source.findIndex((obj) => obj[0] === "晚餐");
|
||||
source.splice(tarIdx > -1 ? tarIdx + 1 : source.length, 0, [
|
||||
"晚加餐",
|
||||
data.calories6,
|
||||
]);
|
||||
}
|
||||
return source;
|
||||
},
|
||||
@ -83,13 +94,25 @@ export default {
|
||||
["晚餐", data.weight5],
|
||||
];
|
||||
if (data.weight2) {
|
||||
source.push(["早加餐", data.weight2]);
|
||||
const tarIdx = source.findIndex((obj) => obj[0] === "早餐");
|
||||
source.splice(tarIdx > -1 ? tarIdx + 1 : source.length, 0, [
|
||||
"早加餐",
|
||||
data.weight2,
|
||||
]);
|
||||
}
|
||||
if (data.weight4) {
|
||||
source.push(["午加餐", data.weight4]);
|
||||
const tarIdx = source.findIndex((obj) => obj[0] === "午餐");
|
||||
source.splice(tarIdx > -1 ? tarIdx + 1 : source.length, 0, [
|
||||
"午加餐",
|
||||
data.weight4,
|
||||
]);
|
||||
}
|
||||
if (data.weight6) {
|
||||
source.push(["晚加餐", data.weight6]);
|
||||
const tarIdx = source.findIndex((obj) => obj[0] === "晚餐");
|
||||
source.splice(tarIdx > -1 ? tarIdx + 1 : source.length, 0, [
|
||||
"晚加餐",
|
||||
data.weight6,
|
||||
]);
|
||||
}
|
||||
return source;
|
||||
},
|
||||
|
@ -63,6 +63,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
label: '',
|
||||
loading: false,
|
||||
title: "",
|
||||
logo: require("@/assets/logo/st_logo.png"),
|
||||
@ -96,7 +97,7 @@ export default {
|
||||
}
|
||||
},
|
||||
processShoppingCart(num, data = []) {
|
||||
console.log(data);
|
||||
// console.log(data);
|
||||
this.shoppingCart = data.reduce((obj, cur, idx) => {
|
||||
if (
|
||||
num < 0 || // 全部计算
|
||||
@ -141,7 +142,7 @@ export default {
|
||||
}
|
||||
return obj;
|
||||
}, {});
|
||||
console.log(this.shoppingCart);
|
||||
// console.log(this.shoppingCart);
|
||||
},
|
||||
handleOnBackClick() {
|
||||
this.visible = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user