import { mapGetters } from 'vuex' export default { data() { return { content: '', showModal: false, } }, computed: { ...mapGetters(['supplierInfo', 'userInfo', 'routePrefix']), isEmpty() { return this.content.length === 0 }, }, methods: { async onSubmit() { const { clubUserId } = this.userInfo if (this.isEmpty) { this.$toast('留言不能为空') return } try { await this.$http.api.feedback({ clubUserId, content: this.content }) this.showModal = true this.content = '' } catch (error) { console.log(error) } }, onConfirm() { this.showModal = false this.$router.push(this.routePrefix) }, }, }