Merge branch 'dev-sws' of gitee.com:zongzhige/shopxo-uniapp into dev-sws

This commit is contained in:
gongfuxiang
2024-09-26 14:28:57 +08:00
15 changed files with 168 additions and 193 deletions

View File

@ -1985,7 +1985,7 @@
// #ifdef H5 || APP
// 是有效的url地址则通过#号分割处理参数
if(this.is_url(result['url'])) {
result['url'] = this.page_url_protocol(result.url.split('#')[0] + '#' + (result.path.substr(0, 1) == '/' ? '' : '/') + result.path + result.query);
result['url'] = this.page_url_protocol(result.url.split('#')[0] + '#' + (result.path == null || result.path.substr(0, 1) == '/' ? '' : '/') + result.path + result.query);
}
// #endif
return result;

View File

@ -4,11 +4,13 @@
<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 }]">
<imageEmpty :propImageSrc="item.carousel_img[0]" class="img" :style="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.carousel_img[0]" :propTypeStyle="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'">
<imageEmpty :propImageSrc="new_style.video_img[0]" class="video_img" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></imageEmpty>
<view class="video_img">
<imageEmpty :propImageSrc="new_style.video_img[0]" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></imageEmpty>
</view>
</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 +22,13 @@
<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">
<imageEmpty :propImageSrc="item.carousel_img[0]" class="img" :style="img_style" :propImgFit="img_fit" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.carousel_img[0]" :propTypeStyle="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'">
<imageEmpty :propImageSrc="new_style.video_img[0]" class="video_img" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></imageEmpty>
<view class="video_img">
<imageEmpty :propImageSrc="new_style.video_img[0]" propImgFit="aspectFill" propErrorStyle="width: 28rpx;height: 28rpx;"></imageEmpty>
</view>
</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>
@ -291,11 +295,6 @@
transform: scale(1.1);
}
}
.img {
width: 100%;
height: 100%;
}
.video_img {
max-width: 120rpx;
height: 28rpx;

View File

@ -52,8 +52,8 @@
<view v-if="item.data_style.is_show == '1' && item.data_content.list.length > 1" :class="{ 'dot-center': item.data_style.indicator_location == 'center', 'dot-right': item.data_style.indicator_location == 'flex-end' }" class="dot flex-row pa" :style="{ bottom: item.data_style.indicator_bottom * 2 + 'rpx' }">
<template v-if="item.data_style.indicator_style == 'num'">
<view :style="item.data_style.indicator_styles" class="dot-item">
<text class="num-active" :style="{ color: item.data_style.actived_color }">{{ item.actived_index + 1 }}</text
><text>/{{ item.data_content.list.length }}</text>
<text class="num-active" :style="{ color: item.data_style.actived_color }">{{ item.actived_index + 1 }}</text>
<text>/{{ item.data_content.list.length }}</text>
</view>
</template>
<template v-else>

View File

@ -1,15 +1,15 @@
<template>
<view class="ht-auto min-ht">
<!-- 头部小程序兼容 -->
<view class="pr header-content">
<view class="pr header">
<componentDiyHeader :key="key" :propValue="header_data.com_data"></componentDiyHeader>
</view>
<view class="pr" :style="diy_content_style">
<view class="pr content" :style="header_top">
<view v-for="(item, index) in tabs_data" :key="index">
<componentDiyTabs v-if="item.key == 'tabs'" :propValue="item.com_data" :key="key" @tabs-click="tabs_click_event"></componentDiyTabs>
<componentDiyTabsCarousel v-else-if="item.key == 'tabs-carousel'" :propValue="item.com_data" :key="key + index" @tabs-click="tabs_click_event"></componentDiyTabsCarousel>
</view>
<view v-if="is_tabs_type" class="diy-content">
<view v-if="is_tabs_type" class="diy">
<template v-if="diy_data.length > 0">
<view v-for="(item, index) in diy_data" :key="index" :style="{ 'margin-top': -(item.com_data.style.common_style.floating_up * 2 || 0) + 'rpx' }">
<!-- 基础组件 -->
@ -55,9 +55,9 @@
</scroll-view>
</view>
</view>
<block v-if="is_show_footer == 1">
<componentDiyFooter :key="key" :propValue="footer_data.com_data" @footer-height="footer_height_value_event"></componentDiyFooter>
</block>
<view v-if="is_show_footer == 1" class="footer">
<componentDiyFooter :key="key" :propValue="footer_data.com_data"></componentDiyFooter>
</view>
</view>
</template>
@ -142,22 +142,20 @@
return {
// 基础配置
currency_symbol: app.globalData.currency_symbol(),
// 底部菜单导航高度计算
footer_height_value: 140,
// 是否有选项卡
is_tabs: false,
// 是否是模块数据或者是九宫格商品分类样式数据, 默认模块数据
is_tabs_type: true,
// 5,7,0 是误差,, 12 是下边距60是高度bar_height是不同小程序下的导航栏距离顶部的高度
// 5,7,0 是误差,, 12 是下边距66是高度bar_height是不同小程序下的导航栏距离顶部的高度
// #ifdef MP
header_top: 'padding-top:' + (bar_height + 34 + 5 + 12) + 'px;',
header_top: 'padding-top:calc(' + (bar_height + 5 + 12) + 'px + 66rpx);',
// #endif
// #ifdef H5 || MP-TOUTIAO
header_top: 'padding-top:' + (bar_height + 34 + 7 + 12) + 'px;',
header_top: 'padding-top:calc(' + (bar_height + 7 + 12) + 'px + 66rpx);',
// #endif
// #ifdef APP
header_top: 'padding-top:' + (bar_height + 34 + 0 + 12) + 'px;',
header_top: 'padding-top:calc(' + (bar_height + 0 + 12) + 'px + 66rpx);',
// #endif
header_data: {},
@ -188,11 +186,6 @@
cache_key: app.globalData.data.cache_diy_data_key,
};
},
computed: {
diy_content_style() {
return this.header_top + `padding-bottom:${this.footer_height_value}rpx;`;
},
},
created() {
// 初始化配置
this.init_config();
@ -208,7 +201,7 @@
var is_show_footer = this.propValue.header.com_data.content.bottom_navigation_show;
var is_tabbar = app.globalData.is_tabbar_pages();
this.setData({
is_show_footer: is_show_footer && !is_tabbar
is_show_footer: is_show_footer && !is_tabbar,
});
} else {
app.globalData.is_config(this, 'init_config');
@ -228,13 +221,6 @@
uni.setStorageSync(this.cache_key + this.tabs_home_id, this.propValue.diy_data);
},
// 底部菜单高度
footer_height_value_event(number) {
this.setData({
footer_height_value: number * 2
});
},
// 选项卡回调更新数据
tabs_click_event(tabs_id, bool, params = {}) {
let new_data = [];
@ -399,13 +385,9 @@
});
},
});
}
},
},
};
</script>
<style lang="scss" scoped>
.header-content {
z-index: 101;
}
</style>
<style lang="scss" scoped></style>

