修复样式

This commit is contained in:
peihaoyu 2020-09-18 21:13:55 +08:00
parent f290b65694
commit 56016fffe9
3 changed files with 85 additions and 53 deletions

View File

@ -1,25 +1,27 @@
<template>
<view class="page">
<view class="title">
{{noticeInfo.title}}
</view>
<view class="label">
{{noticeInfo.label}}
</view>
<view class="author-and-time">
<view class="author">
{{noticeInfo.real_name}}
<view class="top">
<view class="title">
{{noticeInfo.title}}
</view>
<view class="time">
{{noticeInfo.release_time}}
<view class="label">
{{noticeInfo.label}}
</view>
<view class="author-and-time">
<view class="author">
{{noticeInfo.real_name}}
</view>
<view class="time">
{{noticeInfo.release_time}}
</view>
</view>
<view class="content">
<textarea placeholder="请输入文章内容"
v-model="noticeInfo.content"
auto-height="true"
disabled="true"
></textarea>
</view>
</view>
<view class="content">
<textarea placeholder="请输入文章内容"
v-model="noticeInfo.content"
auto-height="true"
disabled="true"
></textarea>
</view>
<view class="feedback">
<view class="reading-volume">
@ -103,30 +105,40 @@
mounted() {
this.getMessageList()
},
onPullDownRefresh () {
uni.startPullDownRefresh();
},
methods: {
/**
* 点击留言弹出输入框确定
*/
clickPromptConfirm(message) {
request.post('/hs/addMessage',{
noticeId: this.noticeInfo.id,
userId: uni.getStorageSync("userInfo").user_id,
content: message
}).then(res=>{
console.log("新增留言结果",res);
if (res.data === 1) {
this.promptVisible = false;
uni.showToast({
icon: 'loading',
title: '留言成功',
});
setTimeout(()=>{
this.getMessageList();
},1000)
}
},err=>{
console.log("err",err);
})
if (message === '') {
uni.showToast({
icon: 'none',
title: '请输入留言,亲'
})
} else {
request.post('/hs/addMessage',{
noticeId: this.noticeInfo.id,
userId: uni.getStorageSync("userInfo").user_id,
content: message
}).then(res=>{
console.log("新增留言结果",res);
if (res.data === 1) {
this.promptVisible = false;
uni.showToast({
icon: 'loading',
title: '留言成功',
});
setTimeout(()=>{
this.getMessageList();
},1000)
}
},err=>{
console.log("err",err);
})
}
},
/**
* 获取留言
@ -153,6 +165,11 @@
</script>
<style scoped>
.page .top, .one-message{
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 20rpx;
}
.content textarea{
background-color: #F1F1F1;
padding: 20rpx;
@ -213,9 +230,10 @@
display: inline-block;
}
.label{
margin-left: 20rpx;
margin: 20rpx 0 20rpx 20rpx;
border-radius: 10rpx;
width: 4rem;
font-size: 30rpx;
text-align: center;
color: #ff9041;
border: 1rpx solid #ff9041;

View File

@ -11,7 +11,7 @@
</view>
</view>
<view class="header-photo cu-avatar radius" v-if="item.send_id === userInfo.user_id">
{{messageInfo.userInfo.real_name.slice(0,1)}}
{{userInfo.real_name.slice(0,1)}}
</view>
<view class="date">{{item.letter_create_time}}</view>
</view>
@ -53,10 +53,9 @@
onShow() {
this.updateRead();
this.getTwoLetterApp();
this.interval = setInterval(() => {
this.getTwoLetterApp();
} ,1000);
} ,5000);
},
onBackPress() {
clearInterval(this.interval);
@ -97,19 +96,27 @@
* 发送消息
*/
sendMessage() {
request.post('/hs/sendLetter',{
sendId: uni.getStorageSync("userInfo").user_id,
receiveId: this.messageInfo.userInfo.user_id,
content: this.messageContent
}).then(res => {
console.log("发送消息",res);
if (res.data === 1) {
this.getTwoLetterApp();
if (this.messageContent === '') {
uni.showToast({
icon: 'none',
title: '请输入消息,亲'
})
} else {
request.post('/hs/sendLetter',{
sendId: uni.getStorageSync("userInfo").user_id,
receiveId: this.messageInfo.userInfo.user_id,
content: this.messageContent
}).then(res => {
this.messageContent = '';
}
},err=>{
console.log("err",err);
})
console.log("发送消息",res);
if (res.data === 1) {
this.getTwoLetterApp();
this.messageContent = '';
}
},err=>{
console.log("err",err);
})
}
},
/**
* 改为已读

View File

@ -64,6 +64,9 @@
},
mounted() {
},
onPullDownRefresh () {
uni.startPullDownRefresh();
},
methods: {
/**
* 发表
@ -103,6 +106,10 @@
</script>
<style scoped>
.page{
background-color: #FFFFFF;
border-radius: 10rpx;
}
.button{
padding: 40rpx 100rpx 80rpx;
}