修改视频高度问题
parent
6e9645ee4d
commit
22a822fe7d
16
pages.json
16
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": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view class="content pr">
|
||||
<!-- 搜索框 -->
|
||||
<view v-if="!show_comment_modal" class="header-top" :style="top_content_style + menu_button_info">
|
||||
<view class="search-height flex-row align-c">
|
||||
<view id="search-height" class="flex-row align-c">
|
||||
<view class="cp" @tap="handle_back">
|
||||
<iconfont name="icon-arrow-left " size="36rpx" color="#333" class="mr-10"></iconfont>
|
||||
</view>
|
||||
|
|
@ -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) {
|
||||
// 处理负数索引
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<!-- 搜索框 -->
|
||||
<view class="header-top">
|
||||
<view class="ht-auto" :style="top_content_style + menu_button_info">
|
||||
<view class="search-height">
|
||||
<view id="search-height" class="wh-auto ht-auto">
|
||||
<search-component :propSearchQuery="search_query" :propIsDisabled="true" @disabledSearch="handle_search"/>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -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() {
|
||||
// 跳转到搜索记录页面
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<view class="wh-auto ht pr search-record-container">
|
||||
<!-- 搜索框 -->
|
||||
<view class="header-top" :style="top_content_style + menu_button_info">
|
||||
<view class="search-height flex-row align-c">
|
||||
<view id="search-height" class="flex-row align-c">
|
||||
<view class="cp" @tap="handle_back">
|
||||
<iconfont name="icon-arrow-left " size="36rpx" color="#333" class="mr-10"></iconfont>
|
||||
</view>
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<!-- 搜索框 -->
|
||||
<view class="header-top">
|
||||
<view class="header-search" :style="top_content_style + menu_button_info">
|
||||
<view class="search-height flex-row align-c">
|
||||
<view id="search-height" class="flex-row align-c">
|
||||
<view class="cp" @tap="handle_back">
|
||||
<iconfont name="icon-arrow-left " size="36rpx" color="#333" class="mr-10"></iconfont>
|
||||
</view>
|
||||
|
|
@ -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();
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue