1.diy---代码优化

master
sws 2024-09-25 18:46:50 +08:00
parent 3b95bb173b
commit bd5578e5d1
4 changed files with 29 additions and 12 deletions

View File

@ -236,7 +236,7 @@ button:before {
z-index: 2 !important; z-index: 2 !important;
} }
.z-i-deep-must { .z-i-deep-must {
z-index: 9 !important; z-index: 999 !important;
} }
.bs-bb { .bs-bb {
box-sizing: border-box; box-sizing: border-box;

View File

@ -1,10 +1,8 @@
<template> <template>
<!-- 文章列表 --> <!-- 文章列表 -->
<view class="pr" :style="style_container"> <view class="overflow-unset" :style="style_container">
<view :class="top_up == '1' ? 'ps z-i-deep-must top-0' : ''"> <componentDiyModulesTabsView :value="article_tabs" :is-top="top_up == '1'" @tabs-click="tabs_click_event"></componentDiyModulesTabsView>
<componentDiyModulesTabsView :value="article_tabs" @tabs-click="tabs_click_event"></componentDiyModulesTabsView> <view class="padding-top oh">
</view>
<view class="padding-top">
<componentDiyArticleList :key="key" :value="article_tabs" :is-common-style="false"></componentDiyArticleList> <componentDiyArticleList :key="key" :value="article_tabs" :is-common-style="false"></componentDiyArticleList>
</view> </view>
</view> </view>
@ -86,4 +84,8 @@
}, },
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.overflow-unset {
overflow: unset !important;
}
</style>

View File

@ -1,7 +1,7 @@
<template> <template>
<view :style="style_container"> <view class="overflow-unset" :style="style_container">
<componentDiyModulesTabsView :value="goods_tabs" @tabs-click="tabs_click_event"></componentDiyModulesTabsView> <componentDiyModulesTabsView :value="goods_tabs" :is-top="top_up == '1'" @tabs-click="tabs_click_event"></componentDiyModulesTabsView>
<view class="padding-top"> <view class="padding-top oh">
<componentGoodsList :key="key" :value="goods_tabs" :is-common-style="false"></componentGoodsList> <componentGoodsList :key="key" :value="goods_tabs" :is-common-style="false"></componentGoodsList>
</view> </view>
</view> </view>
@ -29,6 +29,7 @@
style_container: '', style_container: '',
goods_tabs: {}, goods_tabs: {},
key: 1, key: 1,
top_up: '0',
}; };
}, },
created() { created() {
@ -36,8 +37,10 @@
}, },
methods: { methods: {
init() { init() {
const new_content = this.value.content || {};
const new_style = this.value.style || {}; const new_style = this.value.style || {};
let new_data = JSON.parse(JSON.stringify(this.value)); let new_data = JSON.parse(JSON.stringify(this.value));
this.top_up = new_content.tabs_top_up;
// //
new_data.content.data_type = new_data.content.tabs_list[0].data_type; new_data.content.data_type = new_data.content.tabs_list[0].data_type;
new_data.content.category = new_data.content.tabs_list[0].category; new_data.content.category = new_data.content.tabs_list[0].category;
@ -71,4 +74,8 @@
}; };
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss">
.overflow-unset {
overflow: unset !important;
}
</style>

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 文章列表 --> <!-- 文章列表 -->
<view class="container"> <view class="container" :class="isTop ? 'ps z-i-deep-must bg-white' : ''" :style="'top:' + top + 'px;'">
<view class="flex-row gap-10 jc-sb align-c"> <view class="flex-row gap-10 jc-sb align-c">
<view class="tabs flex-1 flex-width"> <view class="tabs flex-1 flex-width">
<scroll-view :scroll-x="true" :show-scrollbar="false" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-' + active_index" class="wh-auto"> <scroll-view :scroll-x="true" :show-scrollbar="false" :scroll-with-animation="true" :scroll-into-view="'one-nav-item-' + active_index" class="wh-auto">
@ -60,6 +60,14 @@
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isTop: {
type: Boolean,
default: false,
},
top: {
type: String,
default: '0',
},
}, },
components: { components: {
componentPopup, componentPopup,