1.顶部导航优化

master
sws 2024-10-17 11:24:12 +08:00
parent bd0688eefc
commit 537a91cf14
1 changed files with 10 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="pr" :style="style_container"> <view class="pr" :style="style_container">
<view class="pr" :style="style_img_container"> <view class="pr" :style="style_img_container">
<swiper circular="true" :autoplay="form.is_roll == '1'" :interval="form.interval_time * 1000" :display-multiple-items="slides_per_group" :duration="500" :style="{ height: form.height * 2 + 'rpx' }" :previous-margin="previousMargin" :next-margin="nextMargin" @change="slideChange"> <swiper circular="true" :autoplay="form.is_roll == '1'" :interval="form.interval_time * 1000" :display-multiple-items="slides_per_group" :duration="500" :style="{ height: swiper_height }" :previous-margin="previousMargin" :next-margin="nextMargin" @change="slideChange">
<block v-if="form.carousel_type == 'card'"> <block v-if="form.carousel_type == 'card'">
<swiper-item v-for="(item, index) in new_list" :key="index" class="flex-row align-c" :data-value="item.carousel_link.page" @tap="url_open"> <swiper-item v-for="(item, index) in new_list" :key="index" class="flex-row align-c" :data-value="item.carousel_link.page" @tap="url_open">
<view class="swiper-item" :style="img_style" :class="['scale-defalt', { 'scale-1': animationData === index }]"> <view class="swiper-item" :style="img_style" :class="['scale-defalt', { 'scale-1': animationData === index }]">
@ -58,6 +58,8 @@
const app = getApp(); const app = getApp();
import { common_styles_computer, common_img_computer, radius_computer, isEmpty, gradient_computer, padding_computer } from '@/common/js/common/common.js'; import { common_styles_computer, common_img_computer, radius_computer, isEmpty, gradient_computer, padding_computer } from '@/common/js/common/common.js';
import imageEmpty from '@/components/diy/modules/image-empty.vue'; import imageEmpty from '@/components/diy/modules/image-empty.vue';
var system = app.globalData.get_system_info(null, null, true);
var sys_width = app.globalData.window_width_handle(system.windowWidth);
export default { export default {
components: { components: {
imageEmpty, imageEmpty,
@ -106,6 +108,8 @@
nextMargin: '0rpx', nextMargin: '0rpx',
slides_per_group: 1, slides_per_group: 1,
// hackReset: true, // hackReset: true,
//
swiper_height: 50,
}; };
}, },
watch: { watch: {
@ -116,6 +120,7 @@
}, },
created() { created() {
this.init(); this.init();
console.log(sys_width);
}, },
methods: { methods: {
isEmpty, isEmpty,
@ -131,11 +136,12 @@
let fit = ''; let fit = '';
if (new_form.img_fit == 'contain') { if (new_form.img_fit == 'contain') {
fit = 'aspectFit'; fit = 'aspectFit';
} else if (new_form.img_fit =='fill') { } else if (new_form.img_fit == 'fill') {
fit = 'scaleToFill'; fit = 'scaleToFill';
} else if (new_form.img_fit == 'cover') { } else if (new_form.img_fit == 'cover') {
fit = 'aspectFill'; fit = 'aspectFill';
} }
console.log(common_style);
this.setData({ this.setData({
form: this.propValue.content, form: this.propValue.content,
new_style: this.propValue.style, new_style: this.propValue.style,
@ -150,6 +156,7 @@
dot_style: `bottom: ${common_style.padding_bottom * 2 + 24}rpx;`, // dot_style: `bottom: ${common_style.padding_bottom * 2 + 24}rpx;`, //
img_fit: fit, img_fit: fit,
video_style: this.get_video_style(new_style), // video_style: this.get_video_style(new_style), //
swiper_height: new_form.height * (sys_width / 390) * 2 + 'rpx',
}); });
if (new_form.carousel_type == 'card') { if (new_form.carousel_type == 'card') {
this.$nextTick(() => { this.$nextTick(() => {