<uniUpdate v-if="updateVisible" :params="updateParams" />
const updateParams = ref()
const updateVisible = ref(false)
onLoad(async () => {
getVersion()
}
})
async function getVersion() {
const url = 'pageIndex=1&pageSize=10&applicationType=2'
const res = await Version.Version(url)
const { version, versionNum, downLoadUrl, versionMsg } =
res.data?.items?.[0] || {}
updateParams.value = {
describe: versionMsg,
edition_url: downLoadUrl,
edition_force: 1,
package_type: 0,
edition_name: version
}
currentVersion.value = versionNum
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
if (Number(inf.versionCode) < Number(versionNum)) {
updateVisible.value = true
}
})
}