增加other分包页面
我的页面里增加跳转other分包跳转(仅在ios不是浏览器审核时展示)
This commit is contained in:
72
App.vue
72
App.vue
@@ -1,6 +1,6 @@
|
||||
|
||||
<script>
|
||||
import config from '@/common/config.js'
|
||||
import store from './store/index.js'
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
let that = this
|
||||
@@ -276,7 +276,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// setInterval(d => { //定时器,定时去调取聊天未读消息
|
||||
@@ -300,8 +300,8 @@
|
||||
// });
|
||||
// }
|
||||
// }, 3000);
|
||||
|
||||
|
||||
|
||||
|
||||
//#ifdef H5
|
||||
|
||||
this.$u.get('/app/common/type/108').then(res => { //// 是否开启公众号自动登陆 108
|
||||
@@ -369,13 +369,13 @@
|
||||
plus.runtime.restart();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
} else {
|
||||
//获取当前系统版本信息
|
||||
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||
//请求后台接口 解析数据 对比版本
|
||||
that.$Request.getT('/app/user/selectNewApp').then(res => {
|
||||
res = res.data[0];
|
||||
|
||||
|
||||
if (widgetInfo.version < res.version) {
|
||||
let downloadLink = '';
|
||||
let androidLink = res.androidWgtUrl;
|
||||
@@ -391,7 +391,7 @@
|
||||
console.log('发现下载地址');
|
||||
// 安卓:创建下载任务
|
||||
if (androidLink.match(RegExp(/.wgt/))) {
|
||||
console.log('确认wgt热更新包');
|
||||
console.log('确认wgt热更新包');
|
||||
downloadLink = androidLink;
|
||||
ready = true;
|
||||
} else {
|
||||
@@ -401,8 +401,8 @@
|
||||
console.log('下载地址是空的,无法继续');
|
||||
}
|
||||
} else {
|
||||
console.log('苹果系统');
|
||||
if (iosLink && iosLink !== '#') {
|
||||
console.log('苹果系统');
|
||||
if (iosLink && iosLink !== '#') {
|
||||
// 我这里默认#也是没有地址,请根据业务自行修改
|
||||
console.log('发现下载地址');
|
||||
// 苹果(A):进行热更新(如果iosLink是wgt更新包的下载地址)判断文件名中是否含有.wgt
|
||||
@@ -460,7 +460,7 @@
|
||||
}
|
||||
} else {
|
||||
//不是热更新是在线更新 校验是否强制升级
|
||||
|
||||
|
||||
if (res.method == "true") {
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
@@ -469,8 +469,9 @@
|
||||
content: res.des,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
plus.runtime.openURL(config.APIHOST2+'/pages/login/appEq')
|
||||
return
|
||||
plus.runtime.openURL(config.APIHOST2 +
|
||||
'/pages/login/appEq')
|
||||
return
|
||||
uni.showLoading({
|
||||
title: '下载中...',
|
||||
mask: true
|
||||
@@ -480,10 +481,18 @@
|
||||
uni.downloadFile({
|
||||
url: androidLink,
|
||||
success: downloadResult => {
|
||||
console.log(downloadResult)
|
||||
if (downloadResult.statusCode === 200) {
|
||||
console.log(
|
||||
downloadResult
|
||||
)
|
||||
if (downloadResult
|
||||
.statusCode ===
|
||||
200) {
|
||||
plus.runtime
|
||||
.install(downloadResult.tempFilePath, { force: false },
|
||||
.install(
|
||||
downloadResult
|
||||
.tempFilePath, {
|
||||
force: false
|
||||
},
|
||||
d => {
|
||||
console
|
||||
.log(
|
||||
@@ -493,7 +502,10 @@
|
||||
.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console
|
||||
.log(
|
||||
e
|
||||
)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
@@ -504,11 +516,11 @@
|
||||
// entry.getParent(_oldFile=>{
|
||||
// entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
// console.log('newFilePath',newFilePath.fullPath)
|
||||
|
||||
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -523,7 +535,7 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '发现新版本',
|
||||
confirmText: '立即更新',
|
||||
@@ -531,8 +543,9 @@
|
||||
content: res.des,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
plus.runtime.openURL(config.APIHOST2+'/pages/login/appEq')
|
||||
return
|
||||
plus.runtime.openURL(config.APIHOST2 +
|
||||
'/pages/login/appEq')
|
||||
return
|
||||
uni.showLoading({
|
||||
title: '下载中...',
|
||||
mask: true
|
||||
@@ -542,9 +555,15 @@
|
||||
uni.downloadFile({
|
||||
url: androidLink,
|
||||
success: downloadResult => {
|
||||
if (downloadResult.statusCode === 200) {
|
||||
if (downloadResult
|
||||
.statusCode ===
|
||||
200) {
|
||||
plus.runtime
|
||||
.install(downloadResult.tempFilePath, { force: false },
|
||||
.install(
|
||||
downloadResult
|
||||
.tempFilePath, {
|
||||
force: false
|
||||
},
|
||||
d => {
|
||||
console
|
||||
.log(
|
||||
@@ -554,7 +573,10 @@
|
||||
.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console
|
||||
.log(
|
||||
e
|
||||
)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
@@ -840,4 +862,6 @@
|
||||
@import 'components/colorui/main.css';
|
||||
@import 'components/colorui/icon.css';
|
||||
@import '@/common/style/common.scss';
|
||||
@import './tuniao-ui/index.scss';
|
||||
@import './tuniao-ui/iconfont.css';
|
||||
</style>
|
||||
Reference in New Issue
Block a user