feat: T10 回归测试 Bug 修复与功能完善
修复 BUG-001 至 BUG-009 及 T10-1 至 T10-6 相关问题: - 打卡积分显示与累加逻辑优化 - 食谱计算器 Tab 选中样式修复 - 食物百科列表图片与简介展示修复 - 食物详情页数据加载修复 - AI营养师差异化回复优化 - 健康知识/营养知识名称统一 - 饮食指南/科普文章详情页内容展示修复 - 帖子营养统计数据展示修复 - 社区帖子类型中文命名统一 - 帖子详情标签中文显示修复 - 食谱营养AI填充功能完善 - 食谱收藏/点赞功能修复 新增: - ToolNutritionFillService 营养填充服务 - T10 回归测试用例 (Playwright) - 知识文章数据 SQL 脚本 涉及模块: - crmeb-common: VO/Request/Response 优化 - crmeb-service: 业务逻辑完善 - crmeb-front: API 接口扩展 - msh_single_uniapp: 前端页面修复 - tests/e2e: 回归测试用例
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
<scroll-view class="content-scroll" scroll-y>
|
||||
<!-- 食物大图 -->
|
||||
<view class="food-image-section">
|
||||
<image class="food-image" :src="foodData.image" mode="aspectFill"></image>
|
||||
<image class="food-image" :src="foodData.image || defaultFoodData.image" mode="aspectFill"></image>
|
||||
<view class="image-overlay"></view>
|
||||
<view class="food-info-overlay">
|
||||
<view class="food-name-overlay">{{ foodData.name }}</view>
|
||||
<view class="food-name-overlay">{{ foodData.name || '—' }}</view>
|
||||
<view class="food-tags">
|
||||
<view class="food-tag category">{{ foodData.category }}</view>
|
||||
<view class="food-tag safe">{{ foodData.safetyTag }}</view>
|
||||
<view class="food-tag category">{{ foodData.category || '—' }}</view>
|
||||
<view class="food-tag safe">{{ foodData.safetyTag || '—' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -193,6 +193,7 @@ export default {
|
||||
try {
|
||||
const res = await getFoodDetail(id)
|
||||
const data = res.data || res
|
||||
console.log('[food-detail] getFoodDetail 响应:', data ? { hasName: !!data.name, hasImage: !!data.image, keys: Object.keys(data) } : null)
|
||||
if (data && data.name) {
|
||||
// 解析API返回的食物数据
|
||||
this.foodData = {
|
||||
@@ -220,6 +221,7 @@ export default {
|
||||
} catch (error) {
|
||||
const errMsg = (error && (error.message || error.msg || error.errMsg || error)) ? String(error.message || error.msg || error.errMsg || error) : '未知错误'
|
||||
console.error('[food-detail] 加载食物数据失败:', error)
|
||||
console.error('[food-detail] loadError(用于调试):', errMsg)
|
||||
// a. 将 loadError 置为具体错误信息(用于调试)
|
||||
this.loadError = errMsg
|
||||
// b. 使用 defaultFoodData 填充页面,保证用户能看到基础界面;不清空 loadError 以便展示「当前数据来自缓存」提示
|
||||
@@ -230,6 +232,7 @@ export default {
|
||||
this.foodData.name = decodeURIComponent(String(this.pageParams.name))
|
||||
} catch (e) {}
|
||||
}
|
||||
// c. 页面已通过 v-if="loadError" 显示「当前数据来自缓存,可能不是最新」;再弹出轻提示
|
||||
uni.showToast({
|
||||
title: '数据加载失败',
|
||||
icon: 'none'
|
||||
|
||||
Reference in New Issue
Block a user