添加注释
parent
3fe40595e2
commit
7cb680e3af
|
|
@ -40,7 +40,9 @@
|
|||
init() {
|
||||
const new_content = this.propValue.content || {};
|
||||
const new_style = this.propValue.style || {};
|
||||
// 边框设置
|
||||
let border_content = `border-bottom-style: ${new_content?.styles || 'solid'};`;
|
||||
// 边框颜色设置
|
||||
let border_style = `border-bottom-width: ${new_style.line_width * 2 || 2}rpx; border-bottom-color: ${new_style.line_color || 'rgba(204, 204, 204, 1)'};`;
|
||||
this.setData({
|
||||
style: border_content + border_style,
|
||||
|
|
|
|||
|
|
@ -126,12 +126,13 @@
|
|||
init() {
|
||||
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 } = new_style;
|
||||
// scaleToFill 对应 cover aspectFit 对应 contain center 对应 none
|
||||
// scaleToFill 对应 fill aspectFit 对应 contain aspectFill 对应 cover
|
||||
let fit = '';
|
||||
if (new_form.img_fit == 'contain') {
|
||||
fit = 'aspectFit';
|
||||
|
|
@ -146,17 +147,18 @@
|
|||
new_style: this.propValue.style,
|
||||
seat_list: this.get_seat_list(new_form),
|
||||
new_list: new_form.carousel_list.concat(this.get_seat_list(new_form)),
|
||||
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) : '', // 用于样式显示
|
||||
popup_width: block * 16 * 2 + 'rpx', // 视频的宽度,依照16:9比例来算
|
||||
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(new_style), // 图片的设置
|
||||
indicator_style: this.get_indicator_style(new_style), // 指示器的样式
|
||||
dot_style: `bottom: ${ (new_style.indicator_bottom + common_style.margin_bottom + common_style.padding_bottom) * (sys_width / 390) * 2 }rpx;`, // 指示器位置
|
||||
img_fit: fit,
|
||||
img_fit: fit, // 图片风格
|
||||
video_style: this.get_video_style(new_style), // 视频播放按钮显示逻辑
|
||||
swiper_height: new_form.height * (sys_width / 390) * 2 + 'rpx',
|
||||
swiper_height: new_form.height * (sys_width / 390) * 2 + 'rpx', // 轮播图高度
|
||||
});
|
||||
// 风格二显示逻辑
|
||||
if (new_form.carousel_type == 'card') {
|
||||
this.$nextTick(() => {
|
||||
this.setData({
|
||||
|
|
@ -166,6 +168,7 @@
|
|||
});
|
||||
});
|
||||
} else if (new_form.carousel_type != 'inherit') {
|
||||
// 风格三,四显示逻辑
|
||||
this.$nextTick(() => {
|
||||
this.setData({
|
||||
nextMargin: '100rpx',
|
||||
|
|
@ -188,13 +191,16 @@
|
|||
if (!isEmpty(indicator_radius)) {
|
||||
styles += radius_computer(indicator_radius);
|
||||
}
|
||||
// 数字类型的指示器
|
||||
if (indicator_style == 'num') {
|
||||
styles += `color: ${color || '#DDDDDD'};`;
|
||||
styles += `font-size: ${indicator_size * 2}rpx;`;
|
||||
} else if (indicator_style == 'elliptic') {
|
||||
// 宽的指示器,按照宽高1:3 来计算
|
||||
styles += `background: ${color || '#DDDDDD'};`;
|
||||
styles += `width: ${indicator_size * 6}rpx; height: ${indicator_size * 2}rpx;`;
|
||||
} else {
|
||||
// 圆点指示器
|
||||
styles += `background: ${color || '#DDDDDD'};`;
|
||||
styles += `width: ${indicator_size * 2}rpx; height: ${indicator_size * 2}rpx;`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -299,7 +299,11 @@
|
|||
// is_search_alone_row: true,
|
||||
// data_alone_row_space: 20,
|
||||
});
|
||||
|
||||
var client_value = app.globalData.application_client_type();
|
||||
var client_brand = app.globalData.application_client_brand();
|
||||
if (client_value == 'h5' || client_brand == 'devtools') {
|
||||
|
||||
}
|
||||
// 缓存数据
|
||||
uni.setStorageSync(this.cache_key + this.tabs_home_id, this.propValue.diy_data);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -60,22 +60,24 @@
|
|||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 获取内容
|
||||
let form = this.propValue.content || {};
|
||||
// 获取图片
|
||||
let img_url = (form.button_img || null) != null ? (form.button_img[0] || null) : null;
|
||||
if (img_url != null) {
|
||||
img_url = img_url.url || null;
|
||||
}
|
||||
this.setData({
|
||||
form: form,
|
||||
style: this.propValue.style,
|
||||
img_url: img_url,
|
||||
});
|
||||
const { float_style, float_style_color, display_location, offset_number_percentage } = this.propValue.style;
|
||||
// 获取当前手机的宽度和高度
|
||||
const { windowWidth, windowHeight } = uni.getSystemInfoSync();
|
||||
// 计算出距离左边的距离
|
||||
let x = display_location == 'left' ? 10 : windowWidth - 60;
|
||||
// 计算出距离顶部的距离
|
||||
const y = Math.ceil(windowHeight * (1 - Number(offset_number_percentage)) - 20);
|
||||
this.setData({
|
||||
form: form,
|
||||
style: this.propValue.style,
|
||||
img_url: img_url,
|
||||
content_style: float_style == 'shadow' ? `box-shadow: 0 0 40rpx ${float_style_color};border-radius: 50%;` : `background-color: ${float_style_color};border-radius: 50%;`,
|
||||
x: x,
|
||||
y: y
|
||||
|
|
@ -83,6 +85,7 @@
|
|||
},
|
||||
url_open() {
|
||||
const { button_jump, button_link } = this.form;
|
||||
// 如果是指定链接,并且链接不为空的情况下跳转
|
||||
if (button_jump == 'link' && !isEmpty(button_link)) {
|
||||
app.globalData.url_open(button_link.page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,13 +145,16 @@
|
|||
if (!isEmpty(indicator_radius)) {
|
||||
styles += radius_computer(indicator_radius);
|
||||
}
|
||||
// 数字类型的指示器
|
||||
if (indicator_style == 'num') {
|
||||
styles += `color: ${color || '#DDDDDD'};`;
|
||||
styles += `font-size: ${indicator_size * 2}rpx;`;
|
||||
} else if (indicator_style == 'elliptic') {
|
||||
// 宽的指示器,按照宽高1:3 来计算
|
||||
styles += `background: ${color || '#DDDDDD'};`;
|
||||
styles += `width: ${indicator_size * 6}rpx; height: ${indicator_size * 2}rpx;`;
|
||||
} else {
|
||||
// 圆点指示器
|
||||
styles += `background: ${color || '#DDDDDD'};`;
|
||||
styles += `width: ${indicator_size * 2}rpx; height: ${indicator_size * 2}rpx;`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue