diff --git a/src/custom-tab-bar/index.less b/src/components/CustomTabBar/index.less similarity index 100% rename from src/custom-tab-bar/index.less rename to src/components/CustomTabBar/index.less diff --git a/src/custom-tab-bar/index.tsx b/src/components/CustomTabBar/index.tsx similarity index 96% rename from src/custom-tab-bar/index.tsx rename to src/components/CustomTabBar/index.tsx index 475145b..7ab6504 100644 --- a/src/custom-tab-bar/index.tsx +++ b/src/components/CustomTabBar/index.tsx @@ -1,8 +1,6 @@ import {useEffect, useState} from 'react' import Taro from '@tarojs/taro' import {View, Text, Image} from '@tarojs/components' -import useAuthStore from '@/stores/auth/useAuthStore' -import useCartStore from '@/stores/cart/useCartStore' import IndexImage from '@/static/images/nav/index.png'; import IndexActiveImage from '@/static/images/nav/index_active.png'; import CartImage from '@/static/images/nav/cart.png'; diff --git a/src/pages/agreement/index.tsx b/src/pages/agreement/index.tsx index cae45cb..94efd90 100644 --- a/src/pages/agreement/index.tsx +++ b/src/pages/agreement/index.tsx @@ -1,5 +1,4 @@ import { View, Text, ScrollView } from '@tarojs/components' -import CustomNavBar from '@/components/NavBar' import './index.less' /** @@ -9,7 +8,6 @@ import './index.less' export default function AgreementPage() { return ( - 用户服务协议 diff --git a/src/pages/cart/index.tsx b/src/pages/cart/index.tsx index 712846f..95ac547 100644 --- a/src/pages/cart/index.tsx +++ b/src/pages/cart/index.tsx @@ -10,6 +10,7 @@ import {formatRetailPrice, formatSpec} from '@/utils/format' import type { CartItem } from '@/types/cart' import type { StoreDetail } from '@/types/store' import './index.less' +import CustomTabBar from "@/components/CustomTabBar"; export default function CartPage() { const token = useAuthStore(s => s.token) @@ -351,6 +352,8 @@ export default function CartPage() { + + {process.env.TARO_ENV === 'h5' && } ) } diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index f7d103d..dec4f62 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -13,6 +13,7 @@ import CartBall from '@/components/CartBall' import CartStepper from '@/components/CartStepper' import {formatRetailPrice, formatSpec} from '@/utils/format' import './index.less' +import CustomTabBar from "@/components/CustomTabBar"; /** 首页 → 商品页的本地存储传参 key(switchTab 无法带参) */ const PENDING_CATEGORY_KEY = 'product_category_id' @@ -362,6 +363,7 @@ export default function IndexPage() { {/* ========== 购物车悬浮球 ========== */} + {process.env.TARO_ENV === 'h5' && } ) } diff --git a/src/pages/login/index.less b/src/pages/login/index.less index 866497d..fc46650 100644 --- a/src/pages/login/index.less +++ b/src/pages/login/index.less @@ -132,6 +132,8 @@ height: 100%; font-size: 30px; color: #323233; + display: flex; + align-items: center; } .form-input-placeholder { diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 94c664f..083579b 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -1,7 +1,6 @@ import { useCallback, useState } from 'react' import Taro from '@tarojs/taro' import { View, Text, Button, Input } from '@tarojs/components' -import CustomNavBar from '@/components/NavBar' import useAuthStore from '@/stores/auth/useAuthStore' import './index.less' @@ -76,8 +75,6 @@ export default function LoginPage() { return ( - {/* ========== 导航栏 ========== */} - {/* ========== 内容区域 ========== */} diff --git a/src/pages/message/index.tsx b/src/pages/message/index.tsx index c117240..664a969 100644 --- a/src/pages/message/index.tsx +++ b/src/pages/message/index.tsx @@ -8,6 +8,7 @@ import { formatTime } from '@/utils/format' import { NOTICE_TYPE_MAP } from '@/types/notice' import type { Notice, NoticeType } from '@/types/notice' import './index.less' +import CustomTabBar from "@/components/CustomTabBar"; const PAGE_SIZE = 10 @@ -123,6 +124,8 @@ export default function MessagePage() { {loggedIn && finished && notices.length > 0 && ( 没有更多了 )} + + {process.env.TARO_ENV === 'h5' && } ) } diff --git a/src/pages/privacy/index.tsx b/src/pages/privacy/index.tsx index 074e68d..ace5b14 100644 --- a/src/pages/privacy/index.tsx +++ b/src/pages/privacy/index.tsx @@ -1,5 +1,4 @@ import { View, Text, ScrollView } from '@tarojs/components' -import CustomNavBar from '@/components/NavBar' import './index.less' /** @@ -9,7 +8,6 @@ import './index.less' export default function PrivacyPage() { return ( - 隐私政策 diff --git a/src/pages/product/index.less b/src/pages/product/index.less index e3afbbb..45daf5c 100644 --- a/src/pages/product/index.less +++ b/src/pages/product/index.less @@ -3,9 +3,6 @@ display: flex; flex-direction: column; background: #f7f8fa; - // 底部预留给自定义 tabBar(110rpx + 安全区),避免列表被遮挡 - padding-bottom: calc(110rpx + env(safe-area-inset-bottom)); - box-sizing: border-box; .product-search { flex-shrink: 0; diff --git a/src/pages/product/index.tsx b/src/pages/product/index.tsx index 4308371..87a52af 100644 --- a/src/pages/product/index.tsx +++ b/src/pages/product/index.tsx @@ -11,6 +11,7 @@ import CartBall from '@/components/CartBall' import CartStepper from '@/components/CartStepper' import {formatRetailPrice, formatSpec} from '@/utils/format' import './index.less' +import CustomTabBar from "@/components/CustomTabBar"; const PAGE_SIZE = 10 /** 存储 key:首页点击分类/搜索跳转时经本地存储传参(switchTab 无法带参) */ @@ -331,6 +332,7 @@ export default function ProductPage() { {/* ========== 购物车悬浮球 ========== */} + {process.env.TARO_ENV === 'h5' && } ) } diff --git a/src/pages/profile/index.tsx b/src/pages/profile/index.tsx index 0c53c77..111fbdf 100644 --- a/src/pages/profile/index.tsx +++ b/src/pages/profile/index.tsx @@ -9,6 +9,7 @@ import type { BillSummary } from '@/services/bill' import { ORDER_NAV_ITEMS } from '@/types/order' import { resolveAvatarUrl } from '@/utils/format' import './index.less' +import CustomTabBar from "@/components/CustomTabBar"; /** 菜单项(订单/账单入口已由上方专区承载,后续单独页面开发时在此追加) */ const MENU_ITEMS = [ @@ -229,6 +230,8 @@ export default function ProfilePage() { 退出登录 )} + + {process.env.TARO_ENV === 'h5' && } ) } diff --git a/src/utils/request.ts b/src/utils/request.ts index 1093a8a..df6beb4 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -10,8 +10,8 @@ const LOGIN_PATH = '/pages/login/index' /** 默认请求超时(ms) */ const DEFAULT_TIMEOUT = 15000 /** 接口根地址(uploadFile 等原生请求同样使用) */ -export const BASE_URL = "http://localhost:8000/index.php" -// export const BASE_URL = "https://purchase.henanklkj.com/index.php" +// export const BASE_URL = "http://localhost:8000/index.php" +export const BASE_URL = "https://purchase.henanklkj.com/index.php" /** * HTTP 状态码 → 错误提示映射