首页标签特效
This commit is contained in:
parent
87c6fe7112
commit
9d9aa3d006
1
components.d.ts
vendored
1
components.d.ts
vendored
|
|
@ -17,7 +17,6 @@ declare module 'vue' {
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
Search: typeof import('./components/guyu/home/search.vue')['default']
|
Search: typeof import('./components/guyu/home/search.vue')['default']
|
||||||
SlideLabel: typeof import('./components/guyu/page/slide-label.vue')['default']
|
SlideLabel: typeof import('./components/guyu/page/slide-label.vue')['default']
|
||||||
SlideLable: typeof import('./components/guyu/page/slide-lable.vue')['default']
|
|
||||||
Swiper: typeof import('./components/guyu/home/swiper.vue')['default']
|
Swiper: typeof import('./components/guyu/home/swiper.vue')['default']
|
||||||
Tabs: typeof import('./components/guyu/home/tabs.vue')['default']
|
Tabs: typeof import('./components/guyu/home/tabs.vue')['default']
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,9 @@
|
||||||
<view class="tabs-container">
|
<view class="tabs-container">
|
||||||
<view class="tabs-wrapper">
|
<view class="tabs-wrapper">
|
||||||
<template v-for="(item, index) in slideLableList" :key="index">
|
<template v-for="(item, index) in slideLableList" :key="index">
|
||||||
<view class="tab-item-wrapper" :style="{ width: item.width }">
|
<view class="tab-item-wrapper" @click="clickTab(index)"
|
||||||
<SlideLabel ref="slideLabels"
|
:style="{ width: item.width }">
|
||||||
style="width: 100%;height:40rpx;border-radius: 50rpx;border: 1rpx solid #9A8F79;"
|
<SlideLabel ref="slideLabels" :defaultColor="item.active ? '#F5D677' : '#fff'">
|
||||||
:defaultColor="item.active ? '#F5D677' : '#fff'" @click="clickTab(index)">
|
|
||||||
<text class="tab-text myZt-500w">{{ item.name }}</text>
|
<text class="tab-text myZt-500w">{{ item.name }}</text>
|
||||||
</SlideLabel>
|
</SlideLabel>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,12 @@ const props = defineProps({
|
||||||
// 高度
|
// 高度
|
||||||
height: {
|
height: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: '80rpx'
|
default: '45rpx'
|
||||||
},
|
},
|
||||||
// 圆角
|
// 圆角
|
||||||
borderRadius: {
|
borderRadius: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: '8rpx'
|
default: '25rpx'
|
||||||
},
|
},
|
||||||
// 文字颜色
|
// 文字颜色
|
||||||
textColor: {
|
textColor: {
|
||||||
|
|
@ -169,6 +169,7 @@ defineExpose({
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
border: 1rpx solid #9A8F79;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-bg {
|
.color-bg {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
</view>
|
</view>
|
||||||
<swiper class="swiper" :style="[{ height: swiperHeight + 'px' }]" :current="current"
|
<swiper class="swiper" :style="[{ height: swiperHeight + 'px' }]" :current="current"
|
||||||
@transition="swiperTransition" @animationfinish="swiperAnimationfinish">
|
@transition="swiperTransition" @animationfinish="swiperAnimationfinish">
|
||||||
<swiper-item class="swiper-item" v-for="(item, index) in tabList" :key="index">
|
<swiper-item class="swiper-item" v-for="(item, index) in homeData?.categories" :key="index">
|
||||||
<guyu-home-goods-list ref="swiperList" :tabIndex="index" :currentIndex="current"
|
<guyu-home-goods-list ref="swiperList" :tabIndex="index" :currentIndex="current"
|
||||||
@heightChanged="heightChanged">
|
@heightChanged="heightChanged">
|
||||||
</guyu-home-goods-list>
|
</guyu-home-goods-list>
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,11 @@ function getSystemInfoSync(useCache = false) {
|
||||||
const infoTypes = ['DeviceInfo', 'AppBaseInfo', 'WindowInfo'];
|
const infoTypes = ['DeviceInfo', 'AppBaseInfo', 'WindowInfo'];
|
||||||
const { deviceInfo, appBaseInfo, windowInfo } = infoTypes.reduce((acc, key) => {
|
const { deviceInfo, appBaseInfo, windowInfo } = infoTypes.reduce((acc, key) => {
|
||||||
const method = `get${key}`;
|
const method = `get${key}`;
|
||||||
if (uni[method] && uni.canIUse(method)) {
|
try{
|
||||||
acc[key.charAt(0).toLowerCase() + key.slice(1)] = uni[method]();
|
if (uni[method] && uni.canIUse(method)) {
|
||||||
}
|
acc[key.charAt(0).toLowerCase() + key.slice(1)] = uni[method]();
|
||||||
|
}
|
||||||
|
}catch{}
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
// 如果deviceInfo、appBaseInfo和windowInfo都可以从各自专属的api中获取,则整合它们的数据
|
// 如果deviceInfo、appBaseInfo和windowInfo都可以从各自专属的api中获取,则整合它们的数据
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user