H5适配
This commit is contained in:
@@ -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';
|
||||
@@ -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 (
|
||||
<View className='agreement-page'>
|
||||
<CustomNavBar title='用户服务协议' />
|
||||
<ScrollView scrollY className='agreement-scroll'>
|
||||
<View className='agreement-content'>
|
||||
<Text className='doc-title'>用户服务协议</Text>
|
||||
|
||||
@@ -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() {
|
||||
</View>
|
||||
</View>
|
||||
</Popup>
|
||||
|
||||
{process.env.TARO_ENV === 'h5' && <CustomTabBar />}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
{/* ========== 购物车悬浮球 ========== */}
|
||||
<CartBall />
|
||||
{process.env.TARO_ENV === 'h5' && <CustomTabBar />}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -132,6 +132,8 @@
|
||||
height: 100%;
|
||||
font-size: 30px;
|
||||
color: #323233;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.form-input-placeholder {
|
||||
|
||||
@@ -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 (
|
||||
<View className='login-page'>
|
||||
{/* ========== 导航栏 ========== */}
|
||||
<CustomNavBar title='登录' />
|
||||
|
||||
{/* ========== 内容区域 ========== */}
|
||||
<View className='login-content'>
|
||||
|
||||
@@ -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 && (
|
||||
<View className='message-loading'><Text>没有更多了</Text></View>
|
||||
)}
|
||||
|
||||
{process.env.TARO_ENV === 'h5' && <CustomTabBar />}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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 (
|
||||
<View className='privacy-page'>
|
||||
<CustomNavBar title='隐私政策' />
|
||||
<ScrollView scrollY className='privacy-scroll'>
|
||||
<View className='privacy-content'>
|
||||
<Text className='doc-title'>隐私政策</Text>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
{/* ========== 购物车悬浮球 ========== */}
|
||||
<CartBall />
|
||||
{process.env.TARO_ENV === 'h5' && <CustomTabBar />}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
<Text>退出登录</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{process.env.TARO_ENV === 'h5' && <CustomTabBar />}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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 状态码 → 错误提示映射
|
||||
|
||||
Reference in New Issue
Block a user