fix(harmony): 鸿蒙环境下商品列表初始加载后强制触发视图刷新

- 鸿蒙 ArkUI 对 v-for 数组响应式更新支持不完善
- goodsList 赋值后视图不自动渲染,必须点击排序等操作后才显示
- 在 getGoodsList 数据赋值后,通过快速切换 isList 状态强制触发视图重计算
- 仅对 MP-HARMONY 环境生效,不影响其他平台
This commit is contained in:
2026-06-05 11:03:18 +08:00
parent 8f1eb1f5fe
commit 048305eb23

View File

@@ -253,13 +253,24 @@ export default {
this.coupon_name = resolve
});
}
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
this.goodsList = this.goodsList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
this.goodsList = this.goodsList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
this.waterfallflow((mescroll.num - 1) * 10);
// #ifdef MP-HARMONY
// 鸿蒙 ArkUI 对 v-for 数组响应式更新支持不完善,强制触发视图刷新
setTimeout(() => {
const temp = this.isList;
this.isList = !temp;
setTimeout(() => {
this.isList = temp;
}, 0);
}, 50);
// #endif
this.waterfallflow((mescroll.num - 1) * 10);
},
fail: res => {
//联网失败的回调