更新记录
1.0.0(2023-04-20) 下载此版本
第一版初级
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | - | - | - | √ | - | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
<!-- html -->
<template>
<uni-popup ref="popupHi" type="center" :mask-click="!androidForceUpgradeFlag">
<verson-pop :versonData="versonData" @hiddenPop="closePopup('popupHi')"></verson-pop>
</uni-popup>
</template>
<!-- js -->
import versonMix from '@/utils/mixins/verson.js'
import versonPop from '@/components/shaoll-upgradation.vue'
export default {
mixins: [versonMix],
components: {versonPop},
methods: {},
};
<!-- verson.js -->
const app = getApp()
export default {
data() {
return {
}
},
methods: {
//版本更新
toUpdateVerson(isAutoCheck) {
// console.log('isAutoCheck',plus.runtime.version)
let platform = uni.getSystemInfoSync().platform
let that = this;
let params = {
appPackageName: platform === 'android'? 'com.repair.app':'com.juxiang.repair.app',
verNo: plus.runtime.version,
};
// console.log(params)
that.API.service.postToken(that.URL.appCommonVersionGetUpdateInfo, params).then(res => {
if (res.code == 200) {
that.closeDrawer();
if (res.data) {
this.versonData = res.data;
this.androidForceUpgradeFlag = res.data.androidForceUpgradeFlag==='1'?true:false;
if(isAutoCheck){
if(uni.getStorageSync('zanbushengji') && uni.getStorageSync('zanbushengji').verNo===res.data.verNo){
console.log('此更新版本暂不升级')
}else{
that.openPopup('popupHi', 'center')
}
}else{
that.openPopup('popupHi', 'center')
}
} else {
if (!isAutoCheck) {
app.globalData.showToast('当前版本已是最新,不用更新!', 2000)
}
}
}
})
},
openPopup(popupRef, pos) {
this.$refs[popupRef].open(pos)
},
closePopup(popupRef) {
this.$refs[popupRef].close()
},
<!-- versonpop组件组件中修改此方法 -->
hiddenPopUp() {
uni.setStorageSync('zanbushengji',this.versonData)
this.$emit('hiddenPop')
},
},
}