unknown
11 months ago
12 changed files with 246 additions and 84 deletions
-
6config/api.js
-
5pages.json
-
8pages/indexEntry/enroll/enroll.vue
-
73pages/indexEntry/enroll/realName/realName.vue
-
6pages/indexEntry/enroll/realName/webView.vue
-
26pages/indexEntry/enroll/registInfo/registInfo.vue
-
10pages/indexEntry/enroll/signContract/signContract.vue
-
40pages/mineEntry/myOrder/comp/download.js
-
18pages/mineEntry/myOrder/detail/detail.vue
-
45pages/mineEntry/myOrder/voucher/voucher.vue
-
10pages/mineEntry/personaInfo/personaInfo.vue
-
51pages/mineEntry/refund/comp/myform.vue
@ -0,0 +1,40 @@ |
|||||
|
|
||||
|
export let downloadImg = function (imageUrl) { |
||||
|
uni.downloadFile({ |
||||
|
url: imageUrl, |
||||
|
success(res) { |
||||
|
if (res.statusCode === 200) { |
||||
|
// 下载成功后,获取临时文件路径
|
||||
|
const tempFilePath = res.tempFilePath; |
||||
|
|
||||
|
// 保存图片到本地相册
|
||||
|
uni.saveImageToPhotosAlbum({ |
||||
|
filePath: tempFilePath, |
||||
|
success() { |
||||
|
uni.showToast({ |
||||
|
title: '图片保存成功', |
||||
|
icon: 'success', |
||||
|
duration: 2000 |
||||
|
}); |
||||
|
}, |
||||
|
fail(err) { |
||||
|
console.error('保存图片失败', err); |
||||
|
uni.showToast({ |
||||
|
title: '图片保存失败', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
fail(err) { |
||||
|
console.error('下载图片失败', err); |
||||
|
uni.showToast({ |
||||
|
title: '图片下载失败', |
||||
|
icon: 'none', |
||||
|
duration: 2000 |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue