index.vue
3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<template>
<van-popup
v-model:show="show"
:close-on-click-overlay="false"
position="bottom"
:style="{ height: '100%' }"
>
<div class="van-hairline--bottom">
<van-row>
<van-col span="4">
</van-col>
<van-col span="16" style="color: #222222; text-align: center; line-height: 3;">
<span v-if="type === 'comment'">留言</span>
<span v-else>回复</span>
</van-col>
<van-col span="4" @click="closeBtn">
<div style="padding: 1rem;">
<van-icon :name="icon_y" size="1.25rem" />
</div>
</van-col>
</van-row>
</div>
<div style="background-color: #F7F7F7; font-size: 0.9rem;">
<p style="color: #777777; padding: 1rem;">您的留言评论将会展示在页面中,请谨慎发表留言评论</p>
<van-row>
<van-col span="16">
<p v-if="type === 'comment'" style="padding: 1rem; padding-top: 0;">请写下你友善的留言:</p>
<p v-else style="padding: 1rem; padding-top: 0;">回复<span style="color: #0B3A72;">@是妮妮吖~:</span></p>
</van-col>
<van-col span="8">
<div class="button-primary-comment" @click="submitComment">发送</div>
</van-col>
</van-row>
</div>
<div>
<van-cell-group inset>
<van-field
v-model="message"
rows="2"
autosize
label=""
type="textarea"
maxlength="200"
:placeholder="type === 'comment' ? '请输入留言内容' : '请输入回复内容'"
show-word-limit
/>
</van-cell-group>
</div>
</van-popup>
</template>
<script setup>
import icon_x from '@images/x.png'
import icon_y from '@images/y.png'
import MyButton from '@/components/MyButton/index.vue'
import { ref, reactive, onMounted } from 'vue'
// const props = defineProps({
// showPopup: Boolean
// })
const message = ref('')
onMounted(() => {
})
</script>
<script>
export default {
props: ['showPopup', 'type'],
data () {
return {
show: false
}
},
mounted () {
},
watch: {
showPopup (value, pre) {
if (value) {
this.show = value;
}
}
},
methods: {
onClose () {
this.show = false;
},
refreshBtn () {},
closeBtn () {
this.$emit('on-close', false)
this.show = false;
},
submitComment () {
this.$emit('on-close', false)
this.show = false;
}
}
}
</script>
<style lang="less" scoped>
.comment-wrapper {
color: #999999;
padding: 1rem;
line-height: 1.75;
.reply-wrapper {
background: #F7F7F7;
border-radius: 10px;
padding: 0.5rem;
margin-top: 0.5rem;
color: #0B3A72;
.content {
color: #222222;
}
}
}
.button-primary-comment {
width: 5rem;
height: auto;
text-align: center;
padding: 0.2rem;
// margin: 0.25rem;
font-size: 0.9rem;
background: #F9D95C;
border-radius: 24px;
border: 1px solid #F9D95C;
color: #713610;
font-weight: bold;
margin-left: 1rem;
margin-bottom: 1rem;
}
</style>