diff --git a/package.json b/package.json
new file mode 100644
index 00000000..05da5dee
--- /dev/null
+++ b/package.json
@@ -0,0 +1,9 @@
+{
+ "name": "i18n",
+ "version": "1.0.0",
+ "main": "index.uts",
+ "types": "index.uts",
+ "uni_modules": {
+ "uni_modules": true
+ }
+}
\ No newline at end of file
diff --git a/pages/mall/consumer/category - 副本 (2).uvue b/pages/mall/consumer/category - 副本 (2).uvue
new file mode 100644
index 00000000..d3a5b3e2
--- /dev/null
+++ b/pages/mall/consumer/category - 副本 (2).uvue
@@ -0,0 +1,834 @@
+
+
+
+
+
+
+
+ 🔍
+ 症状/药品/品牌智能搜索
+
+
+
+
+
+
+
+
+
+ {{ item.icon }}
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ product.badge }}
+
+
+ {{ product.name }}
+ {{ product.specification }}
+
+
+
+ ¥
+ {{ product.price }}
+
+
+ ¥{{ product.originalPrice }}
+
+
+
+
+ {{ product.manufacturer }}
+
+ 已售{{ product.sales }}
+
+
+
+
+
+
+
+
+ 💊
+ 暂无相关药品
+ 该分类下暂无商品,敬请期待
+
+
+
+
+ 上拉加载更多
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/mall/consumer/category - 副本.uvue b/pages/mall/consumer/category - 副本.uvue
index be8f8358..d217ab27 100644
--- a/pages/mall/consumer/category - 副本.uvue
+++ b/pages/mall/consumer/category - 副本.uvue
@@ -1,526 +1,131 @@
-
-
-
-
-
-
-
-
-
-
- {{ category.name }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ currentCategory?.name }}分类
-
-
-
- {{ subCategory.name }}
-
-
-
-
-
-
-
-
-
-
-
- {{ brand.name }}
-
-
-
-
-
-
-
- 热销商品
-
-
-
-
- {{ product.name }}
-
- ¥{{ product.price }}
- ¥{{ product.original_price }}
-
-
- 已售{{ product.sales }}
-
-
-
-
-
-
-
-
- 加载中...
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/mall/consumer/category.uvue b/pages/mall/consumer/category.uvue
index a92848ae..b46448fc 100644
--- a/pages/mall/consumer/category.uvue
+++ b/pages/mall/consumer/category.uvue
@@ -2,10 +2,12 @@
-
-
- 🔍
- 搜索商品
+
+
+
+ 🔍
+ 症状/药品/品牌智能搜索
+
@@ -18,55 +20,69 @@
:key="item.id"
:class="['primary-item', { active: activePrimary === item.id }]"
@click="selectPrimaryCategory(item.id)"
+ :style="{ backgroundColor: activePrimary === item.id ? item.color : 'transparent' }"
>
+ {{ item.icon }}
{{ item.name }}
-
-
-
-
-
-
- {{ sub.name }}
-
+
+
+
+
-
-
+
+
-
-
+ {{ product.badge }}
+
+
+ {{ product.name }}
+ {{ product.specification }}
+
+
+
+ ¥
+ {{ product.price }}
+
+
+ ¥{{ product.originalPrice }}
+
+
+
+
+ {{ product.manufacturer }}
+
+ 已售{{ product.sales }}
+
+
- {{ product.name }}
- ¥{{ product.price }}
-
- 📁
- 暂无商品
-
+
+ 💊
+ 暂无相关药品
+ 该分类下暂无商品,敬请期待
+
+
+
+
+ 上拉加载更多
@@ -77,168 +93,649 @@
import { ref, onMounted } from 'vue'
// 响应式数据
+const statusBarHeight = ref(0)
const primaryCategories = ref([])
-const secondaryCategories = ref([])
const productList = ref([])
-const activePrimary = ref('1')
-const loading = ref(false)
+const activePrimary = ref('cold')
+const cartCount = ref(3)
+const hasMore = ref(true)
-// Mock 数据
-const mockCategories = {
- primary: [
- { id: '1', name: '推荐' },
- { id: '2', name: '女装' },
- { id: '3', name: '男装' },
- { id: '4', name: '鞋靴' },
- { id: '5', name: '箱包' },
- { id: '6', name: '美妆' },
- { id: '7', name: '数码' },
- { id: '8', name: '家电' },
- { id: '9', name: '家居' },
- { id: '10', name: '母婴' },
- { id: '11', name: '食品' },
- { id: '12', name: '运动' },
- { id: '13', name: '汽车' },
- { id: '14', name: '百货' }
+// 获取当前分类信息
+const currentCategoryName = ref('感冒发烧')
+const currentCategoryDesc = ref('解热镇痛')
+
+// 页面参数
+const pageParams = ref({})
+
+// 医药分类数据(与主页一致)
+const medicineCategories = [
+ { id: 'cold', name: '感冒发烧', icon: '🤧', desc: '解热镇痛', color: '#2196F3' },
+ { id: 'stomach', name: '肠胃用药', icon: '🤢', desc: '消化系统', color: '#4CAF50' },
+ { id: 'pain', name: '止痛消炎', icon: '💊', desc: '镇痛消炎', color: '#F44336' },
+ { id: 'skin', name: '皮肤用药', icon: '🤕', desc: '皮肤护理', color: '#9C27B0' },
+ { id: 'vitamin', name: '维生素', icon: '🍊', desc: '营养补充', color: '#FF9800' },
+ { id: 'chronic', name: '慢性病', icon: '🫀', desc: '长期管理', color: '#795548' },
+ { id: 'child', name: '儿童用药', icon: '👶', desc: '儿童专用', color: '#00BCD4' },
+ { id: 'external', name: '外用药品', icon: '🧴', desc: '外用制剂', color: '#8BC34A' },
+ { id: 'device', name: '医疗器械', icon: '🩺', desc: '医疗设备', color: '#607D8B' },
+ { id: 'health', name: '健康食品', icon: '🥗', desc: '保健食品', color: '#FFC107' }
+]
+
+// Mock 商品数据 - 使用本地图片避免网络请求
+const mockProducts = {
+ cold: [
+ {
+ id: 'cold1',
+ name: '布洛芬缓释胶囊',
+ specification: '0.3g*24粒',
+ price: 18.5,
+ originalPrice: 25.8,
+ image: '/static/images/default-product.png',
+ manufacturer: '修正药业',
+ sales: 2560,
+ badge: '热销'
+ },
+ {
+ id: 'cold2',
+ name: '板蓝根颗粒',
+ specification: '10g*20袋',
+ price: 22.8,
+ originalPrice: 29.9,
+ image: '/static/images/default-product.png',
+ manufacturer: '白云山',
+ sales: 1890,
+ badge: '推荐'
+ },
+ {
+ id: 'cold3',
+ name: '连花清瘟胶囊',
+ specification: '0.35g*36粒',
+ price: 42.8,
+ originalPrice: 48.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '以岭药业',
+ sales: 3200,
+ badge: '爆款'
+ },
+ {
+ id: 'cold4',
+ name: '对乙酰氨基酚片',
+ specification: '0.5g*12片',
+ price: 8.9,
+ originalPrice: 12.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '强生制药',
+ sales: 1420,
+ badge: '特价'
+ },
+ {
+ id: 'cold5',
+ name: '感冒清热颗粒',
+ specification: '3g*10袋',
+ price: 16.5,
+ originalPrice: 19.9,
+ image: '/static/images/default-product.png',
+ manufacturer: '同仁堂',
+ sales: 980,
+ badge: '新品'
+ },
+ {
+ id: 'cold6',
+ name: '复方氨酚烷胺片',
+ specification: '10片/盒',
+ price: 12.8,
+ originalPrice: 15.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '三九医药',
+ sales: 1650,
+ badge: '家庭装'
+ }
],
- secondary: {
- '1': [
- { id: '101', name: '热销推荐', image: 'https://picsum.photos/100/100?random=1' },
- { id: '102', name: '新品上市', image: 'https://picsum.photos/100/100?random=2' },
- { id: '103', name: '限时特惠', image: 'https://picsum.photos/100/100?random=3' },
- { id: '104', name: '精选好物', image: 'https://picsum.photos/100/100?random=4' }
- ],
- '2': [
- { id: '201', name: '连衣裙', image: 'https://picsum.photos/100/100?random=5' },
- { id: '202', name: 'T恤', image: 'https://picsum.photos/100/100?random=6' },
- { id: '203', name: '裤子', image: 'https://picsum.photos/100/100?random=7' },
- { id: '204', name: '外套', image: 'https://picsum.photos/100/100?random=8' },
- { id: '205', name: '内衣', image: 'https://picsum.photos/100/100?random=9' }
- ]
- },
+ stomach: [
+ {
+ id: 'stomach1',
+ name: '胃康灵胶囊',
+ specification: '0.4g*24粒',
+ price: 32.8,
+ originalPrice: 38.5,
+ image: '/static/images/default-product.png',
+ manufacturer: '三九医药',
+ sales: 890,
+ badge: '热销'
+ },
+ {
+ id: 'stomach2',
+ name: '奥美拉唑肠溶胶囊',
+ specification: '20mg*14粒',
+ price: 28.5,
+ originalPrice: 35.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '阿斯利康',
+ sales: 1250,
+ badge: '处方药'
+ },
+ {
+ id: 'stomach3',
+ name: '健胃消食片',
+ specification: '0.8g*32片',
+ price: 15.9,
+ originalPrice: 19.9,
+ image: '/static/images/default-product.png',
+ manufacturer: '江中制药',
+ sales: 2100,
+ badge: '推荐'
+ },
+ {
+ id: 'stomach4',
+ name: '蒙脱石散',
+ specification: '3g*10袋',
+ price: 18.6,
+ originalPrice: 22.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '益普生',
+ sales: 1780,
+ badge: '止泻'
+ },
+ {
+ id: 'stomach5',
+ name: '多潘立酮片',
+ specification: '10mg*30片',
+ price: 22.8,
+ originalPrice: 26.5,
+ image: '/static/images/default-product.png',
+ manufacturer: '西安杨森',
+ sales: 950,
+ badge: '促消化'
+ },
+ {
+ id: 'stomach6',
+ name: '铝碳酸镁咀嚼片',
+ specification: '0.5g*20片',
+ price: 25.9,
+ originalPrice: 29.9,
+ image: '/static/images/default-product.png',
+ manufacturer: '拜耳',
+ sales: 1320,
+ badge: '护胃'
+ }
+ ],
- products: {
- '101': [
- { id: '1001', name: '热销商品1', price: 99.9, image: 'https://picsum.photos/150/150?random=10' },
- { id: '1002', name: '热销商品2', price: 199, image: 'https://picsum.photos/150/150?random=11' },
- { id: '1003', name: '热销商品3', price: 299, image: 'https://picsum.photos/150/150?random=12' }
- ],
- '201': [
- { id: '2001', name: '连衣裙1', price: 199, image: 'https://picsum.photos/150/150?random=13' },
- { id: '2002', name: '连衣裙2', price: 299, image: 'https://picsum.photos/150/150?random=14' }
- ]
- }
+ pain: [
+ {
+ id: 'pain1',
+ name: '阿莫西林胶囊',
+ specification: '0.25g*24粒',
+ price: 28.5,
+ originalPrice: 35.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '华北制药',
+ sales: 1560,
+ badge: '处方药'
+ },
+ {
+ id: 'pain2',
+ name: '双氯芬酸钠缓释片',
+ specification: '75mg*10片',
+ price: 19.8,
+ originalPrice: 24.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '诺华制药',
+ sales: 1280,
+ badge: '止痛'
+ },
+ {
+ id: 'pain3',
+ name: '云南白药胶囊',
+ specification: '0.25g*32粒',
+ price: 35.9,
+ originalPrice: 42.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '云南白药',
+ sales: 2350,
+ badge: '经典'
+ },
+ {
+ id: 'pain4',
+ name: '塞来昔布胶囊',
+ specification: '0.2g*10粒',
+ price: 48.6,
+ originalPrice: 55.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '辉瑞',
+ sales: 890,
+ badge: '抗炎'
+ },
+ {
+ id: 'pain5',
+ name: '布洛芬片',
+ specification: '0.1g*24片',
+ price: 12.5,
+ originalPrice: 15.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '中美史克',
+ sales: 1680,
+ badge: '经济装'
+ },
+ {
+ id: 'pain6',
+ name: '头孢克肟胶囊',
+ specification: '0.1g*6粒',
+ price: 32.8,
+ originalPrice: 38.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '广州白云山',
+ sales: 1120,
+ badge: '抗生素'
+ }
+ ]
+}
+
+// 补充其他分类的默认数据(简化版)
+const generateDefaultProducts = (categoryId: string) => {
+ const baseProducts = [
+ { name: '通用药品1', price: 25.8, manufacturer: '知名药企', sales: 1200 },
+ { name: '通用药品2', price: 18.5, manufacturer: '知名药企', sales: 950 },
+ { name: '通用药品3', price: 32.0, manufacturer: '知名药企', sales: 1450 },
+ { name: '通用药品4', price: 22.8, manufacturer: '知名药企', sales: 880 },
+ { name: '通用药品5', price: 28.9, manufacturer: '知名药企', sales: 1100 },
+ { name: '通用药品6', price: 19.9, manufacturer: '知名药企', sales: 920 }
+ ]
+
+ return baseProducts.map((product, index) => ({
+ id: `${categoryId}${index + 1}`,
+ ...product,
+ specification: '规格待定',
+ originalPrice: product.price * 1.2,
+ image: '/static/images/default-product.png',
+ badge: index === 0 ? '热销' : index === 1 ? '推荐' : ''
+ }))
}
// 生命周期
onMounted(() => {
- loadData()
+ initPage()
+
+ console.log('=== category页面onMounted被调用 ===')
+
+ // 在onMounted中只初始化页面,不处理分类参数
+ // 分类参数的处理交给onLoad函数,因为onLoad在页面加载时执行
+ console.log('onMounted中不处理分类参数,等待onLoad处理')
+
+ // 注意:这里不再默认选择分类,让onLoad函数处理分类选择
+ // 如果onLoad没有设置分类,则保持默认状态
})
-// 加载数据
-const loadData = () => {
- loading.value = true
+// 页面加载时处理参数 - 这是处理分类切换的主要入口
+onLoad((options: any) => {
+ console.log('=== category页面onLoad被调用 ===')
+ console.log('页面加载时间:', Date.now())
+ console.log('传入的options参数:', options)
+ console.log('当前活动分类:', activePrimary.value)
+
+ let categoryId = ''
+ let categoryName = ''
+
+ // 首先检查传入的options参数
+ if (options && options.categoryId) {
+ categoryId = options.categoryId
+ categoryName = options.name || ''
+ console.log('✅ onLoad中找到分类参数:', categoryId, categoryName)
+ }
+
+ // 如果options中没有,尝试从getCurrentPages()获取
+ if (!categoryId) {
+ const pages = getCurrentPages()
+ if (pages.length > 0) {
+ const currentPage = pages[pages.length - 1]
+ const pageOptions = currentPage.options || {}
+ console.log('从getCurrentPages()获取参数:', pageOptions)
+
+ if (pageOptions.categoryId) {
+ categoryId = pageOptions.categoryId
+ categoryName = pageOptions.name || ''
+ console.log('✅ 从getCurrentPages()找到分类参数:', categoryId, categoryName)
+ }
+ }
+ }
+
+ // 如果有找到分类ID,则选中对应的分类
+ if (categoryId) {
+ console.log('✅ 准备选中分类:', categoryId)
+ console.log('分类名称:', categoryName || '未指定')
+
+ // 检查是否需要更新分类
+ if (activePrimary.value !== categoryId) {
+ console.log('当前分类:', activePrimary.value, '与目标分类:', categoryId, '不同,需要更新')
+ console.log('准备调用selectPrimaryCategory函数...')
+ selectPrimaryCategory(categoryId)
+ } else {
+ console.log('当前分类已经是目标分类,但可能用户想要刷新页面')
+ console.log('当前分类:', activePrimary.value, '目标分类:', categoryId)
+ // 即使分类相同,也重新加载数据,确保数据是最新的
+ // 添加一个小的延迟,确保页面完全显示后再更新数据
+ setTimeout(() => {
+ selectPrimaryCategory(categoryId)
+ }, 100)
+ }
+ } else {
+ console.log('⚠️ onLoad中未找到分类参数')
+ console.log('保持当前分类显示:', activePrimary.value)
+ }
+
+ console.log('=== category页面onLoad执行完成 ===')
+})
+
+// 页面显示时也检查参数,确保从其他页面返回时能正确显示
+onShow(() => {
+ console.log('=== category页面onShow被调用 ===')
+ console.log('页面显示时间:', Date.now())
+ console.log('当前活动分类:', activePrimary.value)
+
+ // 在onShow中,我们也需要检查是否有新的参数
+ // 因为当从主页再次点击分类跳转过来时,可能不会触发onLoad
+ // 而是触发onShow
+
+ // 获取当前页面实例和参数
+ const pages = getCurrentPages()
+ if (pages.length > 0) {
+ const currentPage = pages[pages.length - 1]
+ const pageOptions = currentPage.options || {}
+ console.log('onShow中获取参数:', pageOptions)
+
+ // 检查是否有分类参数
+ if (pageOptions.categoryId) {
+ const categoryId = pageOptions.categoryId
+ const categoryName = pageOptions.name || ''
+
+ console.log('✅ onShow中找到分类参数:', categoryId, categoryName)
+ console.log('URL中的时间戳参数:', pageOptions.timestamp)
+ console.log('URL中的随机参数:', pageOptions.random)
+
+ // 检查是否需要更新分类
+ if (activePrimary.value !== categoryId) {
+ console.log('当前分类:', activePrimary.value, '与目标分类:', categoryId, '不同,需要更新')
+ console.log('准备调用selectPrimaryCategory函数...')
+ selectPrimaryCategory(categoryId)
+ } else {
+ console.log('当前分类已经是目标分类,但可能用户想要刷新页面')
+ console.log('当前分类:', activePrimary.value, '目标分类:', categoryId)
+ // 即使分类相同,也重新加载数据,确保数据是最新的
+ // 添加一个小的延迟,确保页面完全显示后再更新数据
+ setTimeout(() => {
+ selectPrimaryCategory(categoryId)
+ }, 100)
+ }
+ } else {
+ console.log('⚠️ onShow中未找到分类参数')
+ console.log('尝试从URL中解析参数...')
+
+ // 尝试从当前页面的URL中解析参数
+ const currentUrl = currentPage.route || ''
+ console.log('当前页面路由:', currentUrl)
+
+ // 如果URL中有查询参数,尝试解析
+ if (currentPage.$page && currentPage.$page.fullPath) {
+ const fullPath = currentPage.$page.fullPath
+ console.log('完整路径:', fullPath)
+
+ // 尝试解析查询参数
+ const queryIndex = fullPath.indexOf('?')
+ if (queryIndex > -1) {
+ const queryString = fullPath.substring(queryIndex + 1)
+ console.log('查询字符串:', queryString)
+
+ // 简单解析查询参数
+ const params = new URLSearchParams(queryString)
+ const urlCategoryId = params.get('categoryId')
+ if (urlCategoryId) {
+ console.log('✅ 从URL解析到分类参数:', urlCategoryId)
+ selectPrimaryCategory(urlCategoryId)
+ }
+ }
+ }
+ }
+ }
+
+ console.log('=== category页面onShow执行完成 ===')
+})
+
+// 初始化页面
+const initPage = () => {
+ const systemInfo = uni.getSystemInfoSync()
+ statusBarHeight.value = systemInfo.statusBarHeight || 0
- // 使用模拟数据
- setTimeout(() => {
- primaryCategories.value = mockCategories.primary
- secondaryCategories.value = mockCategories.secondary[activePrimary.value] || []
- productList.value = mockCategories.products['101'] || []
- loading.value = false
- }, 500)
+ // 获取页面参数
+ const pages = getCurrentPages()
+ if (pages.length > 0) {
+ const currentPage = pages[pages.length - 1]
+ pageParams.value = currentPage.options || {}
+ }
+
+ // 加载分类数据
+ primaryCategories.value = medicineCategories
}
// 选择一级分类
const selectPrimaryCategory = (categoryId: string) => {
+ console.log('=== selectPrimaryCategory函数开始执行 ===')
+ console.log('传入的categoryId:', categoryId)
+ console.log('当前时间:', Date.now())
+
+ // 验证categoryId是否有效
+ if (!categoryId) {
+ console.error('categoryId为空,使用默认分类')
+ categoryId = 'cold'
+ }
+
+ console.log('验证后的categoryId:', categoryId)
+ console.log('当前activePrimary的值:', activePrimary.value)
+
+ // 更新活动分类
activePrimary.value = categoryId
- secondaryCategories.value = mockCategories.secondary[categoryId] || []
- productList.value = mockCategories.products[categoryId + '01'] || []
+ console.log('更新后的activePrimary:', activePrimary.value)
+
+ // 更新当前分类信息
+ const category = medicineCategories.find(cat => cat.id === categoryId)
+ if (category) {
+ currentCategoryName.value = category.name
+ currentCategoryDesc.value = category.desc
+ console.log('✅ 找到分类:', category.name, '描述:', category.desc)
+ } else {
+ console.error('❌ 未找到分类ID:', categoryId, ',使用默认分类')
+ // 如果找不到对应的分类,使用第一个分类
+ if (medicineCategories.length > 0) {
+ const firstCategory = medicineCategories[0]
+ currentCategoryName.value = firstCategory.name
+ currentCategoryDesc.value = firstCategory.desc
+ activePrimary.value = firstCategory.id
+ categoryId = firstCategory.id
+ console.log('使用默认分类:', firstCategory.name)
+ }
+ }
+
+ console.log('准备加载商品数据...')
+
+ // 加载对应商品
+ if (mockProducts[categoryId]) {
+ productList.value = mockProducts[categoryId]
+ console.log('✅ 加载mock商品数据成功')
+ console.log('分类:', categoryId)
+ console.log('商品数量:', mockProducts[categoryId].length)
+ console.log('商品列表:', mockProducts[categoryId])
+ } else {
+ productList.value = generateDefaultProducts(categoryId)
+ console.log('✅ 加载默认商品数据成功')
+ console.log('分类:', categoryId)
+ console.log('商品数量:', productList.value.length)
+ console.log('商品列表:', productList.value)
+ }
+
+ hasMore.value = true
+
+ // 验证数据是否已正确更新
+ console.log('数据更新验证:')
+ console.log('activePrimary:', activePrimary.value)
+ console.log('currentCategoryName:', currentCategoryName.value)
+ console.log('currentCategoryDesc:', currentCategoryDesc.value)
+ console.log('productList长度:', productList.value.length)
+
+ console.log('=== selectPrimaryCategory函数执行完成 ===')
}
-// 选择二级分类
-const selectSecondaryCategory = (subCategoryId: string) => {
- productList.value = mockCategories.products[subCategoryId] || []
+// 添加到购物车
+const addToCart = (product: any) => {
+ uni.showToast({
+ title: '已添加到购物车',
+ icon: 'success'
+ })
+ cartCount.value++
}
// 导航函数
-const navigateToSearch = () => {
- uni.navigateTo({ url: '/pages/mall/consumer/search' })
-}
-
+const navigateToSearch = () => uni.navigateTo({ url: '/pages/medicine/search' })
+const navigateToCart = () => uni.navigateTo({ url: '/pages/medicine/cart' })
const navigateToProduct = (product: any) => {
- uni.navigateTo({ url: `/pages/mall/consumer/product-detail?id=${product.id}` })
+ uni.navigateTo({
+ url: `/pages/medicine/detail?id=${product.id}`
+ })
}
\ No newline at end of file
+
+.load-text {
+ display: inline-block;
+ padding: 8px 16px;
+ background: #f5f5f5;
+ border-radius: 20px;
+}
+
+/* ===== 响应式设计 ===== */
+
+/* 小屏手机 (小于414px) */
+@media screen and (max-width: 414px) {
+ .category-content {
+ flex-direction: column;
+ padding: 0 12px;
+ }
+
+ .primary-category {
+ width: 100%;
+ display: flex;
+ flex-wrap: wrap;
+ padding: 8px;
+ }
+
+ .primary-item {
+ width: calc(25% - 8px);
+ margin: 4px;
+ padding: 10px 8px;
+ text-align: center;
+ }
+
+ .primary-icon {
+ margin-right: 0;
+ margin-bottom: 4px;
+ font-size: 16px;
+ }
+
+ .primary-name {
+ font-size: 12px;
+ }
+
+ .product-grid {
+ grid-template-columns: 1fr;
+ gap: 16px;
+ }
+
+ .search-container {
+ padding: 0 12px;
+ height: 55px;
+ }
+
+ .search-box {
+ padding: 8px 16px;
+ }
+
+ .category-header {
+ padding: 0;
+ }
+}
+
+/* 中屏手机/小平板 (415px-768px) */
+@media screen and (min-width: 415px) and (max-width: 768px) {
+ .product-grid {
+ grid-template-columns: repeat(2, 1fr);
+ gap: 16px;
+ }
+}
+
+/* 平板设备 (769px-1024px) */
+@media screen and (min-width: 769px) and (max-width: 1024px) {
+ .product-grid {
+ grid-template-columns: repeat(3, 1fr);
+ gap: 20px;
+ }
+}
+
+/* 桌面端 (1025px以上) */
+@media screen and (min-width: 1025px) {
+ .category-content {
+ gap: 30px;
+ padding: 0 24px;
+ }
+
+ .primary-category {
+ width: 160px;
+ padding: 16px 0;
+ }
+
+ .primary-item {
+ padding: 16px 20px;
+ margin: 6px 12px;
+ border-radius: 10px;
+ }
+
+ .primary-icon {
+ font-size: 20px;
+ min-width: 28px;
+ }
+
+ .primary-name {
+ font-size: 15px;
+ }
+
+ .product-content {
+ padding: 20px 0;
+ }
+
+ .category-header {
+ margin-bottom: 24px;
+ padding: 0 12px;
+ }
+
+ .category-title {
+ font-size: 24px;
+ }
+
+ .category-desc {
+ font-size: 15px;
+ }
+
+ .product-grid {
+ grid-template-columns: repeat(4, 1fr);
+ gap: 24px;
+ }
+
+ .product-card {
+ border-radius: 14px;
+ }
+
+ .product-info {
+ padding: 20px;
+ }
+
+ .product-name {
+ font-size: 16px;
+ }
+
+ .product-spec {
+ font-size: 14px;
+ }
+
+ .price-value {
+ font-size: 22px;
+ }
+}
+
+/* 大桌面端 (1400px以上) */
+@media screen and (min-width: 1400px) {
+ .category-content {
+ max-width: 1600px;
+ gap: 40px;
+ padding: 0 32px;
+ }
+
+ .primary-category {
+ width: 200px;
+ padding: 20px 0;
+ }
+
+ .primary-item {
+ padding: 18px 24px;
+ margin: 8px 16px;
+ border-radius: 12px;
+ }
+
+ .primary-icon {
+ font-size: 22px;
+ min-width: 32px;
+ }
+
+ .primary-name {
+ font-size: 16px;
+ }
+
+ .product-content {
+ padding: 24px 0;
+ }
+
+ .category-header {
+ margin-bottom: 28px;
+ padding: 0 16px;
+ }
+
+ .category-title {
+ font-size: 26px;
+ }
+
+ .category-desc {
+ font-size: 16px;
+ }
+
+ .product-grid {
+ grid-template-columns: repeat(5, 1fr);
+ gap: 28px;
+ }
+
+ .product-card {
+ border-radius: 16px;
+ }
+
+ .product-image {
+ height: 180px;
+ }
+
+ .product-info {
+ padding: 24px;
+ }
+
+ .product-name {
+ font-size: 17px;
+ }
+
+ .product-spec {
+ font-size: 15px;
+ }
+
+ .price-value {
+ font-size: 24px;
+ }
+}
+
diff --git a/pages/mall/consumer/index - 副本.uvue b/pages/mall/consumer/index - 副本.uvue
index f237adb2..93d69e90 100644
--- a/pages/mall/consumer/index - 副本.uvue
+++ b/pages/mall/consumer/index - 副本.uvue
@@ -1,21 +1,14 @@
-
+
-
-
-
-
-
- 📍
- {{ currentCity }}
- ▼
-
-
-
-
- 💬
-
-
- 🛒
+
+
+
+
+
+
+
+ 康乐医药商城
+ 官方认证·正品保障
@@ -24,225 +17,286 @@
-
-
-
-
-
-
- {{ category.icon }}
-
- {{ category.name }}
-
+
+
+
+
-
-
-
-
-
-
-
- 🔍
- 搜索商品/品牌/店铺
+
+ 💡 按时用药提醒
+ 📋 健康记录跟踪
+ 🩺 在线问诊咨询
-
-
+
+
+
+
+
+
+ {{ category.icon }}
+
+ {{ category.name }}
+ {{ category.desc }}
+
+
+
+
+
+
+
+ 🔍
+ 症状/药品/品牌智能搜索
+
+ 语音
+ 拍照
+
+
+
+
+
+
+
-
-
+
+
+
+
+ {{ news.tag }}
+ {{ news.title }}
+
+
-
-
-
- ⚡
- 限时秒杀
-
-
- 🎫
- 领券中心
-
-
- 🔥
- 每日特价
-
-
- 🏷️
- 品牌特卖
-
-
- 👥
- 拼团购
+
+
+
+
+
+ 👨⚕️
+
+ 在线问诊
+ 三甲医生在线
+
+
+
+ 📋
+
+ 电子处方
+ 医生开方购药
+
+
+
+ 💊
+
+ 非处方药
+ 安全自主选购
+
+
+
+ 🩺
+
+ 健康工具
+ 健康管理助手
+
-
-
+
+
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
- {{ product.tag }}
-
-
- {{ product.name }}
-
-
- ¥
- {{ product.price }}
-
-
- ¥{{ product.original_price }}
-
-
-
- {{ product.sales }}人已买
-
- {{ product.shop }}
-
-
+
+
+
+
+
+ {{ product.tag }}
+ {{ product.featured }}
-
-
-
-
-
-
-
- {{ product.tag }}
-
-
- {{ product.name }}
-
-
- ¥
- {{ product.price }}
-
-
- ¥{{ product.original_price }}
-
+
+
+ {{ product.name }}
+ {{ product.specification }}
+
+
+
+ ⭐
+ {{ product.rating }}
-
- {{ product.sales }}人已买
-
- {{ product.shop }}
-
+ {{ product.reviews }}条评价
+
+
+
+
+ ¥
+ {{ product.price }}
+
+
+ ¥{{ product.originalPrice }}
+
+
+
+
+
+ 🛒
@@ -250,16 +304,30 @@
-
+
加载中...
-
- --- 我是有底线的 ---
+
+ --- 已加载全部内容 ---
-
+
+
+
+
+ ⏰
+
+ 健康提醒
+ 您有1个待用药提醒,点击查看详情
+
+
+ 查看
+
+
+
+
@@ -267,887 +335,883 @@
\ No newline at end of file
diff --git a/pages/mall/consumer/index.uvue b/pages/mall/consumer/index.uvue
index 036b8a11..f780dd9d 100644
--- a/pages/mall/consumer/index.uvue
+++ b/pages/mall/consumer/index.uvue
@@ -1,267 +1,318 @@
-
-
-
-
-
- 📍
- {{ currentCity }}
- ▼
-
-
-
-
- 💬
- {{ unreadMessageCount }}
+
+
+
+
+
+
+
+
+
+ 康乐医药商城
+ 官方认证·正品保障
+
-
- 🛒
- {{ cartCount }}
+
+
+
+
+
+ 🔍
+
+
+ 语音
+ 拍照
+
+
+
+
+
+
-
-
-
-
-
-
- {{ category.icon }}
-
- {{ category.name }}
-
+
+
+
+
-
-
-
-
-
-
-
- 🔍
- 搜索商品/品牌/店铺
+
+ 💡 按时用药提醒
+ 📋 健康记录跟踪
+ 🩺 在线问诊咨询
-
-
+
+
+
+
+
+
+ {{ category.icon }}
+
+ {{ category.name }}
+ {{ category.desc }}
+
+
+
+
+
+
+
-
-
+
+
+
+
+ {{ news.tag }}
+ {{ news.title }}
+
+
-
-
-
- ⚡
- 限时秒杀
-
-
- 🎫
- 领券中心
-
-
- 🔥
- 每日特价
-
-
- 🏷️
- 品牌特卖
-
-
- 👥
- 拼团购
+
+
+
+
+
+ 👨⚕️
+
+ 在线问诊
+ 三甲医生在线
+
+
+
+ 📋
+
+ 电子处方
+ 医生开方购药
+
+
+
+ 💊
+
+ 非处方药
+ 安全自主选购
+
+
+
+ 🩺
+
+ 健康工具
+ 健康管理助手
+
-
-
+
+
@@ -286,1108 +351,1358 @@
\ No newline at end of file
+
+/* 中屏手机/小平板 (415px-768px) */
+@media screen and (min-width: 415px) and (max-width: 768px) {
+ .nav-container {
+ padding: 0 16px;
+ height: 95px;
+ }
+
+ .brand-section {
+ flex-direction: row;
+ align-items: center;
+ gap: 15px;
+ flex-wrap: nowrap;
+ justify-content: space-between;
+ }
+
+ .brand-logo-area {
+ min-width: 140px;
+ max-width: 160px;
+ flex-shrink: 1;
+ flex-grow: 0;
+ }
+
+ .brand-name {
+ font-size: 17px;
+ }
+
+ .nav-search-container {
+ flex: 1;
+ min-width: 0;
+ flex-grow: 1;
+ }
+
+ .nav-search-tools {
+ display: none;
+ }
+
+ .main-scroll {
+ /* 移除 margin-top */
+ }
+
+ .category-grid {
+ grid-template-columns: repeat(3, 1fr);
+ }
+
+ .services-grid {
+ grid-template-columns: repeat(2, 1fr);
+ gap: 20px;
+ }
+
+ .products-grid {
+ grid-template-columns: repeat(2, 1fr);
+ }
+
+ .recommend-grid {
+ grid-template-columns: repeat(2, 1fr);
+ }
+
+ .family-grid {
+ grid-template-columns: repeat(3, 1fr);
+ }
+
+ .sort-tabs,
+ .recommend-filters {
+ gap: 10px;
+ justify-content: flex-start;
+ }
+
+ .sort-tab,
+ .filter-item {
+ padding: 6px 14px;
+ font-size: 12px;
+ flex-grow: 0;
+ }
+
+ .section-header {
+ flex-direction: column;
+ align-items: stretch;
+ gap: 12px;
+ }
+
+ .title-section {
+ justify-content: center;
+ }
+
+ .sort-tabs,
+ .recommend-filters {
+ width: 100%;
+ justify-content: center;
+ }
+}
+
+/* 平板设备 (769px-1024px) */
+@media screen and (min-width: 769px) and (max-width: 1024px) {
+ .nav-container {
+ padding: 0 24px;
+ max-width: 100%;
+ height: 100px;
+ }
+
+ .nav-search-tools .nav-tool-item {
+ display: none;
+ }
+
+ .main-scroll {
+ max-width: 100%;
+ padding: 20px 24px;
+ }
+
+ .category-grid {
+ grid-template-columns: repeat(4, 1fr);
+ }
+
+ .services-grid {
+ grid-template-columns: repeat(4, 1fr);
+ }
+
+ .products-grid {
+ grid-template-columns: repeat(3, 1fr);
+ }
+
+ .recommend-grid {
+ grid-template-columns: repeat(2, 1fr);
+ }
+
+ .family-grid {
+ grid-template-columns: repeat(3, 1fr);
+ }
+
+ .news-swiper {
+ height: 240px;
+ }
+}
+
+/* 桌面端 (1025px以上) */
+@media screen and (min-width: 1025px) {
+ .nav-container {
+ padding: 0 32px;
+ height: 100px;
+ }
+
+ .main-scroll {
+ padding: 24px 32px;
+ }
+
+ .category-grid {
+ grid-template-columns: repeat(5, 1fr);
+ }
+
+ .services-grid {
+ grid-template-columns: repeat(4, 1fr);
+ }
+
+ .products-grid {
+ grid-template-columns: repeat(4, 1fr);
+ }
+
+ .recommend-grid {
+ grid-template-columns: repeat(3, 1fr);
+ }
+
+ .family-grid {
+ grid-template-columns: repeat(3, 1fr);
+ }
+
+ .news-swiper {
+ height: 260px;
+ }
+}
+
+/* 大桌面端 (1400px以上) */
+@media screen and (min-width: 1400px) {
+ .category-grid {
+ grid-template-columns: repeat(5, 1fr);
+ gap: 24px;
+ }
+
+ .products-grid {
+ grid-template-columns: repeat(4, 1fr);
+ }
+
+ .recommend-grid {
+ grid-template-columns: repeat(4, 1fr);
+ }
+}
+
+/* 暗黑模式适配 */
+@media (prefers-color-scheme: dark) {
+ .medic-home {
+ background: #121212;
+ }
+
+ .smart-categories,
+ .health-news,
+ .smart-services,
+ .hot-products,
+ .family-medicine,
+ .smart-recommend {
+ background: #1e1e1e;
+ border-color: #333;
+ }
+
+ .nav-search-box {
+ background: rgba(30, 30, 30, 0.95);
+ border-color: #444;
+ }
+
+ .category-card,
+ .service-card,
+ .product-card,
+ .family-item,
+ .recommend-product {
+ background: #2d2d2d;
+ border-color: #444;
+ }
+
+ .section-title,
+ .card-name,
+ .service-name,
+ .product-name,
+ .family-name,
+ .product-title,
+ .section-desc,
+ .card-desc,
+ .service-desc,
+ .product-spec,
+ .product-specification,
+ .family-desc {
+ color: #aaa;
+ }
+
+ .sort-tab,
+ .filter-item {
+ background: #333;
+ border-color: #444;
+ color: #ccc;
+ }
+
+ .sort-tab.active,
+ .filter-item.active {
+ background: #4CAF50;
+ color: white;
+ }
+
+ .sort-tab:hover,
+ .filter-item:hover {
+ background: #444;
+ }
+
+ .sort-tab.active:hover,
+ .filter-item.active:hover {
+ background: #388E3C;
+ }
+
+ .nav-tool-item {
+ background: rgba(76, 175, 80, 0.2);
+ color: #4CAF50;
+ }
+
+ .manufacturer,
+ .sales-count,
+ .reviews-count,
+ .original-price {
+ color: #888;
+ }
+}
+
diff --git a/pages/mall/consumer/index1.uvue b/pages/mall/consumer/index1.uvue
new file mode 100644
index 00000000..a2f3c8a5
--- /dev/null
+++ b/pages/mall/consumer/index1.uvue
@@ -0,0 +1,1550 @@
+
+
+
+
+
+
+
+ 📍
+ {{ currentCity }}
+ ▼
+
+
+
+
+ 💬
+
+
+ 🛒
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ category.icon }}
+
+ {{ category.name }}
+
+
+
+
+
+
+
+
+
+ 🔍
+ 搜索商品/品牌/店铺
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ⚡
+ 限时秒杀
+
+
+ 🎫
+ 领券中心
+
+
+ 🔥
+ 每日特价
+
+
+ 🏷️
+ 品牌特卖
+
+
+ 👥
+ 拼团购
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ product.tag }}
+
+
+ ¥{{ product.price }}
+ ¥{{ product.original_price }}
+
+
+
+
+ 已抢{{ product.soldPercent }}%
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ product.tag }}
+
+
+ {{ product.name }}
+
+
+ ¥
+ {{ product.price }}
+
+
+ ¥{{ product.original_price }}
+
+
+
+ {{ product.sales }}人已买
+
+ {{ product.shop }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ product.tag }}
+
+
+ {{ product.name }}
+
+
+ ¥
+ {{ product.price }}
+
+
+ ¥{{ product.original_price }}
+
+
+
+ {{ product.sales }}人已买
+
+ {{ product.shop }}
+
+
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+ --- 我是有底线的 ---
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/mall/consumer/indexback.uvue b/pages/mall/consumer/indexback.uvue
index a2f3c8a5..f0cffee0 100644
--- a/pages/mall/consumer/indexback.uvue
+++ b/pages/mall/consumer/indexback.uvue
@@ -13,9 +13,11 @@
💬
+ {{ unreadMessageCount }}
🛒
+ {{ cartCount }}
@@ -107,35 +109,12 @@
🏷️
品牌特卖
-
- 👥
- 拼团购
-
@@ -175,16 +154,6 @@
❤️
为你推荐
-
-
- {{ option.name }}
-
-
@@ -301,6 +270,8 @@ const activeSort = ref('recommend')
const statusBarHeight = ref(0)
const scrollViewHeight = ref(0)
const scrollLeft = ref(0)
+const cartCount = ref(0)
+const unreadMessageCount = ref(3)
// 倒计时数据
const countdown = reactive({
@@ -548,6 +519,9 @@ onMounted(() => {
// 加载数据
loadMockData()
setupCountdown()
+
+ // 模拟获取购物车数量和未读消息数
+ cartCount.value = Math.floor(Math.random() * 5) + 1
})
onUnmounted(() => {
@@ -659,7 +633,7 @@ const loadMore = () => {
}
}
-// 导航函数
+// 导航函数 - 修改消息为跳转到消息tab页
const navigateToSearch = () => uni.navigateTo({ url: '/pages/mall/consumer/search' })
const navigateToCategory = (category?: any) => {
if (category) {
@@ -672,7 +646,7 @@ const navigateToProduct = (product: any) => {
uni.navigateTo({ url: `/pages/mall/consumer/product-detail?id=${product.id}` })
}
const navigateToCoupons = () => uni.navigateTo({ url: '/pages/mall/consumer/coupons' })
-const navigateToMessages = () => uni.navigateTo({ url: '/pages/mall/consumer/messages' })
+const navigateToMessages = () => uni.switchTab({ url: '/pages/mall/consumer/messages' })
const navigateToFlashSale = () => uni.navigateTo({ url: '/pages/mall/consumer/flash-sale' })
const navigateToBrand = () => uni.navigateTo({ url: '/pages/mall/consumer/brand' })
const navigateToCart = () => uni.switchTab({ url: '/pages/mall/consumer/cart' })
@@ -757,12 +731,28 @@ const navigateToGroupBuy = () => uni.navigateTo({ url: '/pages/mall/consumer/gro
justify-content: center;
width: 30px;
height: 30px;
+ position: relative;
}
.icon {
font-size: 20px;
}
+.message-badge, .cart-badge {
+ position: absolute;
+ top: -5px;
+ right: -5px;
+ background: #ff3b30;
+ color: white;
+ font-size: 10px;
+ width: 16px;
+ height: 16px;
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
/* 主内容区 */
.main-content {
background: #f5f5f5;
diff --git a/pages/mall/consumer/index松散.uvue b/pages/mall/consumer/index松散.uvue
new file mode 100644
index 00000000..5e053b49
--- /dev/null
+++ b/pages/mall/consumer/index松散.uvue
@@ -0,0 +1,1612 @@
+
+
+
+
+
+
+
+
+ 💊
+ 康乐医药商城
+
+
+ 健康生活,品质保障
+
+
+
+
+
+
+ 🔍
+
+
+ 📋
+ {{ pendingOrders }}
+
+
+ 🛒
+ {{ cartCount }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 💡
+ 今日健康小贴士:按时服药,保持良好生活习惯
+
+
+
+
+
+
+
+
+
+
+
+ {{ category.icon }}
+
+ {{ category.name }}
+
+
+
+
+
+
+
+
+
+ 🔍
+ 搜索药品/症状/品牌
+
+
+
+
+
+
+
+
+
+
+ {{ banner.title }}
+ {{ banner.desc }}
+
+
+
+
+
+
+
+
+
+ 👨⚕️
+ 在线问诊
+
+
+ 📝
+ 处方购药
+
+
+ 💊
+ 非处方药
+
+
+ 🩺
+ 健康工具
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ medicine.tag }}
+
+
+
+ {{ medicine.name }}
+ {{ medicine.specification }}
+
+
+ ¥{{ medicine.price }}
+
+ ¥{{ medicine.originalPrice }}
+
+
+
+
+ {{ medicine.manufacturer }}
+
+ 已售{{ medicine.sales }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ medicine.icon }}
+
+
+ {{ medicine.name }}
+ {{ medicine.use }}
+
+
+
+ 加入清单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ medicine.specification }}
+
+
+ {{ medicine.manufacturer }}
+
+
+
+
+ ¥{{ medicine.price }}
+
+ ¥{{ medicine.originalPrice }}
+
+
+
+
+ 🛒
+
+
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+ --- 已显示全部药品 ---
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/mall/consumer/index紧凑.uvue b/pages/mall/consumer/index紧凑.uvue
new file mode 100644
index 00000000..a6d2b56b
--- /dev/null
+++ b/pages/mall/consumer/index紧凑.uvue
@@ -0,0 +1,1793 @@
+
+
+
+
+
+
+
+
+ 💊
+ 康乐医药商城
+
+
+ 健康生活,品质保障
+
+
+
+
+
+
+ 🔍
+
+
+ 📋
+ {{ pendingOrders }}
+
+
+ 🛒
+ {{ cartCount }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 💡
+ 今日健康小贴士:按时服药,保持良好生活习惯
+
+
+
+
+
+
+
+
+
+
+
+ {{ category.icon }}
+
+ {{ category.name }}
+
+
+
+
+
+
+
+ {{ category.icon }}
+
+ {{ category.name }}
+
+
+
+
+
+
+
+
+
+ 🔍
+ 搜索药品/症状/品牌
+
+
+
+
+
+
+
+
+
+
+ {{ banner.title }}
+ {{ banner.desc }}
+
+
+
+
+
+
+
+
+
+ 👨⚕️
+ 在线问诊
+
+
+ 📝
+ 处方购药
+
+
+ 💊
+ 非处方药
+
+
+ 🩺
+ 健康工具
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ medicine.tag }}
+
+
+
+ {{ medicine.name }}
+ {{ medicine.specification }}
+
+
+ ¥{{ medicine.price }}
+
+ ¥{{ medicine.originalPrice }}
+
+
+
+
+ {{ medicine.manufacturer }}
+
+ 已售{{ medicine.sales }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ medicine.icon }}
+
+
+ {{ medicine.name }}
+ {{ medicine.use }}
+
+
+
+ 加入清单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ medicine.specification }}
+
+
+ {{ medicine.manufacturer }}
+
+
+
+
+ ¥{{ medicine.price }}
+
+ ¥{{ medicine.originalPrice }}
+
+
+
+
+ 🛒
+
+
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+ --- 已显示全部药品 ---
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/mall/consumer/messages - 副本.uvue b/pages/mall/consumer/messages - 副本.uvue
new file mode 100644
index 00000000..a5e69b8b
--- /dev/null
+++ b/pages/mall/consumer/messages - 副本.uvue
@@ -0,0 +1,634 @@
+
+
+
+
+
+
+
+
+
+ {{ tab.name }}
+ {{ tab.unread }}
+
+
+
+
+
+
+
+
+
+ 📢
+
+
+
+ {{ message.content }}
+
+
+
+
+
+
+
+
+ 📦
+
+
+
+ {{ message.content }}
+ 订单号: {{ message.order_no }}
+
+
+
+
+
+
+
+
+
+ 💁
+
+
+
+ {{ message.content }}
+
+
+
+
+
+
+
+
+ 🎁
+
+
+
+ {{ message.content }}
+
+ {{ message.coupon }}优惠券
+
+
+
+
+
+
+
+ 💬
+ 暂无消息
+ 暂时没有新消息
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/mall/consumer/messages.uvue b/pages/mall/consumer/messages.uvue
index a5e69b8b..c747221a 100644
--- a/pages/mall/consumer/messages.uvue
+++ b/pages/mall/consumer/messages.uvue
@@ -3,13 +3,13 @@
-
+
+
+
+
+
+
+ 专业医药顾问在线解答,服务时间 9:00-22:00
+
+
+
+ 💊
+ 用药咨询
+
+
+ 📋
+ 处方咨询
+
+
+ ⚠️
+ 副作用咨询
+
+
+ 🚚
+ 药品配送
+
+
+
+
+
+
+
+
+
+ {{ message.icon }}
+
+
+
+
+
+
+ {{ message.content }}
+ {{ message.lastMessage }}
+
+
+ {{ tag }}
+
+
+
+
+
+
+ 💡
+ 温馨提示:请勿相信任何要求转账、付款的信息,谨防诈骗
+
+
+
{{ message.time }}
{{ message.content }}
+ 重要
@@ -69,33 +147,9 @@
{{ message.content }}
订单号: {{ message.order_no }}
-
-
-
-
-
-
-
-
-
- 💁
-
-
-
@@ -117,15 +171,16 @@
{{ message.time }}
{{ message.content }}
-
+
{{ message.coupon }}优惠券
+ 有效期至 {{ message.expiry }}
-
+
💬
暂无消息
暂时没有新消息
@@ -134,9 +189,9 @@
-
@@ -145,18 +200,102 @@
+
+
diff --git a/pages/mall/consumer/search.uvue b/pages/mall/consumer/search.uvue
index 82d46a6b..feeea53d 100644
--- a/pages/mall/consumer/search.uvue
+++ b/pages/mall/consumer/search.uvue
@@ -1,13 +1,513 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ item }}
+ ×
+
+
+
+
+
+
+
+
+
+ {{ index + 1 }}
+ {{ item.keyword }}
+ 🔥
+
+
+
+
+
+
+
+
+
+
+ {{ category.icon }}
+
+ {{ category.name }}
+
+
+
+
+
+
+
+
+ 🔍
+ {{ suggestion }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ product.name }}
+ {{ product.specification }}
+
+
+ {{ product.manufacturer }}
+ 已售{{ product.sales }}
+
+
+
+
+ ¥
+ {{ product.price }}
+
+
+ ¥{{ product.originalPrice }}
+
+
+
+
+ {{ product.tag }}
+ {{ product.featured }}
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+ --- 没有更多了 ---
+
+
+
+
+
+ 🔍
+ 暂无搜索结果
+ 换个关键词试试吧
+
+
+
+
+
-
\ No newline at end of file
+.search-page {
+ width: 100%;
+ min-height: 100vh;
+ background: #f8fafc;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe
diff --git a/utils/mock-category-data.uts b/utils/mock-category-data.uts
new file mode 100644
index 00000000..e00bebc0
--- /dev/null
+++ b/utils/mock-category-data.uts
@@ -0,0 +1,271 @@
+// 分类页面mock数据模块
+// 导出医药分类数据
+export const medicineCategories = [
+ { id: 'cold', name: '感冒发烧', icon: '🤧', desc: '解热镇痛', color: '#2196F3' },
+ { id: 'stomach', name: '肠胃用药', icon: '🤢', desc: '消化系统', color: '#4CAF50' },
+ { id: 'pain', name: '止痛消炎', icon: '💊', desc: '镇痛消炎', color: '#F44336' },
+ { id: 'skin', name: '皮肤用药', icon: '🤕', desc: '皮肤护理', color: '#9C27B0' },
+ { id: 'vitamin', name: '维生素', icon: '🍊', desc: '营养补充', color: '#FF9800' },
+ { id: 'chronic', name: '慢性病', icon: '🫀', desc: '长期管理', color: '#795548' },
+ { id: 'child', name: '儿童用药', icon: '👶', desc: '儿童专用', color: '#00BCD4' },
+ { id: 'external', name: '外用药品', icon: '🧴', desc: '外用制剂', color: '#8BC34A' },
+ { id: 'device', name: '医疗器械', icon: '🩺', desc: '医疗设备', color: '#607D8B' },
+ { id: 'health', name: '健康食品', icon: '🥗', desc: '保健食品', color: '#FFC107' }
+]
+
+// 导出mock商品数据
+export const mockProducts = {
+ cold: [
+ {
+ id: 'cold1',
+ name: '布洛芬缓释胶囊',
+ specification: '0.3g*24粒',
+ price: 18.5,
+ originalPrice: 25.8,
+ image: '/static/images/default-product.png',
+ manufacturer: '修正药业',
+ sales: 2560,
+ badge: '热销'
+ },
+ {
+ id: 'cold2',
+ name: '板蓝根颗粒',
+ specification: '10g*20袋',
+ price: 22.8,
+ originalPrice: 29.9,
+ image: '/static/images/default-product.png',
+ manufacturer: '白云山',
+ sales: 1890,
+ badge: '推荐'
+ },
+ {
+ id: 'cold3',
+ name: '连花清瘟胶囊',
+ specification: '0.35g*36粒',
+ price: 42.8,
+ originalPrice: 48.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '以岭药业',
+ sales: 3200,
+ badge: '爆款'
+ },
+ {
+ id: 'cold4',
+ name: '对乙酰氨基酚片',
+ specification: '0.5g*12片',
+ price: 8.9,
+ originalPrice: 12.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '强生制药',
+ sales: 1420,
+ badge: '特价'
+ },
+ {
+ id: 'cold5',
+ name: '感冒清热颗粒',
+ specification: '3g*10袋',
+ price: 16.5,
+ originalPrice: 19.9,
+ image: '/static/images/default-product.png',
+ manufacturer: '同仁堂',
+ sales: 980,
+ badge: '新品'
+ },
+ {
+ id: 'cold6',
+ name: '复方氨酚烷胺片',
+ specification: '10片/盒',
+ price: 12.8,
+ originalPrice: 15.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '三九医药',
+ sales: 1650,
+ badge: '家庭装'
+ }
+ ],
+
+ stomach: [
+ {
+ id: 'stomach1',
+ name: '胃康灵胶囊',
+ specification: '0.4g*24粒',
+ price: 32.8,
+ originalPrice: 38.5,
+ image: '/static/images/default-product.png',
+ manufacturer: '三九医药',
+ sales: 890,
+ badge: '热销'
+ },
+ {
+ id: 'stomach2',
+ name: '奥美拉唑肠溶胶囊',
+ specification: '20mg*14粒',
+ price: 28.5,
+ originalPrice: 35.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '阿斯利康',
+ sales: 1250,
+ badge: '处方药'
+ },
+ {
+ id: 'stomach3',
+ name: '健胃消食片',
+ specification: '0.8g*32片',
+ price: 15.9,
+ originalPrice: 19.9,
+ image: '/static/images/default-product.png',
+ manufacturer: '江中制药',
+ sales: 2100,
+ badge: '推荐'
+ },
+ {
+ id: 'stomach4',
+ name: '蒙脱石散',
+ specification: '3g*10袋',
+ price: 18.6,
+ originalPrice: 22.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '益普生',
+ sales: 1780,
+ badge: '止泻'
+ },
+ {
+ id: 'stomach5',
+ name: '多潘立酮片',
+ specification: '10mg*30片',
+ price: 22.8,
+ originalPrice: 26.5,
+ image: '/static/images/default-product.png',
+ manufacturer: '西安杨森',
+ sales: 950,
+ badge: '促消化'
+ },
+ {
+ id: 'stomach6',
+ name: '铝碳酸镁咀嚼片',
+ specification: '0.5g*20片',
+ price: 25.9,
+ originalPrice: 29.9,
+ image: '/static/images/default-product.png',
+ manufacturer: '拜耳',
+ sales: 1320,
+ badge: '护胃'
+ }
+ ],
+
+ pain: [
+ {
+ id: 'pain1',
+ name: '阿莫西林胶囊',
+ specification: '0.25g*24粒',
+ price: 28.5,
+ originalPrice: 35.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '华北制药',
+ sales: 1560,
+ badge: '处方药'
+ },
+ {
+ id: 'pain2',
+ name: '双氯芬酸钠缓释片',
+ specification: '75mg*10片',
+ price: 19.8,
+ originalPrice: 24.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '诺华制药',
+ sales: 1280,
+ badge: '止痛'
+ },
+ {
+ id: 'pain3',
+ name: '云南白药胶囊',
+ specification: '0.25g*32粒',
+ price: 35.9,
+ originalPrice: 42.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '云南白药',
+ sales: 2350,
+ badge: '经典'
+ },
+ {
+ id: 'pain4',
+ name: '塞来昔布胶囊',
+ specification: '0.2g*10粒',
+ price: 48.6,
+ originalPrice: 55.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '辉瑞',
+ sales: 890,
+ badge: '抗炎'
+ },
+ {
+ id: 'pain5',
+ name: '布洛芬片',
+ specification: '0.1g*24片',
+ price: 12.5,
+ originalPrice: 15.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '中美史克',
+ sales: 1680,
+ badge: '经济装'
+ },
+ {
+ id: 'pain6',
+ name: '头孢克肟胶囊',
+ specification: '0.1g*6粒',
+ price: 32.8,
+ originalPrice: 38.0,
+ image: '/static/images/default-product.png',
+ manufacturer: '广州白云山',
+ sales: 1120,
+ badge: '抗生素'
+ }
+ ]
+}
+
+// 为其他分类生成默认商品数据
+export const generateDefaultProducts = (categoryId: string) => {
+ const baseProducts = [
+ { name: '通用药品1', price: 25.8, manufacturer: '知名药企', sales: 1200 },
+ { name: '通用药品2', price: 18.5, manufacturer: '知名药企', sales: 950 },
+ { name: '通用药品3', price: 32.0, manufacturer: '知名药企', sales: 1450 },
+ { name: '通用药品4', price: 22.8, manufacturer: '知名药企', sales: 880 },
+ { name: '通用药品5', price: 28.9, manufacturer: '知名药企', sales: 1100 },
+ { name: '通用药品6', price: 19.9, manufacturer: '知名药企', sales: 920 }
+ ]
+
+ return baseProducts.map((product, index) => ({
+ id: `${categoryId}${index + 1}`,
+ ...product,
+ specification: '规格待定',
+ originalPrice: product.price * 1.2,
+ image: '/static/images/default-product.png',
+ badge: index === 0 ? '热销' : index === 1 ? '推荐' : ''
+ }))
+}
+
+// 获取分类商品数据
+export const getCategoryProducts = (categoryId: string) => {
+ if (mockProducts[categoryId]) {
+ return mockProducts[categoryId]
+ } else {
+ return generateDefaultProducts(categoryId)
+ }
+}
+
+// 获取分类信息
+export const getCategoryInfo = (categoryId: string) => {
+ const category = medicineCategories.find(cat => cat.id === categoryId)
+ if (category) {
+ return {
+ name: category.name,
+ desc: category.desc
+ }
+ } else {
+ // 返回默认分类信息
+ return {
+ name: '感冒发烧',
+ desc: '解热镇痛'
+ }
+ }
+}