优化图标,修改模拟数据

This commit is contained in:
2025-11-29 18:30:28 +08:00
parent 0eb8ac9181
commit 7be5b1b66c
9 changed files with 31 additions and 26 deletions

View File

@@ -6,25 +6,25 @@ import type { Banner } from '@/typings/mall'
export const mockBannerList: Banner[] = [
{
id: 'banner_001',
image: 'https://picsum.photos/750/400?random=banner1',
image: '/static/ban/1.jpg',
title: '春季新品上市',
goodsId: 'goods_001',
},
{
id: 'banner_002',
image: 'https://picsum.photos/750/400?random=banner2',
image: '/static/ban/2.jpg',
title: '数码产品大促',
goodsId: 'goods_004',
},
{
id: 'banner_003',
image: 'https://picsum.photos/750/400?random=banner3',
image: '/static/ban/3.jpg',
title: '美妆护肤专场',
goodsId: 'goods_010',
},
{
id: 'banner_004',
image: 'https://picsum.photos/750/400?random=banner4',
image: '/static/ban/4.jpg',
title: '家居好物推荐',
goodsId: 'goods_008',
},

View File

@@ -1,55 +1,55 @@
import type { Category } from '@/typings/mall'
// i-carbon-webhook
/**
* 分类模拟数据
*/
export const mockCategoryList: Category[] = [
{
id: 'cat_001',
name: '服装',
icon: 'i-carbon-clothing',
name: '农产品',
icon: 'i-carbon-webhook',
cover: 'https://picsum.photos/200/200?random=cat1',
},
{
id: 'cat_002',
name: '数码',
icon: 'i-carbon-phone',
name: '非遗老字号',
icon: 'i-carbon-store',
cover: 'https://picsum.photos/200/200?random=cat2',
},
{
id: 'cat_003',
name: '品',
name: '美食饮品',
icon: 'i-carbon-restaurant',
cover: 'https://picsum.photos/200/200?random=cat3',
},
{
id: 'cat_004',
name: '家居',
icon: 'i-carbon-home',
name: '粮油副食',
icon: 'i-carbon-crop',
cover: 'https://picsum.photos/200/200?random=cat4',
},
{
id: 'cat_005',
name: '美妆',
icon: 'i-carbon-face-satisfied',
name: '文创工艺品',
icon: 'i-carbon-ibm-deployable-architecture',
cover: 'https://picsum.photos/200/200?random=cat5',
},
{
id: 'cat_006',
name: '运动',
icon: 'i-carbon-basketball',
name: '电子数码',
icon: 'i-carbon-edge-device',
cover: 'https://picsum.photos/200/200?random=cat6',
},
{
id: 'cat_007',
name: '图书',
icon: 'i-carbon-book',
name: '服装鞋袜',
icon: 'i-carbon-ibm-cloud-direct-link-1-dedicated-hosting',
cover: 'https://picsum.photos/200/200?random=cat7',
},
{
id: 'cat_008',
name: '母婴',
icon: 'i-carbon-baby',
name: '美妆',
icon: 'i-carbon-face-satisfied',
cover: 'https://picsum.photos/200/200?random=cat8',
},
]

View File

@@ -66,7 +66,9 @@ async function handleLogin() {
uni.showToast({ title: '登录成功', icon: 'success' })
setTimeout(() => {
uni.navigateBack()
uni.switchTab({
url: '/pages/index/index'
})
}, 1500)
} catch (error) {
uni.showToast({ title: '登录失败', icon: 'none' })

BIN
src/static/ban/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

BIN
src/static/ban/2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

BIN
src/static/ban/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

BIN
src/static/ban/4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

View File

@@ -20,7 +20,7 @@ export const TABBAR_STRATEGY_MAP = {
// TODO: 1/3. 通过这里切换使用tabbar的策略
// 如果是使用 NO_TABBAR(0)nativeTabbarList 和 customTabbarList 都不生效(里面的配置不用管)
// 如果是使用 NATIVE_TABBAR(1),只需要配置 nativeTabbarListcustomTabbarList 不生效
// 如果是使用 CUSTOM_TABBAR(2,3),只需要配置 customTabbarListnativeTabbarList 不生效
// 如果是使用 CUSTOM_TABBAR(2,3),只需要配置 不生效
export const selectedTabbarStrategy = TABBAR_STRATEGY_MAP.CUSTOM_TABBAR_WITH_CACHE
// TODO: 2/3. 使用 NATIVE_TABBAR 时,更新下面的 tabbar 配置
@@ -51,14 +51,15 @@ export const customTabbarList: CustomTabBarItem[] = [
iconType: 'unocss',
icon: 'i-carbon-home',
// badge: 'dot',
navigationStyle: 'custom',
},
{
pagePath: 'pages/sort/index',
text: '分类',
// 1在fg-tabbar.vue页面上引入一下并注释掉见tabbar/index.vue代码第2行
// 2配置到 unocss.config.ts 的 safelist 中
iconType: 'uiLib',
icon: 'add-circle',
iconType: 'unocss',
icon: 'i-carbon-view-mode-2',
// badge: 10,
},
{
@@ -67,7 +68,7 @@ export const customTabbarList: CustomTabBarItem[] = [
// 1在fg-tabbar.vue页面上引入一下并注释掉见tabbar/index.vue代码第2行
// 2配置到 unocss.config.ts 的 safelist 中
iconType: 'unocss',
icon: 'i-clarity-shopping-cart-line',
icon: 'i-carbon-shopping-cart',
// badge: 10,
},
{

View File

@@ -71,7 +71,9 @@ export default defineConfig({
},
],
// 动态图标需要在这里配置或者写在vue页面中注释掉
safelist: ['i-carbon-code', 'i-carbon-home', 'i-carbon-user'],
safelist: ['i-carbon-code', 'i-carbon-home', 'i-carbon-user','i-carbon-shopping-cart','i-carbon-view-mode-2','i-carbon-webhook',
'i-carbon-restaurant','i-carbon-crop','i-carbon-ibm-deployable-architecture',
'i-carbon-edge-device','i-carbon-ibm-cloud-direct-link-1-dedicated-hosting','i-carbon-face-satisfied'],
rules: [
[
'p-safe',