1.diy---代码优化

master
sws 2024-09-26 10:52:50 +08:00
parent e48c8182c9
commit 0e7774761e
8 changed files with 21 additions and 21 deletions

View File

@ -4,11 +4,11 @@
<block v-if="form.carousel_type == 'card'">
<swiper-item v-for="(item, index) in new_list" :key="index" class="flex-row align-c" :data-value="item.carousel_link.page" @tap="url_open">
<view class="swiper-item" :style="img_style" :class="['scale-defalt', { 'scale-1': animationData === index }]">
<image-empty :propImageSrc="item.carousel_img[0]" class="img" :style="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
<imageEmpty :propImageSrc="item.carousel_img[0]" class="img" :style="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</view>
<view v-if="new_style.video_is_show == '1' && item.carousel_video.length > 0" :class="{ 'x-middle': new_style.video_location == 'center', 'right-0': new_style.video_location == 'flex-end' }" class="video-class flex-row pa gap-10 align-c oh" :style="video_style" @tap.stop="video_play(item.carousel_video)">
<block v-if="new_style.video_type == 'img'">
<image-empty :propImageSrc="new_style.video_img[0]" class="video_img" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></image-empty>
<imageEmpty :propImageSrc="new_style.video_img[0]" class="video_img" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></imageEmpty>
</block>
<block v-else>
<iconfont :name="!isEmpty(new_style.video_icon_class) ? 'icon-' + new_style.video_icon_class : 'icon-bofang'" size="'28rpx'" :color="new_style.video_icon_color"></iconfont>
@ -20,11 +20,11 @@
<block v-else>
<swiper-item v-for="(item, index) in new_list" :key="index" :style="{ 'padding-right': new_style.image_spacing * 2 + 'rpx' }">
<view class="item-image flex-row jc-c align-c wh-auto ht-auto pr" :style="img_style">
<image-empty :propImageSrc="item.carousel_img[0]" class="img" :style="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
<imageEmpty :propImageSrc="item.carousel_img[0]" class="img" :style="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</view>
<view v-if="new_style.video_is_show == '1' && item.carousel_video.length > 0" :class="{ 'x-middle': new_style.video_location == 'center', 'right-0': new_style.video_location == 'flex-end' }" class="video-class flex-row pa gap-10 align-c oh" :style="video_style" @tap.stop="video_play(item.carousel_video)">
<block v-if="new_style.video_type == 'img'">
<image-empty :propImageSrc="new_style.video_img[0]" class="video_img" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></image-empty>
<imageEmpty :propImageSrc="new_style.video_img[0]" class="video_img" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></imageEmpty>
</block>
<block v-else>
<iconfont :name="!isEmpty(new_style.video_icon_class) ? 'icon-' + new_style.video_icon_class : 'icon-bofang'" size="'28rpx'" :color="new_style.video_icon_color"></iconfont>

View File

@ -6,7 +6,7 @@
<view class="ring" :style="color"></view>
<view class="ring" :style="color"></view>
</block>
<image-empty :propImageSrc="form.button_img[0]" class="img" :propTypeStyle="color" propImgFit="aspectFill" propErrorStyle="width: 60rpx;height: 60rpx;"></image-empty>
<imageEmpty :propImageSrc="form.button_img[0]" class="img" :propTypeStyle="color" propImgFit="aspectFill" propErrorStyle="width: 60rpx;height: 60rpx;"></imageEmpty>
</view>
</view>
</view>

View File

@ -16,10 +16,10 @@
<block v-else>
<block v-if="!isEmpty(item)">
<block v-if="!isEmpty(item.new_cover)">
<image-empty :propImageSrc="item.new_cover[0]" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
<imageEmpty :propImageSrc="item.new_cover[0]" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</block>
<block v-else>
<image-empty :propImageSrc="item.images" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
<imageEmpty :propImageSrc="item.images" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</block>
</block>
<view class="flex-col flex-1 jc-sb content gap-10" :style="content_style">
@ -106,10 +106,10 @@
<view v-for="(item, index) in item1.split_list" :key="index" class="pr" :class="layout_type" :style="layout_style" :data-value="item.goods_url" @tap="url_event">
<block v-if="!isEmpty(item)">
<block v-if="!isEmpty(item.new_cover)">
<image-empty :propImageSrc="item.new_cover[0]" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
<imageEmpty :propImageSrc="item.new_cover[0]" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</block>
<block v-else>
<image-empty :propImageSrc="item.images" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
<imageEmpty :propImageSrc="item.images" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</block>
</block>
<view class="flex-col flex-1 jc-sb content gap-10" :style="content_style">

View File

