// pages/shipOwnerManage/shipOwnerList/shipOwnerList.js import { uploadFile } from "../../../utils/upload" import { postApi } from "../../../apis/api" Page({ data: { shipOwnerList: [], term: '', currentLetter: '' }, async getShipOwnerList(type) { let res = await postApi('/ship/list', { loginAccountId: wx.getStorageSync('loginAccountId'), term: this.data.term }) if (type) wx.stopPullDownRefresh() let shipOwnerList = res.data.result shipOwnerList.push(shipOwnerList.shift()) this.setData({ shipOwnerList }) }, call(e) { wx.makePhoneCall({ phoneNumber: e.currentTarget.dataset.phone }) }, addShipOwner() { wx.navigateTo({ url: '../addShipOnwer/addShipOnwer', }) }, tapLetter(e) { this.setData({ currentLetter: e.currentTarget.dataset.letter }) }, onLoad() { this.getShipOwnerList() }, onPullDownRefresh() { this.setData({ term: '' }) this.getShipOwnerList(1) }, onShow() { if (wx.getStorageSync('apiStatus') == "success") { this.getShipOwnerList() wx.removeStorageSync('apiStatus') } } })