View File

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

View File

@ -4,7 +4,7 @@
<view class="footer-nav-content flex-row jc-c align-c wh-auto" :style="style_container">
<view class="bottom-line-exclude flex-row jc-c align-c wh-auto">
<view class="flex-row jc-sa align-c wh padding-0">
<view v-for="(item, index) in nav_content" :key="index" class="flex-1 flex-col jc-c align-c gap-5" :data-index="index" :data-value="item.link.page || ''" @tap="url_event">
<view v-for="(item, index) in nav_content" :key="index" class="flex-1 flex-col jc-c align-c gap-5" :data-value="item.link.page || ''" @tap="url_event">
<view v-if="nav_style != 2" class="img-content pr">
<view class="img-item pa border-radius-xs animate-linear" :class="active_index != index ? 'active' : ''">
<image :src="item.img[0].url" class="img dis-block" model="widthFix"></image>
@ -84,21 +84,12 @@
text_color_checked: 'color:' + new_style.text_color_checked || 'rgba(204, 204, 204, 1)',
style_container: common_styles_computer(new_style.common_style),
});
let footer_height = parseInt(new_style.common_style.padding_top) + parseInt(new_style.common_style.padding_bottom) + parseInt(new_style.common_style.margin_top) + parseInt(new_style.common_style.margin_bottom) + 40;
// #ifndef APP
// 底部菜单距离底部的安全距离
footer_height += parseInt(uni.getSystemInfoSync().statusBarHeight);
// #endif
this.$emit('footer-height', footer_height);
}
},
// 跳转链接
url_event(e) {
let index = e.currentTarget.dataset.index;
let item = this.nav_content[index];
app.globalData.url_event(e);
this.$emit('footer-tap', index, item);
},
},
};

View File

