myBills.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // pages/voyageManage/myBills/myBills.js
  2. const app = getApp()
  3. const {
  4. postApi
  5. } = require("../../../apis/api")
  6. Page({
  7. data: {
  8. medias: [],
  9. voyageId: 0,
  10. trans: '',
  11. },
  12. check(e) {
  13. let arr = this.data.currentBillItem.shipownerUploadFiles
  14. let {
  15. index
  16. } = e.currentTarget.dataset
  17. arr[index].checked = arr[index].checked ? false : true
  18. this.data.currentBillItem.shipownerUploadFiles = arr
  19. this.setData({
  20. currentBillItem: this.data.currentBillItem
  21. })
  22. },
  23. onLoad(options) {
  24. let currentBillItem = app.globalData.currentBillItem
  25. this.setData({
  26. currentBillItem,
  27. voyageId: options.id
  28. })
  29. },
  30. isTrue() {
  31. },
  32. examineMedia() {
  33. let arr = this.data.currentBillItem.shipownerUploadFiles
  34. if (!arr.some((e) => {
  35. return e.checked
  36. })) {
  37. wx.showToast({
  38. title: '至少选择一张单据',
  39. icon: "error"
  40. })
  41. return
  42. }
  43. wx.navigateTo({
  44. url: `/pages/voyageManage/myBills/examine/examine?id=${this.data.voyageId}`,
  45. })
  46. },
  47. onShareAppMessage() {
  48. }
  49. })