- 资产卡片区域:深色骨架屏匹配原有卡片风格 - 持仓列表区域:模拟卡片布局的骨架占位 - 添加 loading 状态控制,数据加载完成后切换 - 骨架屏带渐变动画效果,提升用户体验
13 lines
373 B
JavaScript
Executable File
13 lines
373 B
JavaScript
Executable File
uni.addInterceptor({
|
|
returnValue (res) {
|
|
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
|
|
return res;
|
|
}
|
|
return new Promise((resolve, reject) => {
|
|
res.then((res) => {
|
|
if (!res) return resolve(res)
|
|
return res[0] ? reject(res[0]) : resolve(res[1])
|
|
});
|
|
});
|
|
},
|
|
}); |