@ -15,12 +15,12 @@
</block>
<block v-else>
<block v-if="!isEmpty(item)">
<block v-if="!isEmpty(item.new_cover)">
<imageEmpty :propImageSrc="item.new_cover[0]" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</block>
<block v-else>
<imageEmpty :propImageSrc="item.images" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</block>
<view v-if="!isEmpty(item.new_cover)" :class="'flex-img' + theme">
<imageEmpty :propImageSrc="item.new_cover[0]" :propTypeStyle="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</view>
<view v-else :class="'flex-img' + theme">
<imageEmpty :propImageSrc="item.images" :propTypeStyle="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</view>
</block>
<view class="flex-col flex-1 jc-sb content gap-10" :style="content_style">
<view class="flex-col gap-10 top-title">
@ -105,12 +105,12 @@
<swiper-item v-for="(item1, index1) in shop_content_list" :key="index1" class="flex-row" :style="onter_style">
<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)">
<imageEmpty :propImageSrc="item.new_cover[0]" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</block>
<block v-else>
<imageEmpty :propImageSrc="item.images" :class="'flex-img' + theme" :style="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</block>
<view v-if="!isEmpty(item.new_cover)" :class="'flex-img' + theme">
<imageEmpty :propImageSrc="item.new_cover[0]" :propTypeStyle="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</view>
<view v-else :class="'flex-img' + theme">
<imageEmpty :propImageSrc="item.images" :propTypeStyle="content_img_radius" propErrorStyle="width: 100rpx;height: 100rpx;"></imageEmpty>
</view>
</block>
<view class="flex-col flex-1 jc-sb content gap-10" :style="content_style">
<view class="flex-col gap-10 top-title">

View File

@ -1,7 +1,7 @@
<template>
<view v-if="(propValue || null) !== null" class="header-container" :style="roll_style + position">
<view class="bg-white" :style="top_content_style">
<view class="header-content flex-row align-c padding-vertical-xs" style="height: 34px">
<view class="header-content flex-row align-c">
<view class="model-top flex-1">
<view class="roll pr z-i">
<view class="model-head tc pr padding-horizontal-sm flex-row align-c" :style="header_style">
@ -135,8 +135,11 @@
<style lang="scss" scoped>
.header-container {
z-index: 2;
z-index: 102;
width: 100%;
.header-content {
height: 66rpx;
}
.model-top {
.roll {
width: 100%;

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">
<imageEmpty :propImageSrc="item1.carousel_img[0]" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item1.carousel_img[0]" :propTypeStyle="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)">
<imageEmpty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.new_cover[0]" :propTypeStyle="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<template v-else>
<imageEmpty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.images" :propTypeStyle="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)">
<imageEmpty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.new_cover[0]" :propTypeStyle="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<template v-else>
<imageEmpty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.images" :propTypeStyle="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)">
<imageEmpty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.new_cover[0]" :propTypeStyle="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<template v-else>
<imageEmpty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.images" :propTypeStyle="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)">
<imageEmpty :propImageSrc="item.new_cover[0]" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.new_cover[0]" :propTypeStyle="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
</template>
<template v-else>
<imageEmpty :propImageSrc="item.images" class="wh-auto ht-auto" :style="propContentImgRadius" propErrorStyle="width: 80rpx;height: 80rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item.images" :propTypeStyle="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

@ -97,13 +97,13 @@
propIsBar: false,
// 5,7,0 是误差,, 12 是下边距60是高度bar_height是不同小程序下的导航栏距离顶部的高度
// #ifdef MP
tabs_top: bar_height + 34 + 5 + 12 + 'px;',
tabs_top: 'calc(' + bar_height + 5 + 12 + 'px + 66rpx);',
// #endif
// #ifdef H5 || MP-TOUTIAO
tabs_top: bar_height + 34 + 7 + 12 + 'px;',
tabs_top: 'calc(' + bar_height + 7 + 12 + 'px+ 66rpx);',
// #endif
// #ifdef APP
tabs_top: bar_height + 34 + 0 + 12 + 'px;',
tabs_top: 'calc(' + bar_height + 0 + 12 + 'px+ 66rpx);',
// #endif
};
},

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">
<imageEmpty :propImageSrc="item1.img[0]" :style="img_style" propErrorStyle="width: 60rpx;height: 60rpx;"></imageEmpty>
<imageEmpty :propImageSrc="item1.img[0]" :propTypeStyle="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

