shipOwnerList.js 950 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. currentLetter: ''
  13. },
  14. async getShipOwnerList(type) {
  15. let res = await postApi('/ship/list', {
  16. loginAccountId: wx.getStorageSync('loginAccountId'),
  17. term: this.data.term
  18. })
  19. if (type) wx.stopPullDownRefresh()
  20. this.setData({
  21. shipOwnerList: res.data.result
  22. })
  23. },
  24. call(e) {
  25. wx.makePhoneCall({
  26. phoneNumber: e.currentTarget.dataset.phone
  27. })
  28. },
  29. addShipOwner() {
  30. wx.navigateTo({
  31. url: '../addShipOnwer/addShipOnwer',
  32. })
  33. },
  34. tapLetter(e) {
  35. this.setData({
  36. currentLetter: e.currentTarget.dataset.letter
  37. })
  38. },
  39. onLoad() {
  40. this.getShipOwnerList()
  41. },
  42. onPullDownRefresh() {
  43. this.setData({
  44. term: ''
  45. })
  46. this.getShipOwnerList(1)
  47. },
  48. })