|
|
|
@ -77,36 +77,39 @@ export const takePhotoWithWaterMark = async ({ |
|
|
|
await ensureW6sAuth() |
|
|
|
console.log('[w6sMedia] 鉴权完成, 准备调起拍照') |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
w6s.image.takePicture({ |
|
|
|
editable: false, |
|
|
|
success: function (res) { |
|
|
|
console.log('[w6sMedia] takePhotoAndAddWaterMark success 原始返回:', res) |
|
|
|
console.log('[w6sMedia] 返回字段 imageURL:', res?.imageURL, 'key:', res?.key, 'imageInfo:', res?.imageInfo) |
|
|
|
resolve(res) |
|
|
|
}, |
|
|
|
fail: function (err) { |
|
|
|
console.error('[w6sMedia] takePhotoAndAddWaterMark fail:', err) |
|
|
|
reject(err) |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
// w6s.image.takePhotoAndAddWaterMark({
|
|
|
|
// content,
|
|
|
|
// fontSize,
|
|
|
|
// color,
|
|
|
|
// markDisable: false,
|
|
|
|
// timeEnable,
|
|
|
|
// locationEnable,
|
|
|
|
// success: (res) => {
|
|
|
|
// w6s.image.takePicture({
|
|
|
|
// editable: false,
|
|
|
|
// success: function (res) {
|
|
|
|
// console.log('[w6sMedia] takePhotoAndAddWaterMark success 原始返回:', res)
|
|
|
|
// console.log('[w6sMedia] 返回字段 imageURL:', res?.imageURL, 'key:', res?.key, 'imageInfo:', res?.imageInfo)
|
|
|
|
// resolve(res)
|
|
|
|
// },
|
|
|
|
// fail: (err) => {
|
|
|
|
// console.error('[w6sMedia] takePhotoAndAddWaterMark fail:', err)
|
|
|
|
// fail: function (err) {
|
|
|
|
// console.error('[w6sMedia] takePhotoAndAddWaterMark fail:', err)
|
|
|
|
// reject(err)
|
|
|
|
// },
|
|
|
|
// })
|
|
|
|
// },
|
|
|
|
// });
|
|
|
|
w6s.image.takePhotoAndAddWaterMark({ |
|
|
|
content, |
|
|
|
fontSize, |
|
|
|
color, |
|
|
|
// markDisable: false,
|
|
|
|
timeEnable, |
|
|
|
// locationEnable,
|
|
|
|
success: (res) => { |
|
|
|
console.log('[w6sMedia] takePhotoAndAddWaterMark success 原始返回:', res) |
|
|
|
console.log('[w6sMedia] 返回字段 imageURL:', res?.result.imageURL, 'key:', res?.result.key, 'imageInfo:', res?.result.imageInfo) |
|
|
|
getLocation().then((location) => { |
|
|
|
console.log('[w6sMedia] 获取定位成功:', location) |
|
|
|
// res?.result.location = location
|
|
|
|
resolve(res) |
|
|
|
}) |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
console.error('[w6sMedia] takePhotoAndAddWaterMark fail:', err) |
|
|
|
reject(err) |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|