修改选项卡轮播显示
parent
f12f956b8e
commit
1d6fd63b28
8
App.vue
8
App.vue
|
|
@ -7,12 +7,12 @@
|
|||
data: {
|
||||
// 基础配置
|
||||
// 数据接口请求地址
|
||||
//request_url: 'http://shopxo.com/',
|
||||
request_url:'https://new.shopxo.vip/',
|
||||
request_url: 'http://shopxo.com/',
|
||||
// request_url:'https://new.shopxo.vip/',
|
||||
|
||||
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/)
|
||||
//static_url: 'http://shopxo.com/',
|
||||
static_url:'https://new.shopxo.vip/',
|
||||
static_url: 'http://shopxo.com/',
|
||||
// static_url:'https://new.shopxo.vip/',
|
||||
|
||||
// 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立)
|
||||
system_type: 'default',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view class="flex-col ou" :style="style_container">
|
||||
<view class="ou" :style="style_img_container">
|
||||
<componentDiyTabs :propValue="propValue" :propTop="propTop" :propNavIsTop="propNavIsTop" :propTabsIsTop="propTabsIsTop" @onComputerHeight="tabs_height_event" @onTabsTap="tabs_click_event"></componentDiyTabs>
|
||||
<view class="ou" :style="style_container">
|
||||
<view class="flex-col ou" :style="style_img_container">
|
||||
<componentDiyTabs :propValue="propValue" :propTop="propTop" :propNavIsTop="propNavIsTop" :propTabsIsTop="propTabsIsTop" :propIsCommon="false" :propSpacingCommonStyle="spacing_common_style" @tabs-click="tabs_click_event"></componentDiyTabs>
|
||||
<componentDiycarousel :propValue="propValue" :propIsCommon="false" @onVideoPlay="video_play"></componentDiycarousel>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
margin_left: 0,
|
||||
margin_right: 0,
|
||||
},
|
||||
top_up: '0',
|
||||
// top_up: '0',
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -81,9 +81,20 @@
|
|||
const new_style = this.propValue.style || {};
|
||||
this.setData({
|
||||
// style_container: `${common_styles_computer(common_style)};gap:${new_style.data_spacing * 2}rpx`,
|
||||
style_container: `${common_styles_computer(new_style.common_style)};gap:${new_style.data_spacing * 2}rpx`,
|
||||
style_img_container: common_img_computer(new_style.common_style),
|
||||
top_up: new_content.tabs_top_up,
|
||||
style_container: `${common_styles_computer(new_style.common_style)};`,
|
||||
style_img_container: common_img_computer(new_style.common_style) + 'gap:' + new_style.data_spacing * 2 + 'rpx',
|
||||
spacing_common_style: {
|
||||
padding: 0,
|
||||
padding_top: new_style.common_style.padding_top,
|
||||
padding_bottom: 0,
|
||||
padding_left: new_style.common_style.padding_left,
|
||||
padding_right: new_style.common_style.padding_right,
|
||||
margin: 0,
|
||||
margin_top: new_style.common_style.margin_top,
|
||||
margin_bottom: 0,
|
||||
margin_left: new_style.common_style.margin_left,
|
||||
margin_right: new_style.common_style.margin_right,
|
||||
}
|
||||
});
|
||||
},
|
||||
// tab点击
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="top_up == '1'" class="tabs-seat" :style="'height:' + tabs_seat_height + 'px;'"></view>
|
||||
<view v-if="top_up == '1'" class="tabs-seat" :style="'height:' + (propIsCommon ? tabs_seat_height : tabs_carousel_seat_height) + 'px;'"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
import { common_styles_computer, common_img_computer } from '@/common/js/common/common.js';
|
||||
import { common_styles_computer, common_img_computer, padding_computer, margin_computer } from '@/common/js/common/common.js';
|
||||
import componentDiyModulesTabsView from '@/components/diy/modules/tabs-view';
|
||||
// 状态栏高度
|
||||
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
|
||||
|
|
@ -42,6 +42,14 @@
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
propIsCommon: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
propSpacingCommonStyle: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
// 样式
|
||||
propStyle: {
|
||||
type: String,
|
||||
|
|
@ -61,11 +69,12 @@
|
|||
style_img_container: '',
|
||||
content: '',
|
||||
tabs_data: {},
|
||||
|
||||
// 是否滑动置顶
|
||||
top_up: '0',
|
||||
// 置顶时,选项卡高度
|
||||
tabs_seat_height: 0,
|
||||
// 置顶时,轮播选项卡高度
|
||||
tabs_carousel_seat_height: 0,
|
||||
// 置顶时,选项卡样式
|
||||
tabs_top_style: '',
|
||||
};
|
||||
|
|
@ -119,8 +128,8 @@
|
|||
|
||||
this.setData({
|
||||
tabs_data: new_tabs_data,
|
||||
style_container: common_styles_computer(new_style.common_style) + new_tabs_background,
|
||||
style_img_container: common_img_computer(new_style.common_style),
|
||||
style_container: this.propIsCommon ? common_styles_computer(new_style.common_style) + new_tabs_background : new_content.tabs_top_up == '1' ? new_tabs_background : '', // 如果是选项卡轮播,不需要走默认样式
|
||||
style_img_container: this.propIsCommon ? common_img_computer(new_style.common_style) : new_content.tabs_top_up == '1' ? margin_computer(this.propSpacingCommonStyle) + padding_computer(this.propSpacingCommonStyle) : '', // 如果是选项卡轮播,不需要走默认样式
|
||||
tabs_top_style: new_tabs_top_style,
|
||||
// 判断是否置顶
|
||||
top_up: new_top_up
|
||||
|
|
@ -139,6 +148,7 @@
|
|||
// data包含元素的宽度、高度等信息
|
||||
this.setData({
|
||||
tabs_seat_height: res.height,
|
||||
tabs_carousel_seat_height: res.height - this.propSpacingCommonStyle.padding_top - this.propSpacingCommonStyle.margin_top // 轮播选项卡置顶时去掉顶部间距
|
||||
});
|
||||
this.$emit('onComputerHeight', this.tabs_seat_height);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue