!112 修改食谱展示

Merge pull request !112 from 德仔/develop
This commit is contained in:
德仔 2021-03-09 18:27:55 +08:00 committed by Gitee
commit ff4476532e
7 changed files with 70 additions and 9 deletions

View File

@ -1,5 +1,6 @@
import request from "@/utils/request";
export function getRecipesPlans(id) {
return request({
url: "/wap/recipes/plans/" + id,

View File

@ -6,6 +6,7 @@ import tagsView from "./modules/tagsView";
import permission from "./modules/permission";
import settings from "./modules/settings";
import recipes from "./modules/recipes";
import recipesShow from "./modules/recipesShow";
import global from "./modules/global";
import getters from "./getters";
@ -21,6 +22,7 @@ const store = new Vuex.Store({
permission,
settings,
recipes,
recipesShow,
global
},
getters,

View 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
};

View File

@ -19,11 +19,17 @@
</span>
</div>
</section>
<section class="section_zone">
<section class="section_zone" v-if="data.methods">
<div class="section_title">
做法<em class="el-icon-dish" style="margin-left: 8px" />
</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>
</el-dialog>
</template>
@ -74,7 +80,7 @@ export default {
}
}
.methods {
.section_content {
padding: 0 8px;
margin-top: 14px;
}

View File

@ -1,7 +1,10 @@
<template>
<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">
<div slot="header">
@ -12,7 +15,7 @@
</div>
<div v-for="mObj in obj.values" :key="mObj.id">
<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 class="weight_style">
<span style="margin-right: 20px">{{ mObj.cusStr }}</span>
@ -31,14 +34,14 @@
</div>
</template>
<script>
import NutriComputeCom from "./NutriComputeCom";
// import NutriComputeCom from "./NutriComputeCom";
import DishesDetailDialog from "./DishesDetailDialog";
import { getDicts } from "@/api/custom/recipesShow";
export default {
name: "menuDetail",
props: ["value", "date"],
components: {
NutriComputeCom,
// NutriComputeCom,
DishesDetailDialog,
},
created() {
@ -63,6 +66,7 @@ export default {
},
data() {
return {
logo: require("@/assets/logo/st_logo.png"),
menuTypeTimeDict: {
2: "10:00 - 10:30",
4: "15:00 - 15:30",
@ -113,6 +117,10 @@ export default {
<style lang="scss" scoped>
.menu_detail_wrapper {
padding: 0 12px 12px 12px;
.top {
text-align: center;
padding: 10px 14px;
}
.header_style {
display: flex;

View File

@ -21,6 +21,7 @@
<div class="title_style">
<span>{{ plan.label }}</span>
<em
v-show="false"
class="el-icon-shopping-cart-full icon_style"
@click="(e) => handleOnShoppingPlanClick(e, plan)"
/>

View File

@ -7,7 +7,8 @@
class="icon_btn"
@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
icon="el-icon-user"
type="text"
@ -45,6 +46,15 @@ import PlanDrawer from "./PlanDrawer";
import MenuDetail from "./MenuDetail";
import dayjs from "dayjs";
import { getProcessMenuData } from "./utils";
import { createNamespacedHelpers } from "vuex";
const {
mapActions,
mapState,
mapMutations,
mapGetters,
} = createNamespacedHelpers("recipesShow");
export default {
name: "recipesShow",
components: {
@ -55,7 +65,7 @@ export default {
props: ["id"],
data() {
return {
logo: require("@/assets/logo/st_logo.png"),
// logo: require("@/assets/logo/st_logo.png"),
planList: [],
curPlanId: 0,
curMenuId: 0,