| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // pages/share/sharePage.js
- import {
- postApi
- } from "../../apis/api"
- Page({
- data: {
- markers: [{
- id: 999,
- latitude: '',
- longitude: '',
- iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
- height: 20,
- width: 20
- }],
- latitude: 31.891992,
- longitude: 120.551369,
- },
- async getVoyageDetail(voyageId) {
- let res = await postApi("/voyage/share", {
- voyageId
- })
- // res.data.result.transInfos.forEach(item => {
- // item.createTime = this.subTimeStr(item.createTime)
- // })
- // res.data.result.loadingInfos.forEach(item => {
- // item.createTime = this.subTimeStr(item.createTime)
- // })
- this.setData({
- ...res.data.result
- })
- },
- subTimeStr(str) {
- if (!str || typeof str != "string") return;
- let index = str.indexOf(" ");
- return str.substring(0, index);
- },
- onLoad(options) {
- this.getVoyageDetail(options.id)
- },
- })
|