Showing
1 changed file
with
12 additions
and
2 deletions
| ... | @@ -10,8 +10,9 @@ | ... | @@ -10,8 +10,9 @@ |
| 10 | <van-image | 10 | <van-image |
| 11 | v-if="PHeader.type === '单张图'" | 11 | v-if="PHeader.type === '单张图'" |
| 12 | width="100%" | 12 | width="100%" |
| 13 | - height="200" | 13 | + :height="PHeaderHeight" |
| 14 | :src="PHeader.cover" | 14 | :src="PHeader.cover" |
| 15 | + fit="cover" | ||
| 15 | /> | 16 | /> |
| 16 | <template v-if="PHeader.type === '轮播图'"> | 17 | <template v-if="PHeader.type === '轮播图'"> |
| 17 | <van-swipe class="my-swipe" lazy-render indicator-color="white"> | 18 | <van-swipe class="my-swipe" lazy-render indicator-color="white"> |
| ... | @@ -50,7 +51,16 @@ import { useRoute } from "vue-router"; | ... | @@ -50,7 +51,16 @@ import { useRoute } from "vue-router"; |
| 50 | import { queryFormAPI } from "@/api/form.js"; | 51 | import { queryFormAPI } from "@/api/form.js"; |
| 51 | import { addFormDataAPI } from "@/api/data.js"; | 52 | import { addFormDataAPI } from "@/api/data.js"; |
| 52 | import { showSuccessToast, showFailToast } from "vant"; | 53 | import { showSuccessToast, showFailToast } from "vant"; |
| 53 | - | 54 | +import { wxInfo } from "@/utils/tools"; |
| 55 | +// web端判断封面图片高度 | ||
| 56 | +const is_pc = computed(() => wxInfo().isPC); | ||
| 57 | +const PHeaderHeight = computed(() => { | ||
| 58 | + if (is_pc.value) { | ||
| 59 | + return "35vh"; | ||
| 60 | + } else { | ||
| 61 | + return "20vh"; | ||
| 62 | + } | ||
| 63 | +}); | ||
| 54 | // TAG: 自定义主题颜色 | 64 | // TAG: 自定义主题颜色 |
| 55 | const themeVars = { | 65 | const themeVars = { |
| 56 | buttonPrimaryBackground: "#c2915f", | 66 | buttonPrimaryBackground: "#c2915f", | ... | ... |
-
Please register or login to post a comment