|
@@ -25,7 +25,7 @@ import html2canvas from 'html2canvas'
|
25
|
25
|
import QRCode from 'qrcode'
|
26
|
26
|
import MainPageContainer from '../../../components/common/MainPageContainer'
|
27
|
27
|
import { createNamespacedHelpers } from 'vuex'
|
28
|
|
-const { mapState: mapUserState } = createNamespacedHelpers('user')
|
|
28
|
+const { mapState: mapUserState, mapActions: mapUserActions } = createNamespacedHelpers('user')
|
29
|
29
|
export default {
|
30
|
30
|
name: '',
|
31
|
31
|
data () {
|
|
@@ -55,6 +55,9 @@ export default {
|
55
|
55
|
})
|
56
|
56
|
},
|
57
|
57
|
methods: {
|
|
58
|
+ ...mapUserActions([
|
|
59
|
+ 'UploadBase64Img'
|
|
60
|
+ ]),
|
58
|
61
|
GetBase64Image (img) {
|
59
|
62
|
let canvas = document.createElement('canvas')
|
60
|
63
|
canvas.width = img.width
|
|
@@ -67,8 +70,14 @@ export default {
|
67
|
70
|
return dataURL
|
68
|
71
|
},
|
69
|
72
|
SaveImg () {
|
70
|
|
- if (this.$refs.CanvasImgDownload) {
|
71
|
|
- this.$refs.CanvasImgDownload.click()
|
|
73
|
+ if (window.downloadImage) {
|
|
74
|
+ this.UploadBase64Img({ data: { image: this.Base64Img } }).then((res) => {
|
|
75
|
+ window.downloadImage(res.data.data)
|
|
76
|
+ })
|
|
77
|
+ } else {
|
|
78
|
+ if (this.$refs.CanvasImgDownload) {
|
|
79
|
+ this.$refs.CanvasImgDownload.click()
|
|
80
|
+ }
|
72
|
81
|
}
|
73
|
82
|
},
|
74
|
83
|
Init () {
|