myDaily.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const {
  2. postApi
  3. } = require("../../../apis/api")
  4. // pages/voyageManage/myDaily/myDaily.js
  5. const app = getApp()
  6. Page({
  7. data: {
  8. medias: [],
  9. voyageId: 0,
  10. trans: '',
  11. currentIndex: -1
  12. },
  13. check(e) {
  14. this.setData({
  15. currentIndex: e.currentTarget.dataset.index,
  16. })
  17. },
  18. async getMedias() {
  19. let res = await postApi("/dayReport/getMedia", {
  20. loginAccountId: wx.getStorageSync('loginAccountId'),
  21. voyageId: this.data.voyageId
  22. })
  23. this.setData({
  24. medias: res.data.result
  25. })
  26. },
  27. onLoad(options) {
  28. this.setData({
  29. voyageId: options.id,
  30. trans: options.trans
  31. })
  32. },
  33. examineMedia() {
  34. if (this.data.currentIndex == -1) {
  35. wx.showToast({
  36. title: '请选择一张图片',
  37. icon: "error"
  38. })
  39. return
  40. }
  41. app.globalData.currentExamineMedia = this.data.medias[this.data.currentIndex]
  42. wx.navigateTo({
  43. url: `/pages/voyageManage/myDaily/examine/examine?id=${this.data.voyageId}&trans=${this.data.trans}`,
  44. })
  45. },
  46. onShareAppMessage() {
  47. }
  48. })