refactor(components): migrate to vant and tailwind, clean up
- refactor TopNavBar: replace legacy flex classes with Tailwind utilities, swap uni-icons to Vant van-icon, remove unused status bar placeholder and old SCSS classes - overhaul ImageSwiper: replace custom swiper with Vant Swipe components, migrate all SCSS styles to inline Tailwind classes, remove unused znicons font assets and delete old stylesheet - clean up goods page: remove unused TopNavBar import and template, remove dead navOpacity scroll logic, remove local style import
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
<template>
|
||||
<div class="flex flex-col h-screen bg-white">
|
||||
<TopNavBar :title="navOpacity < 0.5 ? '' : '商品详情'" :background="`rgba(217, 238, 255, ${navOpacity})`"
|
||||
:titleColor="navOpacity < 0.5 ? '#ffffff' : '#000000'"
|
||||
:backIconColor="navOpacity < 0.5 ? '#ffffff' : '#000000'" />
|
||||
|
||||
<!-- 滚动区域 -->
|
||||
<div class="flex-1 overflow-y-auto" @scroll="handleScroll">
|
||||
<imgSwiper :border-radius="0" :height="300" :images="goodsData.commodityPhotoList" thumbnailBottom="42px" />
|
||||
<ImageSwiper :border-radius="0" :height="300" :images="goodsData.commodityPhotoList" thumbnailBottom="42px" />
|
||||
|
||||
<div class="bg-white py-[20px] relative -mt-[30px] z-10 rounded-t-[28px]">
|
||||
<!-- 商品信息组件 -->
|
||||
@@ -66,7 +62,6 @@ import { ref } from "vue";
|
||||
import { useRouter } from 'vue-router'
|
||||
import { goodsDetail, commodityDailyPriceList } from "@/api/goods";
|
||||
import { DateUtils } from "@/utils/dateUtils";
|
||||
import TopNavBar from "@/components/TopNavBar/index.vue";
|
||||
import ImageSwiper from "@/components/ImageSwiper/index.vue";
|
||||
import GoodInfo from "./components/GoodInfo/index.vue";
|
||||
import Calender from "@/components/Calender/index.vue";
|
||||
@@ -81,7 +76,6 @@ import { useSelectedDateStore } from "@/store";
|
||||
const router = useRouter()
|
||||
|
||||
// 导航栏透明度 - 默认透明,随滚动变为不透明
|
||||
const navOpacity = ref(0);
|
||||
const calendarVisible = ref(false);
|
||||
const goodsData = ref({});
|
||||
|
||||
@@ -90,8 +84,6 @@ const handleScroll = (e) => {
|
||||
const scrollTop = e.detail.scrollTop;
|
||||
// 设置一个阈值,当滚动超过200px时,导航栏完全不透明
|
||||
const threshold = 200;
|
||||
// 计算透明度,范围从0到1
|
||||
navOpacity.value = Math.min(scrollTop / threshold, 1);
|
||||
};
|
||||
|
||||
const selectedDate = ref({
|
||||
@@ -247,7 +239,3 @@ const navigateToPay = ({ commodityId }) => {
|
||||
})
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "./styles/index.scss";
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user