diff --git a/components/diy/carousel.vue b/components/diy/carousel.vue
index 162847b5..d2dec3d6 100644
--- a/components/diy/carousel.vue
+++ b/components/diy/carousel.vue
@@ -133,8 +133,8 @@
const new_style = this.propValue.style;
// 获取当前手机的宽度
const { windowWidth } = uni.getSystemInfoSync();
- // 将90%的宽度分成16份
- const block = (windowWidth * 0.9) / 16;
+ // 将80%的宽度分成16份
+ const block = (windowWidth * 0.8) / 16;
const { common_style, actived_color } = new_style;
// scaleToFill 对应 fill aspectFit 对应 contain aspectFill 对应 cover
diff --git a/components/diy/diy.vue b/components/diy/diy.vue
index a7babdaa..475ae9aa 100644
--- a/components/diy/diy.vue
+++ b/components/diy/diy.vue
@@ -1,7 +1,7 @@
-
+
-
+
+
{{ $t('recommend-form.recommend-form.7gc30l') }}
-
+
{{ item.title }}
@@ -68,11 +69,6 @@
type: Boolean,
default: false,
},
- // 粘性定位距离顶部的高度
- propTop: {
- type: Number,
- default: 0,
- },
// 指定样式
propStyle: {
type: String,
@@ -93,6 +89,11 @@
type: String,
default: 'transparent',
},
+ // 置顶距离顶部高度
+ propTop: {
+ type: [String,Number],
+ default: '0',
+ },
},
components: {
componentPopup,
@@ -118,28 +119,11 @@
// 过滤弹窗
popup_status: false,
propIsBar: false,
- // 5,7,0 是误差,, 12 是下边距,60是高度,bar_height是不同小程序下的导航栏距离顶部的高度
- // #ifdef MP
- tabs_top: 'calc(' + (bar_height + 5 + 12) + 'px + 66rpx);',
- // #endif
- // #ifdef H5 || MP-TOUTIAO
- tabs_top: 'calc(' + (bar_height + 7 + 12) + 'px+ 66rpx);',
- // #endif
- // #ifdef APP
- tabs_top: 'calc(' + (bar_height + 0 + 12) + 'px+ 66rpx);',
- // #endif
- custom_nav_height: '66rpx',
tabs_bottom_line_theme: '',
};
},
mounted() {
this.init();
- // 延迟执行,等待dom渲染完成
- this.$nextTick(() => {
- this.setData({
- custom_nav_height: this.propCustomNavHeight,
- });
- });
},
methods: {
// 判断是否为空
@@ -175,18 +159,14 @@
},
// 获取选项卡主题
get_tabs_theme(data) {
- switch (data.tabs_theme) {
- case '1':
- return 'tabs-style-2';
- case '2':
- return 'tabs-style-3';
- case '3':
- return 'tabs-style-4';
- case '4':
- return 'tabs-style-5';
- default:
- return 'tabs-style-1';
- }
+ let arr = {
+ '1': 'tabs-style-2',
+ '2': 'tabs-style-3',
+ '3': 'tabs-style-4',
+ '4': 'tabs-style-5',
+ };
+ let value = arr[data.tabs_theme];
+ return value === undefined ? 'tabs-style-1' : value;
},
// 选中的背景渐变色样式
tabs_check_computer(data) {
@@ -252,7 +232,7 @@
position: absolute;
left: 0;
right: 0;
- bottom: -10rpx;
+ bottom: 0;
display: none;
}
.icon {
diff --git a/components/diy/tabs-carousel.vue b/components/diy/tabs-carousel.vue
index 11dec88b..7c1e13dd 100644
--- a/components/diy/tabs-carousel.vue
+++ b/components/diy/tabs-carousel.vue
@@ -2,7 +2,7 @@
-
+
@@ -24,7 +24,7 @@
},
},
propTop: {
- type: Number,
+ type: [String,Number],
default: 0,
},
// 是否导航栏置顶
@@ -86,12 +86,19 @@
top_up: new_content.tabs_top_up,
});
},
+ // tab点击
tabs_click_event(tabs_id, is_micro_page) {
this.$emit('onTabsTap', tabs_id, is_micro_page);
},
+ // tab高度
tabs_height_event(height) {
this.$emit('onComputerHeight', height);
},
+ // 视频播放
+ video_play(url, popup_width, popup_height) {
+ console.log(url, popup_width, popup_height)
+ this.$emit('onVideoPlay', url, popup_width, popup_height);
+ },
},
};
diff --git a/components/diy/tabs.vue b/components/diy/tabs.vue
index 2ecac15b..b22c4910 100644
--- a/components/diy/tabs.vue
+++ b/components/diy/tabs.vue
@@ -1,10 +1,10 @@
-
+
-
+
@@ -29,7 +29,7 @@
},
// 置顶距离顶部高度
propTop: {
- type: String,
+ type: [String,Number],
default: '0',
},
// 是否导航栏置顶
@@ -66,8 +66,6 @@
top_up: '0',
// 置顶时,选项卡高度
tabs_seat_height: 0,
- // 置顶时,选项卡距离顶部高度
- // tabs_padding_top: 0,
// 置顶时,选项卡样式
tabs_top_style: '',
};
@@ -125,18 +123,17 @@
style_img_container: common_img_computer(new_style.common_style),
tabs_top_style: new_tabs_top_style,
// 判断是否置顶
- top_up: new_top_up,
- // tabs_padding_top: this.propNavIsTop || this.propTabsIsTop ? other_style : '0',
+ top_up: new_top_up
});
},
// 获取选项卡高度
get_tabs_height() {
if (this.top_up == '1') {
- const query = uni.createSelectorQuery();
// 选择我们想要的元素
+ const query = uni.createSelectorQuery();
query
.in(this)
- .select('.tabs-content')
+ .select('.tabs-top')
.boundingClientRect((res) => {
if ((res || null) != null) {
// data包含元素的宽度、高度等信息
@@ -145,8 +142,7 @@
});
this.$emit('onComputerHeight', this.tabs_seat_height);
}
- })
- .exec(); // 执行查询
+ }).exec();
} else {
this.$emit('onComputerHeight', 0);
}
@@ -173,7 +169,7 @@