Commit cde25617 authored by ly's avatar ly

多典花

parent d7d3e63c
No preview for this file type
......@@ -26,17 +26,17 @@
})
plus.screen.lockOrientation("portrait-primary")
console.log('App Launch')
/*** tabbar*/
this.switchShowTabbar()
//app更新版本
silentlyAppUpdate()
if (plus.runtime.isAgreePrivacy()) {
// initHeaderInfo()
console.log(333)
const isAgree = uni.getStorageSync('m-agreement')
if (isAgree && plus.os.name=='iOS') {
silentlyAppUpdate()
}
// this.getAppVersion()
// this.getAppVersion()
console.log('App Launch')
},
methods:{
getAppVersion(){
......@@ -218,7 +218,7 @@
},
onShow: function() {
console.log(2,'App Show')
},
onHide: function() {
......
No preview for this file type
<template>
<view>
<!-- 遮罩滚动锁定组件 -->
<page-meta :page-style="'overflow:'+(popupShow?'hidden':'visible')"></page-meta>
<uni-popup ref="upgradePopup" background-color="#fff" class="upgradePopup" @change="upgradePopupChange"
:mask-click="false">
<view class="rocket-content">
<view class="rocket-img"></view>
</view>
<view class="title">
发现新版本
</view>
<view class="update-content">
<text space="nbsp">{{appUpgeadeObj.updateContent}}</text>
</view>
<view v-if="updateButtonBoolean" class="update-button">
<button class="not-updated-button" :disabled="noUpdatedDisabled"
v-if="appUpgeadeObj.versionUpdateEnum == 'REQUIRED'" type="warn" @tap.stop="noUpdate">暂不更新</button>
<button class="updated-button" type="warn" @tap.stop="upgradeNow">立即升级</button>
</view>
<!-- v-if="progressBolean" -->
<!-- {{progressBolean}} -->
<view v-if="progressBolean" class="progress-bar">
<progress border-radius="90" font-size="24" activeColor="#DB4032" backgroundColor="#f0f0f0" show-info
:percent="progressData.percent" stroke-width="15" />
</view>
</uni-popup>
</view>
</template>
<script>
export default {
props: {
appUpgeadeObj: {
type: Object,
default: () => {
return {}
}
}
},
components: {
},
data() {
return {
popupShow: false,
updateButtonBoolean: true, // 按钮的显示和隐藏
// 进度条数据
progressData: {
percent: 0, //百分比
},
progressBolean: false, // 进度条的显示和隐藏
noUpdatedDisabled: false,
// viewTop: null, // 创建原生View控件
// viewBottom: null // 创建原生View控件
};
},
watch: {
'progressData.percent': {
handler(newdata) {
if (newdata) {
this.progressBolean = true
this.updateButtonBoolean = false
}
if (newdata == 100) {
this.noUpdatedDisabled = false
}
},
immediate: true,
},
},
beforeMount() {
uni.hideTabBar()
},
mounted() {
this.$refs.upgradePopup.open('center')
},
methods: {
// 升级弹窗的change事件
upgradePopupChange(e) {
this.popupShow = e.show
},
// 暂不更新按钮事件
noUpdate() {
uni.showTabBar()
this.$emit('pause')
},
// 立即升级事件
upgradeNow() {
this.noUpdatedDisabled = true
let that = this
let platform = uni.getSystemInfoSync().platform
const index = this.appUpgeadeObj.url.indexOf('apps.apple.com')
if (platform == 'ios' && index !== -1) return plus.runtime.openURL(this.appUpgeadeObj.url);
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
var downloadTask = uni.downloadFile({
url: that.appUpgeadeObj.url,
success: (downloadResult) => {
if (downloadResult.statusCode === 200) {
plus.runtime.install(downloadResult
.tempFilePath, {
force: false
},
function() {
plus.cache.clear();
plus.runtime.restart();
},
function(err) {
console.log('err--------安装升级包失败', err)
uni.showToast({
title: '安装升级包失败',
icon: 'none'
});
});
}
},
});
downloadTask.onProgressUpdate((res) => {
this.progressData.percent = res.progress
});
})
}
}
};
</script>
<style scoped lang="scss">
.upgradePopup {
z-index: 999;
/deep/.uni-popup__wrapper {
width: 602rpx;
background-image: url('~@/static/imgs/home/upgradeBackground.png');
background-repeat: no-repeat;
background-size: 100% 100%;
border-radius: 15rpx;
// border: solid 1px red;
position: relative;
display: flex;
flex-direction: column;
.rocket-content {
height: 368rpx;
.rocket-img {
background-image: url('~@/static/imgs/home/rocket.png');
background-repeat: no-repeat;
background-size: 100% 100%;
width: 152rpx;
height: 212rpx;
position: absolute;
top: -105rpx;
left: 225rpx;
}
}
.title {
display: flex;
justify-content: center;
font-size: 36rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #282828;
}
.update-content {
margin-top: 44rpx;
// border: solid 1rpx red;
padding-left: 100rpx;
display: flex;
flex-direction: column;
uni-text {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #989899;
margin-bottom: 8rpx;
}
}
.update-button {
// border: solid 1rpx yellow;
display: flex;
width: 482rpx;
margin: 0 auto;
margin-top: 48rpx;
uni-button {
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin: 0rpx;
flex: 1;
height: 80rpx;
margin-bottom: 80rpx;
}
.not-updated-button {
margin-right: 40rpx;
}
}
.progress-bar {
width: 538rpx;
// border: solid 1px red;
margin: 0 auto;
margin-top: 96rpx;
margin-bottom: 102rpx;
uni-progress {
.uni-progress-bar {
border-radius: 50rpx;
.uni-progress-inner-bar {
border-radius: 50rpx;
}
}
}
}
}
}
</style>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -70,7 +70,7 @@ export const initHeaderDevice = function () {
}
if (locationInfo) {
// device = Object.assign(device, common, JSON.parse(locationInfo))
device = Object.assign(device, common, JSON.parse(locationInfo))
}
if(loadUuid){
device = Object.assign(device, common, JSON.parse(loadUuid))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment