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