修改食谱展示
This commit is contained in:
parent
032b4e8106
commit
7709c85cb0
@ -1,5 +1,6 @@
|
|||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
|
|
||||||
export function getRecipesPlans(id) {
|
export function getRecipesPlans(id) {
|
||||||
return request({
|
return request({
|
||||||
url: "/wap/recipes/plans/" + id,
|
url: "/wap/recipes/plans/" + id,
|
||||||
|
@ -6,6 +6,7 @@ import tagsView from "./modules/tagsView";
|
|||||||
import permission from "./modules/permission";
|
import permission from "./modules/permission";
|
||||||
import settings from "./modules/settings";
|
import settings from "./modules/settings";
|
||||||
import recipes from "./modules/recipes";
|
import recipes from "./modules/recipes";
|
||||||
|
import recipesShow from "./modules/recipesShow";
|
||||||
import global from "./modules/global";
|
import global from "./modules/global";
|
||||||
|
|
||||||
import getters from "./getters";
|
import getters from "./getters";
|
||||||
@ -21,6 +22,7 @@ const store = new Vuex.Store({
|
|||||||
permission,
|
permission,
|
||||||
settings,
|
settings,
|
||||||
recipes,
|
recipes,
|
||||||
|
recipesShow,
|
||||||
global
|
global
|
||||||
},
|
},
|
||||||
getters,
|
getters,
|
||||||
|
33
stdiet-ui/src/store/modules/recipesShow.js
Normal file
33
stdiet-ui/src/store/modules/recipesShow.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
const oriState = {
|
||||||
|
recipes: {},
|
||||||
|
shoppingCart: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
const mutations = {
|
||||||
|
updateStateData(state, payload) {
|
||||||
|
Object.keys(payload).forEach(key => {
|
||||||
|
state[key] = payload[key];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
clean(state) {
|
||||||
|
Object.keys(oriState).forEach(key => {
|
||||||
|
state[key] = oriState[key];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
async fetchFullRecipes({commit, dispatch},payload ) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getters = {};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
state: Object.assign({}, oriState),
|
||||||
|
mutations,
|
||||||
|
actions,
|
||||||
|
getters
|
||||||
|
};
|
@ -19,11 +19,17 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section class="section_zone">
|
<section class="section_zone" v-if="data.methods">
|
||||||
<div class="section_title">
|
<div class="section_title">
|
||||||
做法<em class="el-icon-dish" style="margin-left: 8px" />
|
做法<em class="el-icon-dish" style="margin-left: 8px" />
|
||||||
</div>
|
</div>
|
||||||
<div class="methods">{{ data.methods }}</div>
|
<div class="section_content">{{ data.methods }}</div>
|
||||||
|
</section>
|
||||||
|
<section class="section_zone" v-if="data.remark">
|
||||||
|
<div class="section_title">
|
||||||
|
备注<em class="el-icon-warning-outline" style="margin-left: 8px" />
|
||||||
|
</div>
|
||||||
|
<div class="section_content">{{ data.remark }}</div>
|
||||||
</section>
|
</section>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@ -74,7 +80,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.methods {
|
.section_content {
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
margin-top: 14px;
|
margin-top: 14px;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="menu_detail_wrapper">
|
<div class="menu_detail_wrapper">
|
||||||
<!-- 营养分析 -->
|
<!-- 营养分析 -->
|
||||||
<NutriComputeCom :date="date" :value="value" />
|
<!-- <NutriComputeCom :date="date" :value="value" /> -->
|
||||||
|
<div class="top">
|
||||||
|
<img :src="logo" style="width: auto; height: 32px" alt="logo" />
|
||||||
|
</div>
|
||||||
<!-- 食谱详细 -->
|
<!-- 食谱详细 -->
|
||||||
<el-card v-for="obj in menus" :key="obj.type" style="margin-top: 12px">
|
<el-card v-for="obj in menus" :key="obj.type" style="margin-top: 12px">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
@ -12,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-for="mObj in obj.values" :key="mObj.id">
|
<div v-for="mObj in obj.values" :key="mObj.id">
|
||||||
<div class="dishes_item">
|
<div class="dishes_item">
|
||||||
<div v-if="!mObj.methods" class="simple_dishes">
|
<div v-if="!mObj.methods && !mObj.remark" class="simple_dishes">
|
||||||
<span>{{ mObj.name }}</span>
|
<span>{{ mObj.name }}</span>
|
||||||
<span class="weight_style">
|
<span class="weight_style">
|
||||||
<span style="margin-right: 20px">{{ mObj.cusStr }}</span>
|
<span style="margin-right: 20px">{{ mObj.cusStr }}</span>
|
||||||
@ -31,14 +34,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import NutriComputeCom from "./NutriComputeCom";
|
// import NutriComputeCom from "./NutriComputeCom";
|
||||||
import DishesDetailDialog from "./DishesDetailDialog";
|
import DishesDetailDialog from "./DishesDetailDialog";
|
||||||
import { getDicts } from "@/api/custom/recipesShow";
|
import { getDicts } from "@/api/custom/recipesShow";
|
||||||
export default {
|
export default {
|
||||||
name: "menuDetail",
|
name: "menuDetail",
|
||||||
props: ["value", "date"],
|
props: ["value", "date"],
|
||||||
components: {
|
components: {
|
||||||
NutriComputeCom,
|
// NutriComputeCom,
|
||||||
DishesDetailDialog,
|
DishesDetailDialog,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -63,6 +66,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
logo: require("@/assets/logo/st_logo.png"),
|
||||||
menuTypeTimeDict: {
|
menuTypeTimeDict: {
|
||||||
2: "10:00 - 10:30",
|
2: "10:00 - 10:30",
|
||||||
4: "15:00 - 15:30",
|
4: "15:00 - 15:30",
|
||||||
@ -113,6 +117,10 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.menu_detail_wrapper {
|
.menu_detail_wrapper {
|
||||||
padding: 0 12px 12px 12px;
|
padding: 0 12px 12px 12px;
|
||||||
|
.top {
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px 14px;
|
||||||
|
}
|
||||||
|
|
||||||
.header_style {
|
.header_style {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
<div class="title_style">
|
<div class="title_style">
|
||||||
<span>{{ plan.label }}</span>
|
<span>{{ plan.label }}</span>
|
||||||
<em
|
<em
|
||||||
|
v-show="false"
|
||||||
class="el-icon-shopping-cart-full icon_style"
|
class="el-icon-shopping-cart-full icon_style"
|
||||||
@click="(e) => handleOnShoppingPlanClick(e, plan)"
|
@click="(e) => handleOnShoppingPlanClick(e, plan)"
|
||||||
/>
|
/>
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
class="icon_btn"
|
class="icon_btn"
|
||||||
@click="handleOnPlanClick"
|
@click="handleOnPlanClick"
|
||||||
/>
|
/>
|
||||||
<img :src="logo" style="width: auto; height: 32px" alt="logo" />
|
<!-- <img :src="logo" style="width: auto; height: 32px" alt="logo" /> -->
|
||||||
|
<span>{{ curDate }}</span>
|
||||||
<el-button
|
<el-button
|
||||||
icon="el-icon-user"
|
icon="el-icon-user"
|
||||||
type="text"
|
type="text"
|
||||||
@ -45,6 +46,15 @@ import PlanDrawer from "./PlanDrawer";
|
|||||||
import MenuDetail from "./MenuDetail";
|
import MenuDetail from "./MenuDetail";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { getProcessMenuData } from "./utils";
|
import { getProcessMenuData } from "./utils";
|
||||||
|
|
||||||
|
import { createNamespacedHelpers } from "vuex";
|
||||||
|
const {
|
||||||
|
mapActions,
|
||||||
|
mapState,
|
||||||
|
mapMutations,
|
||||||
|
mapGetters,
|
||||||
|
} = createNamespacedHelpers("recipesShow");
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "recipesShow",
|
name: "recipesShow",
|
||||||
components: {
|
components: {
|
||||||
@ -55,7 +65,7 @@ export default {
|
|||||||
props: ["id"],
|
props: ["id"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
logo: require("@/assets/logo/st_logo.png"),
|
// logo: require("@/assets/logo/st_logo.png"),
|
||||||
planList: [],
|
planList: [],
|
||||||
curPlanId: 0,
|
curPlanId: 0,
|
||||||
curMenuId: 0,
|
curMenuId: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user