Commit 6f850c0e authored by 李晓兵's avatar 李晓兵

'版本更新'

parent 45c25f93
......@@ -12,7 +12,6 @@ module.exports = merge(prodEnv, {
rootPath: '"http://180.104.121.66:8088/r/api"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"',
ocrPath:'"http://180.104.121.66:8088/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"0.0.1"'
appId: '"com.xcmg.app"',
currentVersion: '"1.0.1"'
});
......@@ -8,7 +8,6 @@ module.exports = {
loginPath: '"http://hlsapp.hand-china.com/core/oauth/token?client_id=hQGCtxTItRa34PUOgxaD0r7oSPeuEaIB&client_secret=7ee8338c-4a06-44a1-87cc-afa63f8e1bc3&grant_type=password&username=app&password=" ',
basePath: '"http://hlsapp.hand-china.com/core/r/api?sysName=HLS_APP&apiName="',
rootPath: '"http://hlsapp.hand-china.com/core/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
appId: '"com.xcmg.app"',
currentVersion: '"1.0.0"'
}
......@@ -9,7 +9,6 @@ module.exports = {
rootPath: '"http://180.104.121.66:8088/r/api"',
filePath: '"http://180.104.121.66:8088/r/api/app/fileViewSvc?sysName=XCMG_DEV&apiName=file_view&"',
ocrPath:'"http://180.104.121.66:8088/r/api"',
file_url: '"http://hlsapp.hand-china.com/file/"',
appId: '"com.hls.easy.car"',
currentVersion: '"0.0.1"'
appId: '"com.xcmg.app"',
currentVersion: '"1.0.1"'
}
......@@ -26,7 +26,7 @@
<div class="button submit" @click="access">登录</div>
</div>
</h-content>
<!-- <div style="width: 100%;height: 100%;background-color: #007aff;display: flex;justify-content: center;align-items: center;">
<!-- <div style="width: 100%;height: 100%;background-color: #007aff;display: flex;justify-content: center;align-items: center;">
<p style="font-weight: 700;font-size: 36px">登录</p>
</div>-->
</template>
......@@ -42,7 +42,7 @@ export default {
? window.localStorage.username
: '',
password: '',
version: process.env.currentVersion,
currentVersion: process.env.currentVersion,
routeName: this.$route.params.routeName || '',
}
},
......@@ -50,6 +50,7 @@ export default {
window.addEventListener('native.keyboardhide', function () {
document.activeElement.blur()
})
this.updateVersion() // 版本更新
},
methods: {
changeType () {
......@@ -119,6 +120,74 @@ export default {
clearPassword: function () {
this.password = ''
},
// 版本更新
updateVersion () {
let vm = this
let url = $config.basePath + 'version_update'
let param = {}
vm.$post(url, param).then(function (res) {
if (res.result === 'S') {
// 版本更新
var updateUrl = ''
var content = ''
if (vum.Platform.isAndroid()) {
if (res.android_version_list.length) {
if (res.android_version_list[0].app_version !== vm.currentVersion) {
updateUrl = res.android_version_list[0].version_url
content = res.android_version_list[0].update_content
if (res.android_version_list[0].big_version === 'Y') {
vm.open_new_win(content, updateUrl)
} else {
vm.hote_update_version(content, updateUrl)
}
} else {
}
}
} else if (vum.Platform.isIOS()) {
if (res.ios_version_list.length) {
if (res.ios_version_list[0].app_version !== vm.currentVersion) {
updateUrl = res.ios_version_list[0].version_url
content = res.ios_version_list[0].update_content
if (res.ios_version_list[0].big_version === 'Y') {
vm.open_new_win(content, updateUrl)
} else {
vm.hote_update_version(content, updateUrl)
}
} else {
}
}
}
}
})
},
open_new_win (content, url) {
if (url) {
hlsPopup.showConfirm({
title: '版本更新',
content: content,
onConfirm: function (index) {
if (index === 1) {
cordova.InAppBrowser.open(url, '_system', 'location=yes')
} else {
}
},
})
}
},
hote_update_version (content, url) {
hlsPopup.showConfirm({
title: '版本更新',
content: content,
onConfirm: function (index) {
if (index === 1) {
hotpatch.updateNewVersion(url)
}
},
})
},
},
}
</script>
......
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