-
Notifications
You must be signed in to change notification settings - Fork 12
/
myReply.vue
131 lines (129 loc) · 2.43 KB
/
myReply.vue
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
<template>
<view id="myReply">
<view class="bottom-reply" @click="myReplayBtn(0)">
<u-line />
<view class="reply">
<u-avatar size="45" :src="avatar"></u-avatar>
<view class="bg-input">
<u-icon name="edit-pen-fill"></u-icon>
我来说几句...
</view>
</view>
</view>
<view>
<u-popup :safe-area-inset-bottom="true" mode="bottom" v-model="replayShow">
<view class="my-reply">
<u-input maxlength="1000" v-model="query.content" placeholder="我来说几句..." focus border type="textarea"/>
<view @click="replayShowBtn" class="send" :class="query.content ? 'yesSend' : 'noSend'">
发送
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script>
import {add_reply} from '../api/postManagement/index.js'
export default {
props: {
post_id: {
type: String,
default: ''
}
},
data() {
return {
avatar: this.$store.state.user.avatar,
replayShow: false,
query: {
post_id: '',
content: '',
reply_id: 0
},
};
},
beforeCreate() {
},
created() {
},
methods: {
myReplayBtn(id) {
this.query.reply_id = id
this.replayShow = true
},
replayShowBtn() {
if(this.query.content) {
uni.showLoading({
mask: true,
title: '发送中...'
})
add_reply(this.query).then(res=>{
uni.showToast({
icon: 'none',
title: '发送成功'
})
this.$emit('getReplyList')
}).catch(err=>{
console.log(err)
})
this.query.content = ''
this.replayShow = false
setTimeout(_=>{
uni.hideLoading()
},100)
} else {
uni.showToast({
icon: 'none',
title: '评论不能为空'
})
}
},
},
beforeMount() {
},
mounted() {
},
destroyed() {
}
}
</script>
<style lang="scss">
.bottom-reply {
z-index: 9999;
position: fixed;
bottom: 0rpx;
width: 100%;
background-color: #fff;
.reply {
align-items: center;
padding: 20rpx;
display: flex;
flex-direction: row;
.bg-input {
padding: 10rpx;
margin-left: 12rpx;
border-radius: 23rpx;
background-color: rgb(242, 242, 242);
width: 95%;
color: #9a9a9a;
font-size: 18rpx;
}
}
}
.my-reply {
display: flex;
align-items: center;
padding: 20rpx;
.send {
padding: 0rpx 0rpx 0rpx 20rpx;
}
.yesSend {
color: #5677fc;
font-weight: bold;
}
.noSend {
color: #9a9a9a;
font-weight: bold;
}
}
</style>