fix(home): 更新首页商品分类配置并优化跳转功能

- 修改开发环境API_BASE_URL配置
- 引入通用导航工具函数navTo
- 更新商品分类标签名称为桶装水和水票套餐
- 添加政企采购专区卡片组件
- 集成桂乐淘福利惊爆区跳转功能
- 修复页面布局结构中的多余空行问题
This commit is contained in:
2026-03-07 15:20:16 +08:00
parent 7375a3b1ce
commit 83ba49d860
2 changed files with 20 additions and 6 deletions

View File

@@ -2,8 +2,8 @@
export const ENV_CONFIG = {
// 开发环境
development: {
API_BASE_URL: 'http://127.0.0.1:9200/api',
// API_BASE_URL: 'https://glt-api.websoft.top/api',
// API_BASE_URL: 'http://127.0.0.1:9200/api',
API_BASE_URL: 'https://glt-api.websoft.top/api',
APP_NAME: '开发环境',
DEBUG: 'true',
},

View File

@@ -11,6 +11,7 @@ import type { ShopGoods, ShopGoodsParam } from '@/api/shop/shopGoods/model'
import { getMyGltUserTicketTotal } from '@/api/glt/gltUserTicket'
import { ensureLoggedIn } from '@/utils/auth'
import './index.scss'
import navTo from "@/utils/common";
function Home() {
const [activeTabKey, setActiveTabKey] = useState('recommend')
@@ -178,8 +179,8 @@ function Home() {
>(
() => [
{ key: 'recommend', title: '推荐', params: { recommend: 1 } },
{ key: '4476', title: '政企采购专区', params: { categoryId: 4476 } },
{ key: '4556', title: '桂乐淘·福利惊爆区', params: { categoryId: 4556 } },
{ key: '4476', title: '桶装水', params: { categoryId: 4476 } },
{ key: '4556', title: '水票套餐', params: { categoryId: 4556 } },
// { key: '4557', title: '购机套餐', params: { categoryId: 4557 } },
// { key: '4477', title: '饮水设备', params: { categoryId: 4477 } },
],
@@ -289,7 +290,20 @@ function Home() {
</View>
</View>
{/* 分类Tabs */}
<View className="ticket-card" onClick={() => Taro.navigateTo({ url: `/shop/category/index?id=4557` })}>
<View className="ticket-card__head">
<Text className="ticket-card__title"></Text>
</View>
</View>
<View className="ticket-card" onClick={() => navTo('/shop/category/index?id=4556')}>
<View className="ticket-card__head">
<Text className="ticket-card__title">·</Text>
</View>
</View>
{/*分类Tabs*/}
<ScrollView className="home-tabs" scrollX enableFlex>
<View className="home-tabs__inner">
{tabs.map((tab) => {
@@ -306,7 +320,6 @@ function Home() {
})}
</View>
</ScrollView>
{/* 商品列表 */}
<View className="goods-grid">
{visibleGoods.map((item) => (
@@ -356,6 +369,7 @@ function Home() {
</View>
))}
</View>
</View>
</>
)