当前位置:网站首页>Design of wechat applet message board
Design of wechat applet message board
2022-04-22 17:13:00 【When there's not enough time】
Wechat applet realizes the interface of message board , It mainly involves the message and the interface to reply to the message . In the process of redesign , The main reference is the interface style of wechat circle of friends . There are still flaws , At the same time, there are ideas provided by reference posts Wechat applet Part 2 : About comments , And reply , And the realization and thinking of re reply .
In design , Because there is only an array of message information sent to me in the background , So I am request( The data from the background is sorted according to the latest time ) after , Perform the following processing on the data , Pass the existing data through answer Value (answer=0 Is the default message ) To store in two arrays msgReply[ ] and msgLeave[ ] in
let msgLeave = []
let msgReply = []
res.data.data.forEach(element => {
if (element.answer === 0) {
element.children = []
msgLeave.push(element)
} else {
msgReply.push(element)
}
})
msgReply = msgReply.reverse() // Because the message is returned through the latest time , This reply message , It should be displayed after the message , So use reverse() Reorder the array
msgLeave.forEach(element => {
msgReply.forEach(element1 => {
if (element1.answer === element.id) {
element1.toAuthor = element.author
element.children.push(element1)
}
})
})
In the process of design , Because there will be a navigation bar at the bottom , So I will input The box is designed at the head of the page , Then a problem to consider at this time is —— take input The box hangs at the top of the page .
wxml Design
<view class="page-section">
<view class="textarea-wrp">
<textarea class="input_content" auto-height />
<button type="primary" bindtap='sendComment' class="btn"> send out </button>
</view>
</view>
<view class="msg_detail ">
Message display
</view>
wxss Design
.page-section{
position: fixed;
width: 100%;
/* margin-bottom: 60rpx; */
}
textarea {
width: 700rpx;
padding: 20rpx 2px;
margin: 8px 8px 8px 0;
background: #fff;
}
.textarea-wrp {
display: flex;
padding: 0 25rpx;
background: rgb(238, 238, 238);
}
.input_content {
background: #fff;
/* padding: 2px; */
font-size: 14px;
width: 90%;
height: 40px;
border-radius: 3px;
}
.btn {
width: 60px;
height: 30px;
font-size: 13px;
margin-top: 4%;
}
.msg_detail {
padding-top: 60px; /* To solve this problem, because the top hover box position: fixed; The content is blocked */
}
Specific page details about the applet , as well as tabbar See another article for the solution Blog
版权声明
本文为[When there's not enough time]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221712242689.html
边栏推荐
- How can Hong Kong cloud servers avoid blackmail software attacks?
- Anomaly detection of log data based on deep learning
- 2022年环境影响评价工程师考试案例分析练习题及答案
- 小程序如何集成即构IM实现即时通讯发消息聊天
- ES6 对象扩展 链判断运算符 和 Null判断运算符
- [Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)
- ES6 Proxy和Object.defineProperty
- 2022 EIA Engineer Examination case analysis exercises and answers
- ES6 Generator函数和async函数
- JS to get the first character of Chinese characters
猜你喜欢

KindEditor在移动端默认显示源码模式

2022 technical guidelines and standard exercises and answers for environmental impact assessment engineer examination

小程序如何集成即构IM实现即时通讯发消息聊天

7 interview questions about closure

Distributed (III) -- realize distributed lock

Notes on deep learning (I) -- loss function

Openstack uses devstack to install. After installation, the dashboard reports an internal server error
![[Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)](/img/b1/035c907253739a3e8c68b5934fd4e0.png)
[Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)

2022年环境影响评价工程师考试技术导则与标准练习题及答案

7 Questions d'entrevue sur la fermeture
随机推荐
Test life | less than 2 years after graduation, 0 experience and won the 30W annual salary of a well-known Internet enterprise. How did he do it?
2022年环境影响评价工程师考试相关法律法规练习题及答案
[Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)
基于深度模型的日志序列异常检测
[deep learning] hands on learning pytorch version
Globalmapper20 how to convert DWG files into DXF files in batches, efficiency artifact
ES6 Proxy和Object.defineProperty
对数器的概念和使用
Introduction to webrtc: 4 Rtcpeerconnection connects audio and video streams
Opendaylight analysis of SDN learning (1)
MySQL索引底层原理
Which financial product has high income on May Day?
2022年湖南省初级会计职称考试经济法基础练习题及答案
There was another bug today. When mogodb was used to query data, it was found that the returned data was null
Notes on deep learning (I) -- loss function
【分布式项目】认证服务中心、社交登录OAuth2.0、单点登录、分布式Session解决方案
Concept and application of logarithm
GlobalMapper20 如何批量的把shp转为kml并带上属性
Cloud native observability, one of the cornerstones of cloud native building
[sentence pattern] 24. Special questions