1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import { documentList } from "../../api/document";
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- vanoverlayshow: false,
- qrcodeDialog: false,
- currentPage: 1,
- hasNext: false,
- fileList: []
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow() {
- this.getDocumentList()
- },
- // 获取档案列表
- getDocumentList () {
- var data = {
- currentPage: this.data.currentPage
- }
- documentList(data).then(res => {
- console.log(res, 'documentList');
- var response = res.data.vos
- response.map(item => {
- item.birthDay = item.birthday.split(' ')[0]
- })
- this.setData({
- hasNext: res.data.hasNext,
- fileList: response
- })
- })
- },
- onReachBottom () {
- if (this.data.hasNext) {
- var _currentPag = this.data.currentPage + 1
- this.setData({
- currentPage: _currentPag
- })
- this.getDocumentList()
- }
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- handleConfirm() {
- this.setData({ vanoverlayshow: false })
- },
- /**
- * 新建档案
- */
- handleAddFile() {
- this.setData({ vanoverlayshow: true })
- },
- /**
- * 管理档案
- */
- handleFile() {
- wx.navigateTo({
- url: '/pages/handleFile/handleFile',
- })
- },
- handleShowQRCode () {
- this.setData({
- qrcodeDialog: true
- })
- }
- })
|