@ -39,12 +39,12 @@
<view v-for="(item, index) in item1.split_list" :key="index" :class="layout_type" :style="layout_type_style + content_radius + (form.shop_style_type == '1' ? content_padding : '')" :data-value="item.goods_url" @tap="url_event">
<template v-if="!isEmpty(item)">
<view class="oh pr" :class="'flex-img' + form.shop_style_type">
<template v-if="!isEmpty(item.new_cover)">
<imageEmpty :propImageSrc="item.new_cover[0]" :class="'flex-img' + form.shop_style_type" :typeStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></imageEmpty>
</template>
<template v-else>
<imageEmpty :propImageSrc="item.images" :class="'flex-img' + form.shop_style_type" :typeStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></imageEmpty>
</template>
<view v-if="!isEmpty(item.new_cover)" :class="'flex-img' + form.shop_style_type">
<imageEmpty :propImageSrc="item.new_cover[0]" :propTypeStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></imageEmpty>
</view>
<view v-else :class="'flex-img' + form.shop_style_type">
<imageEmpty :propImageSrc="item.images" :propTypeStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></imageEmpty>
</view>
<view v-if="form.seckill_subscript_show == '1'" class="text-size-xs nowrap corner-marker" :style="corner_marker">
<text class="text-line-1">{{ form.subscript_text }}</text>
</view>
@ -102,12 +102,12 @@
<view v-for="(item, index) in item1.split_list" :key="index" :class="layout_type" :style="content_radius + (form.shop_style_type == '1' ? content_padding : '') + (new_style.rolling_fashion != 'translation' ? layout_type_style : 'margin-right:' + content_outer_spacing_magin + ';height: 100%;whith: 100%')" :data-value="item.goods_url" @tap="url_event">
<template v-if="!isEmpty(item)">
<view class="oh pr wh-auto ht-auto">
<template v-if="!isEmpty(item.new_cover)">
<imageEmpty :propImageSrc="item.new_cover[0]" :class="'flex-img' + form.shop_style_type" :typeStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></imageEmpty>
</template>
<template v-else>
<imageEmpty :propImageSrc="item.images" :class="'flex-img' + form.shop_style_type" :typeStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></imageEmpty>
</template>
<view v-if="!isEmpty(item.new_cover)" :class="'flex-img' + form.shop_style_type">
<imageEmpty :propImageSrc="item.new_cover[0]" :propTypeStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></imageEmpty>
</view>
<view v-else :class="'flex-img' + form.shop_style_type">
<imageEmpty :propImageSrc="item.images" :propTypeStyle="content_img_radius" propErrorStyle="width:100rpx; height: 100rpx;"></imageEmpty>
</view>
<view v-if="form.seckill_subscript_show == '1'" class="text-size-xs nowrap corner-marker" :style="corner_marker">
<text class="text-line-1">{{ form.subscript_text }}</text>
</view>
@ -476,12 +476,6 @@
</script>
<style scoped lang="scss">
:deep(.el-image) {
.image-slot img {
width: 5rem;
height: 5rem;
}
}
.identifying {
font-size: 18rpx;
}

View File

