修改传递参数为setData
parent
297ab5dd32
commit
50e82a7d33
|
|
@ -25,17 +25,23 @@
|
|||
};
|
||||
},
|
||||
created() {
|
||||
const {
|
||||
height
|
||||
} = this.value.content;
|
||||
const {
|
||||
line_color,
|
||||
common_style
|
||||
} = this.value.style;
|
||||
this.style = `height: ${height * 2 }rpx;background: ${line_color || 'transparent'};`;
|
||||
this.style_container = common_styles_computer(common_style);
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
const {
|
||||
height
|
||||
} = this.value.content;
|
||||
const {
|
||||
line_color,
|
||||
common_style
|
||||
} = this.value.style;
|
||||
this.setData({
|
||||
style: `height: ${height * 2 }rpx;background: ${line_color || 'transparent'};`,
|
||||
style_container: common_styles_computer(common_style)
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -184,19 +184,21 @@
|
|||
}
|
||||
},
|
||||
slideChange(e) {
|
||||
this.animationData = e.target.current;
|
||||
let actived_index = e.target.current;
|
||||
if (e.target.current > this.form.carousel_list.length - 1) {
|
||||
const seat_length = this.seat_list.length;
|
||||
if (seat_length == 2 && e.target.current == 3) {
|
||||
this.actived_index = 1;
|
||||
actived_index = 1;
|
||||
} else if (seat_length == 3) {
|
||||
this.actived_index = 0;
|
||||
actived_index = 0;
|
||||
} else {
|
||||
this.actived_index = e.target.current - this.seat_list.length;
|
||||
actived_index = e.target.current - this.seat_list.length;
|
||||
}
|
||||
} else {
|
||||
this.actived_index = e.target.current;
|
||||
}
|
||||
this.setData({
|
||||
animationData: e.target.current,
|
||||
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;
|
||||
|
|
@ -217,11 +219,15 @@
|
|||
})
|
||||
this.$refs.popup.open();
|
||||
const videoContext = uni.createVideoContext('carousel_video');
|
||||
videoContext.play();
|
||||
if (!is_obj_empty(videoContext)) {
|
||||
videoContext.play();
|
||||
}
|
||||
},
|
||||
video_close() {
|
||||
const videoContext = uni.createVideoContext('carousel_video');
|
||||
videoContext.pause();
|
||||
if (!is_obj_empty(videoContext)) {
|
||||
videoContext.pause();
|
||||
}
|
||||
this.$refs.popup.close();
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -33,18 +33,25 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.form = this.value.content;
|
||||
this.new_style = this.value.style;
|
||||
const { float_style, float_style_color, display_location, offset_number } = this.value.style;
|
||||
this.color = float_style == 'shadow' ? `box-shadow: 0 10rpx 40rpx ${ float_style_color }` : `background-color: ${ float_style_color }`;
|
||||
let location = `right: 20rpx;`;
|
||||
if (display_location == 'left') {
|
||||
location = `left: 20rpx;`;
|
||||
}
|
||||
const { windowHeight } = uni.getSystemInfoSync();
|
||||
this.style = `bottom: ${((offset_number / windowHeight) * 100).toFixed(4) + '%'};` + location;
|
||||
this.setData({
|
||||
form: this.value.content,
|
||||
new_style: this.value.style
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
const { float_style, float_style_color, display_location, offset_number } = this.value.style;
|
||||
let location = `right: 20rpx;`;
|
||||
if (display_location == 'left') {
|
||||
location = `left: 20rpx;`;
|
||||
}
|
||||
const { windowHeight } = uni.getSystemInfoSync();
|
||||
this.setData({
|
||||
color: float_style == 'shadow' ? `box-shadow: 0 10rpx 40rpx ${ float_style_color }` : `background-color: ${ float_style_color }`,
|
||||
style: `bottom: ${((offset_number / windowHeight) * 100).toFixed(4) + '%'};` + location
|
||||
});
|
||||
},
|
||||
url_open() {
|
||||
const { button_jump, button_link} = this.form;
|
||||
if (button_jump == 'link' && !is_obj_empty(button_link)) {
|
||||
|
|
|
|||
|
|
@ -60,24 +60,23 @@
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.form = this.value.content;
|
||||
this.new_style = this.value.style;
|
||||
this.setData({
|
||||
form: this.value.content,
|
||||
new_style: this.value.style
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
is_obj_empty,
|
||||
init() {
|
||||
const { search_button_radius, common_style } = this.new_style;
|
||||
// 内部样式
|
||||
this.style = this.get_style();
|
||||
// 全局样式
|
||||
this.style_container = this.isPageSettings ? '' : common_styles_computer(common_style);
|
||||
// 按钮圆角
|
||||
this.search_button_radius = radius_computer(search_button_radius);
|
||||
// 搜索框设置
|
||||
this.box_style = this.get_box_style();
|
||||
// 搜索按钮显示
|
||||
this.search_button = this.get_search_button();
|
||||
this.setData({
|
||||
style: this.get_style(), // 内部样式
|
||||
style_container: this.isPageSettings ? '' : common_styles_computer(common_style), // 全局样式
|
||||
search_button_radius: radius_computer(search_button_radius), // 按钮圆角
|
||||
box_style: this.get_box_style(), // 搜索框设置
|
||||
search_button: this.get_search_button(), // 搜索按钮显示
|
||||
});
|
||||
},
|
||||
get_style() {
|
||||
let common_styles = '';
|
||||
|
|
@ -107,7 +106,6 @@
|
|||
}
|
||||
style += gradient_computer(data) + background_computer(data) + `color: ${ this.new_style.button_inner_color };`;
|
||||
}
|
||||
console.log(style);
|
||||
return style;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -41,26 +41,30 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.form = this.value.content;
|
||||
this.new_style = this.value.style;
|
||||
// 是否居中
|
||||
this.title_center = this.form.is_title_center == '1' ? 'jc-c' : '';
|
||||
// 关键字
|
||||
this.set_keyword_list();
|
||||
// 样式设置
|
||||
this.set_common_styles();
|
||||
this.setData({
|
||||
form: this.value.content,
|
||||
new_style: this.value.style
|
||||
});
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 是否居中
|
||||
this.setData({
|
||||
title_center: this.form.is_title_center == '1' ? 'jc-c' : ''
|
||||
});
|
||||
// 关键字
|
||||
this.set_keyword_list();
|
||||
// 样式设置
|
||||
this.set_common_styles();
|
||||
},
|
||||
set_keyword_list() {
|
||||
this.keyword_list = this.form.keyword_list.filter(item => item.is_show == '1');
|
||||
this.setData({
|
||||
keyword_list: this.form.keyword_list.filter(item => item.is_show == '1')
|
||||
});
|
||||
},
|
||||
set_common_styles() {
|
||||
const { keyword_color, keyword_size, right_color, right_size, common_style, title_weight, title_color, title_size } = this.new_style;
|
||||
// 关键字设置
|
||||
this.keyword_style = `color:${ keyword_color }; font-size: ${ keyword_size * 2 }rpx;`;
|
||||
// 右边按钮设置
|
||||
this.right_size = right_size * 2 + 'rpx';
|
||||
this.right_style = `color:${ right_color }; font-size: ${ right_size * 2 }rpx;`;
|
||||
// 标题样式设置
|
||||
let common_styles = '';
|
||||
if (title_weight == 'italic') {
|
||||
|
|
@ -68,9 +72,13 @@ export default {
|
|||
} else if (title_weight == '500') {
|
||||
common_styles += `font-weight: 500`;
|
||||
}
|
||||
this.title_style = `color:${ title_color }; font-size: ${ title_size * 2 }rpx; ${ common_styles }`;
|
||||
// 通用样式区
|
||||
this.style_container = common_styles_computer(common_style);
|
||||
this.setData({
|
||||
keyword_style: `color:${ keyword_color }; font-size: ${ keyword_size * 2 }rpx;`, // 关键字设置
|
||||
right_size: right_size * 2 + 'rpx' ,// 右边按钮设置
|
||||
right_style: `color:${ right_color }; font-size: ${ right_size * 2 }rpx;`,
|
||||
title_style: `color:${ title_color }; font-size: ${ title_size * 2 }rpx; ${ common_styles }`,
|
||||
style_container: common_styles_computer(common_style) // 通用样式区
|
||||
})
|
||||
},
|
||||
url_open_event(link) {
|
||||
if (!is_obj_empty(link)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue