diff --git a/components/diy/article-list.vue b/components/diy/article-list.vue index 609da741..fcddb8e7 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,Number], 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 f9bd6530..defc1ab3 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 || {}; @@ -91,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) { @@ -125,6 +127,7 @@ }); }, methods: { + // 初始化数据 init() { let new_content = this.propValue.content || {}; let new_style = this.propValue.style || {}; @@ -162,6 +165,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 +184,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 0703ccc4..e69c6793 100644 --- a/components/diy/auxiliary-line.vue +++ b/components/diy/auxiliary-line.vue @@ -15,6 +15,7 @@ type: Object, default: () => ({}), }, + // key propKey: { type: [String,Number], 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 bf2a1c67..4b62990f 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 bf495e75..40cca90e 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 5b4204b1..cb650f3c 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 51d122d0..4a3c7dc7 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 a7e0b256..500752be 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 3817b14e..d991366d 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 5800c7f7..2ecac15b 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 4bb2d288..90e6cf0b 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 d63b9656..5acfbf53 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 5fdb951d..b790353e 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) => {