Jelajahi Sumber

新增 海事

王智慧 2 tahun lalu
induk
melakukan
a45a40e0eb

+ 6 - 0
miniprogram/app.json

@@ -30,6 +30,12 @@
         "selectedIconPath": "./images/tabs/camera-.png",
         "iconPath": "./images/tabs/camera.png"
       },
+      {
+        "pagePath": "pages/maritime/maritime",
+        "text": "海事",
+        "selectedIconPath": "./images/tabs/ship-.png",
+        "iconPath": "./images/tabs/ship.png"
+      },
       {
         "pagePath": "pages/securityCheck/securityCheck",
         "text": "海事安检",

+ 45 - 1
miniprogram/pages/maritime/maritime.js

@@ -4,9 +4,53 @@ import {
 } 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()
   },
 })

+ 3 - 2
miniprogram/pages/maritime/maritime.wxml

@@ -1,2 +1,3 @@
-<view class="tac" style="color:#777;font-size: 50rpx;margin-top: 20vh;">海事</view>
-<view class="tac" style="color:#777;font-size: 50rpx;margin-top: 20vh;">建设中...</view>
+<view class="mb10" wx:for="{{list}}">
+  {{item.fileName}}
+</view>

+ 7 - 0
project.private.config.json

@@ -8,6 +8,13 @@
           "query": "",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/maritime/maritime",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }