求助,每次进来都会有loading,能默默后台加载吗?
代木
- 发布:2023-04-12 14:49
- 更新:2023-04-14 15:25
- 阅读:468
如果实在不想要这个loading,则在组件代码搜索 let res = await uniPayCo.getOpenid(data);
在这个代码的上面增加代码
const uniPayCo = uniCloud.importObject("uni-pay-co", {
customUI: true
});
即最终
// 根据code获取openid
async getOpenid(data = {}) {
try {
const uniPayCo = uniCloud.importObject("uni-pay-co", {
customUI: true
});
let res = await uniPayCo.getOpenid(data);
if (typeof data.success === "function") data.success(res);
return res;
} catch (err) {
if (typeof data.fail === "function") data.fail(err);
}
},