<template>
	<!-- #ifdef APP -->
	<scroll-view style="flex:1">
		<!-- #endif -->
		<image src="/static/uni.png" style="margin: 30rpx 200rpx;height:196px;width:196px;"></image>
		<button style="margin: 30rpx;" @click="saveImage">将图片保存到手机相册</button>
		<!-- #ifdef APP -->
	</scroll-view>
	<!-- #endif -->
</template>

<script>
	export default {
		data() {
			return {
			}
		},
		methods: {
			saveImage() {
				uni.saveImageToPhotosAlbum({
					filePath: "/static/uni.png",
					success() {
						uni.showToast({
							position: "center",
							icon: "none",
							title: "图片保存成功，请到手机相册查看"
						})
					},
					fail(e) {
						uni.showModal({
							content: "保存相册失败，errCode：" + e.errCode + "，errMsg：" + e.errMsg + "，errSubject：" + e.errSubject,
							showCancel: false
						});
					}
				})
			}
		}
	}
</script>

<style>
</style>
