1.diy---header
parent
1c0b883a7c
commit
aebcd3a203
|
|
@ -102,7 +102,7 @@
|
|||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
propDataId: {
|
||||
propHomeId: {
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
},
|
||||
|
|
@ -148,14 +148,15 @@
|
|||
// 是否是模块数据或者是九宫格商品分类样式数据, 默认模块数据
|
||||
is_tabs_type: true,
|
||||
|
||||
// 5,7,0 是误差,, 12 是下边距,60是高度,bar_height是不同小程序下的导航栏距离顶部的高度
|
||||
// #ifdef MP
|
||||
header_top: 'padding-top:' + (bar_height + 154) + 'rpx;',
|
||||
header_top: 'padding-top:' + (bar_height + 34 + 5 + 12) + 'px;',
|
||||
// #endif
|
||||
// #ifdef H5 || MP-TOUTIAO
|
||||
header_top: 'padding-top:' + (bar_height + 158) + 'rpx;',
|
||||
header_top: 'padding-top:' + (bar_height + 34 + 7 + 12) + 'px;',
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
header_top: 'padding-top:' + (bar_height + 144) + 'rpx;',
|
||||
header_top: 'padding-top:' + (bar_height + 34 + 0 + 12) + 'px;',
|
||||
// #endif
|
||||
|
||||
header_data: {},
|
||||
|
|
@ -163,6 +164,7 @@
|
|||
// 选项卡数据
|
||||
tabs_data: {},
|
||||
diy_data: [],
|
||||
tabs_home_id: this.propHomeId,
|
||||
// 商品列表
|
||||
goods_list: [],
|
||||
goods_total: 0,
|
||||
|
|
@ -180,8 +182,6 @@
|
|||
// 判断数据是否在加载中
|
||||
data_is_loading: 0,
|
||||
key: '',
|
||||
// 缓存key
|
||||
cache_key: app.globalData.data.cache_diy_data_key
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -195,6 +195,7 @@
|
|||
methods: {
|
||||
init() {
|
||||
// tabs选项卡数据过滤
|
||||
// const filter_tabs_list = this.value.tabs_data || [];
|
||||
this.setData({
|
||||
key: get_math(),
|
||||
header_data: this.value.header,
|
||||
|
|
@ -202,7 +203,7 @@
|
|||
diy_data: this.value.diy_data,
|
||||
tabs_data: this.value.tabs_data,
|
||||
});
|
||||
uni.setStorageSync(this.cache_key + this.propDataId, this.value.diy_data);
|
||||
uni.setStorageSync('diy-data-' + this.propId, this.value.diy_data);
|
||||
},
|
||||
footer_height_computer(number) {
|
||||
this.padding_footer_computer = number * 2;
|
||||
|
|
@ -218,7 +219,7 @@
|
|||
id: tabs_id,
|
||||
};
|
||||
if (tabs_id) {
|
||||
new_data = uni.getStorageSync(this.cache_key + tabs_id) || [];
|
||||
new_data = uni.getStorageSync('diy-data-' + tabs_id) || [];
|
||||
if (new_data.length > 0) {
|
||||
// 先使用缓存数据展示
|
||||
this.setData({
|
||||
|
|
@ -239,7 +240,7 @@
|
|||
const data = res.data.data.data;
|
||||
if (res.data.code == 0) {
|
||||
new_data = data?.config.diy_data || [];
|
||||
uni.setStorageSync(this.cache_key + tabs_id, new_data);
|
||||
uni.setStorageSync('diy-data-' + tabs_id, new_data);
|
||||
this.setData({
|
||||
diy_data: new_data,
|
||||
});
|
||||
|
|
@ -256,7 +257,7 @@
|
|||
this.get_goods_list(1);
|
||||
}
|
||||
} else {
|
||||
new_data = uni.getStorageSync(this.cache_key + this.propDataId) || [];
|
||||
new_data = uni.getStorageSync('diy-data-' + this.tabs_home_id) || [];
|
||||
// 先使用缓存数据展示
|
||||
this.setData({
|
||||
diy_data: new_data,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="header-container" :style="roll_style + position">
|
||||
<view class="bg-white pf top-0 left-0 right-0 padding-bottom" :style="top_content_style">
|
||||
<view class="bg-white pf top-0 left-0 right-0" :style="top_content_style">
|
||||
<view class="header-content flex-row align-c">
|
||||
<view class="model-top flex-1">
|
||||
<view class="roll pr z-i">
|
||||
|
|
@ -77,13 +77,13 @@
|
|||
header_style: 'max-width:100%',
|
||||
common_app_is_header_nav_fixed: 0,
|
||||
// #ifdef MP
|
||||
top_content_style: 'padding-top:' + (bar_height + 5) + 'px;',
|
||||
top_content_style: 'padding-top:' + (bar_height + 5) + 'px;padding-bottom:12px;',
|
||||
// #endif
|
||||
// #ifdef H5 || MP-TOUTIAO
|
||||
top_content_style: 'padding-top:' + (bar_height + 7) + 'px;',
|
||||
top_content_style: 'padding-top:' + (bar_height + 7) + 'px;padding-bottom:12px;',
|
||||
// #endif
|
||||
// #ifdef APP
|
||||
top_content_style: 'padding-top:' + bar_height + 'px;',
|
||||
top_content_style: 'padding-top:' + bar_height + 'px;padding-bottom:12px;',
|
||||
// #endif
|
||||
};
|
||||
},
|
||||
|
|
@ -111,7 +111,6 @@
|
|||
|
||||
// #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU
|
||||
const custom = uni.getMenuButtonBoundingClientRect();
|
||||
console.log(custom);
|
||||
menuButtonInfo = `max-width:calc(100% - ${custom.width + 30}px);`;
|
||||
// #endif
|
||||
this.setData({
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<!-- 选项卡 -->
|
||||
<view class="pr">
|
||||
<view v-if="top_up == '1'" class="pf z-i-deep-must left-0 right-0 top-0">
|
||||
<view class="seize-seat" :style="'padding-top:' + tabs_top"></view>
|
||||
<view class="seize-seat" :style="tabs_top"></view>
|
||||
<view :style="style_container">
|
||||
<componentDiyModulesTabsView :value="tabs_data" isTabs @tabs-click="tabs_click_event"></componentDiyModulesTabsView>
|
||||
</view>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
spacingCommonStyle: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
componentDiyModulesTabsView,
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
// 是否滑动置顶
|
||||
top_up: 0,
|
||||
tabs_top: bar_height + 120 + 'rpx',
|
||||
tabs_top: 'padding-top:' + bar_height + 34 + 'px',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue