更新讯飞六个AI小程序,优化小程序调用逻辑,修复小程序内头像未出现的bug
This commit is contained in:
parent
3a8691c0d9
commit
5cf28341eb
File diff suppressed because it is too large
Load Diff
@ -152,17 +152,68 @@ const loadMPx = async (id) => {
|
|||||||
// 按URL加载小程序
|
// 按URL加载小程序
|
||||||
const loadMPurl = async (e) => {
|
const loadMPurl = async (e) => {
|
||||||
appid = e.id;
|
appid = e.id;
|
||||||
mp.getUniMPVersion(appid, (ret) => {
|
let FURL = e.url;
|
||||||
console.log('当前版本', ret);
|
uni.showLoading({
|
||||||
wgtFile = e.url;
|
title: '初始化中...',
|
||||||
doInstallMP();
|
mask: true
|
||||||
// if (0 != ret.code) {
|
})
|
||||||
// wgtFile = e.url;
|
uni.request({
|
||||||
// installMP();
|
url: FURL,
|
||||||
// } else {
|
method: 'GET',
|
||||||
// open()
|
success: (fileInfo) => {
|
||||||
// }
|
mp.getUniMPVersion(appid, (ret) => {
|
||||||
});
|
console.log('当前版本', ret);
|
||||||
|
let flag;
|
||||||
|
if (HTTP_REQUEST_URL == 'https://shop.lihaink.cn') {
|
||||||
|
flag = false
|
||||||
|
} else {
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
if (0 != ret.code || compareVersions(fileInfo.data?.data?.version, ret.versionInfo.name) == 1 || flag ==
|
||||||
|
true) {
|
||||||
|
let count = 0;
|
||||||
|
timer = setInterval(() => {
|
||||||
|
if (count < 100) uni.showLoading({
|
||||||
|
title: `初始化中... ${count}%`,
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
else uni.showLoading({
|
||||||
|
title: '初始化中...100%',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
|
}, 600)
|
||||||
|
let downloadTask = uni.downloadFile({
|
||||||
|
url: fileInfo.data?.data?.down_url,
|
||||||
|
success(res) {
|
||||||
|
wgtFile = res.tempFilePath;
|
||||||
|
console.log('初始化完成', wgtFile);
|
||||||
|
installMP();
|
||||||
|
},
|
||||||
|
fail(res) {
|
||||||
|
clearInterval(timer);
|
||||||
|
timer = null;
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
downloadTask.onProgressUpdate((res) => {
|
||||||
|
// console.log('初始化进度' + res.progress);
|
||||||
|
if (res.progress > count) count += 10;
|
||||||
|
if (count >= 90) {
|
||||||
|
clearInterval(timer);
|
||||||
|
timer = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
open()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
fail:(err)=> {
|
||||||
|
console.log('错误:', err);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 小程序版本信息
|
// 小程序版本信息
|
||||||
|
Loading…
x
Reference in New Issue
Block a user