Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jiaxiu-miniapp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蔡亮华(贵阳日报)
jiaxiu-miniapp
Commits
31c65da5
Commit
31c65da5
authored
Aug 29, 2024
by
彭佳妮(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片上传
parent
34c97c57
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
37 deletions
+37
-37
detail.vue
src/pages/classify/detail.vue
+37
-37
No files found.
src/pages/classify/detail.vue
View file @
31c65da5
...
...
@@ -145,44 +145,44 @@ const convertSize = (sizeInKB) => {
// 下载图片
const
handleDownload
=
()
=>
{
uni
.
downloadFile
({
url
:
previewImages
.
value
[
index
.
value
],
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
// 保存图片到相册
plus
.
gallery
.
save
(
res
.
tempFilePath
,
()
=>
{
uni
.
showToast
({
title
:
'图片保存成功'
,
icon
:
'success'
});
},
(
err
)
=>
{
console
.
error
(
'保存图片失败'
,
err
);
uni
.
showToast
({
title
:
'图片保存失败'
,
icon
:
'none'
});
});
}
else
{
console
.
error
(
'图片下载失败'
);
}
},
fail
:
(
err
)
=>
{
console
.
error
(
'图片下载失败'
,
err
);
}
});
// xma.downloadFile({
// url: previewImages.value[index.value], // 替换为你要下载的图片URL
// success: (res) => {
// if (res.statusCode === 200) {
// // 下载成功后保存图片到相册
// saveImage(res.tempFilePath);
// } else {
// console.error('下载图片失败');
// }
// },
// fail: (err) => {
// console.error('下载图片失败', err);
// }
// uni.downloadFile({
// url: previewImages.value[index.value],
// success: (res) => {
// if (res.statusCode === 200) {
// // 保存图片到相册
// plus.gallery.save(res.tempFilePath, () => {
// uni.showToast({
// title: '图片保存成功',
// icon: 'success'
// });
// }, (err) => {
// console.error('保存图片失败', err);
// uni.showToast({
// title: '图片保存失败',
// icon: 'none'
// });
// });
// } else {
// console.error('图片下载失败');
// }
// }, fail: (err) => {
// console.error('图片下载失败', err);
// }
// });
xma
.
downloadFile
({
url
:
previewImages
.
value
[
index
.
value
],
// 替换为你要下载的图片URL
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
// 下载成功后保存图片到相册
saveImage
(
res
.
tempFilePath
);
}
else
{
console
.
error
(
'下载图片失败'
);
}
},
fail
:
(
err
)
=>
{
console
.
error
(
'下载图片失败'
,
err
);
}
});
}
// function saveImage(filePath) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment