Commit 93077745 authored by 刘文虎's avatar 刘文虎
parents f1214a7a d26e7519
Pipeline #3072 canceled with stages
......@@ -80,12 +80,18 @@
</view>
</template>
<l-painter
:board="poster"
:board="posterSave"
isCanvasToTempFilePath
@success="handleCanvasSuccess"
@success="handleCanvasSuccessSave"
custom-style="position: fixed; left: 200%"
/>
<QRCodeView :url="shareUrl" @canvas="handleCanvas" />
<l-painter
:board="posterShare"
isCanvasToTempFilePath
@success="handleCanvasSuccessShare"
custom-style="position: fixed; right: 200%"
/>
<QRCodeView :url="codeShareUrl" @canvas="handleCanvas" />
<u-toast ref="uToast" />
</view>
</template>
......@@ -112,10 +118,10 @@ export default {
size: 60,
img: '',
codeUrl: '',
poster: {},
posterShare: {},
posterSave: {},
saveUrl: '',
currentBlock: () => {},
type: 'share',
}
},
computed: {
......@@ -131,7 +137,7 @@ export default {
isBlack() {
return this.info.coverUrl == 'black'
},
shareUrl() {
codeShareUrl() {
return card_share_url + `?cardId=${this.info.id}`
},
// green 绿;blue 蓝;black 黑;
......@@ -154,8 +160,7 @@ export default {
}
}
},
currentPoster() {
if (this.isSave) {
currentPosterSave() {
switch (this.info.coverUrl) {
case 'green':
return {
......@@ -277,7 +282,7 @@ export default {
},
{
type: 'qrcode',
text: this.shareUrl,
text: this.codeShareUrl,
css: {
position: 'absolute',
width: '120rpx',
......@@ -411,7 +416,7 @@ export default {
},
{
type: 'qrcode',
text: this.shareUrl,
text: this.codeShareUrl,
css: {
position: 'absolute',
width: '120rpx',
......@@ -519,7 +524,7 @@ export default {
},
{
type: 'qrcode',
text: this.shareUrl,
text: this.codeShareUrl,
css: {
position: 'absolute',
width: '120rpx',
......@@ -562,7 +567,8 @@ export default {
],
}
}
} else if (this.isShare) {
},
currentPosterShare() {
switch (this.info.coverUrl) {
case 'green':
return {
......@@ -697,7 +703,7 @@ export default {
},
{
type: 'qrcode',
text: this.shareUrl,
text: this.codeShareUrl,
css: {
position: 'absolute',
width: '120rpx',
......@@ -845,7 +851,7 @@ export default {
},
{
type: 'qrcode',
text: this.shareUrl,
text: this.codeShareUrl,
css: {
position: 'absolute',
width: '120rpx',
......@@ -968,7 +974,7 @@ export default {
},
{
type: 'qrcode',
text: this.shareUrl,
text: this.codeShareUrl,
css: {
position: 'absolute',
width: '120rpx',
......@@ -1013,7 +1019,6 @@ export default {
],
}
}
}
},
isSave() {
return this.type == 'save'
......@@ -1029,14 +1034,14 @@ export default {
handleCanvas(url) {
this.codeUrl = url
},
handleCanvasSuccess(url) {
if (this.isSave) {
this.saveUrl = url
}
handleCanvasSuccessShare(url) {
this.$emit('update', url)
},
handleCanvasSuccessSave(url) {
this.saveUrl = url
this.currentBlock(url)
},
saveImage(type = 'save') {
this.type = type
this.currentBlock = (url) => {
uni.saveImageToPhotosAlbum({
filePath: url,
......@@ -1068,16 +1073,12 @@ export default {
if (this.saveUrl) {
this.currentBlock(this.saveUrl)
} else {
console.log('------currentPoster-------', this.currentPoster)
this.poster = this.currentPoster
this.posterSave = this.currentPosterSave
}
},
updateImage(type = 'share') {
this.type = type
this.currentBlock = (url) => {
this.$emit('update', url)
}
this.poster = this.currentPoster
updateImage() {
console.log('----updateImage-------')
this.posterShare = this.currentPosterShare
},
},
}
......
This diff is collapsed.
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