From 5583b149adb945ebb3b34e33df95f0a6ba2a9763 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Fri, 18 Oct 2024 18:15:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/article-list.vue | 3 +++ components/diy/article-tabs.vue | 9 ++++++++- components/diy/auxiliary-line.vue | 2 ++ components/diy/coupon.vue | 1 + components/diy/footer.vue | 1 + components/diy/header.vue | 5 +++++ components/diy/hot-zone.vue | 1 + components/diy/modules/tabs-view.vue | 7 +++++++ components/diy/notice.vue | 1 + components/diy/rich-text.vue | 1 + components/diy/tabs.vue | 3 +++ components/diy/title.vue | 5 +++++ components/diy/user-info.vue | 1 + components/diy/video.vue | 2 ++ 14 files changed, 41 insertions(+), 1 deletion(-) diff --git a/components/diy/article-list.vue b/components/diy/article-list.vue index e9a73cbd..b1a68fd1 100644 --- a/components/diy/article-list.vue +++ b/components/diy/article-list.vue @@ -73,10 +73,12 @@ type: Object, default: () => {}, }, + // 是否使用公共样式 propIsCommonStyle: { type: Boolean, default: true, }, + // 关键key propKey: { type: String, default: '', @@ -141,6 +143,7 @@ this.init(); }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; diff --git a/components/diy/article-tabs.vue b/components/diy/article-tabs.vue index 1a81d193..bcce604b 100644 --- a/components/diy/article-tabs.vue +++ b/components/diy/article-tabs.vue @@ -25,14 +25,17 @@ type: Object, default: () => {}, }, + // 距离顶部高度 propTop: { type: Number, default: 0, }, + // 自定义导航栏高度 propCustomNavHeight: { type: Number, default: 33, }, + // 滚动距离 propScrollTop: { type: Number, default: 0, @@ -76,6 +79,7 @@ }; }, watch: { + // 监听滚动距离 propScrollTop(newVal) { if (newVal + this.propTop + this.custom_nav_height > this.tabs_top + this.nav_safe_space && this.top_up == '1') { let new_style = this.propValue.style || {}; @@ -125,6 +129,7 @@ }); }, methods: { + // 初始化数据 init() { let new_content = this.propValue.content || {}; let new_style = this.propValue.style || {}; @@ -162,6 +167,7 @@ tabs_style: new_tabs_style, }); }, + // tabs切换事件 tabs_click_event(index) { let new_data = JSON.parse(JSON.stringify(this.propValue)); new_data.content.theme = new_data.content.article_theme; @@ -180,7 +186,8 @@ article_tabs: new_data, diy_key: Math.random(), }); - }, // 获取商品距离顶部的距离 + }, + // 获取商品距离顶部的距离 getTop() { const query = uni.createSelectorQuery().in(this); query diff --git a/components/diy/auxiliary-line.vue b/components/diy/auxiliary-line.vue index e9b85101..9314e6ee 100644 --- a/components/diy/auxiliary-line.vue +++ b/components/diy/auxiliary-line.vue @@ -15,6 +15,7 @@ type: Object, default: () => ({}), }, + // key propKey: { type: String, default: '', @@ -37,6 +38,7 @@ this.init(); }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; diff --git a/components/diy/coupon.vue b/components/diy/coupon.vue index 03b041b3..ac9e3114 100644 --- a/components/diy/coupon.vue +++ b/components/diy/coupon.vue @@ -205,6 +205,7 @@ this.init(); }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; diff --git a/components/diy/footer.vue b/components/diy/footer.vue index 8603e337..72a46693 100644 --- a/components/diy/footer.vue +++ b/components/diy/footer.vue @@ -41,6 +41,7 @@ type: Object, default: null, }, + // 底部选中索引 propFooterActiveIndex: { type: Number, default: 0, diff --git a/components/diy/header.vue b/components/diy/header.vue index aa35ade8..e3630c68 100644 --- a/components/diy/header.vue +++ b/components/diy/header.vue @@ -102,6 +102,7 @@ type: Object, default: () => ({}), }, + // 滚动距离 propScrollTop: { type: Number, default: 0, @@ -162,6 +163,7 @@ }; }, watch: { + // 监听滚动距离 propScrollTop(newVal) { const { up_slide_background_color_list, up_slide_background_direction, up_slide_background_img, up_slide_background_img_style } = this.propValue.style || {}; // 渐变 @@ -181,12 +183,15 @@ }, }, created() { + // 判断是否有值初始化 if ((this.propValue || null) !== null) { this.init(); } }, methods: { + // 判断是否为空 isEmpty, + // 初始化 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; diff --git a/components/diy/hot-zone.vue b/components/diy/hot-zone.vue index 2166d3b0..c8344b20 100644 --- a/components/diy/hot-zone.vue +++ b/components/diy/hot-zone.vue @@ -52,6 +52,7 @@ this.init(); }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; diff --git a/components/diy/modules/tabs-view.vue b/components/diy/modules/tabs-view.vue index 6b64d85f..e9ab4979 100644 --- a/components/diy/modules/tabs-view.vue +++ b/components/diy/modules/tabs-view.vue @@ -58,6 +58,7 @@ type: Object, default: () => {}, }, + // 是否需要icon propIsTabsIcon: { type: Boolean, default: false, @@ -77,14 +78,17 @@ type: String, default: '', }, + // 层级 propZIndex: { type: Number, default: 2, }, + // 自定义导航栏高度 propCustomNavHeight: { type: String, default: '66rpx', }, + // tabs背景色 propTabsBackground: { type: String, default: 'transparent', @@ -138,7 +142,9 @@ }); }, methods: { + // 判断是否为空 isEmpty, + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; @@ -167,6 +173,7 @@ tabs_bottom_line_theme: new_style.tabs_one_theme == '1' ? 'tabs-bottom-line-theme' : '', }); }, + // 获取选项卡主题 get_tabs_theme(data) { switch (data.tabs_theme) { case '1': diff --git a/components/diy/notice.vue b/components/diy/notice.vue index 22c14cec..b35a5e98 100644 --- a/components/diy/notice.vue +++ b/components/diy/notice.vue @@ -115,6 +115,7 @@ this.init(); }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; diff --git a/components/diy/rich-text.vue b/components/diy/rich-text.vue index de1e045f..d776558f 100644 --- a/components/diy/rich-text.vue +++ b/components/diy/rich-text.vue @@ -37,6 +37,7 @@ this.init(); }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; diff --git a/components/diy/tabs.vue b/components/diy/tabs.vue index bdd51595..ea386d41 100644 --- a/components/diy/tabs.vue +++ b/components/diy/tabs.vue @@ -42,6 +42,7 @@ type: Boolean, default: false, }, + // 样式 propStyle: { type: String, default: '', @@ -94,6 +95,7 @@ }, }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; @@ -158,6 +160,7 @@ const is_micro_page = item.data_type == '0'; this.$emit('onTabsTap', tabs_id, is_micro_page); }, + // 获取 tabs_id get_tabs_id(item, index) { if (item.data_type === '0') { return index !== 0 ? item.micro_page_list?.id : ''; diff --git a/components/diy/title.vue b/components/diy/title.vue index 9d4782ac..a1e43af2 100644 --- a/components/diy/title.vue +++ b/components/diy/title.vue @@ -72,7 +72,9 @@ this.init(); }, methods: { + // 判断是否为空 isEmpty, + // 初始化数据 init() { this.setData({ form: this.propValue.content, @@ -87,11 +89,13 @@ // 样式设置 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; // 标题样式设置 @@ -112,6 +116,7 @@ style_img_container: common_img_computer(common_style), }); }, + // 副标题样式设置 get_subtitle_style() { let common_styles = ''; if (this.new_style.subtitle_weight == 'italic') { diff --git a/components/diy/user-info.vue b/components/diy/user-info.vue index 1841f7eb..55b8da64 100644 --- a/components/diy/user-info.vue +++ b/components/diy/user-info.vue @@ -94,6 +94,7 @@ this.init(); }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; diff --git a/components/diy/video.vue b/components/diy/video.vue index 672871a3..c71c651b 100644 --- a/components/diy/video.vue +++ b/components/diy/video.vue @@ -41,6 +41,7 @@ this.init(); }, methods: { + // 初始化数据 init() { const new_content = this.propValue.content || {}; const new_style = this.propValue.style || {}; @@ -53,6 +54,7 @@ style_img_container: common_img_computer(new_style.common_style), }); }, + // 获取视频高度 get_video_height(data) { uni.getSystemInfo({ success: (res) => { From dc4ac50cb9bcd3f53dccd9369ed4188b059bcb2e Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Fri, 18 Oct 2024 18:16:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/article-tabs.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/diy/article-tabs.vue b/components/diy/article-tabs.vue index bcce604b..189757f0 100644 --- a/components/diy/article-tabs.vue +++ b/components/diy/article-tabs.vue @@ -95,12 +95,10 @@ this.setData({ tabs_background: (new_tabs_background.length > 0 ? new_tabs_background : 'background:#fff;') + new_tabs_background_img, }); - console.log(1); } else { this.setData({ tabs_background: 'background:transparent', }); - console.log(2); } }, propKey(val) {