下载优化
This commit is contained in:
parent
0dd632eaff
commit
4638a4a30d
|
|
@ -29,33 +29,32 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
let u = navigator.userAgent;
|
|
||||||
if ( u.indexOf('iPhone') > -1) {
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
|
let u = window.navigator.userAgent;
|
||||||
|
if ( uni.getSystemInfoSync().platform == 'ios') {
|
||||||
data.confirmBtn = "跳转网页版首页"
|
data.confirmBtn = "跳转网页版首页"
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
|
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
|
||||||
data.isWeixin = true
|
data.isWeixin = true
|
||||||
}
|
}
|
||||||
|
// #endif
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
function download() {
|
function download() {
|
||||||
var u = navigator.userAgent;
|
console.log(uni.getSystemInfoSync().platform == 'android')
|
||||||
if (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1) {
|
if (uni.getSystemInfoSync().platform == 'android') {
|
||||||
commonType(49).then(res => {
|
commonType(49).then(res => {
|
||||||
if (res.code === 0) {
|
console.log(res)
|
||||||
if (res.data && res.data.value) {
|
if (res && res.value) {
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
plus.runtime.openURL(res.data.value, function(res) {
|
plus.runtime.openURL(res.value, function(res) {
|
||||||
|
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: res.data.value,
|
data: res.value,
|
||||||
success: r => {
|
success: r => {
|
||||||
// this.$queue.showToast('邀请码复制成功');
|
// this.$queue.showToast('邀请码复制成功');
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -64,23 +63,21 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
window.location.href = res.data.value;
|
window.location.href = res.value;
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
commonType(50).then(res => {
|
commonType(50).then(res => {
|
||||||
if (res.code === 0) {
|
if (res && res.value) {
|
||||||
if (res.data && res.data.value) {
|
|
||||||
// #ifndef H5
|
// #ifndef H5
|
||||||
plus.runtime.openURL(res.data.value, function(res) {
|
plus.runtime.openURL(res.value, function(res) {
|
||||||
|
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
uni.setClipboardData({
|
uni.setClipboardData({
|
||||||
data: res.data.value,
|
data: res.value,
|
||||||
success: r => {
|
success: r => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '邀请码复制成功',
|
title: '邀请码复制成功',
|
||||||
|
|
@ -95,7 +92,6 @@
|
||||||
// window.location.href = res.data.value;
|
// window.location.href = res.data.value;
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue