v2体验版
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user