first commit
This commit is contained in:
104
pages/qa/qa.js
Normal file
104
pages/qa/qa.js
Normal file
@@ -0,0 +1,104 @@
|
||||
// pages/messageEdit/messageEdit.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
messages: [
|
||||
{
|
||||
id: 1, // unique identifier for each message
|
||||
title: "留言标题1",
|
||||
date: "2024-01-01"
|
||||
},
|
||||
{
|
||||
id: 1, // unique identifier for each message
|
||||
title: "留言标题1",
|
||||
date: "2024-01-01"
|
||||
},
|
||||
{
|
||||
id: 1, // unique identifier for each message
|
||||
title: "留言标题1",
|
||||
date: "2024-01-01"
|
||||
},
|
||||
{
|
||||
id: 1, // unique identifier for each message
|
||||
title: "留言标题1",
|
||||
date: "2024-01-01"
|
||||
},
|
||||
{
|
||||
id: 1, // unique identifier for each message
|
||||
title: "留言标题1",
|
||||
date: "2024-01-01"
|
||||
},
|
||||
{
|
||||
id: 1, // unique identifier for each message
|
||||
title: "留言标题1",
|
||||
date: "2024-01-01"
|
||||
},
|
||||
// 更多留言...
|
||||
]
|
||||
},
|
||||
|
||||
goToMessageEdit: function () {
|
||||
wx.navigateTo({
|
||||
url: '/pages/messageEdit/messageEdit'
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
5
pages/qa/qa.json
Normal file
5
pages/qa/qa.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTextStyle": "white",
|
||||
"navigationBarTitleText": "问答"
|
||||
}
|
||||
14
pages/qa/qa.wxml
Normal file
14
pages/qa/qa.wxml
Normal file
@@ -0,0 +1,14 @@
|
||||
<view class="messages-page">
|
||||
<!-- 留言列表 -->
|
||||
<view class="message-list">
|
||||
<block wx:for="{{messages}}" wx:key="unique">
|
||||
<navigator url="/pages/messageDetail/messageDetail?id={{item.id}}" class="message-card">
|
||||
<view class="message-title">{{item.title}}</view>
|
||||
<view class="message-date">{{item.date}}</view>
|
||||
</navigator>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
|
||||
<button class="leave-message-btn" bindtap="goToMessageEdit">我要留言</button>
|
||||
</view>
|
||||
38
pages/qa/qa.wxss
Normal file
38
pages/qa/qa.wxss
Normal file
@@ -0,0 +1,38 @@
|
||||
.messages-page {
|
||||
position: relative; /* 为子元素绝对定位提供参考 */
|
||||
padding: 20rpx;
|
||||
padding-bottom: 100rpx; /* 留出足够的空间给底部的按钮 */
|
||||
}
|
||||
|
||||
.message-list .message-card {
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
margin: 10px 0;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.message-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.message-date {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.leave-message-btn {
|
||||
position: fixed; /* 固定位置 */
|
||||
bottom: 20px; /* 距离底部20px */
|
||||
left: 50%; /* 水平居中 */
|
||||
transform: translateX(-50%); /* 与left配合使其完全居中 */
|
||||
width: 90%;
|
||||
padding: 10px;
|
||||
border-radius: 20px; /* 增加圆角 */
|
||||
font-size: 16px;
|
||||
color: black; /* 字体颜色为红色 */
|
||||
background-color: white; /* 按钮背景色,可以根据需要调整 */
|
||||
border: 1px solid #ccc; /* 轻微边框,可以根据需要调整 */
|
||||
}
|
||||
Reference in New Issue
Block a user