commentContent.vue
3.7 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<template>
<view class="content">
<view class="title">
<image class="photo" :src="image"></image>
<view class="name">{{nickname}}</view>
</view>
<view class="contentBox">
<view class="comment" :style="{'margin-left:246rpx;': user_id==item.usera_id}" v-for="(item,index) in meslist" :key="index">
<span>{{item.des_content}}</span>
<view class="time">{{item.createtime}}</view>
</view>
</view>
<view class="inputBox">
<input type="text" class="input" v-model="des_content">
<view class="btn" @click="sendmsg">发送</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data(){
return{
des_content:'',
userb_id:'',
page:1,
size:10,
meslist:[],
image:'',
nickname:'',
user_id:''
}
},
methods:{
sendmsg(){
var that = this
var url = "mes/sendMes"
var params = {
token:uni.getStorageSync('token'),
userb_id:that.userb_id,
des_content:that.des_content
}
app.post(url,params,"post").then((res)=>{
console.log(res)
that.des_content=''
}).catch((err)=>{
console.log(err)
})
},
getmeslist(){
var that = this
var url = "mes/getMesDetail"
var params = {
token:uni.getStorageSync('token'),
page:that.page,
size:that.size,
userb_id:that.userb_id
}
app.post(url,params,"get").then((res)=>{
console.log(res)
that.meslist=res
}).catch((err)=>{
console.log(err)
})
}
},
onLoad(options){
console.log(options)
this.userb_id=options.userb_id
this.user_id=options.user_id
this.nickname=options.nickname
this.image=options.head_image
this.getmeslist()
}
}
</script>
<style lang="less">
.content{
background-color: #F9F9F9;
.title{
display: flex;
align-items: center;
background-color: #fff;
padding: 16rpx 32rpx;
.photo{
width: 68rpx;
height: 68rpx;
}
.name{
font-size: 28rpx;
margin-left: 18rpx;
}
}
.contentBox{
// height: 100vh;
background-color: #F9F9F9;
.right{
margin-left:246rpx;
}
.comment{
color:rgba(6,18,30,1);
font-size: 24rpx;
width:472rpx;
background:rgba(255,255,255,1);
padding: 22rpx 18rpx;
box-sizing: border-box;
margin: 56rpx 32rpx;
.time{
text-align: right;
color: #8C9198;
font-size: 22rpx;
}
}
}
.inputBox{
display: flex;
background-color: #fff;
padding: 16rpx 32rpx;
position: fixed;
bottom: 0;
.input{
width:506rpx;
height:68rpx;
background:rgba(238,238,238,1);
opacity:1;
border-radius:8rpx;
}
.btn{
width:150rpx;
height:68rpx;
background:rgba(129,195,191,1);
opacity:1;
border-radius:8rpx;
color: #fff;
text-align: center;
line-height: 68rpx;
font-size: 24rpx;
margin-left: 30rpx;
}
}
}
</style>