1.diy---header

master
sws 2024-09-25 11:40:12 +08:00
parent 1c0b883a7c
commit aebcd3a203
3 changed files with 18 additions and 18 deletions

View File

@ -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 60bar_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,

View File

@ -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({

View File

@ -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() {