更新记录
1.0.0(2023-03-22) 下载此版本
v1.0.0上线
功能需要真机才能使用,此插件为APP升级弹窗 安卓在线升级/ios跳转AppStore
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | √ | - | - | √ | √ | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
使用说明
<template>
<view class="content">
<view @click="checkVersion">检测更新</view>
<upVersion :upLoadUrl="upLoadUrl" :newVision="newVision" :appStoreUrl='appStoreUrl'></upVersion>
</view>
</template>
<script>
import upVersion from "@/components/as-upVersion/as-upVersion.vue"
export default {
components: {
upVersion
},
data() {
return {
upLoadUrl: "", // 安卓下载链接
newVision: "", // 最新版本号
appStoreUrl: '' // AppStore链接
}
},
onReady() {
this.checkVersion()
},
methods: {
checkVersion() {
uni.request({
url: 'https://mock.apifox.cn/m1/1822165-0-default/getVersion', //仅为示例,并非真实接口地址。
success: (res) => {
//此处调用后端接口返回当前版本号和下载地址
//回调赋值
this.newVision = res.data.newVision
this.appStoreUrl = res.data.appStoreUrl
this.upLoadUrl = res.data.upLoadUrl
}
});
},
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style>