Commit 7afd638c authored by caimeng's avatar caimeng

1.0.8版本提交审核

parent 5ea7feaf
......@@ -108,56 +108,38 @@ export default {
delStorageSync() {
// 清空一些数据
uni.removeStorageSync('m-header-version')
uni.removeStorageSync('m-agreement')
uni.removeStorageSync('appStart')
uni.removeStorageSync('m-header-device')
uni.removeStorageSync('m-location-info')
uni.removeStorageSync('m-network-info')
uni.removeStorageSync('m-device-info')
},
// 立即升级事件
upgradeNow() {
this.removeStorageSync();
const that = this
that.noUpdatedDisabled = true
let platform = uni.getSystemInfoSync().platform
const wgtType = that.containsWGTExtension(that.appUpgeadeObj.downloadUrl)
that.isWGT = wgtType
const index = that.appUpgeadeObj.downloadUrl.indexOf('apps.apple.com')
console.log(that.isWGT, 'that.isWGT3333')
if (that.isWGT == true) {
that.updateWgt(that.appUpgeadeObj.downloadUrl, that.appUpgeadeObj.downloadUrl.versionName)
} else {
if (platform == 'ios' && index !== -1) return plus.runtime.openURL(that.appUpgeadeObj.downloadUrl);
}
this.delStorageSync();
const downloadUrl = this.appUpgeadeObj.downloadUrl
plus.runtime.launchApplication({
action: `itms-apps://itunes.apple.com/cn/app/id6642694240`,
}, function (e) {
console.log('Open system default browser failed: ' + e.message);
return plus.runtime.openURL(downloadUrl)
})
},
upgradeNowAndroid() {
this.removeStorageSync();
this.delStorageSync();
let that = this
that.noUpdatedDisabled = true
let platform = uni.getSystemInfoSync().platform
const index = that.containsApkExtension(that.appUpgeadeObj.downloadUrl)
const wgtType = that.containsWGTExtension(that.appUpgeadeObj.downloadUrl)
console.log(wgtType, 'that.isWGT')
that.isWGT = wgtType
if (index == true) {
plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
const isAPK = that.containsApkExtension(that.appUpgeadeObj.downloadUrl)
if (isAPK) {
plus.runtime.getProperty(plus.runtime.appid, () => {
var downloadTask = uni.downloadFile({
url: that.appUpgeadeObj.downloadUrl,
success: (downloadResult) => {
if (downloadResult.statusCode === 200) {
plus.runtime.install(downloadResult.tempFilePath, {
force: false
},
plus.runtime.install(downloadResult.tempFilePath, { force: false },
function () {
console.log('日日')
console.log('下载APK成功,还是安装成功呢')
plus.cache.clear();
plus.runtime.restart();
},
......@@ -176,74 +158,13 @@ export default {
});
})
} else {
console.log(333, 'indexw')
//跳转到应用商店
// 这里需要根据不同的应用市场,跳转到指定的地方
let appurl = "market://details?id=io.dcloud.ddh"
plus.runtime.openURL(appurl)
}
// }
},
//wgt更新
updateWgt(downloadUrl, newVersion) {
uni.showModal({
title: '已发现新版本',
content: '确认更新?',
showCancel: false,
success: function (res) {
uni.setStorageSync('checkVersions', newVersion)
if (res.confirm) {
uni.downloadFile({
url: downloadUrl,
success: (downloadResult) => {
plus.runtime.install(downloadResult.tempFilePath, { force: true }, function () {
//应用热重启,重新启动进入首页
plus.runtime.restart();
uni.showModal({
title: '安装成功!',
content: '已重新进入应用',
showCancel: false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击确定');
}
}
})
},
function (e) {
console.log(e, '安装失败')
uni.showModal({
title: '安装失败',
icon: 'none'
})
})
},
fail: (err) => {
uni.showToast({
title: '下载失败',
icon: 'none'
})
}
})
} else if (res.cancel) {
uni.showToast({
title: '已取消',
icon: 'none'
})
}
}
})
},
containsApkExtension(url) {
return /\.apk$/i.test(url);
},
containsWGTExtension(url) {
return /\.wgt$/i.test(url);
}
}
};
......
......@@ -22,7 +22,7 @@ const BASE = {
prod: {
common: "https://api.yyhock.com",
event: 'https://event.jqtianxia.com',
h5: 'https://ddang.rockstect.com/v1.0.5.html#/'
h5: 'https://ddang.rockstect.com/v1.0.8.html'
}
}
let env = process.env.VUE_APP_BASE_NODE_ENV
......
import Permission from "@/js_sdk/wa-permission/permission"; //权限工具类
import {
SelectLocation
} from "./authPermission"; //权限工具类
const LFv2 = uni.requireNativePlugin("AThree-LFv2");
// 隐藏tabbar
export const hideTabBar = () => {
uni.hideTabBar();
};
// 显示tabbar
export const showTabBar = () => {
uni.showTabBar();
......@@ -32,6 +30,7 @@ export const loadDeviceInfo = async (lat, lng, address) => {
// 网络状态
const { networkType = "" } = await loadNetwork();
const { imei = '', imsi = '', uuid = '' } = await loadUuid();
return new Promise((resolve, reject) => {
uni.getSystemInfo({
success: async (result) => {
......@@ -41,7 +40,6 @@ export const loadDeviceInfo = async (lat, lng, address) => {
osVersion,
screenWidth,
screenHeight,
appName,
osName,
appWgtVersion,
model,
......@@ -59,10 +57,10 @@ export const loadDeviceInfo = async (lat, lng, address) => {
osVersion: osVersion, //操作系统版本
mobileType: model, // 手机型号
idfa: "", // IOS设备则为:IDFA
imei: imei, //安卓设备为:imei
imei: imsi,
uuid: uuid,
imei: imsi,
uuid: uuid,
mac: "", // mac
wifiMac: "", // wifimac
......@@ -160,7 +158,7 @@ export const loadLocation = () => {
const locationInfo = {
lat: String(res.latitude),
lng: String(res.longitude),
address: res.address ? JSON.stringify(res.address) : '',
address: res.address ? res.address : '',
};
// 位置信息存储
......@@ -182,7 +180,7 @@ export const loadLocation = () => {
const hasShowModal = uni.getStorageSync('showModal');
if (!hasShowModal) {
uni.setStorageSync('showModal', 'true')
let hasReject;
// let hasReject;
// if (plus.os.name == "iOS") {
// hasReject = Permission.judgeIosPermission('location')
......@@ -223,11 +221,20 @@ export const loadLocation = () => {
* 包括国际移动设备身份码、国际移动用户识别码、设备的唯一标识等信息。
* Android平台调用此方法需要申请访问设备标识(部分设备提示为拨打电话)权限,详情参考https://ask.dcloud.net.cn/article/36075。
*/
export const loadUuid = () => {
return new Promise((resolve, reject) => {
plus.device.getInfo({
success: (res) => {
console.log("**************** 设备信息:" + JSON.stringify(res));
const deviceInfo = {
...res,
token: res.uuid,
};
uni.setStorage({
key: 'm-load-udid',
data: JSON.stringify(deviceInfo)
})
resolve(res);
},
fail: (err) => {
......
......@@ -11,9 +11,11 @@ const request = async (url, type, data) => {
AppVersion = AppVersion === '1.0.8' ? AppVersion : '1.0.8';
const device = Object.assign({},JSON.parse(headerDevice))
device.appVersion = AppVersion
console.log(device,'设备头信息')
console.log(device.appVersion,'设备头信息')
console.log('+++++++++++++++++++++++++从缓存拿数据')
rd = encodeURIComponent(headerDevice)
} else {
console.log('=========================不从缓存拿数据')
rd = JSON.stringify(initHeaderDevice())
}
......
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