shipOwnerList.js 827 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // pages/shipOwnerManage/shipOwnerList/shipOwnerList.js
  2. import {
  3. uploadFile
  4. } from "../../../utils/upload"
  5. import {
  6. postApi
  7. } from "../../../apis/api"
  8. Page({
  9. data: {
  10. shipOwnerList: [],
  11. term: ''
  12. },
  13. async getShipOwnerList(type) {
  14. let res = await postApi('/ship/list', {
  15. loginAccountId: wx.getStorageSync('loginAccountId'),
  16. term: this.data.term
  17. })
  18. if (type) wx.stopPullDownRefresh()
  19. this.setData({
  20. shipOwnerList: res.data.result
  21. })
  22. },
  23. call(e) {
  24. wx.makePhoneCall({
  25. phoneNumber: e.currentTarget.dataset.phone
  26. })
  27. },
  28. addShipOwner() {
  29. wx.navigateTo({
  30. url: '../addShipOnwer/addShipOnwer',
  31. })
  32. },
  33. onLoad() {
  34. this.getShipOwnerList()
  35. },
  36. onPullDownRefresh() {
  37. this.setData({
  38. term: ''
  39. })
  40. this.getShipOwnerList(1)
  41. },
  42. })