This commit is contained in:
lanzhihui 2026-04-15 17:18:30 +08:00
parent fd6d35b044
commit 75e60a734c
2 changed files with 11 additions and 8 deletions

View File

@ -57,11 +57,13 @@ Vue.prototype.$clipboard = clipboard
Vue.prototype.$md5 = md5
Vue.use(wxShare)
Vue.use(CanvasPoster)
import { RadioGroup, Radio, AddressEdit } from 'vant'
import { RadioGroup, Radio, AddressEdit, Icon, Loading } from 'vant'
Vue.use(AddressEdit)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Icon)
Vue.use(Loading)
var i18n = new VueI18n({
locale: localStorage.getItem('locale') || 'zh',
messages: {

View File

@ -99,16 +99,12 @@ class="activity-item"
</template>
<script>
import { nextTick } from 'vue' // Vue 2 vue nextTick使 this.$nextTick
import html2canvas from 'html2canvas'
import { ImagePreview, Icon, Loading } from 'vant'
import { ImagePreview } from 'vant'
import { $toastText, $toastSuccess, $toastLoading, $toastClear } from '@/config/toast'
import requestApp from '@/utils/request'
import QRCode from 'qrcode'
import Vue from 'vue'
Vue.use(Icon)
Vue.use(Loading)
export default {
name: 'ActivityPoster',
@ -237,7 +233,9 @@ export default {
async generatePoster() {
try {
console.log(this.selectedActivity, 'pp--')
if (!this.selectedActivity) {
console.log('fd')
$toastText('请先选择活动!')
return
}
@ -271,7 +269,9 @@ export default {
$toastText('生成海报失败,请重试!')
} finally {
this.isGenerating = false
$toastClear()
setTimeout(() => {
$toastClear()
}, 3000)
}
},
@ -728,6 +728,7 @@ img {
padding: 20px;
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
transition: all 0.3s;
box-sizing: border-box;
}
.preview-header {