// pages/voyageManage/myDaily/examine/examine.js const { postApi } = require("../../../../apis/api"); const app = getApp(); Page({ data: { media: {}, voyageId: 0, markers: [], latitude: 31.891992, longitude: 120.551369, trans: "", isMarkVisable: false, }, previewImage(e) { let { src } = e.currentTarget.dataset; wx.previewImage({ current: src, // 当前显示图片的http链接 urls: [src], // 需要预览的图片http链接列表 }); }, async noPass() { this.checkMedia({ audit: 2, }); }, async checkMedia(postData) { let res = await postApi("/dayReport/audit", { ...postData, mediaId: this.data.media.id, }); wx.showToast({ title: res.data.msg, }); if (res.data.status == 0) { setTimeout(() => { wx.switchTab({ url: "/pages/voyageManage/voyageManage", }); }, 1500); } }, showMark() { this.setData({ isMarkVisable: true, }); }, async markMedia(e) { let { type } = e.currentTarget.dataset; this.checkMedia({ type, audit: 1, }); }, onLoad(options) { this.setData({ voyageId: options.id, trans: options.trans, }); }, onReady() { let media = app.globalData.currentExamineMedia; let { latitude, longitude } = media; let markers = [ { id: 1, latitude, longitude, // latitude: Number(latitude), // longitude: Number(longitude), iconPath: "https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972", height: 20, width: 20, }, ]; let points = [ { latitude, longitude, }, ]; this.setData({ media, points, markers, }); }, share(e) { console.log(e); }, onShareAppMessage(res) { let { type } = res.target.dataset; let path; let { shipName: title } = this.data.media; if (type == 1) { let { media, longitude, latitude } = this.data; let shareImageUrl = media.viewUrl; path = `/pages/share/share?shareImageUrl=${shareImageUrl .replace(/\?/g, "qwerdfb000mmmccc") .replace( /=/g, "mmmcccqwerdfb" )}&latitude=${latitude}&longitude=${longitude}`; } else { let id = this.data.voyageId; path = `/pages/sharePage/sharePage?id=${id}`; } return { title, path, }; }, });