diff --git a/pages.json b/pages.json index d1d077f3..2df13728 100644 --- a/pages.json +++ b/pages.json @@ -2038,6 +2038,10 @@ // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || H5 || APP "navigationStyle": "custom", // #endif + // #ifdef MP-ALIPAY + "transparentTitle": "always", + "titlePenetrate": "YES", + // #endif "enablePullDownRefresh": false, "navigationBarTitleText": "" } @@ -2048,6 +2052,10 @@ // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || H5 || APP "navigationStyle": "custom", // #endif + // #ifdef MP-ALIPAY + "transparentTitle": "auto", + "titlePenetrate": "YES", + // #endif "enablePullDownRefresh": false, "navigationBarTitleText": "" } @@ -2058,6 +2066,10 @@ // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || H5 || APP "navigationStyle": "custom", // #endif + // #ifdef MP-ALIPAY + "transparentTitle": "auto", + "titlePenetrate": "YES", + // #endif "enablePullDownRefresh": false, "navigationBarTitleText": "" } @@ -2068,6 +2080,10 @@ // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || H5 || APP "navigationStyle": "custom", // #endif + // #ifdef MP-ALIPAY + "transparentTitle": "auto", + "titlePenetrate": "YES", + // #endif "enablePullDownRefresh": false, "navigationBarTitleText": "" } diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index 45a73c4c..9d160e69 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -2,7 +2,7 @@ - + @@ -144,16 +144,7 @@ }, data() { return { - // 5,7,0 是误差,10 是下边距,bar_height是不同小程序下的导航栏距离顶部的高度 - // #ifdef MP - top_content_style: 'padding-top:' + (bar_height + 5) + 'px;padding-bottom:10px;', - // #endif - // #ifdef H5 || MP-TOUTIAO - top_content_style: 'padding-top:' + (bar_height + 7) + 'px;padding-bottom:10px;', - // #endif - // #ifdef APP top_content_style: 'padding-top:' + bar_height + 'px;padding-bottom:10px;', - // #endif videoData: videoList, display_video_list: [], current_index: 0, @@ -233,7 +224,6 @@ if (is_current_single_page == 0) { const custom = uni.getMenuButtonBoundingClientRect(); menu_button_info = `max-width:calc(100% - ${custom.width + 10}px);`; - this.get_top_content_style(custom.height); } // #endif // #endif @@ -264,32 +254,6 @@ this.getVideoByIndex(2) // 下两个元素 ]; }, - get_top_content_style(custom_height) { - // 获取搜索区域的高度 - setTimeout(() => { - const query = uni.createSelectorQuery().in(this); - // 选择我们想要的元素 - query.select('.search-height').boundingClientRect((res) => { - if ((res || null) != null) { - // 判断搜索跟胶囊的大小间隔 - const top_height = custom_height == 0 ? 0 : (res.height - custom_height) / 2; - let top_content_style = ''; - // #ifdef MP - top_content_style = 'padding-top:' + (bar_height + 5 - top_height) + 'px;padding-bottom:10px;'; - // #endif - // #ifdef H5 || MP-TOUTIAO - top_content_style = 'padding-top:' + (bar_height + 7 - top_height) + 'px;padding-bottom:10px;'; - // #endif - // #ifdef APP - top_content_style = 'padding-top:' + bar_height - top_height + 'px;padding-bottom:10px;'; - // #endif - this.setData({ - top_content_style: top_content_style - }); - } - }).exec(); // 执行查询 - }, 500); - }, // 安全获取视频数据的方法,处理索引超限情况 getVideoByIndex(index) { // 处理负数索引 diff --git a/pages/plugins/video/index/index.vue b/pages/plugins/video/index/index.vue index 1ce3d33d..a51c3cc5 100644 --- a/pages/plugins/video/index/index.vue +++ b/pages/plugins/video/index/index.vue @@ -5,7 +5,7 @@ - + @@ -65,16 +65,7 @@ export default { }, data() { return { - // 5,7,0 是误差,10 是下边距,bar_height是不同小程序下的导航栏距离顶部的高度 - // #ifdef MP - top_content_style: 'padding-top:' + (bar_height + 5) + 'px;padding-bottom:10px;', - // #endif - // #ifdef H5 || MP-TOUTIAO - top_content_style: 'padding-top:' + (bar_height + 7) + 'px;padding-bottom:10px;', - // #endif - // #ifdef APP top_content_style: 'padding-top:' + bar_height + 'px;padding-bottom:10px;', - // #endif search_query: '', tabs: ['推荐', 'DIV装修', '商城管理', '多商户', '多门店', '客服','多门店', '客服'], currentTab: 0, @@ -100,7 +91,6 @@ export default { if (is_current_single_page == 0) { const custom = uni.getMenuButtonBoundingClientRect(); menu_button_info = `max-width:calc(100% - ${custom.width + 10}px);`; - this.get_top_content_style(custom.height); } // #endif // #endif @@ -139,14 +129,16 @@ export default { }, ] }); - }, 10000); + }, 100); }, get_top_content_style(custom_height) { + const this_ = this; // 获取搜索区域的高度 - setTimeout(() => { - const query = uni.createSelectorQuery().in(this); - // 选择我们想要的元素 - query.select('.search-height').boundingClientRect((res) => { + this.$nextTick(() => { + const query = uni.createSelectorQuery().in(this_); + // 选择我们想要的元素 + query.select('#search-height').boundingClientRect((res) => { + console.log(res, '1144'); if ((res || null) != null) { // 判断搜索跟胶囊的大小间隔 const top_height = custom_height == 0 ? 0 : (res.height - custom_height) / 2; @@ -160,12 +152,12 @@ export default { // #ifdef APP top_content_style = 'padding-top:' + bar_height - top_height + 'px;padding-bottom:10px;'; // #endif - this.setData({ + this_.setData({ top_content_style: top_content_style }); } }).exec(); // 执行查询 - }, 500); + }); }, handle_search() { // 跳转到搜索记录页面 diff --git a/pages/plugins/video/search/search-record.vue b/pages/plugins/video/search/search-record.vue index e3bd43f5..28d2bc66 100644 --- a/pages/plugins/video/search/search-record.vue +++ b/pages/plugins/video/search/search-record.vue @@ -2,7 +2,7 @@ - + @@ -69,16 +69,7 @@ export default { }, data() { return { - // 5,7,0 是误差,10 是下边距,bar_height是不同小程序下的导航栏距离顶部的高度 - // #ifdef MP - top_content_style: 'padding-top:' + (bar_height + 5) + 'px;padding-bottom:10px;', - // #endif - // #ifdef H5 || MP-TOUTIAO - top_content_style: 'padding-top:' + (bar_height + 7) + 'px;padding-bottom:10px;', - // #endif - // #ifdef APP top_content_style: 'padding-top:' + bar_height + 'px;padding-bottom:10px;', - // #endif search_query: '', search_history: [ { text: '软件升级规则' }, @@ -117,7 +108,6 @@ export default { if (is_current_single_page == 0) { const custom = uni.getMenuButtonBoundingClientRect(); menu_button_info = `max-width:calc(100% - ${custom.width + 10}px);`; - this.get_top_content_style(custom.height); } // #endif // #endif @@ -125,32 +115,6 @@ export default { menu_button_info: menu_button_info }); }, - get_top_content_style(custom_height) { - // 获取搜索区域的高度 - setTimeout(() => { - const query = uni.createSelectorQuery().in(this); - // 选择我们想要的元素 - query.select('.search-height').boundingClientRect((res) => { - if ((res || null) != null) { - // 判断搜索跟胶囊的大小间隔 - const top_height = custom_height == 0 ? 0 : (res.height - custom_height) / 2; - let top_content_style = ''; - // #ifdef MP - top_content_style = 'padding-top:' + (bar_height + 5 - top_height) + 'px;padding-bottom:10px;'; - // #endif - // #ifdef H5 || MP-TOUTIAO - top_content_style = 'padding-top:' + (bar_height + 7 - top_height) + 'px;padding-bottom:10px;'; - // #endif - // #ifdef APP - top_content_style = 'padding-top:' + bar_height - top_height + 'px;padding-bottom:10px;'; - // #endif - this.setData({ - top_content_style: top_content_style - }); - } - }).exec(); // 执行查询 - }, 500); - }, // 返回 handle_back() { app.globalData.page_back_prev_event(); diff --git a/pages/plugins/video/search/search.vue b/pages/plugins/video/search/search.vue index 053590b8..5cd94593 100644 --- a/pages/plugins/video/search/search.vue +++ b/pages/plugins/video/search/search.vue @@ -5,7 +5,7 @@ - + @@ -91,16 +91,7 @@ export default { }, data() { return { - // 5,7,0 是误差,10 是下边距,bar_height是不同小程序下的导航栏距离顶部的高度 - // #ifdef MP - top_content_style: 'padding-top:' + (bar_height + 5) + 'px;padding-bottom:10px;', - // #endif - // #ifdef H5 || MP-TOUTIAO - top_content_style: 'padding-top:' + (bar_height + 7) + 'px;padding-bottom:10px;', - // #endif - // #ifdef APP top_content_style: 'padding-top:' + bar_height + 'px;padding-bottom:10px;', - // #endif search_query: '', tabs: ['推荐', 'DIV装修', '商城管理', '多商户', '多门店', '客服','多门店', '客服'], currentTab: 0, @@ -176,7 +167,6 @@ export default { if (is_current_single_page == 0) { const custom = uni.getMenuButtonBoundingClientRect(); menu_button_info = `max-width:calc(100% - ${custom.width + 10}px);`; - this.get_top_content_style(custom.height); } // #endif // #endif @@ -200,32 +190,6 @@ export default { .exec(); // 执行查询 }, 500); }, - get_top_content_style(custom_height) { - // 获取搜索区域的高度 - setTimeout(() => { - const query = uni.createSelectorQuery().in(this); - // 选择我们想要的元素 - query.select('.search-height').boundingClientRect((res) => { - if ((res || null) != null) { - // 判断搜索跟胶囊的大小间隔 - const top_height = custom_height == 0 ? 0 : (res.height - custom_height) / 2; - let top_content_style = ''; - // #ifdef MP - top_content_style = 'padding-top:' + (bar_height + 5 - top_height) + 'px;padding-bottom:10px;'; - // #endif - // #ifdef H5 || MP-TOUTIAO - top_content_style = 'padding-top:' + (bar_height + 7 - top_height) + 'px;padding-bottom:10px;'; - // #endif - // #ifdef APP - top_content_style = 'padding-top:' + bar_height - top_height + 'px;padding-bottom:10px;'; - // #endif - this.setData({ - top_content_style: top_content_style - }); - } - }).exec(); // 执行查询 - }, 500); - }, handle_back() { app.globalData.page_back_prev_event(); },