Files
tk-mini-program/pages/Forum/Forum.vue

210 lines
4.0 KiB
Vue
Raw Normal View History

2025-06-06 22:36:41 +08:00
<template>
2025-06-23 22:00:46 +08:00
<view class="forum">
<view class="bg">
<image
class="bgImg"
src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/HomeBackground.png"
mode="scaleToFill"
/>
2025-06-06 22:36:41 +08:00
</view>
2025-06-24 14:46:01 +08:00
<view class="title">站内信</view>
2025-06-23 22:00:46 +08:00
</view>
<view class="content">
2025-07-01 21:30:08 +08:00
<view class="scrollView">
<scroll-view
show-scrollbar="false"
scroll-y="true"
class="scroll"
refresher-enabled="true"
refresher-threshold="40"
@refresherrefresh="onRefresherRefresh"
lower-threshold="100"
@scrolltolower="onScrollToLower"
:refresher-triggered="triggered"
>
<view class="card" v-for="(item, index) in list" :key="index">
<view class="cardTitle">{{ item.title }}</view>
<view class="cardContent">
{{ item.content }}
</view>
<view class="cardTime">
<view class="cardTimeTitle">{{ item.time }}</view>
</view>
</view>
</scroll-view>
2025-06-06 22:36:41 +08:00
</view>
2025-06-23 22:00:46 +08:00
</view>
<view class="tabBar">
2025-06-11 22:16:44 +08:00
<tabBar :tabIndex="1"></tabBar>
2025-06-06 22:36:41 +08:00
</view>
</template>
<script>
import tabBar from "../../components/tabBar/tabBar";
2025-07-01 21:30:08 +08:00
import request from "../../components/request.js";
2025-06-23 22:00:46 +08:00
export default {
data() {
return {
2025-07-01 21:30:08 +08:00
list: [],
triggered: false,
page: 0,
pageSize: 10,
2025-06-23 22:00:46 +08:00
};
},
onShareAppMessage(res) {
if (res.from === "menu") {
return {
title: "分享",
path: getCurrentPages()[getCurrentPages().length - 1].route,
};
2025-06-06 22:36:41 +08:00
}
2025-06-23 22:00:46 +08:00
},
onLoad() {
2025-07-01 21:30:08 +08:00
this.getlist();
2025-06-23 22:00:46 +08:00
},
methods: {
2025-07-01 21:30:08 +08:00
//获取列表数据
getlist() {
request({
url: "systemMessage/list",
data: {
page: this.page,
size: this.pageSize,
},
method: "POST",
}).then((res) => {
this.triggered = false;
console.log(res);
if (res.code === 200) {
this.list.push(...res.data);
}
});
},
//下拉刷新
onRefresherRefresh() {
console.log("下拉刷新");
this.triggered = true;
this.list = [];
this.page = 0;
this.getlist();
},
//上拉加载
onScrollToLower() {
this.page ++;
this.getlist();
},
2025-06-23 22:00:46 +08:00
},
components: {
tabBar,
},
};
2025-06-06 22:36:41 +08:00
</script>
<style scoped>
.bg {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
.bgImg {
width: 100%;
height: 100%;
}
.title {
position: absolute;
top: 120rpx;
2025-07-01 21:30:08 +08:00
left: 335rpx;
2025-06-06 22:36:41 +08:00
font-size: 34rpx;
color: #100e0f;
font-weight: bold;
}
2025-06-19 22:27:00 +08:00
/* 建设中 */
2025-06-23 22:00:46 +08:00
.content {
2025-06-19 22:27:00 +08:00
position: absolute;
top: 250rpx;
left: 0rpx;
right: 0rpx;
bottom: 100rpx;
}
2025-06-23 22:00:46 +08:00
.building {
2025-06-19 22:27:00 +08:00
width: 100%;
height: 90%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
2025-06-23 22:00:46 +08:00
.buildingTitle {
2025-06-19 22:27:00 +08:00
font-size: 40rpx;
color: #999999;
font-weight: bold;
text-align: center;
margin-top: 50rpx;
}
2025-07-01 21:30:08 +08:00
.scrollView{
width: 100%;
height: 100%;
}
.scroll{
width: 100%;
height: 93%;
}
.card{
width: 570rpx;
background-color: #ffffff;
margin-top: 20rpx;
margin-left: 50rpx;
margin-right: 50rpx;
border-radius: 20rpx;
box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
align-items: center;
padding-left: 40rpx;
padding-right: 40rpx;
padding-bottom: 20rpx;
padding-top: 40rpx;
}
.cardTitle{
width: 570rpx;
height: 60rpx;
margin-top: -10rpx;
font-size: 30rpx;
color: #333333;
font-weight: bold;
text-align: center;
border-bottom: 1px solid #e5e5e5;
overflow: hidden; /* 隐藏溢出 */
text-overflow: ellipsis; /* 显示省略号 */
white-space: nowrap;
}
.cardContent{
width: 570rpx;
font-size: 28rpx;
color: #666666;
border-bottom: 1px solid #e5e5e5;
padding: 30rpx 0;
line-height: 50rpx;
}
.cardTime{
width: 100%;
height: 60rpx;
display: flex;
flex-direction: row-reverse;
align-items: center;
}
.cardTimeTitle{
font-size: 28rpx;
color: #999999;
margin-right: 20rpx;
}
2025-06-23 22:00:46 +08:00
</style>