| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- // 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,
- };
- },
- });
|