1.head优化

master
sws 2024-10-11 14:59:08 +08:00
parent 532f732584
commit e2204ec646
1 changed files with 10 additions and 13 deletions

View File

@ -138,19 +138,16 @@
},
watch: {
propScrollTop(newVal) {
if (newVal < this.header_top) {
console.log(this.propValue);
const { up_slide_background_color_list, up_slide_background_direction, up_slide_background_img, up_slide_background_img_style } = this.propValue.style || {};
//
const gradient = { color_list: up_slide_background_color_list, direction: up_slide_background_direction };
//
const back = { background_img: up_slide_background_img, background_img_style: up_slide_background_img_style };
this.setData({
// 20
up_slide_style: gradient_computer(gradient) + 'opacity:' + (newVal / (this.header_top + 33) > 1 ? 1 : (newVal / (this.header_top + 33)).toFixed(2)) + ';',
up_slide_img_style: background_computer(back),
});
}
const { up_slide_background_color_list, up_slide_background_direction, up_slide_background_img, up_slide_background_img_style } = this.propValue.style || {};
//
const gradient = { color_list: up_slide_background_color_list, direction: up_slide_background_direction };
//
const back = { background_img: up_slide_background_img, background_img_style: up_slide_background_img_style };
this.setData({
// 20
up_slide_style: gradient_computer(gradient) + 'opacity:' + ((newVal - 20) / (this.header_top + 33) > 1 ? 1 : ((newVal - 20) / (this.header_top + 33)).toFixed(2)) + ';',
up_slide_img_style: background_computer(back),
});
},
propkey(val) {
if ((this.propValue || null) !== null) {