@ -1,6 +1,6 @@
<template>
<view class="img-outer pr wh-auto ht-auto" :style="border_style" @tap="url_open(form.link)">
<image-empty :propImageSrc="img" :propTypeStyle="image_style" propErrorStyle="width: 60rpx;height: 60rpx;"></image-empty>
<imageEmpty :propImageSrc="img" :propTypeStyle="image_style" propErrorStyle="width: 60rpx;height: 60rpx;"></imageEmpty>
</view>
</template>
<script>

View File

@ -3,7 +3,7 @@
<swiper-item v-for="(item1, index1) in value.data_content.list" :key="index1">
<template v-if="propType === 'img'">
<view :data-value="item1.carousel_link.page" @tap="url_event">
<image-empty :propImageSrc="item1.carousel_img[0]" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item1.carousel_img[0]" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</view>
</template>
<template v-else>

View File

@ -4,10 +4,10 @@
<template v-if="propFlex === 'row'">
<view v-for="(item, index) in value" :key="index" class="flex-row gap-10 half-width ht-auto" :data-value="item.goods_url" @tap="url_event">
<template v-if="!isEmpty(item.new_cover)">
<image-empty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<template v-else>
<image-empty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<view v-if="!isEmpty(propIsShow)" class="flex-col wh-auto ht-auto tl gap-10">
<view v-if="propIsShow.includes('title')" class="text-line-2 text-size-md shop-title">{{ item.title }}</view>
@ -25,10 +25,10 @@
<view v-for="(item, index) in value" :key="index" :class="['flex-col gap-10 ht-auto', { 'half-width': propNum !== 1, 'wh-auto': propNum == 1 }]" :data-value="item.goods_url" @tap="url_event">
<view class="wh-auto ht-auto pr">
<template v-if="!isEmpty(item.new_cover)">
<image-empty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<template v-else>
<image-empty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<view v-if="propIsShow.includes('price')" class="price-suspension text-line-1">
{{ item.show_price_symbol }}{{ item.min_price }}
@ -43,10 +43,10 @@
<template v-else>
<view v-for="(item, index) in value" :key="index" class="flex-col wh-auto ht-auto" :data-value="item.goods_url" @tap="url_event">
<template v-if="!isEmpty(item.new_cover)">
<image-empty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<template v-else>
<image-empty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<view v-if="!isEmpty(propIsShow)" class="flex-col wh-auto tl gap-10" :style="img_padding_computer">
<view v-if="propIsShow.includes('title')" class="text-line-2 text-size-md shop-title">{{ item.title }}</view>
@ -67,10 +67,10 @@
<template v-if="propFlex === 'row'">
<view v-for="(item, index) in value" :key="index" class="flex-row gap-10 align-c wh-auto ht-auto shop-max-height" :data-value="item.goods_url" @tap="url_event">
<template v-if="!isEmpty(item.new_cover)">
<image-empty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<template v-else>
<image-empty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></image-empty>
<imageEmpty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<view v-if="!isEmpty(propIsShow)" class="flex-col wh-auto ht-auto tl gap-20">
<view v-if="propIsShow.includes('title')" class="text-line-2 text-size-md shop-title">{{ item.title }}</view>

View File

@ -5,7 +5,7 @@
<view class="bannerImg flex-row flex-wrap wh-auto gap-x-10">
<view v-for="(item1, index1) in item.split_list" :key="index1" class="flex-col gap-10 align-c" :style="{ width: group_width }" :data-value="item1.link.page" @tap="url_open_event">
<view v-if="['image_with_text', 'image'].includes(nav_style)" class="top-img flex-row align-c jc-c">
<image-empty :propImageSrc="item1.img[0]" :style="img_style" propErrorStyle="width: 60rpx;height: 60rpx;"></image-empty>
<imageEmpty :propImageSrc="item1.img[0]" :style="img_style" propErrorStyle="width: 60rpx;height: 60rpx;"></imageEmpty>
</view>
<view v-if="['image_with_text', 'text'].includes(nav_style)" class="size-12 ma-0" :style="text_style">{{ item1.title }}</view>
</view>

View File

@ -4,7 +4,7 @@
<view class="pr flex-row" :class="title_center">
<view class="z-i flex-row align-c gap-10 title-img">
<template v-if="!isEmpty(form.img_src)">
<image-empty v-model="form.img_src[0]"></image-empty>
<imageEmpty v-model="form.img_src[0]"></imageEmpty>
</template>
<template v-else-if="!isEmpty(form.icon_class)">
<iconfont :name="'icon-' + form.icon_class" :size="new_style.icon_size * 2 + 'rpx'" :color="new_style.icon_color"></iconfont>