@ -53,13 +53,13 @@
top_up: '0',
// 5,7,0 是误差,, 12 是下边距60是高度bar_height是不同小程序下的导航栏距离顶部的高度
// #ifdef MP
tabs_top: 'padding-top:' + (bar_height + 34 + 5 + 12) + 'px;',
tabs_top: 'padding-top:calc(' + (bar_height + 5 + 12) + 'px + 66rpx);',
// #endif
// #ifdef H5 || MP-TOUTIAO
tabs_top: 'padding-top:' + (bar_height + 34 + 7 + 12) + 'px;',
tabs_top: 'padding-top:calc(' + (bar_height + 7 + 12) + 'px + 66rpx);',
// #endif
// #ifdef APP
tabs_top: 'padding-top:' + (bar_height + 34 + 0 + 12) + 'px;',
tabs_top: 'padding-top:calc(' + (bar_height + 0 + 12) + 'px + 66rpx);',
// #endif
};
},

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)">
<imageEmpty v-model="form.img_src[0]"></imageEmpty>
<imageEmpty :propImageSrc="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>
@ -17,7 +17,9 @@
{{ item.title }}
</view>
</template>
<view v-if="form.right_show == '1'" class="nowrap" :style="right_style">{{ form.right_title }}<iconfont name="icon-arrow-right" :color="new_style.right_color || '#999'"></iconfont></view>
<view v-if="form.right_show == '1'" class="nowrap" :style="right_style">{{ form.right_title }}
<iconfont name="icon-arrow-right" :color="new_style.right_color || '#999'"></iconfont>
</view>
</view>
</view>
<view v-if="!isEmpty(form.subtitle)" class="break" :style="subtitle_style">{{ form.subtitle }}</view>
@ -26,102 +28,104 @@
</template>
<script>
const app = getApp();
import { common_styles_computer, is_obj_empty } from '@/common/js/common/common.js';
export default {
props: {
propValue: {
type: Object,
default: () => {
return {};
},
const app = getApp();
import { common_styles_computer, is_obj_empty } from '@/common/js/common/common.js';
export default {
props: {
propValue: {
type: Object,
default: () => {
return {};
},
},
data() {
return {
form: {},
new_style: {},
style_container: '',
title_center: '',
subtitle_style: '',
keyword_list: [],
keyword_style: '',
right_style: '',
right_size: '',
};
},
created() {
},
data() {
return {
form: {},
new_style: {},
style_container: '',
title_center: '',
subtitle_style: '',
keyword_list: [],
keyword_style: '',
right_style: '',
right_size: '',
};
},
created() {
this.setData({
form: this.propValue.content,
new_style: this.propValue.style,
});
this.init();
},
methods: {
init() {
// 是否居中
this.setData({
form: this.propValue.content,
new_style: this.propValue.style,
title_center: this.form.is_title_center == '1' ? 'jc-c' : '',
});
this.init();
// 关键字
this.set_keyword_list();
// 样式设置
this.set_common_styles();
},
methods: {
init() {
// 是否居中
this.setData({
title_center: this.form.is_title_center == '1' ? 'jc-c' : '',
});
// 关键字
this.set_keyword_list();
// 样式设置
this.set_common_styles();
},
set_keyword_list() {
this.setData({
keyword_list: this.form.keyword_list.filter((item) => item.is_show == '1'),
});
},
set_common_styles() {
const { keyword_color, keyword_size, right_color, right_size, common_style, title_weight, title_color, title_size } = this.new_style;
// 标题样式设置
let common_styles = '';
if (title_weight == 'italic') {
common_styles += `font-style: italic`;
} else if (title_weight == '500') {
common_styles += `font-weight: 500`;
}
this.setData({
keyword_style: `color:${keyword_color}; font-size: ${keyword_size * 2}rpx;`, // 关键字设置
right_size: right_size * 2 + 'rpx', // 右边按钮设置
right_style: `color:${right_color}; font-size: ${right_size * 2}rpx;`,
title_style: `color:${title_color}; font-size: ${title_size * 2}rpx; ${common_styles}`,
subtitle_style: this.get_subtitle_style(), // 副标题样式设置
style_container: common_styles_computer(common_style), // 通用样式区
});
},
get_subtitle_style() {
let common_styles = '';
if (new_style.value.subtitle_weight == 'italic') {
common_styles += `font-style: italic`;
} else if (new_style.value.subtitle_weight == '500') {
common_styles += `font-weight: 500`;
}
return `color:${new_style.value.subtitle_color}; font-size: ${new_style.value.subtitle_size * 2}rpx; ${common_styles}`;
},
url_open_event(link) {
if (!is_obj_empty(link)) {
app.globalData.url_open(link.page);
}
},
set_keyword_list() {
this.setData({
keyword_list: this.form.keyword_list.filter((item) => item.is_show == '1'),
});
},
};
set_common_styles() {
const { keyword_color, keyword_size, right_color, right_size, common_style, title_weight, title_color, title_size } = this.new_style;
// 标题样式设置
let common_styles = '';
if (title_weight == 'italic') {
common_styles += `font-style: italic`;
} else if (title_weight == '500') {
common_styles += `font-weight: 500`;
}
this.setData({
keyword_style: `color:${keyword_color}; font-size: ${keyword_size * 2}rpx;`, // 关键字设置
right_size: right_size * 2 + 'rpx', // 右边按钮设置
right_style: `color:${right_color}; font-size: ${right_size * 2}rpx;`,
title_style: `color:${title_color}; font-size: ${title_size * 2}rpx; ${common_styles}`,
subtitle_style: this.get_subtitle_style(), // 副标题样式设置
style_container: common_styles_computer(common_style), // 通用样式区
});
},
get_subtitle_style() {
let common_styles = '';
if (new_style.value.subtitle_weight == 'italic') {
common_styles += `font-style: italic`;
} else if (new_style.value.subtitle_weight == '500') {
common_styles += `font-weight: 500`;
}
return `color:${new_style.value.subtitle_color}; font-size: ${new_style.value.subtitle_size * 2}rpx; ${common_styles}`;
},
url_open_event(link) {
if (!is_obj_empty(link)) {
app.globalData.url_open(link.page);
}
},
},
};
</script>
<style scoped lang="scss">
.right-0 {
top: 50%;
transform: translateY(-50%);
}
.break {
word-break: break-word;
overflow-wrap: break-word;
word-wrap: break-word;
}
.title-img {
max-width: 6rem;
max-height: 3rem;
}
.right-0 {
top: 50%;
transform: translateY(-50%);
}
.break {
word-break: break-word;
overflow-wrap: break-word;
word-wrap: break-word;
}
.title-img {
max-width: 6rem;
max-height: 3rem;
}
</style>