forked from gxwebsoft/mp-10550
fix(home): 更新首页商品分类配置并优化跳转功能
- 修改开发环境API_BASE_URL配置 - 引入通用导航工具函数navTo - 更新商品分类标签名称为桶装水和水票套餐 - 添加政企采购专区卡片组件 - 集成桂乐淘福利惊爆区跳转功能 - 修复页面布局结构中的多余空行问题
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
export const ENV_CONFIG = {
|
export const ENV_CONFIG = {
|
||||||
// 开发环境
|
// 开发环境
|
||||||
development: {
|
development: {
|
||||||
API_BASE_URL: 'http://127.0.0.1:9200/api',
|
// API_BASE_URL: 'http://127.0.0.1:9200/api',
|
||||||
// API_BASE_URL: 'https://glt-api.websoft.top/api',
|
API_BASE_URL: 'https://glt-api.websoft.top/api',
|
||||||
APP_NAME: '开发环境',
|
APP_NAME: '开发环境',
|
||||||
DEBUG: 'true',
|
DEBUG: 'true',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import type { ShopGoods, ShopGoodsParam } from '@/api/shop/shopGoods/model'
|
|||||||
import { getMyGltUserTicketTotal } from '@/api/glt/gltUserTicket'
|
import { getMyGltUserTicketTotal } from '@/api/glt/gltUserTicket'
|
||||||
import { ensureLoggedIn } from '@/utils/auth'
|
import { ensureLoggedIn } from '@/utils/auth'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
import navTo from "@/utils/common";
|
||||||
|
|
||||||
function Home() {
|
function Home() {
|
||||||
const [activeTabKey, setActiveTabKey] = useState('recommend')
|
const [activeTabKey, setActiveTabKey] = useState('recommend')
|
||||||
@@ -178,8 +179,8 @@ function Home() {
|
|||||||
>(
|
>(
|
||||||
() => [
|
() => [
|
||||||
{ key: 'recommend', title: '推荐', params: { recommend: 1 } },
|
{ key: 'recommend', title: '推荐', params: { recommend: 1 } },
|
||||||
{ key: '4476', title: '政企采购专区', params: { categoryId: 4476 } },
|
{ key: '4476', title: '桶装水', params: { categoryId: 4476 } },
|
||||||
{ key: '4556', title: '桂乐淘·福利惊爆区', params: { categoryId: 4556 } },
|
{ key: '4556', title: '水票套餐', params: { categoryId: 4556 } },
|
||||||
// { key: '4557', title: '购机套餐', params: { categoryId: 4557 } },
|
// { key: '4557', title: '购机套餐', params: { categoryId: 4557 } },
|
||||||
// { key: '4477', title: '饮水设备', params: { categoryId: 4477 } },
|
// { key: '4477', title: '饮水设备', params: { categoryId: 4477 } },
|
||||||
],
|
],
|
||||||
@@ -289,6 +290,19 @@ function Home() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<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*/}
|
{/*分类Tabs*/}
|
||||||
<ScrollView className="home-tabs" scrollX enableFlex>
|
<ScrollView className="home-tabs" scrollX enableFlex>
|
||||||
<View className="home-tabs__inner">
|
<View className="home-tabs__inner">
|
||||||
@@ -306,7 +320,6 @@ function Home() {
|
|||||||
})}
|
})}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
{/* 商品列表 */}
|
{/* 商品列表 */}
|
||||||
<View className="goods-grid">
|
<View className="goods-grid">
|
||||||
{visibleGoods.map((item) => (
|
{visibleGoods.map((item) => (
|
||||||
@@ -356,6 +369,7 @@ function Home() {
|
|||||||
</View>
|
</View>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user