diff --git a/.gitignore b/.gitignore index 8856bc6..683e3f5 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,4 @@ dist .pnp.* /.hbuilderx/ /.idea/ +/database/ diff --git a/pages/home/home.vue b/pages/home/home.vue index 4df0295..6c3f9ea 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -23,6 +23,33 @@ + + + + + + + + + + + + {{ zone.title }} + + + + + @@ -106,87 +133,42 @@ - 热销商品 + {{ topProductsTitle }} 更多 - - - - - OTC非处方药 - - - - - - - {{item.drug.drug_name}} - OTC - - {{item.drug.specification}} - - - - ¥ - {{item.price || (item.drug.drugStoreDrug ? item.drug.drugStoreDrug.price : '0.00')}} - - 购买 + + + + + + + + + {{ item.drug.drug_name }} + OTC + {{ item.drug.specification }} - - - - - - - 处方药 - - - - - - - {{item.drug.drug_name}} - Rx - - {{item.drug.specification}} - - - - ¥ - {{item.price || (item.drug.drugStoreDrug ? item.drug.drugStoreDrug.price : '0.00')}} - - 购买 - - - - - - - - - 保健食品 - - - - - - - {{item.drug.drug_name}} - 保健 - - {{item.drug.specification}} - - - - ¥ - {{item.price || (item.drug.drugStoreDrug ? item.drug.drugStoreDrug.price : '0.00')}} - - 购买 + + + ¥ + + {{ item.price || (item.drug.drugStoreDrug ? item.drug.drugStoreDrug.price : '0.00') }} + + 购买 @@ -194,7 +176,7 @@ - + @@ -266,7 +248,7 @@ import { storeList } from '../../request/api/api' import { getPlatformQualificationsApi } from '../../request/api/platform' -import { getStoreDrugListBySalespersonApi, getHomeTopProductsApi } from "@/request/api/product"; +import { getStoreDrugListBySalespersonApi, getHomeTopProductsApi, getHomeZonesApi } from "@/request/api/product"; export default { data() { @@ -276,11 +258,9 @@ export default { storeinfo: [], doctorList: [], productList: [], // 存储药品列表数据 - topProducts: { - otc: [], - prescription: [], - health_food: [] - }, // 首页热销商品 + homeZones: [], // 首页专区入口 + topProductsTitle: '热销商品', + topProductsList: [], // 首页热销商品(OTC) qualifications: [], // 资质证明列表 show: true, showed: false, @@ -549,11 +529,25 @@ export default { getHomeTopProductsApi({ store_id: uni.getStorageSync('store_id') || '11001', }).then((res) => { - if (res.data.code == 0) { - this.topProducts = res.data.result; + if (res.data.code == 0 && res.data.result) { + const result = res.data.result; + this.topProductsTitle = result.title || '热销商品'; + this.topProductsList = result.list || []; } }) }, + // 获取首页专区入口 + getHomeZones() { + getHomeZonesApi({ + store_id: uni.getStorageSync('store_id') || '11001', + }).then((res) => { + if (res.data.code == 0) { + this.homeZones = res.data.result || res.data.data || []; + } + }).catch(() => { + this.homeZones = []; + }) + }, // 获取平台资质证明 getPlatformQualifications() { getPlatformQualificationsApi({ @@ -565,7 +559,7 @@ export default { }).catch(() => { // 如果接口不存在,使用默认数据 this.qualifications = [ - { name: '药品经营许可证', image: '', type: 1 }, + { name: '互联网药品经营许可证', image: '', type: 1 }, { name: '营业执照', image: '', type: 2 }, { name: '医疗器械经营许可证', image: '', type: 3 }, { name: '食品经营许可证', image: '', type: 4 }, @@ -579,6 +573,13 @@ export default { url: `/subPackages/product/symptoms?id=${item.drug.id}&drug_name=${item.drug.drug_name}&is_otc=${item.drug.is_otc}&image=${item.drug.image}&price=${item.price}` }); }, + // 跳转专区商品列表 + goZoneList(zone) { + if (!zone || !zone.type) return; + uni.navigateTo({ + url: `/subPackages/product/product?zone_type=${zone.type}`, + }); + }, // 直接购买 buyProduct(item) { uni.navigateTo({ @@ -621,6 +622,7 @@ export default { this.getProductList(); // 每次显示页面刷新商品列表 this.getHomeTopProducts(); // 获取首页热销商品 this.getPlatformQualifications(); // 获取平台资质证明 + this.getHomeZones(); // 获取首页专区入口 }, } @@ -689,6 +691,118 @@ export default { height: 300rpx; } + // 2.5 首页专区入口区域 - 水平滚动样式 + .zone-entry-section { + width: 100%; + margin: 30rpx 0; + padding: 30rpx 0; + background: linear-gradient(180deg, #EEF4FF 0%, #F3F7FF 100%); + position: relative; + overflow: hidden; + + .zone-scroll { + width: 100%; + white-space: nowrap; + + .zone-list { + display: inline-flex; + padding: 0 30rpx; + gap: 30rpx; + } + + .zone-item { + display: inline-flex; + flex-direction: column; + align-items: center; + position: relative; + flex-shrink: 0; + padding-bottom: 10rpx; + transition: transform 0.2s ease; + + &:active { + transform: scale(0.95); + } + + .zone-image-wrapper { + width: 140rpx; + height: 140rpx; + position: relative; + margin-bottom: 16rpx; + display: flex; + align-items: center; + justify-content: center; + padding: 8rpx; + + // 不规则形状背景 - 使用border-radius创建云朵/气泡效果 + &::before { + content: ''; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(255, 255, 255, 0.95); + // 使用不规则border-radius创建云朵形状 + border-radius: 65% 35% 55% 45% / 45% 65% 35% 55%; + z-index: 0; + box-shadow: 0 4rpx 16rpx rgba(65, 117, 238, 0.12); + transition: box-shadow 0.3s ease; + } + + // 添加第二个不规则层增加层次感 + &::after { + content: ''; + position: absolute; + top: -4rpx; + left: -4rpx; + right: -4rpx; + bottom: -4rpx; + background: rgba(227, 242, 253, 0.4); + border-radius: 60% 40% 65% 35% / 40% 60% 40% 60%; + z-index: -1; + filter: blur(8rpx); + } + + .zone-image { + width: 100%; + height: 100%; + border-radius: 50%; + object-fit: cover; + position: relative; + z-index: 1; + background: #f5f5f5; + } + + .zone-image-placeholder { + width: 100%; + height: 100%; + border-radius: 50%; + background: #E3F2FD; + display: flex; + align-items: center; + justify-content: center; + position: relative; + z-index: 1; + + .iconfont { + font-size: 60rpx; + color: #4175EE; + } + } + } + + .zone-label { + font-size: 28rpx; + color: #333; + font-weight: 500; + text-align: center; + white-space: nowrap; + line-height: 1.4; + } + } + } + } + // 3. 导航栏样式优化:结合V1布局结构和原版背景图 .nav { width: 710rpx; diff --git a/pages/index/platform-info.vue b/pages/index/platform-info.vue index c2b346e..4156628 100644 --- a/pages/index/platform-info.vue +++ b/pages/index/platform-info.vue @@ -88,7 +88,7 @@ export default { }).catch(() => { // 如果接口不存在,使用默认数据 this.qualifications = [ - { name: '药品经营许可证', image: '', type: 1 }, + { name: '互联网药品经营许可证', image: '', type: 1 }, { name: '营业执照', image: '', type: 2 }, { name: '医疗器械经营许可证', image: '', type: 3 }, { name: '食品经营许可证', image: '', type: 4 }, diff --git a/request/api/order.js b/request/api/order.js index d279880..1f108d3 100644 --- a/request/api/order.js +++ b/request/api/order.js @@ -1,28 +1,10 @@ -import http from './request' -import {get, post, uploadFile} from './http' +import {post} from './http' -const prefix = '/order'; /** - * 获取扫码诊所的商品详情 + * 查询订单的处方状态 * @param params * @returns {Promise<*>} */ -export async function genOrderApi(params) { - return await post(`${prefix}/gen-order`, params, 3) -} -/** - * 创建订单 - 购物车 - * @param params - * @returns {Promise<*>} - */ -export async function genOrderByCartApi(params) { - return await post(`${prefix}/gen-order-by-cart`, params, 3) -} -/** - * 保存购药、复诊状态下的挂号信息 - * @param params - * @returns {Promise<*>} - */ -export async function saveRegisterInfoApi(params) { - return await post(`${prefix}/save-register-info`, params, 3) +export async function getPrescriptionStatusApi(params) { + return await post('/order/prescription-status', params, 3) } diff --git a/request/api/product.js b/request/api/product.js index c4ccbd6..598788e 100644 --- a/request/api/product.js +++ b/request/api/product.js @@ -32,6 +32,14 @@ export async function getOrderTextApi(params) { export async function getHomeTopProductsApi(params) { return await get('/product/home-top-products', params, 3) } +/** + * 获取首页专区入口配置 + * @param params + * @returns {Promise<*>} + */ +export async function getHomeZonesApi(params) { + return await get('/product/home-zones', params, 3) +} /** * 更新商品介绍图 * @param params diff --git a/subPackages/product/product.vue b/subPackages/product/product.vue index 1a01661..9305988 100644 --- a/subPackages/product/product.vue +++ b/subPackages/product/product.vue @@ -68,7 +68,7 @@