|
@@ -44,7 +44,7 @@
|
|
|
|
|
|
<script>
|
|
|
import dayjs from 'dayjs'
|
|
|
-import { materialDetail } from '@/api/modules'
|
|
|
+import { fileDownload, materialDetail } from '@/api/modules'
|
|
|
import { copyText } from '@/utils'
|
|
|
import { savePic } from '@/utils/callFn/appFn'
|
|
|
|
|
@@ -102,18 +102,24 @@ export default {
|
|
|
this.saveEvent(link)
|
|
|
},
|
|
|
|
|
|
- saveEvent(url) {
|
|
|
+ async saveEvent(url) {
|
|
|
if (this.$env.platform === 'app') {
|
|
|
- try {
|
|
|
- savePic(
|
|
|
- url,
|
|
|
- '剑鱼标讯需要您的存储权限,将用于保存图片到本地。'
|
|
|
- )
|
|
|
- this.$toast('保存图片成功')
|
|
|
- }
|
|
|
- catch (e) {
|
|
|
- console.log(e)
|
|
|
- this.$toast('保存图片失败')
|
|
|
+ const loading = this.$toast.loading()
|
|
|
+ const { imgBase } = await fileDownload({ ossUrl: url })
|
|
|
+ if (imgBase) {
|
|
|
+ loading.clear()
|
|
|
+ const base64img = imgBase.split('base64,')[1]
|
|
|
+ try {
|
|
|
+ savePic(
|
|
|
+ base64img,
|
|
|
+ '剑鱼标讯需要您的存储权限,将用于保存图片到本地。'
|
|
|
+ )
|
|
|
+ this.$toast('保存图片成功')
|
|
|
+ }
|
|
|
+ catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ this.$toast('保存图片失败')
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else { // 微信
|