v2体验版

This commit is contained in:
2026-08-31 13:35:50 +08:00
parent 3b4a2f9a78
commit 3bd58e05c5
28 changed files with 299 additions and 115 deletions
+5 -9
View File
@@ -145,9 +145,12 @@ export default {
} catch (e) {
this.windowHeight = 667
}
// 首屏商品请求与基础数据并行发出(goods 无筛选时不依赖国家/分类数据),
// 避免串行等待拖慢首屏(goods 是最慢的接口,应最先发出)
const goodsPromise = this.loadGoods(1)
await this.initData()
this.loadSubCategories('all')
await this.loadGoods(1)
await goodsPromise
// 首屏数据渲染完成后,子组件会通过 mounted 自行测量并 emit 高度
// 这里兜底触发一次重算(防止某些端 mounted 比父组件 onLoad 晚)
this.recomputeScrollHeight()
@@ -252,14 +255,7 @@ export default {
id: item.goodId,
name: truncateProductTitle(item.goodName),
price: item.price,
image: item.image,
tags: (item.tags || []).map(function (t) {
return {
text: t.tagName,
bg: t.tagColor,
color: t.tagFontColor
}
})
image: item.image
}))
const total = data.total || 0