上传代码
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_request = require("../../components/request.js");
|
||||
const tabBar = () => "../../components/tabBar/tabBar.js";
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
title: "Hello"
|
||||
list: [],
|
||||
triggered: false,
|
||||
page: 0,
|
||||
pageSize: 10
|
||||
};
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
@@ -16,9 +20,39 @@ const _sfc_main = {
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getlist();
|
||||
},
|
||||
methods: {
|
||||
// 方法定义
|
||||
//获取列表数据
|
||||
getlist() {
|
||||
components_request.request({
|
||||
url: "systemMessage/list",
|
||||
data: {
|
||||
page: this.page,
|
||||
size: this.pageSize
|
||||
},
|
||||
method: "POST"
|
||||
}).then((res) => {
|
||||
this.triggered = false;
|
||||
common_vendor.index.__f__("log", "at pages/Forum/Forum.vue:79", res);
|
||||
if (res.code === 200) {
|
||||
this.list.push(...res.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
//下拉刷新
|
||||
onRefresherRefresh() {
|
||||
common_vendor.index.__f__("log", "at pages/Forum/Forum.vue:88", "下拉刷新");
|
||||
this.triggered = true;
|
||||
this.list = [];
|
||||
this.page = 0;
|
||||
this.getlist();
|
||||
},
|
||||
//上拉加载
|
||||
onScrollToLower() {
|
||||
this.page++;
|
||||
this.getlist();
|
||||
}
|
||||
},
|
||||
components: {
|
||||
tabBar
|
||||
@@ -34,7 +68,18 @@ if (!Math) {
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
a: common_vendor.f($data.list, (item, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(item.title),
|
||||
b: common_vendor.t(item.content),
|
||||
c: common_vendor.t(item.time),
|
||||
d: index
|
||||
};
|
||||
}),
|
||||
b: common_vendor.o$1((...args) => $options.onRefresherRefresh && $options.onRefresherRefresh(...args)),
|
||||
c: common_vendor.o$1((...args) => $options.onScrollToLower && $options.onScrollToLower(...args)),
|
||||
d: $data.triggered,
|
||||
e: common_vendor.p({
|
||||
tabIndex: 1
|
||||
})
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
<view class="forum data-v-21360a99"><view class="bg data-v-21360a99"><image class="bgImg data-v-21360a99" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/HomeBackground.png" mode="scaleToFill"/></view><view class="title data-v-21360a99">论坛</view></view><view class="content data-v-21360a99"><view class="building data-v-21360a99"><view class="data-v-21360a99"><image class="data-v-21360a99" style="width:500rpx" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/building.png" mode="scaleToFill"/></view><view class="buildingTitle data-v-21360a99">建设中~</view></view></view><view class="tabBar data-v-21360a99"><tab-bar wx:if="{{a}}" class="data-v-21360a99" u-i="21360a99-0" bind:__l="__l" u-p="{{a}}"></tab-bar></view>
|
||||
<view class="forum data-v-21360a99"><view class="bg data-v-21360a99"><image class="bgImg data-v-21360a99" src="https://vv-1317974657.cos.ap-shanghai.myqcloud.com/util/HomeBackground.png" mode="scaleToFill"/></view><view class="title data-v-21360a99">站内信</view></view><view class="content data-v-21360a99"><view class="scrollView data-v-21360a99"><scroll-view show-scrollbar="false" scroll-y="true" class="scroll data-v-21360a99" refresher-enabled="true" refresher-threshold="40" bindrefresherrefresh="{{b}}" lower-threshold="100" bindscrolltolower="{{c}}" refresher-triggered="{{d}}"><view wx:for="{{a}}" wx:for-item="item" wx:key="d" class="card data-v-21360a99"><view class="cardTitle data-v-21360a99">{{item.a}}</view><view class="cardContent data-v-21360a99">{{item.b}}</view><view class="cardTime data-v-21360a99"><view class="cardTimeTitle data-v-21360a99">{{item.c}}</view></view></view></scroll-view></view></view><view class="tabBar data-v-21360a99"><tab-bar wx:if="{{e}}" class="data-v-21360a99" u-i="21360a99-0" bind:__l="__l" u-p="{{e}}"></tab-bar></view>
|
||||
@@ -14,7 +14,7 @@
|
||||
.title.data-v-21360a99 {
|
||||
position: absolute;
|
||||
top: 120rpx;
|
||||
left: 345rpx;
|
||||
left: 335rpx;
|
||||
font-size: 34rpx;
|
||||
color: #100e0f;
|
||||
font-weight: bold;
|
||||
@@ -42,3 +42,60 @@
|
||||
text-align: center;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
.scrollView.data-v-21360a99{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.scroll.data-v-21360a99{
|
||||
width: 100%;
|
||||
height: 93%;
|
||||
}
|
||||
.card.data-v-21360a99{
|
||||
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.data-v-21360a99{
|
||||
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.data-v-21360a99{
|
||||
width: 570rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
padding: 30rpx 0;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.cardTime.data-v-21360a99{
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
align-items: center;
|
||||
}
|
||||
.cardTimeTitle.data-v-21360a99{
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user