下载优化

This commit is contained in:
GaoHao 2025-01-13 11:14:17 +08:00
parent 0dd632eaff
commit 4638a4a30d
1 changed files with 48 additions and 52 deletions

View File

@ -29,72 +29,68 @@
})
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 = "跳转网页版首页"
// #endif
}
if ( u.toLowerCase().indexOf('micromessenger') !== -1) {
data.isWeixin = true
}
// #endif
})
function download() {
var u = navigator.userAgent;
if (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1) {
function download() {
console.log(uni.getSystemInfoSync().platform == 'android')
if (uni.getSystemInfoSync().platform == 'android') {
commonType(49).then(res => {
if (res.code === 0) {
if (res.data && res.data.value) {
// #ifndef H5
plus.runtime.openURL(res.data.value, function(res) {
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: res.data.value,
success: r => {
// this.$queue.showToast('');
uni.showToast({
title: '邀请码复制成功',
icon: 'none',
});
}
});
window.location.href = res.data.value;
// #endif
}
console.log(res)
if (res && res.value) {
// #ifndef H5
plus.runtime.openURL(res.value, function(res) {
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: res.value,
success: r => {
// this.$queue.showToast('');
uni.showToast({
title: '邀请码复制成功',
icon: 'none',
});
}
});
window.location.href = res.value;
// #endif
}
});
} else {
commonType(50).then(res => {
if (res.code === 0) {
if (res.data && res.data.value) {
// #ifndef H5
plus.runtime.openURL(res.data.value, function(res) {
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: res.data.value,
success: r => {
uni.showToast({
title: '邀请码复制成功',
icon: 'none',
});
}
});
if (res && res.value) {
// #ifndef H5
plus.runtime.openURL(res.value, function(res) {
uni.switchTab({
url: '/pages/index/index'
})
// window.location.href = res.data.value;
// #endif
}
});
// #endif
// #ifdef H5
uni.setClipboardData({
data: res.value,
success: r => {
uni.showToast({
title: '邀请码复制成功',
icon: 'none',
});
}
});
uni.switchTab({
url: '/pages/index/index'
})
// window.location.href = res.data.value;
// #endif
}
});
}