|
|
@@ -51,37 +51,47 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 底部占位 -->
|
|
|
- <view class="bottom-spacer"></view>
|
|
|
-
|
|
|
- <!-- 菌群测评商品 -->
|
|
|
- <view class="product-section" v-if="recommendedProducts.length > 0">
|
|
|
- <view class="product-header">
|
|
|
- <text class="product-header-icon">📦</text>
|
|
|
- <text class="product-header-title">为家人购买检测服务</text>
|
|
|
+ <!-- 上传说明 -->
|
|
|
+ <view class="guide-section">
|
|
|
+ <view class="guide-header">
|
|
|
+ <text class="guide-header-icon">📖</text>
|
|
|
+ <text class="guide-header-title">可上传的报告类型</text>
|
|
|
</view>
|
|
|
- <view class="product-grid">
|
|
|
- <view
|
|
|
- class="product-card"
|
|
|
- v-for="item in recommendedProducts"
|
|
|
- :key="item.id"
|
|
|
- @click="goToProduct(item.id)"
|
|
|
- >
|
|
|
- <image class="product-cover" :src="getImageUrl(item.coverImage) || '/static/default-product.png'" mode="aspectFill" />
|
|
|
- <text class="product-name">{{ item.name }}</text>
|
|
|
- <text class="product-price">{{ formatPriceWithSymbol(item.price) }}</text>
|
|
|
- <view class="product-btn">
|
|
|
- <text class="product-btn-text">去购买</text>
|
|
|
+ <view class="guide-list">
|
|
|
+ <view class="guide-item">
|
|
|
+ <view class="guide-icon-box guide-icon-blue"><text class="guide-icon">📄</text></view>
|
|
|
+ <view class="guide-info">
|
|
|
+ <text class="guide-name">体检报告</text>
|
|
|
+ <text class="guide-desc">血常规、尿常规、生化检验等,支持 PDF 或清晰照片</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="guide-item">
|
|
|
+ <view class="guide-icon-box guide-icon-green"><text class="guide-icon">🦠</text></view>
|
|
|
+ <view class="guide-info">
|
|
|
+ <text class="guide-name">肠道菌群检测报告</text>
|
|
|
+ <text class="guide-desc">支持 PDF 或清晰照片,AI 自动解读菌群健康</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="guide-item">
|
|
|
+ <view class="guide-icon-box guide-icon-orange"><text class="guide-icon">👅</text></view>
|
|
|
+ <view class="guide-info">
|
|
|
+ <text class="guide-name">舌象照片</text>
|
|
|
+ <text class="guide-desc">拍摄舌象照片,AI 辅助舌诊分析</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="guide-tips">
|
|
|
+ <text class="guide-tips-title">温馨提示</text>
|
|
|
+ <text class="guide-tips-item">· 单次上传 1 个文件,支持 PDF / JPG / PNG 格式</text>
|
|
|
+ <text class="guide-tips-item">· 拍照时请保持光线充足,确保报告内容完整清晰</text>
|
|
|
+ <text class="guide-tips-item">· 上传后由 AI 自动解析,解析结果可在线编辑确认</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getProductsByDomain, uploadReportOnly } from '../../utils/api.js'
|
|
|
-import config from '@/config.js'
|
|
|
+import { uploadReportOnly } from '../../utils/api.js'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -90,18 +100,11 @@ export default {
|
|
|
uploading: false,
|
|
|
selectedFile: null,
|
|
|
photoPath: null,
|
|
|
- agreedToTerms: false,
|
|
|
- // 购买推荐
|
|
|
- recommendedProducts: [],
|
|
|
- loadingProducts: false
|
|
|
+ agreedToTerms: false
|
|
|
}
|
|
|
},
|
|
|
onLoad: function(options) {
|
|
|
this.memberId = options.memberId ? parseInt(options.memberId) : null
|
|
|
- this.loadRecommendProducts()
|
|
|
- },
|
|
|
- onShow: function() {
|
|
|
- this.loadRecommendProducts()
|
|
|
},
|
|
|
methods: {
|
|
|
// 未勾选声明时弹窗确认
|
|
|
@@ -184,48 +187,8 @@ export default {
|
|
|
uni.showToast({ title: msg, icon: 'none' })
|
|
|
})
|
|
|
},
|
|
|
- loadRecommendProducts: function() {
|
|
|
- var self = this
|
|
|
- self.loadingProducts = true
|
|
|
- // 直接按身体维度加载推荐商品(商城已有的 domain 筛选器)
|
|
|
- getProductsByDomain('body', 1, 4).then(function(res) {
|
|
|
- if (res && res.data && res.data.records) {
|
|
|
- self.recommendedProducts = res.data.records
|
|
|
- } else {
|
|
|
- self.recommendedProducts = []
|
|
|
- }
|
|
|
- }).catch(function() {
|
|
|
- self.recommendedProducts = []
|
|
|
- }).finally(function() {
|
|
|
- self.loadingProducts = false
|
|
|
- })
|
|
|
- },
|
|
|
- goToProduct: function(productId) {
|
|
|
- // 直接进入结算页,跳过商品详情页
|
|
|
- var product = this.recommendedProducts.find(function(p) { return p.id === productId })
|
|
|
- if (product) {
|
|
|
- var productData = {
|
|
|
- productId: product.id,
|
|
|
- productName: product.name,
|
|
|
- coverImage: product.coverImage || '',
|
|
|
- unitPrice: product.price || 0,
|
|
|
- quantity: 1
|
|
|
- }
|
|
|
- uni.setStorageSync('checkoutItems', [productData])
|
|
|
- uni.navigateTo({ url: '/pages/shop/checkout/checkout?from=report_upload&id=' + productId })
|
|
|
- } else {
|
|
|
- uni.navigateTo({ url: '/pages/discover-detail/product-detail/product-detail?id=' + productId })
|
|
|
- }
|
|
|
- },
|
|
|
- formatPriceWithSymbol: function(cents) {
|
|
|
- if (cents === null || cents === undefined) return '¥0'
|
|
|
- return '¥' + (cents / 100).toFixed(2)
|
|
|
- },
|
|
|
goBack() {
|
|
|
uni.navigateBack()
|
|
|
- },
|
|
|
- getImageUrl: function(path) {
|
|
|
- return config.API_BASE_URL + path
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -428,76 +391,99 @@ export default {
|
|
|
box-shadow: 0 4rpx 12rpx rgba(234, 88, 12, 0.25);
|
|
|
}
|
|
|
|
|
|
-/* ===== 菌群测评商品 ===== */
|
|
|
-.product-section {
|
|
|
+/* ===== 上传说明 ===== */
|
|
|
+.guide-section {
|
|
|
margin: 0 30rpx 30rpx;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ padding: 28rpx 24rpx;
|
|
|
+ box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
|
|
|
}
|
|
|
-.product-header {
|
|
|
+.guide-header {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
align-items: center;
|
|
|
- margin-bottom: 16rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
}
|
|
|
-.product-header-icon {
|
|
|
- font-size: 28rpx;
|
|
|
- margin-right: 8rpx;
|
|
|
+.guide-header-icon {
|
|
|
+ font-size: 30rpx;
|
|
|
+ margin-right: 10rpx;
|
|
|
}
|
|
|
-.product-header-title {
|
|
|
- font-size: 26rpx;
|
|
|
+.guide-header-title {
|
|
|
+ font-size: 28rpx;
|
|
|
font-weight: bold;
|
|
|
color: #333;
|
|
|
}
|
|
|
-.product-grid {
|
|
|
+.guide-list {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+.guide-item {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
- flex-wrap: wrap;
|
|
|
- gap: 16rpx;
|
|
|
+ align-items: center;
|
|
|
+ padding: 16rpx 0;
|
|
|
+ border-bottom: 1rpx solid #F0F0F0;
|
|
|
}
|
|
|
-.product-card {
|
|
|
- width: calc(50% - 8rpx);
|
|
|
- background: #fff;
|
|
|
+.guide-item:last-of-type {
|
|
|
+ border-bottom: none;
|
|
|
+}
|
|
|
+.guide-icon-box {
|
|
|
+ width: 72rpx;
|
|
|
+ height: 72rpx;
|
|
|
border-radius: 16rpx;
|
|
|
- padding: 20rpx;
|
|
|
- box-sizing: border-box;
|
|
|
- box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-right: 20rpx;
|
|
|
}
|
|
|
-.product-card:active {
|
|
|
- opacity: 0.85;
|
|
|
+.guide-icon {
|
|
|
+ font-size: 36rpx;
|
|
|
}
|
|
|
-.product-cover {
|
|
|
- width: 100%;
|
|
|
- height: 160rpx;
|
|
|
- border-radius: 10rpx;
|
|
|
- background: #F1F5F9;
|
|
|
- margin-bottom: 12rpx;
|
|
|
+.guide-icon-blue {
|
|
|
+ background: #E3F2FD;
|
|
|
}
|
|
|
-.product-name {
|
|
|
- display: block;
|
|
|
- font-size: 24rpx;
|
|
|
- color: #333;
|
|
|
- font-weight: 500;
|
|
|
- line-height: 1.3;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- white-space: nowrap;
|
|
|
- margin-bottom: 6rpx;
|
|
|
+.guide-icon-green {
|
|
|
+ background: #E8F5E9;
|
|
|
}
|
|
|
-.product-price {
|
|
|
- display: block;
|
|
|
+.guide-icon-orange {
|
|
|
+ background: #FFF3E0;
|
|
|
+}
|
|
|
+.guide-info {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+.guide-name {
|
|
|
font-size: 26rpx;
|
|
|
- color: #EF4444;
|
|
|
- font-weight: bold;
|
|
|
- margin-bottom: 12rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 4rpx;
|
|
|
}
|
|
|
-.product-btn {
|
|
|
- background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
|
|
|
- border-radius: 8rpx;
|
|
|
- padding: 12rpx 0;
|
|
|
- text-align: center;
|
|
|
+.guide-desc {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #94A3B8;
|
|
|
+ line-height: 1.4;
|
|
|
+}
|
|
|
+.guide-tips {
|
|
|
+ background: #F8FAFC;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ padding: 16rpx 20rpx;
|
|
|
+ margin-top: 16rpx;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
}
|
|
|
-.product-btn-text {
|
|
|
+.guide-tips-title {
|
|
|
font-size: 24rpx;
|
|
|
- color: #fff;
|
|
|
- font-weight: 500;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #5B9BD5;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+}
|
|
|
+.guide-tips-item {
|
|
|
+ font-size: 22rpx;
|
|
|
+ color: #64748B;
|
|
|
+ line-height: 1.7;
|
|
|
}
|
|
|
</style>
|