Commit 705399ca authored by Smile's avatar Smile Committed by wux

任务88:客户端改造,版本强制更新,当用户未安装最新版本,更新弹窗无法关闭,但是添加了退出应用按钮

parent 40b8e5a5
......@@ -219,6 +219,9 @@
<view class="ad-btn" @click="toupdate">
<view>{{ $lang.lang.notices.update }}</view>
</view>
<view class="ad-btn" v-if="forceUpdate" @click="toCloseApp">
<view>{{ $lang.lang.notices.closeApp }}</view>
</view>
<view v-if="!forceUpdate" class="ad-btn" @click="closeVe">
<view>{{ $lang.lang.notices.close }}</view>
</view>
......@@ -358,13 +361,13 @@ export default {
var dtask = plus.downloader.createDownload(that.appUrl, {}, (d, status) => {
uni.hideLoading()
if (status == 200) {
that.closeVe()
// that.closeVe()
that.showdownLine = false
console.log('下载成功安装: ' + d.filename)
plus.runtime.install(d.filename)
} else {
that.showdownLine = false
that.closeVe()
// that.closeVe()
plus.nativeUI.alert(that.$lang.lang.notices.failDown)
}
})
......@@ -581,6 +584,14 @@ export default {
this.$refs.vepopup.close()
// this.getUserInfo()
},
toCloseApp() {
if (platform == 'ios') {
//ios使用原来的quit()方法失效
plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
}else {
plus.runtime.quit();
}
},
getBanner() {
this.$request
.get('/app-api/ecw/banner/page', { page: 1, rows: 20, status: 0 })
......
......@@ -140,6 +140,9 @@
<view class="ad-btn" @click="toupdate">
<view>{{ $lang.lang.notices.update }}</view>
</view>
<view class="ad-btn" v-if="forceUpdate" @click="toCloseApp">
<view>{{ $lang.lang.notices.closeApp }}</view>
</view>
<view v-if="!forceUpdate" class="ad-btn" @click="closeVe">
<view>{{ $lang.lang.notices.close }}</view>
</view>
......@@ -377,13 +380,13 @@ export default {
var dtask = plus.downloader.createDownload(that.appUrl, {}, (d, status) => {
uni.hideLoading()
if (status == 200) {
that.closeVe()
// that.closeVe()
that.showdownLine = false
console.log('下载成功安装: ' + d.filename)
plus.runtime.install(d.filename)
} else {
that.showdownLine = false
that.closeVe()
// that.closeVe()
plus.nativeUI.alert(that.$lang.lang.notices.failDown)
}
})
......@@ -446,6 +449,14 @@ export default {
closeVe() {
this.$refs.vepopup.close()
},
toCloseApp() {
let platform = uni.getSystemInfoSync().platform.toLocaleLowerCase()
if (platform == 'ios') {
plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
}else {
plus.runtime.quit();
}
},
// 获取个人信息
async getUserInfo() {
try {
......
......@@ -108,6 +108,7 @@ export default {
"intNotice5": "Value>0",
"easyPass": "Your password is too simple, please change your password",
"update": "Update now",
"closeApp": "Close the app",
"close": "Close",
"newVersion": "New Version update",
"nowVersion": "NowVersion",
......
......@@ -108,6 +108,7 @@ export default {
"intNotice5": "valeur > 0",
"easyPass": "Votre mot de passe est trop simple, veuillez le modifier",
"update": "mettre à jour maintenant",
"closeApp": "Fermer l'application",
"close": "fermer",
"newVersion": "mise à jour de la nouvelle version",
"nowVersion": "version actuelle",
......
......@@ -108,6 +108,7 @@ export default {
"intNotice5": "货值必须大于0",
"easyPass": "您的密码过于简单,请前往修改密码",
"update": "立即更新",
"closeApp": "关闭应用",
"close": "关闭弹窗",
"newVersion": "新版本更新",
"nowVersion": "当前版本号",
......
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