From 43a87ccc8733abbed0127f8d4eea841b146a0a88 Mon Sep 17 00:00:00 2001 From: lq Date: Wed, 31 Dec 2025 10:58:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5UI=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/home.vue | 43 ++++++++++++++++++++++++++++------- pages/index/platform-info.vue | 30 +++++++++++++++++------- 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/pages/home/home.vue b/pages/home/home.vue index ab0d282..2368205 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -472,14 +472,25 @@ export default { store_id: uni.getStorageSync('store_id') || '11001', }).then((res) => { if (res.data.code == 0 || res.data.errcode == 0) { - this.qualifications = res.data.data || res.data.result || []; + const result = res.data.data || res.data.result || {}; + // 适配新的返回格式(包含 store_name 和 list) + if (result.store_name !== undefined) { + this.qualifications = result.list || []; + } else { + // 兼容旧格式(直接返回数组) + this.qualifications = Array.isArray(result) ? result : []; + } } }) }, previewQualification(item) { - if (item.image) { + // 获取所有有图片的资质,支持滑动预览 + const allImages = this.qualifications + .filter(q => q.image) + .map(q => q.image); + if (allImages.length > 0 && item.image) { uni.previewImage({ - urls: [item.image], + urls: allImages, current: item.image }); } @@ -631,7 +642,7 @@ $card-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.04); &::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: linear-gradient(90deg, #FDFEFF 0%, rgba(255,255,255,0) 100%); z-index: 1; } .nav-content { position: relative; z-index: 2; .nav-title { font-size: 36rpx; font-weight: 800; margin-bottom: 8rpx; } .nav-desc { font-size: 22rpx; color: #888; } } .nav-icon-img { position: absolute; right: 0; bottom: 0; width: 128rpx; height: 128rpx; z-index: 1; } - .nav-icon-img-64 { position: absolute; right: 30rpx; top: 30rpx; width: 64rpx; height: 64rpx; z-index: 1; } + .nav-icon-img-64 { position: absolute; right: 30rpx; top: 30rpx; width: 84rpx; height: 84rpx; z-index: 1; } } } @@ -723,11 +734,27 @@ $card-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.04); .qualifications-section { padding: 0 32rpx 40rpx; .qualifications-row { - display: flex; gap: 20rpx; + display: flex; + flex-wrap: wrap; + gap: 20rpx; .qualification-card { - background: #fff; padding: 20rpx; border-radius: 16rpx; width: 160rpx; text-align: center; box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.03); display: flex; flex-direction: column; align-items: center; - .qual-icon { width: 48rpx; height: 48rpx; margin-bottom: 8rpx; } - .qual-name { font-size: 20rpx; color: #666; line-height: 1.2; } + background: #fff; + padding: 24rpx; + border-radius: 16rpx; + width: calc((100% - 20rpx) / 2); /* 一行两个 */ + text-align: center; + box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.03); + display: flex; + flex-direction: column; + align-items: center; + .qual-icon { + width: 200rpx; + height: 140rpx; + margin-bottom: 16rpx; + border-radius: 8rpx; + background: #f8f8f8; + } + .qual-name { font-size: 24rpx; color: #333; line-height: 1.4; font-weight: 500; } } } } diff --git a/pages/index/platform-info.vue b/pages/index/platform-info.vue index 52f1154..f4d898e 100644 --- a/pages/index/platform-info.vue +++ b/pages/index/platform-info.vue @@ -2,9 +2,9 @@ - {{ isPlatform ? '平台资质证明' : '店铺资质证明' }} + {{ storeName || (isPlatform ? '萧康云医' : '店铺') }} - 资质证明 - + {{ item.name }} @@ -61,6 +61,7 @@ export default { return { storeId: '', // 店铺ID,0表示平台 isPlatform: false, // 是否为平台资质 + storeName: '', // 店铺名称 qualifications: [], contactInfo: { phone: '', @@ -98,7 +99,15 @@ export default { store_id: this.storeId, }).then((res) => { if (res.data.code == 0 || res.data.errcode == 0) { - this.qualifications = res.data.data || res.data.result || []; + const result = res.data.data || res.data.result || {}; + // 适配新的返回格式(包含 store_name 和 list) + if (result.store_name !== undefined) { + this.storeName = result.store_name || ''; + this.qualifications = result.list || []; + } else { + // 兼容旧格式(直接返回数组) + this.qualifications = Array.isArray(result) ? result : []; + } } }).catch(() => { // 如果接口不存在,使用默认数据 @@ -129,12 +138,17 @@ export default { // 接口不存在时使用空数据 }) }, - // 预览资质图片 - previewImage(image) { - if (image) { + // 预览资质图片,支持滑动查看所有资质 + previewImage(index) { + // 获取所有有图片的资质 + const allImages = this.qualifications + .filter(q => q.image) + .map(q => q.image); + if (allImages.length > 0) { + const currentImage = this.qualifications[index]?.image; uni.previewImage({ - urls: [image], - current: image + urls: allImages, + current: currentImage || allImages[0] }); } },