Commit 54d3979d authored by Damon's avatar Damon

同步保存图片

parent bb5c7fc0
......@@ -64,36 +64,40 @@
methods: {
// 保存照片到本地
async saveTempToLocal(tempImagePath) {
//has_origin //是否保存原图
let that = this
const photo = getApp().globalData.photo
if(!photo.tempPath){
return
}
let path = ''
if(photo.tempPath.origin && photo.waterSetting.hasOrigin){
// 保存原图到本地
path = photo.tempPath.origin
let result = await this.saveLocal(path)
if(result){
uni.showToast({
icon: 'none',
title: '已将照片原图保存到本地相册'
})
return new Promise(async (resolve, reject) => {
//has_origin //是否保存原图
let that = this
const photo = getApp().globalData.photo
if(!photo.tempPath){
return
}
}
if(photo.tempPath.mixWater){
// 保存水印处理图片到本地
path = photo.tempPath.mixWater
let result1 = await this.saveLocal(path)
if(result1){
uni.showToast({
icon: 'none',
title: '已将水印图片保存到本地相册'
})
let path = ''
if(photo.tempPath.origin && photo.waterSetting.hasOrigin){
// 保存原图到本地
path = photo.tempPath.origin
let result = await this.saveLocal(path)
if(result){
uni.showToast({
icon: 'none',
title: '已将照片原图保存到本地相册'
})
}
}
}
if(photo.tempPath.mixWater){
// 保存水印处理图片到本地
path = photo.tempPath.mixWater
console.log("path", path)
let result1 = await this.saveLocal(path)
if(result1){
uni.showToast({
icon: 'none',
title: '已将水印图片保存到本地相册'
})
resolve()
}
}
})
},
saveLocal(path){
return new Promise((resolve,reject)=>{
......@@ -128,13 +132,13 @@
//this.$emit('finish')
},
// 确认图片
continuePhoto() {
async continuePhoto() {
const photo = getApp().globalData.photo
let self = this
uni.showLoading({
title:'图片保存中…'
})
self.saveTempToLocal()
await self.saveTempToLocal()
if (this.upload) {
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