Merge branch 'dev-sws' into dev-yxl
commit
ee8a668e31
|
|
@ -8,8 +8,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="content flex-col" :style="'padding-top:' + (temp_is_header_top ? temp_header_top : '0')">
|
<view class="content flex-col" :style="'padding-top:' + (temp_is_header_top ? temp_header_top : '0')">
|
||||||
<view v-for="item in tabs_data" :key="item.key">
|
<view v-for="item in tabs_data" :key="item.key">
|
||||||
<componentDiyTabs v-if="item.key == 'tabs'" :propValue="item.com_data" :propTop="temp_sticky_top" :propNavIsTop="is_header_top" :propTabsIsTop="temp_is_header_top" @computer-height="tabs_height_event" @tabs-click="tabs_click_event"></componentDiyTabs>
|
<componentDiyTabs v-if="item.key == 'tabs'" :propValue="item.com_data" :propTop="temp_header_top" :propNavIsTop="is_header_top" :propTabsIsTop="temp_is_header_top" @computer-height="tabs_height_event" @tabs-click="tabs_click_event"></componentDiyTabs>
|
||||||
<componentDiyTabsCarousel v-else-if="item.key == 'tabs-carousel'" :propValue="item.com_data" :propTop="temp_sticky_top" :propNavIsTop="is_header_top" :propTabsIsTop="temp_is_header_top" @computer-height="tabs_height_event" @tabs-click="tabs_click_event"></componentDiyTabsCarousel>
|
<componentDiyTabsCarousel v-else-if="item.key == 'tabs-carousel'" :propValue="item.com_data" :propTop="temp_header_top" :propNavIsTop="is_header_top" :propTabsIsTop="temp_is_header_top" @computer-height="tabs_height_event" @tabs-click="tabs_click_event"></componentDiyTabsCarousel>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="is_tabs_type">
|
<template v-if="is_tabs_type">
|
||||||
<template v-if="diy_data.length > 0">
|
<template v-if="diy_data.length > 0">
|
||||||
|
|
@ -23,8 +23,8 @@
|
||||||
<componentDiyNotice v-else-if="item.key == 'notice'" :propkey="item.id" :propValue="item.com_data"></componentDiyNotice>
|
<componentDiyNotice v-else-if="item.key == 'notice'" :propkey="item.id" :propValue="item.com_data"></componentDiyNotice>
|
||||||
<componentDiyVideo v-else-if="item.key == 'video'" :propkey="item.id" :propValue="item.com_data"></componentDiyVideo>
|
<componentDiyVideo v-else-if="item.key == 'video'" :propkey="item.id" :propValue="item.com_data"></componentDiyVideo>
|
||||||
<componentDiyArticleList v-else-if="item.key == 'article-list'" :propkey="item.id" :propValue="item.com_data"></componentDiyArticleList>
|
<componentDiyArticleList v-else-if="item.key == 'article-list'" :propkey="item.id" :propValue="item.com_data"></componentDiyArticleList>
|
||||||
<componentDiyArticleTabs v-else-if="item.key == 'article-tabs'" :propkey="item.id" :propValue="item.com_data" :propTop="(!is_immersion_model ? temp_sticky_top : 0) + tabs_height" :propScrollTop="scroll_top" :propCustomNavHeight="!is_immersion_model && is_header_top ? 33 : 0"></componentDiyArticleTabs>
|
<componentDiyArticleTabs v-else-if="item.key == 'article-tabs'" :propkey="item.id" :propValue="item.com_data" :propTop="(!is_immersion_model ? temp_sticky_top : 0) + tabs_height" :propScrollTop="scroll_top" :propCustomNavHeight="!is_immersion_model && is_header_top ? (is_search_alone_row ? 66 + data_alone_row_space : 33) : 0"></componentDiyArticleTabs>
|
||||||
<componentDiyGoodsTabs v-else-if="item.key == 'goods-tabs'" :ref="'diy_goods_buy' + index" :propIndex="index" :propkey="item.id" :propValue="item.com_data" :propTop="(!is_immersion_model ? temp_sticky_top : 0) + tabs_height" :propScrollTop="scroll_top" :propCustomNavHeight="!is_immersion_model && is_header_top ? 33 : 0" @goods_buy_event="goods_buy_event"></componentDiyGoodsTabs>
|
<componentDiyGoodsTabs v-else-if="item.key == 'goods-tabs'" :ref="'diy_goods_buy' + index" :propIndex="index" :propkey="item.id" :propValue="item.com_data" :propTop="(!is_immersion_model ? temp_sticky_top : 0) + tabs_height" :propScrollTop="scroll_top" :propCustomNavHeight="!is_immersion_model && is_header_top ? (is_search_alone_row ? 66 + data_alone_row_space : 33) : 0" @goods_buy_event="goods_buy_event"></componentDiyGoodsTabs>
|
||||||
|
|
||||||
<componentDiyGoodsList v-else-if="item.key == 'goods-list'" :ref="'diy_goods_buy' + index" :propIndex="index" :propkey="item.id" :propValue="item.com_data" @goods_buy_event="goods_buy_event"></componentDiyGoodsList>
|
<componentDiyGoodsList v-else-if="item.key == 'goods-list'" :ref="'diy_goods_buy' + index" :propIndex="index" :propkey="item.id" :propValue="item.com_data" @goods_buy_event="goods_buy_event"></componentDiyGoodsList>
|
||||||
<componentDiyDataMagic v-else-if="item.key == 'data-magic'" :propkey="item.id" :propValue="item.com_data"></componentDiyDataMagic>
|
<componentDiyDataMagic v-else-if="item.key == 'data-magic'" :propkey="item.id" :propValue="item.com_data"></componentDiyDataMagic>
|
||||||
|
|
@ -191,16 +191,14 @@
|
||||||
// 5,7,0 是误差,, 12 是下边距,66是高度,bar_height是不同小程序下的导航栏距离顶部的高度
|
// 5,7,0 是误差,, 12 是下边距,66是高度,bar_height是不同小程序下的导航栏距离顶部的高度
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
sticky_top: bar_height + 5 + 12,
|
sticky_top: bar_height + 5 + 12,
|
||||||
header_top: 'calc(' + (bar_height + 5 + 12) + 'px + 66px);',
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5 || MP-TOUTIAO
|
// #ifdef H5 || MP-TOUTIAO
|
||||||
sticky_top: bar_height + 7 + 12,
|
sticky_top: bar_height + 7 + 12,
|
||||||
header_top: 'calc(' + (bar_height + 7 + 12) + 'px + 66rpx);',
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
sticky_top: bar_height + 0 + 12,
|
sticky_top: bar_height + 0 + 12,
|
||||||
header_top: 'calc(' + (bar_height + 0 + 12) + 'px + 66rpx);',
|
|
||||||
// #endif
|
// #endif
|
||||||
|
header_top: '',
|
||||||
temp_sticky_top: 0,
|
temp_sticky_top: 0,
|
||||||
temp_header_top: '0px',
|
temp_header_top: '0px',
|
||||||
is_header_top: false,
|
is_header_top: false,
|
||||||
|
|
@ -246,6 +244,7 @@
|
||||||
popup_height: '0rpx',
|
popup_height: '0rpx',
|
||||||
// 顶部导航是否换行
|
// 顶部导航是否换行
|
||||||
is_search_alone_row: false,
|
is_search_alone_row: false,
|
||||||
|
data_alone_row_space: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -290,9 +289,14 @@
|
||||||
// 判断顶部导航是否置顶
|
// 判断顶部导航是否置顶
|
||||||
is_header_top: parseInt(this.propValue.header.com_data.style.up_slide_display) == 1 ? true : false,
|
is_header_top: parseInt(this.propValue.header.com_data.style.up_slide_display) == 1 ? true : false,
|
||||||
temp_sticky_top: this.sticky_top,
|
temp_sticky_top: this.sticky_top,
|
||||||
temp_header_top: this.header_top,
|
// temp_header_top: `calc(${this.sticky_top}px + 66rpx + ${parseInt(this.propValue.header.com_data.style.data_alone_row_space || 5) * 2}rpx + ${this.propValue.header.com_data.content.data_alone_row_value.length > 0 ? '66rpx' : '0rpx'});`,
|
||||||
|
temp_header_top: `calc(${this.sticky_top}px + 66rpx + 40rpx + 66rpx);`,
|
||||||
|
header_top: `calc(${this.sticky_top}px + 66rpx + 40rpx + 66rpx);`,
|
||||||
// 顶部导航高度是否变化--------------------------------------------------
|
// 顶部导航高度是否变化--------------------------------------------------
|
||||||
is_search_alone_row: false,
|
// is_search_alone_row: this.propValue.header.com_data.content.data_alone_row_value.length > 0 ? true : false,
|
||||||
|
// data_alone_row_space: parseInt(this.propValue.header.com_data.style.data_alone_row_space || 5),
|
||||||
|
is_search_alone_row: true,
|
||||||
|
data_alone_row_space: 20,
|
||||||
});
|
});
|
||||||
|
|
||||||
// 缓存数据
|
// 缓存数据
|
||||||
|
|
@ -489,7 +493,7 @@
|
||||||
// 判断顶部导航是否置顶
|
// 判断顶部导航是否置顶
|
||||||
// #ifdef H5 || MP-TOUTIAO
|
// #ifdef H5 || MP-TOUTIAO
|
||||||
if (!this.is_header_top) {
|
if (!this.is_header_top) {
|
||||||
if (e.detail.scrollTop >= this.sticky_top + 33) {
|
if (e.detail.scrollTop >= this.sticky_top + 33 + (is_search_alone_row ? 0 : 33 + data_alone_row_space)) {
|
||||||
this.setData({
|
this.setData({
|
||||||
temp_sticky_top: 0,
|
temp_sticky_top: 0,
|
||||||
temp_header_top: 0,
|
temp_header_top: 0,
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@
|
||||||
margin_right: 0,
|
margin_right: 0,
|
||||||
},
|
},
|
||||||
top_up: '0',
|
top_up: '0',
|
||||||
tabs_style: '',
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -80,25 +79,11 @@
|
||||||
init() {
|
init() {
|
||||||
const new_content = this.propValue.content || {};
|
const new_content = this.propValue.content || {};
|
||||||
const new_style = this.propValue.style || {};
|
const new_style = this.propValue.style || {};
|
||||||
// let tabs_style_obj = {
|
|
||||||
// padding_top: new_style.common_style.padding_top,
|
|
||||||
// padding_left: new_style.common_style.padding_left,
|
|
||||||
// padding_right: new_style.common_style.padding_right,
|
|
||||||
// margin_top: new_style.common_style.margin_top,
|
|
||||||
// margin_left: new_style.common_style.margin_left,
|
|
||||||
// margin_right: new_style.common_style.margin_right,
|
|
||||||
// };
|
|
||||||
// let new_tabs_style = padding_computer(tabs_style_obj) + margin_computer(tabs_style_obj) + `position:relative;left: -${tabs_style_obj.padding_left * 2}rpx;right: -${tabs_style_obj.padding_right * 2}rpx;width:100%;`;
|
|
||||||
// let common_style = Object.assign({}, new_style.common_style, {
|
|
||||||
// padding_top: 0,
|
|
||||||
// margin_top: 0,
|
|
||||||
// });
|
|
||||||
this.setData({
|
this.setData({
|
||||||
// style_container: `${common_styles_computer(common_style)};gap:${new_style.data_spacing * 2}rpx`,
|
// style_container: `${common_styles_computer(common_style)};gap:${new_style.data_spacing * 2}rpx`,
|
||||||
style_container: `${common_styles_computer(new_style.common_style)};gap:${new_style.data_spacing * 2}rpx`,
|
style_container: `${common_styles_computer(new_style.common_style)};gap:${new_style.data_spacing * 2}rpx`,
|
||||||
style_img_container: common_img_computer(new_style.common_style),
|
style_img_container: common_img_computer(new_style.common_style),
|
||||||
top_up: new_content.tabs_top_up,
|
top_up: new_content.tabs_top_up,
|
||||||
// tabs_style: new_tabs_style,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
tabs_click_event(tabs_id, is_micro_page) {
|
tabs_click_event(tabs_id, is_micro_page) {
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
let new_tabs_data = JSON.parse(JSON.stringify(this.propValue));
|
let new_tabs_data = JSON.parse(JSON.stringify(this.propValue));
|
||||||
new_tabs_data.content.tabs_list.unshift(new_tabs_data.content.home_data);
|
new_tabs_data.content.tabs_list.unshift(new_tabs_data.content.home_data);
|
||||||
// 判断选项卡是否置顶
|
// 判断选项卡是否置顶
|
||||||
let other_style = 'calc(' + this.propTop + 'px' + ' + 66rpx)';
|
let other_style = this.propTop;
|
||||||
|
|
||||||
let new_tabs_top_style = this.propNavIsTop || this.propTabsIsTop || new_content.tabs_top_up == '1' ? (new_content.tabs_top_up == '1' ? 'top:' + other_style + ';z-index:3;' : '') : '';
|
let new_tabs_top_style = this.propNavIsTop || this.propTabsIsTop || new_content.tabs_top_up == '1' ? (new_content.tabs_top_up == '1' ? 'top:' + other_style + ';z-index:3;' : '') : '';
|
||||||
let new_top_up = new_content.tabs_top_up;
|
let new_top_up = new_content.tabs_top_up;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue