tapd相关修改更新
This commit is contained in:
71
App.vue
71
App.vue
@@ -4,7 +4,7 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
||||
-->
|
||||
<script setup>
|
||||
import { onLaunch } from '@dcloudio/uni-app';
|
||||
import { getFindBySource } from '@/http/yskApi/version.js'
|
||||
import { getVersion } from '@/http/api/index.js'
|
||||
import appConfig from '@/config/appConfig.js';
|
||||
import { provide } from 'vue';
|
||||
|
||||
@@ -38,7 +38,8 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
||||
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||
//请求后台接口 解析数据 对比版本
|
||||
console.log("widgetInfo==",widgetInfo)
|
||||
getFindBySource({source:'APP'}).then(res => {
|
||||
let type = uni.getSystemInfoSync().platform == 'ios' ? 2 : 1
|
||||
getVersion({source:'manager_app',type: type}).then(res => {
|
||||
console.log("selectNewApp==",res)
|
||||
console.log("version===",res.url && widgetInfo.version < res.version)
|
||||
if (res.url && widgetInfo.version < res.version) {
|
||||
@@ -59,8 +60,7 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading('下载中...');
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'android') {
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
uni.downloadFile({
|
||||
url: downloadLink,
|
||||
success: downloadResult => {
|
||||
@@ -69,24 +69,16 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
||||
entry.getParent(_oldFile=>{
|
||||
entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
console.log('newFilePath',newFilePath.fullPath)
|
||||
plus.runtime
|
||||
.install(newFilePath.fullPath, { force: false },
|
||||
d => {
|
||||
console
|
||||
.log(
|
||||
'install success...'
|
||||
);
|
||||
plus.runtime
|
||||
.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
);
|
||||
}
|
||||
);
|
||||
plus.runtime.install(newFilePath.fullPath, { force: false },
|
||||
d => {
|
||||
console .log( 'install success...' );
|
||||
plus.runtime .restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console .error( 'install fail...' );
|
||||
}
|
||||
);
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -94,10 +86,8 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
||||
}
|
||||
});
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'ios') {
|
||||
plus.runtime.openURL(downloadLink, function(
|
||||
res) {});
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
plus.runtime.openURL(downloadLink, function( res) {});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('取消');
|
||||
@@ -113,34 +103,23 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading('下载中...');
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'android') {
|
||||
if (uni.getSystemInfoSync().platform == 'android') {
|
||||
uni.downloadFile({
|
||||
url: downloadLink,
|
||||
success: downloadResult => {
|
||||
if (downloadResult
|
||||
.statusCode ===
|
||||
200) {
|
||||
if (downloadResult.statusCode == 200) {
|
||||
plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
|
||||
entry.getParent(_oldFile=>{
|
||||
entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
console.log('newFilePath',newFilePath.fullPath)
|
||||
plus.runtime
|
||||
.install(newFilePath.fullPath, { force: false },
|
||||
plus.runtime.install(newFilePath.fullPath, { force: false },
|
||||
d => {
|
||||
console
|
||||
.log(
|
||||
'install success...'
|
||||
);
|
||||
plus.runtime
|
||||
.restart();
|
||||
console.log('install success...');
|
||||
plus.runtime.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
);
|
||||
console.error('install fail...');
|
||||
}
|
||||
);
|
||||
})
|
||||
@@ -151,10 +130,8 @@ App.vue本身不是页面,这里不能编写视图元素,也就是没有<tem
|
||||
}
|
||||
});
|
||||
}
|
||||
if (uni.getSystemInfoSync().platform ==
|
||||
'ios') {
|
||||
plus.runtime.openURL(downloadLink, function(
|
||||
res) {});
|
||||
if (uni.getSystemInfoSync().platform == 'ios') {
|
||||
plus.runtime.openURL(downloadLink, function( res) {});
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('取消');
|
||||
|
||||
Reference in New Issue
Block a user