|
@@ -40,6 +40,7 @@ export default defineComponent({
|
|
|
codeUrl: '',
|
|
|
shareLoading: false,
|
|
|
shareArray: tempArray || [],
|
|
|
+ saveLoading: false,
|
|
|
showType: ['', 'yellow', 'pink'] as any
|
|
|
}
|
|
|
},
|
|
@@ -59,6 +60,11 @@ export default defineComponent({
|
|
|
},
|
|
|
methods: {
|
|
|
async onSaveImg() {
|
|
|
+ // 判断是否在保存中...
|
|
|
+ if (this.saveLoading) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.saveLoading = true
|
|
|
const container: any = document.getElementById(
|
|
|
`share-preview-container${this.swiperIndex}`
|
|
|
)
|
|
@@ -74,6 +80,9 @@ export default defineComponent({
|
|
|
message: '图片生成中...',
|
|
|
forbidClick: true
|
|
|
})
|
|
|
+ setTimeout(() => {
|
|
|
+ this.saveLoading = false
|
|
|
+ }, 100)
|
|
|
const res = await promisefiyPostMessage({
|
|
|
api: 'savePicture',
|
|
|
content: {
|
|
@@ -88,6 +97,7 @@ export default defineComponent({
|
|
|
})
|
|
|
.catch(() => {
|
|
|
Toast.clear()
|
|
|
+ this.saveLoading = false
|
|
|
})
|
|
|
},
|
|
|
async shareShow() {
|
|
@@ -224,7 +234,14 @@ export default defineComponent({
|
|
|
</div>
|
|
|
|
|
|
<div class={['btnGroup', styles.shareGroupBtn]}>
|
|
|
- <Button type="primary" plain round onClick={this.onSaveImg}>
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ round
|
|
|
+ loading={this.saveLoading}
|
|
|
+ loadingText="保存中"
|
|
|
+ onClick={this.onSaveImg}
|
|
|
+ >
|
|
|
保存图片
|
|
|
</Button>
|
|
|
<Button
|