修改数据魔方字体不限问题

master
于肖磊 2024-11-21 18:50:49 +08:00
parent c587148466
commit 201cba22e7
3 changed files with 12 additions and 4 deletions

View File

@ -52,7 +52,7 @@
</view>
</template>
<template v-else>
<view v-for="(item, index) in data_magic_list" :key="index" class="cube-selected cr-main" :style="selected_style(item) + item.data_style.background_style + content_radius + ';margin:' + spacing + ';'">
<view v-for="(item, index) in data_magic_list" :key="index" :class="'cr-main' + (is_unlimited_size ? '' : ' cube-selected')" :style="selected_style(item) + item.data_style.background_style + content_radius + ';margin:' + spacing + ';'">
<view class="w h" :style="item.data_style.background_img_style">
<template v-if="item.data_content.data_type == 'goods'">
<view class="w h flex-col" :style="'gap:'+ item.data_style.title_data_gap * 2 + 'rpx;' + item.data_style.chunk_padding_data">
@ -68,13 +68,13 @@
<view class="ma-0 w text-word-break text-line-1 flex-basis-shrink" :style="item.data_style.subtitle_style">{{ item.data_content.subtitle || '' }}</view>
</view>
<view class="w h">
<magic-carousel :propValue="item" :propGoodStyle="item.data_style" propType="product" :propActived="form.style_actived" :propDataIndex="index" @onCarouselChange="carousel_change"></magic-carousel>
<magic-carousel :propValue="item" :propGoodStyle="item.data_style" propType="product" :propActived="form.style_actived" :propDataIndex="index" :propIsUnlimitedSize="is_unlimited_size" @onCarouselChange="carousel_change"></magic-carousel>
</view>
</view>
</template>
<template v-else-if="item.data_content.data_type == 'images'">
<div class="w h" :style="item.data_style.chunk_padding_data">
<magic-carousel :propValue="item" propType="img" :propActived="form.style_actived" :propDataIndex="index" @onCarouselChange="carousel_change"></magic-carousel>
<magic-carousel :propValue="item" propType="img" :propActived="form.style_actived" :propDataIndex="index" :propIsUnlimitedSize="is_unlimited_size" @onCarouselChange="carousel_change"></magic-carousel>
</div>
</template>
<template v-else-if="item.data_content.data_type == 'custom'">
@ -153,6 +153,7 @@
style_img_container: '',
div_width: 0,
magic_scale: 1,
is_unlimited_size: false,
};
},
computed: {
@ -186,6 +187,8 @@
const density = !isEmpty(new_form.magic_cube_density) ? new_form.magic_cube_density : 4;
const { margin_left, margin_right, padding_left, padding_right } = new_style.common_style;
const width = sys_width - margin_left - margin_right - padding_left - padding_right - this.propOuterContainerPadding;
//
const is_unlimited_size = new_form.style_actived === 9 && new_form.limit_size == '0';
this.setData({
form: new_form,
new_style: new_style,
@ -199,7 +202,8 @@
magic_scale: width / 390,
div_width: sys_width,
cubeCellWidth: sys_width / density,
container_size: container_height * 2 + 'rpx',
container_size: is_unlimited_size ? '100%;' : container_height * 2 + 'rpx',
is_unlimited_size: is_unlimited_size,
});
},
get_data_magic_list(data, new_style) {

View File

@ -53,6 +53,10 @@
propDataIndex: {
type: Number,
default: () => 0,
},
propIsUnlimitedSize: {
type: Boolean,
default: () => false,
}
},
data() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB