Commit aa5855bf authored by 沈良进's avatar 沈良进

详情页增加空字段判断

parent badaeef3
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
:key="yi" :key="yi"
v-if="y.type == 1" v-if="y.type == 1"
> >
<div <div v-if="y.childItem.description"
class="bg-white rounded-borders q-pa-md diy-content" class="bg-white rounded-borders q-pa-md diy-content"
v-html="y.childItem.description" v-html="y.childItem.description"
></div> ></div>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</div> </div>
</template> </template>
<div class="bg-white rounded-borders q-pa-md diy-content"> <div class="bg-white rounded-borders q-pa-md diy-content">
<span v-html="y.childItem.description"></span> <span v-if="y.childItem.description" v-html="y.childItem.description"></span>
<div <div
v-if="y.childItem.imaArray.length > 0" v-if="y.childItem.imaArray.length > 0"
class="rounded-borders overflow-hidden row q-mt-md" class="rounded-borders overflow-hidden row q-mt-md"
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
v-if="y.type == 4" v-if="y.type == 4"
> >
<div class="bg-white rounded-borders q-pa-md diy-content"> <div class="bg-white rounded-borders q-pa-md diy-content">
<span v-html="y.childItem.description"></span> <span v-if="y.childItem.description" v-html="y.childItem.description"></span>
<div <div
v-if="y.childItem.imaArray.length > 0" v-if="y.childItem.imaArray.length > 0"
class="rounded-borders overflow-hidden row q-mt-md" class="rounded-borders overflow-hidden row q-mt-md"
...@@ -151,13 +151,13 @@ ...@@ -151,13 +151,13 @@
v-if="y.type == 5" v-if="y.type == 5"
> >
<div class="bg-white rounded-borders q-pa-md diy-content"> <div class="bg-white rounded-borders q-pa-md diy-content">
<span v-html="y.childItem.description"></span> <span v-if="y.childItem.description" v-html="y.childItem.description"></span>
<div <div
v-if="y.childItem.imaArray.length > 0" v-if="y.childItem.imaArray.length > 0"
class="rounded-borders overflow-hidden row q-mt-md" class="rounded-borders overflow-hidden row q-mt-md"
> >
<template v-for="(z, zi) in y.childItem.imaArray"> <template v-for="(z, zi) in y.childItem.imaArray">
<q-parallax <!-- <q-parallax
style="height: 20vmin; width: 100%" style="height: 20vmin; width: 100%"
:speed="0.5" :speed="0.5"
v-if="y.childItem.imaArray.length == 1" v-if="y.childItem.imaArray.length == 1"
...@@ -166,7 +166,14 @@ ...@@ -166,7 +166,14 @@
<template v-slot:media> <template v-slot:media>
<img :src="z.url" /> <img :src="z.url" />
</template> </template>
</q-parallax> </q-parallax> -->
<q-img :key="zi"
v-if="y.childItem.imaArray.length == 1"
:src="z.url"
:ratio="16 / 9"
spinner-color="grey"
spinner-size="20px"
/>
<q-responsive <q-responsive
:ratio="16 / 9" :ratio="16 / 9"
class="col" class="col"
...@@ -245,7 +252,7 @@ ...@@ -245,7 +252,7 @@
</div> </div>
</template> </template>
<div class="bg-white rounded-borders q-pa-md diy-content"> <div class="bg-white rounded-borders q-pa-md diy-content">
<span v-html="y.childItem.description"></span> <span v-if="y.childItem.description" v-html="y.childItem.description"></span>
<div <div
v-if="y.childItem.imaArray.length > 0" v-if="y.childItem.imaArray.length > 0"
class="rounded-borders overflow-hidden row q-mt-md" class="rounded-borders overflow-hidden row q-mt-md"
...@@ -288,7 +295,7 @@ ...@@ -288,7 +295,7 @@
v-if="y.type == 6" v-if="y.type == 6"
> >
<div class="bg-orange-1 rounded-borders q-pa-md diy-content"> <div class="bg-orange-1 rounded-borders q-pa-md diy-content">
<span v-html="y.childItem.description"></span> <span v-if="y.childItem.description" v-html="y.childItem.description"></span>
</div> </div>
</q-timeline-entry> </q-timeline-entry>
</template> </template>
...@@ -347,8 +354,12 @@ export default { ...@@ -347,8 +354,12 @@ export default {
y.icon = "iconfont iconjiaotong"; y.icon = "iconfont iconjiaotong";
} else if (y.type == 4) { } else if (y.type == 4) {
let t = ["早餐", "午餐", "晚餐"]; let t = ["早餐", "午餐", "晚餐"];
y.childItem.dinnerTypeName = const arr = y.childItem.useDinnerType.split(',')
t[parseInt(y.childItem.useDinnerType) - 1]; let titleArr = []
arr.forEach(item => {
titleArr.push(t[item - 1])
})
y.childItem.dinnerTypeName = titleArr.join(',')
} }
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment