上传代码
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
|
||||
})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user