1.支付宝小程序兼容性优化

master
sws 2024-10-22 16:49:07 +08:00
parent 1a1abf5785
commit 34eb59e098
3 changed files with 31 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<template>
<!-- 文章列表 -->
<view class="article-tabs ou" :style="style_container">
<view class="article-tabs ou" :class="'article-tabs-' + propKey" :style="style_container">
<view class="ou" :style="style_img_container">
<componentDiyModulesTabsView :propValue="article_tabs" :propIsTop="top_up == '1'" :propTop="propTop" :propStyle="tabs_style + 'padding-bottom:24rpx;'" :propCustomNavHeight="propCustomNavHeight * 2 + 'rpx'" :propTabsBackground="tabs_background" @onTabsTap="tabs_click_event"></componentDiyModulesTabsView>
<view class="oh">
@ -194,7 +194,7 @@
getTop() {
const query = uni.createSelectorQuery().in(this);
query
.select('.article-tabs')
.select('.article-tabs-' + this.propKey)
.boundingClientRect((res) => {
if ((res || null) != null) {
this.setData({

View File

@ -1,5 +1,5 @@
<template>
<view class="goods-tabs ou" :style="style_container">
<view class="goods-tabs ou" :class="'goods-tabs-' + propKey" :style="style_container">
<view class="ou" :style="style_img_container">
<componentDiyModulesTabsView :propValue="goods_tabs" :propIsTop="top_up == '1'" :propTop="propTop" :propStyle="tabs_style + 'padding-bottom:24rpx;'" :propCustomNavHeight="propCustomNavHeight * 2 + 'rpx'" :propTabsBackground="tabs_background" @onTabsTap="tabs_click_event"></componentDiyModulesTabsView>
<view class="oh">
@ -183,7 +183,7 @@
getTop() {
const query = uni.createSelectorQuery().in(this);
query
.select('.goods-tabs')
.select('.goods-tabs-' + this.propKey)
.boundingClientRect((res) => {
if ((res || null) != null) {
this.setData({

View File

@ -1,6 +1,7 @@
<template>
<!-- 66rpx是自定义顶部导航栏的高度-->
<uv-sticky :disabled="!propIsTop" :offset-top="propTop" :zIndex="propZIndex" :customNavHeight="propCustomNavHeight">
<!-- <uv-sticky :disabled="!propIsTop" :offset-top="propTop" :zIndex="propZIndex" :customNavHeight="propCustomNavHeight"> -->
<view class="tabs-view" :style="tabs_sticky">
<view class="tabs-view flex-row gap-10 jc-sb align-c" :style="propStyle + propTabsBackground">
<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">
@ -42,7 +43,8 @@
</view>
</view>
</componentPopup>
</uv-sticky>
</view>
<!-- </uv-sticky> -->
</template>
<script>
@ -122,12 +124,34 @@
popup_status: false,
propIsBar: false,
tabs_bottom_line_theme: '',
tabs_sticky: '',
};
},
watch: {
propValue(new_value, old_value) {
propValue() {
this.init();
},
propIsTop: {
deep: true,
immediate: true,
handler(new_val) {
if (new_val) {
this.tabs_sticky = 'position: sticky;top: calc(' + parseInt(this.propTop) + 'px + ' + this.propCustomNavHeight + ');z-index: ' + this.propZIndex + ';';
console.log(this.tabs_sticky);
console.log(this.propTop, this.propCustomNavHeight);
} else {
this.tabs_sticky = '';
console.log(this.tabs_sticky);
}
},
},
propTop(new_val, old_val) {
if (this.propIsTop) {
this.tabs_sticky = 'position: sticky;top: calc(' + parseInt(this.propTop) + 'px + ' + this.propCustomNavHeight + ');z-index: ' + this.propZIndex + ';';
} else {
this.tabs_sticky = '';
}
},
},
mounted() {
this.init();