Showing
2 changed files
with
24 additions
and
27 deletions
| ... | @@ -50,18 +50,34 @@ | ... | @@ -50,18 +50,34 @@ |
| 50 | </template> | 50 | </template> |
| 51 | 51 | ||
| 52 | <script setup> | 52 | <script setup> |
| 53 | -import icon_x from '@images/x.png' | ||
| 54 | import icon_y from '@images/y.png' | 53 | import icon_y from '@images/y.png' |
| 55 | -import MyButton from '@/components/MyButton/index.vue' | ||
| 56 | import { Toast } from 'vant'; | 54 | import { Toast } from 'vant'; |
| 57 | 55 | ||
| 58 | -import { ref, reactive, onMounted } from 'vue' | 56 | +import { ref } from 'vue' |
| 57 | + | ||
| 59 | // const props = defineProps({ | 58 | // const props = defineProps({ |
| 60 | // showPopup: Boolean | 59 | // showPopup: Boolean |
| 61 | // }) | 60 | // }) |
| 62 | 61 | ||
| 63 | - onMounted(() => { | 62 | +const emit = defineEmits(['on-close', 'on-submit']); |
| 64 | - }) | 63 | + |
| 64 | +const show = ref(false) | ||
| 65 | +const message = ref('') | ||
| 66 | + | ||
| 67 | +const closeBtn = () => { | ||
| 68 | + emit('on-close', false) | ||
| 69 | + show.value = false; | ||
| 70 | +} | ||
| 71 | + | ||
| 72 | +const submitComment = () => { | ||
| 73 | + if (message.value) { | ||
| 74 | + show.value = false; | ||
| 75 | + emit('on-submit', message.value); | ||
| 76 | + message.value = ''; | ||
| 77 | + } else { | ||
| 78 | + Toast.fail('留言不能为空'); | ||
| 79 | + } | ||
| 80 | +} | ||
| 65 | </script> | 81 | </script> |
| 66 | 82 | ||
| 67 | <script> | 83 | <script> |
| ... | @@ -69,8 +85,6 @@ export default { | ... | @@ -69,8 +85,6 @@ export default { |
| 69 | props: ['showPopup', 'type', 'replayUser'], | 85 | props: ['showPopup', 'type', 'replayUser'], |
| 70 | data () { | 86 | data () { |
| 71 | return { | 87 | return { |
| 72 | - show: false, | ||
| 73 | - message: '' | ||
| 74 | } | 88 | } |
| 75 | }, | 89 | }, |
| 76 | mounted () { | 90 | mounted () { |
| ... | @@ -83,23 +97,6 @@ export default { | ... | @@ -83,23 +97,6 @@ export default { |
| 83 | } | 97 | } |
| 84 | }, | 98 | }, |
| 85 | methods: { | 99 | methods: { |
| 86 | - onClose () { | ||
| 87 | - this.show = false; | ||
| 88 | - }, | ||
| 89 | - refreshBtn () {}, | ||
| 90 | - closeBtn () { | ||
| 91 | - this.$emit('on-close', false) | ||
| 92 | - this.show = false; | ||
| 93 | - }, | ||
| 94 | - submitComment () { | ||
| 95 | - if (this.message) { | ||
| 96 | - this.show = false; | ||
| 97 | - this.$emit('on-submit', this.message); | ||
| 98 | - this.message = ''; | ||
| 99 | - } else { | ||
| 100 | - Toast.fail('留言不能为空'); | ||
| 101 | - } | ||
| 102 | - } | ||
| 103 | } | 100 | } |
| 104 | } | 101 | } |
| 105 | </script> | 102 | </script> | ... | ... |
| ... | @@ -115,11 +115,11 @@ export default { | ... | @@ -115,11 +115,11 @@ export default { |
| 115 | margin-top: 0.5rem; | 115 | margin-top: 0.5rem; |
| 116 | overflow: auto; | 116 | overflow: auto; |
| 117 | .plain { | 117 | .plain { |
| 118 | - width: 29%; float: left; | 118 | + width: 28%; float: left; |
| 119 | - margin-right: 1%; | 119 | + margin-right: 3%; |
| 120 | } | 120 | } |
| 121 | .primary { | 121 | .primary { |
| 122 | - width: 70%; float: left; | 122 | + width: 69%; float: left; |
| 123 | } | 123 | } |
| 124 | } | 124 | } |
| 125 | } | 125 | } | ... | ... |
-
Please register or login to post a comment