修改页面显示

master
于肖磊 2024-10-15 14:43:07 +08:00
parent 5faceda678
commit 880e92a21b
2 changed files with 14 additions and 6 deletions

View File

@ -128,11 +128,10 @@
const { common_style, actived_color } = new_style;
// aspectFill cover aspectFit contain scaleToFill none
const { img_fit } = this.form;
let fit = 'scaleToFill';
if (img_fit == 'cover') {
if (new_form.img_fit == 'cover') {
fit = 'aspectFill';
} else if (img_fit == 'contain') {
} else if (new_form.img_fit == 'contain') {
fit = 'aspectFit';
}
this.$nextTick(() => {

View File

@ -7,7 +7,7 @@
<template v-if="form.style_actived == 2">
<view class="flex-row align-c jc-c style-size">
<view v-for="(item, index) in form.img_magic_list" :key="index" class="three" :style="img_spacing" :data-value="item.img_link.page" @tap="url_event">
<image v-if="item.img.length > 0" :src="item.img[0].url" class="dis-block wh-auto ht-auto" mode="aspectFill" :style="content_img_radius"></image>
<image v-if="item.img.length > 0" :src="item.img[0].url" class="dis-block wh-auto ht-auto" :mode="img_fit" :style="content_img_radius"></image>
</view>
</view>
</template>
@ -15,7 +15,7 @@
<template v-else-if="form.style_actived == 8">
<view class="flex-row align-c jc-c style-size flex-wrap">
<view v-for="(item, index) in form.img_magic_list" :key="index" :class="[{ 'style9-top': [0, 1].includes(index), 'style9-bottom': ![0, 1].includes(index) }]" :style="img_spacing" :data-value="item.img_link.page" @tap="url_event">
<image v-if="item.img.length > 0" :src="item.img[0].url" class="dis-block wh-auto ht-auto" mode="aspectFill" :style="content_img_radius"></image>
<image v-if="item.img.length > 0" :src="item.img[0].url" class="dis-block wh-auto ht-auto" :mode="img_fit" :style="content_img_radius"></image>
</view>
</view>
</template>
@ -26,7 +26,7 @@
</template>
<template v-else>
<view v-for="(item, index) in form.img_magic_list" :key="index" class="cube-selected cr-main" :style="img_spacing + selected_style(item)" :data-value="item.img_link.page" @tap="url_event">
<image v-if="item.img.length > 0" :src="item.img[0].url" class="dis-block wh-auto ht-auto" mode="aspectFill" :style="content_img_radius"></image>
<image v-if="item.img.length > 0" :src="item.img[0].url" class="dis-block wh-auto ht-auto" :mode="img_fit" :style="content_img_radius"></image>
</view>
</template>
</view>
@ -62,6 +62,7 @@
cube_cell: '',
container_size: '',
div_width: 0,
img_fit: '',
};
},
watch: {
@ -90,6 +91,13 @@
const outer_sx = `-${new_style.image_spacing}rpx`;
//
const spacing = `${new_style.image_spacing}rpx`;
// aspectFill cover aspectFit contain scaleToFill none
let fit = 'scaleToFill';
if (new_content.img_fit == 'cover') {
fit = 'aspectFill';
} else if (new_content.img_fit == 'contain') {
fit = 'aspectFit';
}
const density = 4;
this.setData({
form: this.propValue.content,
@ -99,6 +107,7 @@
content_img_radius: radius_computer(new_style),
style_container: common_styles_computer(new_style.common_style) + 'box-sizing: border-box;',
style_img_container: common_img_computer(new_style.common_style),
img_fit: fit,
});
this.$nextTick(() => {