提交 b9f8f924 编写于 作者: 张磊

修改提示显示不全的问题

上级 cb3411c9
<template> <template>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view style="flex:1"> <scroll-view style="flex:1">
<!-- #endif --> <!-- #endif -->
<image src="/static/uni.png" style="margin: 30rpx 200rpx;height:350rpx;width: 350rpx;"></image> <image src="/static/uni.png" style="margin: 30rpx 200rpx;height:350rpx;width: 350rpx;"></image>
<button style="margin: 30rpx;" @click="saveImage">将图片保存到相册</button> <button style="margin: 30rpx;" @click="saveImage">将图片保存到相册</button>
<!-- #ifdef APP --> <!-- #ifdef APP -->
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
</template> </template>
...@@ -13,23 +13,24 @@ ...@@ -13,23 +13,24 @@
export default { export default {
data() { data() {
return { return {
} }
}, },
methods: { methods: {
saveImage() { saveImage() {
uni.saveImageToPhotosAlbum({ uni.saveImageToPhotosAlbum({
filePath:"/static/uni.png", filePath: "/static/uni.png",
success() { success() {
uni.showToast({ uni.showToast({
icon:"none", position: "center",
title:"图片保存成功,请到相册查看" icon: "none",
title: "图片保存成功,请到相册查看"
}) })
}, },
fail(e) { fail(e) {
uni.showToast({ uni.showToast({
icon:"none", position: "center",
title:"图片保存失败,"+JSON.stringify(e) icon: "none",
title: "图片保存失败,code:" + e.errCode + ",message:" + e.errMsg
}) })
} }
}) })
...@@ -39,5 +40,4 @@ ...@@ -39,5 +40,4 @@
</script> </script>
<style> <style>
</style>
</style> \ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册