| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- // pages/maritime/maritime.js
- import {
- postApi
- } from "../../apis/api"
- Page({
- data: {
- list: [],
- total: '',
- currentPage: 1,
- size: 10
- },
- async getList(isScroll) {
- let {
- list,
- currentPage,
- size
- } = this.data
- let {
- data
- } = await postApi('/maritime/notice/getFileList', {
- currentPage,
- size
- })
- let {
- total,
- status
- } = data
- if (status == 0) {
- if (isScroll) {
- list = [...list, ...data.result]
- } else {
- list = data.result
- }
- } else {
- if (!isScroll) {
- list = []
- }
- }
- this.setData({
- list,
- total
- })
- },
- onPullDownRefresh() {
- this.setData({
- list: [],
- currentPage: 1,
- total: 0
- })
- this.getList()
- },
- onLoad(options) {
- this.getList()
- },
- })
|