Commit 54d3979d authored by Damon's avatar Damon

同步保存图片

parent bb5c7fc0
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
methods: { methods: {
// 保存照片到本地 // 保存照片到本地
async saveTempToLocal(tempImagePath) { async saveTempToLocal(tempImagePath) {
return new Promise(async (resolve, reject) => {
//has_origin //是否保存原图 //has_origin //是否保存原图
let that = this let that = this
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
...@@ -86,14 +87,17 @@ ...@@ -86,14 +87,17 @@
if(photo.tempPath.mixWater){ if(photo.tempPath.mixWater){
// 保存水印处理图片到本地 // 保存水印处理图片到本地
path = photo.tempPath.mixWater path = photo.tempPath.mixWater
console.log("path", path)
let result1 = await this.saveLocal(path) let result1 = await this.saveLocal(path)
if(result1){ if(result1){
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '已将水印图片保存到本地相册' title: '已将水印图片保存到本地相册'
}) })
resolve()
} }
} }
})
}, },
saveLocal(path){ saveLocal(path){
return new Promise((resolve,reject)=>{ return new Promise((resolve,reject)=>{
...@@ -128,13 +132,13 @@ ...@@ -128,13 +132,13 @@
//this.$emit('finish') //this.$emit('finish')
}, },
// 确认图片 // 确认图片
continuePhoto() { async continuePhoto() {
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
let self = this let self = this
uni.showLoading({ uni.showLoading({
title:'图片保存中…' title:'图片保存中…'
}) })
self.saveTempToLocal() await self.saveTempToLocal()
if (this.upload) { if (this.upload) {
self.confirmUpload(true) self.confirmUpload(true)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment