From d4b4304d3c2cb40d0b37d0d19878d535720e9f4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com>
Date: Fri, 11 Oct 2024 16:29:36 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=90=9C=E7=B4=A2=E9=80=BB?=
=?UTF-8?q?=E8=BE=91=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/diy/carousel.vue | 40 ++++++++++++------------
components/diy/header.vue | 2 +-
components/diy/modules/hot-word-list.vue | 2 +-
components/diy/nav-group.vue | 2 +-
components/diy/search.vue | 39 +++++++++++++++--------
5 files changed, 49 insertions(+), 36 deletions(-)
diff --git a/components/diy/carousel.vue b/components/diy/carousel.vue
index a32c912f..d5e117b3 100644
--- a/components/diy/carousel.vue
+++ b/components/diy/carousel.vue
@@ -120,15 +120,13 @@
methods: {
isEmpty,
init() {
- this.setData({
- form: this.propValue.content,
- new_style: this.propValue.style,
- });
+ const new_form = this.propValue.content;
+ const new_style = this.propValue.style;
const { windowWidth } = uni.getSystemInfoSync();
// 将90%的宽度分成16份
const block = (windowWidth * 0.9) / 16;
- const { common_style, actived_color } = this.new_style;
+ const { common_style, actived_color } = new_style;
// aspectFill 对应 cover aspectFit 对应 contain scaleToFill 对应 none
const { img_fit } = this.form;
let fit = 'scaleToFill';
@@ -139,20 +137,22 @@
}
this.$nextTick(() => {
this.setData({
- seat_list: this.get_seat_list(),
- new_list: this.seat_list.concat(this.form.carousel_list),
+ form: this.propValue.content,
+ new_style: this.propValue.style,
+ seat_list: this.get_seat_list(new_form),
+ new_list: this.get_seat_list(new_form).concat(new_form.carousel_list),
popup_width: block * 16 * 2 + 'rpx',
popup_height: block * 9 * 2 + 'rpx',
style_container: this.propIsCommon ? common_styles_computer(common_style) : '', // 用于样式显示
style_img_container: this.propIsCommon ? common_img_computer(common_style) : '', // 用于样式显示
- img_style: radius_computer(this.new_style), // 图片的设置
- indicator_style: this.get_indicator_style(), // 指示器的样式
+ img_style: radius_computer(new_style), // 图片的设置
+ indicator_style: this.get_indicator_style(new_style), // 指示器的样式
dot_style: `bottom: ${common_style.padding_bottom * 2 + 24}rpx;`, // 指示器位置
img_fit: fit,
- video_style: this.get_video_style(), // 视频播放按钮显示逻辑
+ video_style: this.get_video_style(new_style), // 视频播放按钮显示逻辑
});
});
- if (this.form.carousel_type == 'card') {
+ if (new_form.carousel_type == 'card') {
this.$nextTick(() => {
this.setData({
previousMargin: '82rpx',
@@ -160,11 +160,11 @@
animationData: 0,
});
});
- } else if (this.form.carousel_type != 'inherit') {
+ } else if (new_form.carousel_type != 'inherit') {
this.$nextTick(() => {
this.setData({
nextMargin: '100rpx',
- slides_per_group: this.form.carousel_type == 'twoDragOne' ? 2 : 1,
+ slides_per_group: new_form.carousel_type == 'twoDragOne' ? 2 : 1,
});
});
}
@@ -177,8 +177,8 @@
});
});
},
- get_indicator_style() {
- const { indicator_radius, indicator_style, indicator_size, color } = this.new_style;
+ get_indicator_style(new_style) {
+ const { indicator_radius, indicator_style, indicator_size, color } = new_style;
let styles = '';
if (!isEmpty(indicator_radius)) {
styles += radius_computer(indicator_radius);
@@ -195,12 +195,12 @@
}
return styles;
},
- get_seat_list() {
- if (this.form.carousel_list.length > 3) {
+ get_seat_list(form) {
+ if (form.carousel_list.length > 3) {
return [];
} else {
let seat_list = [];
- const list = JSON.parse(JSON.stringify(this.form.carousel_list));
+ const list = JSON.parse(JSON.stringify(form.carousel_list));
switch (list.length) {
case 1:
seat_list = [...list, ...list, ...list];
@@ -234,8 +234,8 @@
actived_index: actived_index,
});
},
- get_video_style() {
- const { video_bottom, video_radius, video_color_list, video_direction, video_title_color, video_padding } = this.new_style;
+ get_video_style(new_style) {
+ const { video_bottom, video_radius, video_color_list, video_direction, video_title_color, video_padding } = new_style;
let style = `bottom: ${video_bottom}px;`;
if (!isEmpty(video_radius)) {
style += radius_computer(video_radius);
diff --git a/components/diy/header.vue b/components/diy/header.vue
index 916fed18..739cc6ef 100644
--- a/components/diy/header.vue
+++ b/components/diy/header.vue
@@ -48,7 +48,7 @@
-
+
diff --git a/components/diy/modules/hot-word-list.vue b/components/diy/modules/hot-word-list.vue
index 65f77890..5eb21be1 100644
--- a/components/diy/modules/hot-word-list.vue
+++ b/components/diy/modules/hot-word-list.vue
@@ -1,6 +1,6 @@
-
+
{{ item.value }}
diff --git a/components/diy/nav-group.vue b/components/diy/nav-group.vue
index a5745550..699b5e98 100644
--- a/components/diy/nav-group.vue
+++ b/components/diy/nav-group.vue
@@ -10,7 +10,7 @@
- {{ item1.title }}
+ {{ item1.title }}
diff --git a/components/diy/search.vue b/components/diy/search.vue
index cc2d5ceb..c3b737d2 100644
--- a/components/diy/search.vue
+++ b/components/diy/search.vue
@@ -5,18 +5,20 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
{{ form.tips }}
@@ -37,7 +39,7 @@
-
+
@@ -56,7 +58,7 @@
-
+
@@ -245,5 +247,16 @@
max-width: 20rpx;
}
}
+ .search-icon{
+ position: relative;
+ }
+ .search-icon::before {
+ content: '';
+ position: absolute;
+ top: -10px;
+ right: -10px;
+ bottom: -10px;
+ left: -10px
+ }
}