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