Commit 1f72cc2e authored by 刘文虎's avatar 刘文虎
parents afe71054 ed3d7e00
Pipeline #3244 canceled with stages
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
<text>{{ info.backContext }}</text> <text>{{ info.backContext }}</text>
</view> </view>
</view> </view>
<l-painter
:board="posterSave"
isCanvasToTempFilePath
@success="handleCanvasSuccessSave"
custom-style="position: fixed; left: 200%"
/>
</view> </view>
</template> </template>
...@@ -24,7 +30,9 @@ export default { ...@@ -24,7 +30,9 @@ export default {
}, },
data() { data() {
return { return {
loading: true, saveUrl: '',
posterSave: {},
currentBlock: () => {},
} }
}, },
computed: { computed: {
...@@ -42,9 +50,117 @@ export default { ...@@ -42,9 +50,117 @@ export default {
return this.baseUrl + 'muban3fanmian@3x.png' return this.baseUrl + 'muban3fanmian@3x.png'
} }
}, },
currentPosterSave() {
return {
css: {
width: '702rpx',
height: '420rpx',
'border-radius': '16rpx',
'background-color': '#ffffff',
border: '2rpx solie #f6f7fa',
},
views: [
{
src: this.image,
type: 'image',
css: {
position: 'absolute',
top: '0',
right: '0',
width: '100%',
height: '100%',
'border-radius': '16rpx',
},
},
{
type: 'view',
css: {
position: 'absolute',
top: '8rpx',
right: '0',
height: '0',
width: '100%',
height: '100%',
},
views: [
{
type: 'text',
text: this.info.backTitle,
css: {
position: 'absolute',
height: '60rpx',
'line-height': '60rpx',
fontSize: '40rpx',
'font-weight': 'bold',
left: '32rpx',
color: '#ffffff',
textAlign: 'center',
top: '70rpx',
width: '638rpx',
},
},
{
type: 'text',
text: this.info.backContext,
css: {
position: 'absolute',
top: '180rpx',
left: '32rpx',
fontSize: '28rpx',
color: '#ffffff',
fontWeight: 'bold',
textAlign: 'center',
width: '638rpx',
},
},
],
},
],
}
},
}, },
methods: {}, methods: {
handleCanvasSuccessSave(url) {
this.saveUrl = url
this.currentBlock(url)
},
saveImage(type = 'save') {
this.currentBlock = (url) => {
uni.saveImageToPhotosAlbum({
filePath: url,
success: () => {
// this.$refs.uToast.show({
// title: '保存成功',
// type: 'success',
// duration: 1500,
// callback: () => {},
// })
},
fail: (err) => {
var str = err && err.errMsg
if (str && str.indexOf('cancel') != -1) {
str = '取消保存'
}
this.$refs.uToast.show({
title: str,
type: 'error',
duration: 1500,
callback: () => {},
})
},
complete: (res) => {
this.$emit('save', res)
},
})
}
if (this.saveUrl) {
this.currentBlock(this.saveUrl)
} else {
this.posterSave = this.currentPosterSave
}
},
},
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -52,8 +52,6 @@ export default { ...@@ -52,8 +52,6 @@ export default {
this.$refs.card.updateImage() this.$refs.card.updateImage()
}, },
saveImage() { saveImage() {
this.$refs.card.saveImage()
return
this.$refs.cardBack.saveImage() this.$refs.cardBack.saveImage()
}, },
handleClickCard() { handleClickCard() {
......
...@@ -212,7 +212,7 @@ export default { ...@@ -212,7 +212,7 @@ export default {
top: '180rpx', top: '180rpx',
left: '32rpx', left: '32rpx',
fontSize: '28rpx', fontSize: '28rpx',
color: ' #333333', color: '#333333',
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'left', textAlign: 'left',
}, },
...@@ -346,7 +346,7 @@ export default { ...@@ -346,7 +346,7 @@ export default {
top: '200rpx', top: '200rpx',
left: '32rpx', left: '32rpx',
fontSize: '28rpx', fontSize: '28rpx',
color: ' #333333', color: '#333333',
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'left', textAlign: 'left',
}, },
...@@ -454,7 +454,7 @@ export default { ...@@ -454,7 +454,7 @@ export default {
top: '40rpx', top: '40rpx',
left: '32rpx', left: '32rpx',
fontSize: '28rpx', fontSize: '28rpx',
color: ' #333333', color: '#333333',
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'left', textAlign: 'left',
}, },
...@@ -633,7 +633,7 @@ export default { ...@@ -633,7 +633,7 @@ export default {
top: '180rpx', top: '180rpx',
left: '32rpx', left: '32rpx',
fontSize: '28rpx', fontSize: '28rpx',
color: ' #333333', color: '#333333',
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'left', textAlign: 'left',
}, },
...@@ -781,7 +781,7 @@ export default { ...@@ -781,7 +781,7 @@ export default {
top: '200rpx', top: '200rpx',
left: '32rpx', left: '32rpx',
fontSize: '28rpx', fontSize: '28rpx',
color: ' #333333', color: '#333333',
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'left', textAlign: 'left',
}, },
...@@ -904,7 +904,7 @@ export default { ...@@ -904,7 +904,7 @@ export default {
top: '40rpx', top: '40rpx',
left: '32rpx', left: '32rpx',
fontSize: '28rpx', fontSize: '28rpx',
color: ' #333333', color: '#333333',
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'left', textAlign: 'left',
}, },
......
...@@ -88,16 +88,18 @@ export default { ...@@ -88,16 +88,18 @@ export default {
// this.initDate(); // this.initDate();
}, },
onReady() { onReady() {
this.$refs['scroll-box']?.reloadList(); this.firstEnter = false
this.firstEnter = false;
}, },
onShow() { onShow() {
console.log('onShow');
if (!this.firstEnter) { if (!this.firstEnter) {
if (this.current == 0) { if (this.current == 0) {
this.$refs['scroll-box']?.reloadList(); this.$nextTick(()=> {
this.$refs['scroll-box'].reloadList();
})
} else if (this.current == 1) { } else if (this.current == 1) {
this.$refs['chart-view']?.reloadData(); this.$nextTick(()=> {
this.$refs['chart-view'].reloadData();
})
} }
// this.getMouthStatistics(); // this.getMouthStatistics();
} }
......
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
let params = { let params = {
current: this.current, current: this.current,
size: this.size, size: this.size,
month: this.date month: this.defaultDate
}; };
let res = await getList(params); let res = await getList(params);
if (this.current === 1) { if (this.current === 1) {
......
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