wzg 2 лет назад
Родитель
Сommit
770de1d9b4

+ 1 - 1
miniprogram/pages/login/login.wxml

@@ -1,4 +1,4 @@
-<image style="margin:0 auto;display:block;width: 400rpx;margin-top: 10vh;height: 140rpx;" mode="aspectFit" src="https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/%E6%B1%87%E5%BE%88%E5%A4%9Alogo-%E5%B7%A6%E5%8F%B3.png?sign=fcd18f89de727b0193395cd2d44a730a&t=1647417257"></image>
+<image style="margin:0 auto;display:block;width: 400rpx;margin-top: 10vh;height: 140rpx;" mode="aspectFit" src="https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/%E6%B1%87%E5%BE%88%E5%A4%9Alogo-%E5%B7%A6%E5%8F%B3.png?sign=fcd18f89de727b0193395cd2d44a730a&t=1647417257"></image>
 <view style="margin-top: 100rpx;font-size: 50rpx;color: #333;text-align: center;">汇很多运输管家先行版
 </view>
 <view class="df jcc" style="position:absolute;bottom: 15vh;width: 100%;">

+ 23 - 22
miniprogram/pages/share/share.js

@@ -1,31 +1,32 @@
 // pages/share/share.js
 Page({
   data: {
-    shareImageUrl: '',
+    shareImageUrl: "",
     markers: [],
-    logoUrl: 'https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/%E6%B1%87%E5%BE%88%E5%A4%9Alogo-%E5%B7%A6%E5%8F%B3.png'
+    logoUrl:
+      "https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/%E6%B1%87%E5%BE%88%E5%A4%9Alogo-%E5%B7%A6%E5%8F%B3.png",
   },
   onLoad: function (options) {
-    let {
-      latitude,
-      longitude
-    } = options
-    let markers = [{
-      id: 999,
-      latitude: '32.001233',
-      longitude: '120.5475',
-      iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
-      height: 20,
-      width: 20
-    }]
-    markers[0].latitude = latitude
-    markers[0].longitude = longitude
-
-
+    let { latitude, longitude } = options;
+    let markers = [
+      {
+        id: 999,
+        latitude: "32.001233",
+        longitude: "120.5475",
+        iconPath:
+          "https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
+        height: 20,
+        width: 20,
+      },
+    ];
+    markers[0].latitude = latitude;
+    markers[0].longitude = longitude;
 
     this.setData({
       markers,
-      shareImageUrl: (options.shareImageUrl.replace(/qwerdfb000mmmccc/g, '?')).replace(/mmmcccqwerdfb/g, '=')
-    })
-  }
-})
+      shareImageUrl: options.shareImageUrl
+        .replace(/qwerdfb000mmmccc/g, "?")
+        .replace(/mmmcccqwerdfb/g, "="),
+    });
+  },
+});

+ 145 - 145
miniprogram/pages/sharePage/sharePage.js

@@ -1,11 +1,9 @@
 // pages/voyages/detail/detail.js
-import {
-  postApi
-} from "../../apis/api"
+import { postApi } from "../../apis/api";
 Page({
   data: {
     isLogin: true,
-    id: '',
+    id: "",
     tab: 2,
     shipDischargeCurrentPage: 1,
     truckLoadCurrentPage: 1,
@@ -14,73 +12,65 @@ Page({
     policys: [],
     voyage: [],
     waybills: [],
-    infoType: 'ship',
+    infoType: "ship",
     shipDischargeList: [],
     truckLoadList: [],
     shipDischargeTotal: 0,
     truckLoadTotal: 0,
-    polyline: [{
-      points: [],
-      width: 2,
-      dottedLine: true,
-      color: "#eb2f06"
-    }],
+    polyline: [
+      {
+        points: [],
+        width: 2,
+        dottedLine: true,
+        color: "#eb2f06",
+      },
+    ],
     markers: [],
     points: [],
     pageSize: 20,
     latitude: 31.891992,
     longitude: 120.551369,
     currentPortId: 0,
-    tab3CurrentDischargeIndex: 0
+    tab3CurrentDischargeIndex: 0,
   },
   changeTab(e) {
-    let {
-      tab
-    } = e.currentTarget.dataset
+    let { tab } = e.currentTarget.dataset;
     this.setData({
-      tab
-    })
+      tab,
+    });
   },
 
   async getVoyageDetail() {
     let res = await postApi("/voyage/detail", {
       voyageId: this.data.id,
-      isClient: wx.getStorageSync('isClient'),
-      loginAccountId: wx.getStorageSync('loginAccountId'),
-    })
+      isClient: wx.getStorageSync("isClient"),
+      loginAccountId: wx.getStorageSync("loginAccountId"),
+    });
 
-    let {
-      coordinates,
-      medias,
-      policys,
-      voyage,
-      waybills
-    } = res.data.result
+    let { coordinates, medias, policys, voyage, waybills } = res.data.result;
     if (coordinates.length) {
-      let points = []
+      let points = [];
       for (let i of coordinates) {
         points.push({
           latitude: i.latitude,
-          longitude: i.longitude
-        })
+          longitude: i.longitude,
+        });
       }
-      let {
-        latitude,
-        longitude
-      } = points[points.length - 1]
-      this.data.latitude = latitude
-      this.data.longitude = longitude
-      this.data.polyline[0].points = points
-      let id = 1
+      let { latitude, longitude } = points[points.length - 1];
+      this.data.latitude = latitude;
+      this.data.longitude = longitude;
+      this.data.polyline[0].points = points;
+      let id = 1;
       for (let i of points) {
         this.data.markers.push({
           id: id + 1,
           latitude: i.latitude,
           longitude: i.longitude,
-          iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
+          iconPath:
+            "https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
           height: 20,
-          width: 20
-        })
+          width: 20,
+        });
       }
 
       this.setData({
@@ -88,14 +78,13 @@ Page({
         markers: this.data.markers,
         // latitude: this.data.latitude,
         // longitude: this.data.longitude,
-        points
-      })
-
+        points,
+      });
     }
-    voyage.arrivalLoadPortTime = this.subTimeStr(voyage.arrivalLoadPortTime)
-    voyage.loadStartTime = this.subTimeStr(voyage.loadStartTime)
-    voyage.loadEndTime = this.subTimeStr(voyage.loadEndTime)
-    voyage.setSailTime = this.subTimeStr(voyage.setSailTime)
+    voyage.arrivalLoadPortTime = this.subTimeStr(voyage.arrivalLoadPortTime);
+    voyage.loadStartTime = this.subTimeStr(voyage.loadStartTime);
+    voyage.loadEndTime = this.subTimeStr(voyage.loadEndTime);
+    voyage.setSailTime = this.subTimeStr(voyage.setSailTime);
 
     this.setData({
       coordinates,
@@ -103,7 +92,7 @@ Page({
       policys,
       voyage,
       waybills,
-    })
+    });
   },
   subTimeStr(str) {
     if (!str || typeof str != "string") return;
@@ -112,44 +101,49 @@ Page({
   },
 
   async getCarLoadRecordList(isScroll) {
-    if (this.data.truckLoadTotal != 0 && this.data.truckLoadTotal < this.data.pageSize * this.data.truckLoadCurrentPage) return
+    if (
+      this.data.truckLoadTotal != 0 &&
+      this.data.truckLoadTotal <
+        this.data.pageSize * this.data.truckLoadCurrentPage
+    )
+      return;
     if (isScroll) {
-      this.data.truckLoadCurrentPage += 1
+      this.data.truckLoadCurrentPage += 1;
     } else {
-      this.data.truckLoadCurrentPage = 1
+      this.data.truckLoadCurrentPage = 1;
     }
     let res = await postApi("/voyage/getCarLoadRecordList", {
       portId: this.data.currentPortId,
       voyageId: this.data.id,
       size: this.data.pageSize,
       currentPage: this.data.truckLoadCurrentPage,
-      isClient: wx.getStorageSync('isClient'),
-      loginAccountId: wx.getStorageSync('loginAccountId')
-    })
+      isClient: wx.getStorageSync("isClient"),
+      loginAccountId: wx.getStorageSync("loginAccountId"),
+    });
     this.setData({
       truckLoadCurrentPage: this.data.truckLoadCurrentPage,
-    })
+    });
 
     if (0 == res.data.status) {
       if (isScroll) {
-        let truckLoadList = [...this.data.truckLoadList, ...res.data.result]
+        let truckLoadList = [...this.data.truckLoadList, ...res.data.result];
         for (let i of truckLoadList) {
-          i.weighTime = this.cutTimeString(i.weighTime)
+          i.weighTime = this.cutTimeString(i.weighTime);
         }
         this.setData({
           truckLoadList,
-          truckLoadTotal: res.data.total
-        })
+          truckLoadTotal: res.data.total,
+        });
       } else {
-        let truckLoadList = res.data.result
+        let truckLoadList = res.data.result;
 
         for (let i of truckLoadList) {
-          i.weighTime = this.cutTimeString(i.weighTime)
+          i.weighTime = this.cutTimeString(i.weighTime);
         }
         this.setData({
           truckLoadList,
-          truckLoadTotal: res.data.total
-        })
+          truckLoadTotal: res.data.total,
+        });
       }
     } else {
       // wx.showToast({
@@ -161,40 +155,43 @@ Page({
 
   async getDischargeList(isScroll) {
     if (isScroll) {
-      this.data.shipDischargeCurrentPage += 1
+      this.data.shipDischargeCurrentPage += 1;
     } else {
-      this.data.shipDischargeCurrentPage = 1
+      this.data.shipDischargeCurrentPage = 1;
     }
     let res = await postApi("/voyage/getDischargeList", {
       portId: this.data.currentPortId,
       voyageId: this.data.id,
       size: this.data.pageSize,
       currentPage: this.data.shipDischargeCurrentPage,
-      isClient: wx.getStorageSync('isClient'),
-      loginAccountId: wx.getStorageSync('loginAccountId')
-    })
+      isClient: wx.getStorageSync("isClient"),
+      loginAccountId: wx.getStorageSync("loginAccountId"),
+    });
     this.setData({
       shipDischargeCurrentPage: this.data.shipDischargeCurrentPage,
-    })
+    });
     if (0 == res.data.status) {
       if (isScroll) {
-        let shipDischargeList = [...this.data.shipDischargeList, ...res.data.result]
+        let shipDischargeList = [
+          ...this.data.shipDischargeList,
+          ...res.data.result,
+        ];
         for (let i of shipDischargeList) {
-          i.dischargeTime = this.cutTimeString(i.dischargeTime)
+          i.dischargeTime = this.cutTimeString(i.dischargeTime);
         }
         this.setData({
           shipDischargeList,
-          shipDischargeTotal: res.data.total
-        })
+          shipDischargeTotal: res.data.total,
+        });
       } else {
-        let shipDischargeList = res.data.result
+        let shipDischargeList = res.data.result;
         for (let i of shipDischargeList) {
-          i.dischargeTime = this.cutTimeString(i.dischargeTime)
+          i.dischargeTime = this.cutTimeString(i.dischargeTime);
         }
         this.setData({
           shipDischargeList,
-          shipDischargeTotal: res.data.total
-        })
+          shipDischargeTotal: res.data.total,
+        });
       }
     } else {
       // wx.showToast({
@@ -202,23 +199,18 @@ Page({
       //   title: res.data.msg,
       // })
     }
-
   },
 
   previewImage(e) {
-    let {
-      src
-    } = e.currentTarget.dataset
+    let { src } = e.currentTarget.dataset;
     wx.previewImage({
       current: src, // 当前显示图片的http链接
-      urls: [src] // 需要预览的图片http链接列表
-    })
+      urls: [src], // 需要预览的图片http链接列表
+    });
   },
 
   changeInfoType(e) {
-    let {
-      type
-    } = e.currentTarget.dataset
+    let { type } = e.currentTarget.dataset;
     this.setData({
       infoType: type,
       truckLoadCurrentPage: 1,
@@ -227,124 +219,132 @@ Page({
       truckLoadList: [],
       shipDischargeTotal: 0,
       truckLoadTotal: 0,
-    })
+    });
     if (type == "ship") {
-      this.getDischargeList()
+      this.getDischargeList();
     } else {
-      this.getCarLoadRecordList()
+      this.getCarLoadRecordList();
     }
   },
 
   cutTimeString(str) {
-    let index = str.indexOf(' ')
-    return index == -1 ? str : str.substring(0, index)
+    let index = str.indexOf(" ");
+    return index == -1 ? str : str.substring(0, index);
   },
 
   changeBottomPage() {
     if (this.data.infoType == "ship") {
-      this.getDischargeList(true)
+      this.getDischargeList(true);
     } else {
-      this.getCarLoadRecordList(true)
+      this.getCarLoadRecordList(true);
     }
   },
 
   scrollShip() {
-    if (this.data.shipDischargeTotal == 0 || this.data.shipDischargeTotal <= this.data.pageSize * this.data.shipDischargeCurrentPage) return
-    this.getDischargeList(true)
+    if (
+      this.data.shipDischargeTotal == 0 ||
+      this.data.shipDischargeTotal <=
+        this.data.pageSize * this.data.shipDischargeCurrentPage
+    )
+      return;
+    this.getDischargeList(true);
   },
   scrollTruck() {
-    if (this.data.truckLoadTotal == 0 || this.data.truckLoadTotal <= this.data.pageSize * this.data.truckLoadCurrentPage) return
-    this.getCarLoadRecordList(true)
+    if (
+      this.data.truckLoadTotal == 0 ||
+      this.data.truckLoadTotal <=
+        this.data.pageSize * this.data.truckLoadCurrentPage
+    )
+      return;
+    this.getCarLoadRecordList(true);
   },
 
-
   onShareAppMessage: (e) => {
-    console.log(e)
-    let id = this.data.voyageId
+    console.log(e);
+    let id = this.data.voyageId;
     return {
-      title: '真实 实时 精准',
-      path: `/pages/sharePage/sharePage?id=${id}`
-    }
+      title: "真实 实时 精准",
+      path: `/pages/sharePage/sharePage?id=${id}`,
+    };
   },
 
   async getNewDetail() {
     let res = await postApi("/voyage/share", {
       voyageId: this.data.id,
-      isClient: wx.getStorageSync('isClient'),
-      loginAccountId: wx.getStorageSync('loginAccountId'),
-    })
+      isClient: wx.getStorageSync("isClient"),
+      loginAccountId: wx.getStorageSync("loginAccountId"),
+    });
     // for (let i of res.data.result.detailInfos) {
     //   i.transInfos = res.data.result.detailInfos[0].transInfos
     // }
     this.setData({
-      currentPortId: res.data.result.detailInfos[0].portId
-    })
+      currentPortId: res.data.result.detailInfos[0].portId,
+    });
     res.data.result.detailInfos.sort((a, b) => {
-      return b.sort - a.sort
-    })
+      return b.sort - a.sort;
+    });
 
     this.setData({
       ...res.data.result,
-    })
-    this.getCarLoadRecordList()
-    this.getDischargeList()
+    });
+    this.getCarLoadRecordList();
+    this.getDischargeList();
   },
 
   loginEvent(e) {
-    let res = e.detail
+    let res = e.detail;
     if (res.data.status == 0) {
-      let data = res.data.result
+      let data = res.data.result;
       Object.keys(data).forEach(function (key) {
-        wx.setStorageSync(key, data[key])
-      })
+        wx.setStorageSync(key, data[key]);
+      });
       this.setData({
-        isLogin: true
-      })
-      if ((wx.getStorageSync('isClient') && wx.getStorageSync('sharePermission') || !(wx.getStorageSync('isClient')))) {
-        this.getNewDetail()
-        this.getVoyageDetail()
+        isLogin: true,
+      });
+      if (
+        (wx.getStorageSync("isClient") &&
+          wx.getStorageSync("sharePermission")) ||
+        !wx.getStorageSync("isClient")
+      ) {
+        this.getNewDetail();
+        this.getVoyageDetail();
       } else {
         wx.showToast({
           icon: "none",
-          title: '暂无查看权限'
-        })
+          title: "暂无查看权限",
+        });
       }
     } else {
       wx.showToast({
         icon: "none",
-        title: res.data.msg
-      })
+        title: res.data.msg,
+      });
     }
   },
 
-
   changePort(e) {
-    let tab3CurrentDischargeIndex = e.detail
+    let tab3CurrentDischargeIndex = e.detail;
     this.setData({
       tab3CurrentDischargeIndex,
-      currentPortId: this.data.voyage.voyageDetails[tab3CurrentDischargeIndex].portId,
+      currentPortId: this.data.voyage.voyageDetails[tab3CurrentDischargeIndex]
+        .portId,
       shipDischargeList: [],
       truckLoadList: [],
-    })
+    });
     if (this.data.infoType == "ship") {
-      this.getDischargeList()
+      this.getDischargeList();
     } else {
-      this.getCarLoadRecordList()
+      this.getCarLoadRecordList();
     }
-
   },
 
-
   onLoad(options) {
-    let {
-      id
-    } = options
-    wx.setStorageSync('voyageDetailId', id)
+    let { id } = options;
+    wx.setStorageSync("voyageDetailId", id);
     this.setData({
-      id
-    })
-    this.getNewDetail()
-    this.getVoyageDetail()
-
+      id,
+    });
+    this.getNewDetail();
+    this.getVoyageDetail();
   },
-})
+});

+ 61 - 69
miniprogram/pages/voyageManage/myDaily/examine/examine.js

@@ -1,10 +1,8 @@
 // pages/voyageManage/myDaily/examine/examine.js
 
-const {
-  postApi
-} = require("../../../../apis/api")
+const { postApi } = require("../../../../apis/api");
 
-const app = getApp()
+const app = getApp();
 Page({
   data: {
     media: {},
@@ -12,117 +10,111 @@ Page({
     markers: [],
     latitude: 31.891992,
     longitude: 120.551369,
-    trans: '',
-    isMarkVisable: false
+    trans: "",
+    isMarkVisable: false,
   },
 
   previewImage(e) {
-    let {
-      src
-    } = e.currentTarget.dataset
+    let { src } = e.currentTarget.dataset;
     wx.previewImage({
       current: src, // 当前显示图片的http链接
-      urls: [src] // 需要预览的图片http链接列表
-    })
+      urls: [src], // 需要预览的图片http链接列表
+    });
   },
 
   async noPass() {
     this.checkMedia({
-      audit: 2
-    })
+      audit: 2,
+    });
   },
   async checkMedia(postData) {
-    let res = await postApi('/dayReport/audit', {
+    let res = await postApi("/dayReport/audit", {
       ...postData,
-      mediaId: this.data.media.id
-    })
+      mediaId: this.data.media.id,
+    });
     wx.showToast({
       title: res.data.msg,
-    })
+    });
     if (res.data.status == 0) {
       setTimeout(() => {
         wx.switchTab({
-          url: '/pages/voyageManage/voyageManage',
-        })
-      }, 1500)
+          url: "/pages/voyageManage/voyageManage",
+        });
+      }, 1500);
     }
   },
 
   showMark() {
     this.setData({
-      isMarkVisable: true
-    })
+      isMarkVisable: true,
+    });
   },
   async markMedia(e) {
-    let {
-      type
-    } = e.currentTarget.dataset
+    let { type } = e.currentTarget.dataset;
     this.checkMedia({
       type,
-      audit: 1
-    })
+      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://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
-      height: 20,
-      width: 20
-    }]
-    let points = [{
-      latitude,
-      longitude
-    }]
+    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)
+    console.log(e);
   },
   onShareAppMessage(res) {
-    let {
-      type
-    } = res.target.dataset
-    let path
-    let {
-      shipName: title
-    } = this.data.media
+    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}`
-
+      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}`
+      let id = this.data.voyageId;
+      path = `/pages/sharePage/sharePage?id=${id}`;
     }
     return {
       title,
-      path
-    }
+      path,
+    };
   },
-})
+});

+ 73 - 65
miniprogram/pages/voyageManage/takeBill/takeBill.js

@@ -1,116 +1,124 @@
-import {
-  uploadFile
-} from "../../../utils/uploadImage"
+import { uploadFile } from "../../../utils/uploadImage";
 Page({
   data: {
-    avatar: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/avatar-icon.jpg?sign=f5c66c94d189436f82353eb48cb01f08&t=1634538864",
-    cameraIcon: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/camera-icon.png?sign=11a65871a2800cd04ecaa8991687fccd&t=1634607415",
-    newCameraIcon: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/camera.png?sign=ad0fe8bead6a46cb20f45f792d4bed67&t=1645502416",
+    avatar:
+      "https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/avatar-icon.jpg?sign=f5c66c94d189436f82353eb48cb01f08&t=1634538864",
+    cameraIcon:
+      "https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/camera-icon.png?sign=11a65871a2800cd04ecaa8991687fccd&t=1634607415",
+    newCameraIcon:
+      "https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/camera.png?sign=ad0fe8bead6a46cb20f45f792d4bed67&t=1645502416",
     userName: "",
     phone: "",
     shipName: "",
     shipMmsi: "",
     authModal: false,
     modalText: "位置",
-    cw: '',
-    ch: '',
+    cw: "",
+    ch: "",
     disabled: false,
-    imgCache: ''
+    imgCache: "",
   },
   takeBill() {
-    if (this.data.disabled) return
+    if (this.data.disabled) return;
     wx.showLoading({
-      title: '正在上传...',
-    })
-    this.data.disabled = true
-    const ctx = wx.createCameraContext()
+      title: "正在上传...",
+    });
+    this.data.disabled = true;
+    const ctx = wx.createCameraContext();
     ctx.takePhoto({
-      quality: 'high',
+      quality: "high",
       success: (res) => {
-        let src = res.tempImagePath
-        let ch = res.height * 2
-        let cw = res.width * 2
+        let src = res.tempImagePath;
+        let ch = res.height * 2;
+        let cw = res.width * 2;
         wx.getImageInfo({
           src,
-          success: e => {
+          success: (e) => {
             this.setData({
               ch,
-              cw
-            })
+              cw,
+            });
             const query = wx.createSelectorQuery();
-            query.select('#myCanvas').node().exec((res) => {
-              const canvas = res[0].node;
-              const ctx = canvas.getContext('2d');
-              const img = canvas.createImage();
-              let h = ch / 2
-              let w = cw / 2
-              canvas.height = h * 0.85
-              canvas.width = w * 0.9
-              img.src = src
-              img.onload = () => {
-                ctx.drawImage(img, -w * 0.05, -h * 0.05);
-              }
-              this.saveImg(src)
-            })
-          }
-        })
-
-      }
-    })
+            query
+              .select("#myCanvas")
+              .node()
+              .exec((res) => {
+                const canvas = res[0].node;
+                const ctx = canvas.getContext("2d");
+                const img = canvas.createImage();
+                let h = ch / 2;
+                let w = cw / 2;
+                canvas.height = h * 0.85;
+                canvas.width = w * 0.9;
+                img.src = src;
+                img.onload = () => {
+                  ctx.drawImage(img, -w * 0.05, -h * 0.05);
+                };
+                this.saveImg(src);
+              });
+          },
+        });
+      },
+    });
   },
   goBack() {
-    wx.navigateBack()
+    wx.navigateBack();
   },
   async saveImg(src) {
     const query = wx.createSelectorQuery();
     const canvas = await new Promise((resolve, reject) => {
-      query.select('#myCanvas')
+      query
+        .select("#myCanvas")
         .fields({
           node: true,
-          size: true
+          size: true,
         })
         .exec(async (res) => {
           resolve(res[0].node);
-        })
+        });
     });
 
     wx.canvasToTempFilePath({
       canvas,
-      success: async e => {
+      success: async (e) => {
         // let path = e.tempFilePath
         // wx.navigateTo({
         //   url: `/pages/takeBill/success/success?src=${src}&path=${path}`
         // })
         // return
         this.setData({
-          imgCache: e.tempFilePath
-        })
-        let res = await uploadFile("/voyage/uploadVoyageWayBill", e.tempFilePath, {
-          type: this.data.type,
-          voyageId: this.data.voyageId
-        })
+          imgCache: e.tempFilePath,
+        });
+        let res = await uploadFile(
+          "/voyage/uploadVoyageWayBill",
+          e.tempFilePath,
+          {
+            type: this.data.type,
+            voyageId: this.data.voyageId,
+          }
+        );
         wx.hideLoading({
           success: (res) => {},
-        })
-        console.log(res)
+        });
+        console.log(res);
         wx.showToast({
           title: res.msg,
-        })
+        });
         setTimeout(() => {
-          this.data.disabled = false
-          wx.setStorageSync('addStatus', "success")
-          this.goBack()
-        }, 1000)
+          this.data.disabled = false;
+          wx.setStorageSync("addStatus", "success");
+          this.goBack();
+        }, 1000);
       },
       fail(res) {
-        console.log('fail');
-      }
-    })
+        console.log("fail");
+      },
+    });
   },
 
   onLoad(options) {
     this.setData({
-      ...options
-    })
-  }
-})
+      ...options,
+    });
+  },
+});

+ 233 - 253
miniprogram/pages/voyages/detail/detail.js

@@ -1,14 +1,10 @@
 // pages/voyages/detail/detail.js
-import {
-  postApi
-} from "../../../apis/api"
+import { postApi } from "../../../apis/api";
 
-import {
-  uploadImage
-} from "../../../utils/uploadImage"
+import { uploadImage } from "../../../utils/uploadImage";
 Page({
   data: {
-    id: '',
+    id: "",
     tab: 1,
     shipDischargeCurrentPage: 1,
     truckLoadCurrentPage: 1,
@@ -17,17 +13,19 @@ Page({
     policys: [],
     voyage: {},
     waybills: [],
-    infoType: 'ship',
+    infoType: "ship",
     shipDischargeList: [],
     truckLoadList: [],
     shipDischargeTotal: 0,
     truckLoadTotal: 0,
-    polyline: [{
-      points: [],
-      width: 2,
-      dottedLine: true,
-      color: "#eb2f06"
-    }],
+    polyline: [
+      {
+        points: [],
+        width: 2,
+        dottedLine: true,
+        color: "#eb2f06",
+      },
+    ],
     markers: [],
     points: [],
     pageSize: 30,
@@ -35,62 +33,52 @@ Page({
     longitude: 120.551369,
     currentPortId: 0,
     dischargeModal: false,
-    currentDischargePortId: '',
-    currentDischargePort: '',
+    currentDischargePortId: "",
+    currentDischargePort: "",
     tab2disabled: false,
     currentDischargeIndex: 0,
     tab3CurrentDischargeIndex: 0,
     uploadBillVisable: true,
     currentBeforePortIndex: 0,
-    beforePorts: []
+    beforePorts: [],
   },
   changeTab(e) {
-    let {
-      tab
-    } = e.currentTarget.dataset
+    let { tab } = e.currentTarget.dataset;
     this.setData({
-      tab
-    })
+      tab,
+    });
   },
 
   async getVoyageDetail() {
     let res = await postApi("/voyage/detail", {
       voyageId: this.data.id,
-      loginAccountId: wx.getStorageSync('loginAccountId'),
-    })
+      loginAccountId: wx.getStorageSync("loginAccountId"),
+    });
     if (res.data.status == 0) {
-      let {
-        coordinates,
-        medias,
-        policys,
-        voyage,
-        waybills
-      } = res.data.result
+      let { coordinates, medias, policys, voyage, waybills } = res.data.result;
       if (coordinates.length) {
-        let points = []
+        let points = [];
         for (let i of coordinates) {
           points.push({
             latitude: i.latitude,
-            longitude: i.longitude
-          })
+            longitude: i.longitude,
+          });
         }
-        let {
-          latitude,
-          longitude
-        } = points[points.length - 1]
-        this.data.latitude = latitude
-        this.data.longitude = longitude
-        this.data.polyline[0].points = points
-        let id = 1
+        let { latitude, longitude } = points[points.length - 1];
+        this.data.latitude = latitude;
+        this.data.longitude = longitude;
+        this.data.polyline[0].points = points;
+        let id = 1;
         for (let i of points) {
           this.data.markers.push({
             id: id + 1,
             latitude: i.latitude,
             longitude: i.longitude,
-            iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
+            iconPath:
+              "https://frontend-1255802371.cos.ap-shanghai.myqcloud.com/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
             height: 20,
-            width: 20
-          })
+            width: 20,
+          });
         }
 
         this.setData({
@@ -98,26 +86,24 @@ Page({
           markers: this.data.markers,
           latitude: this.data.latitude,
           longitude: this.data.longitude,
-          points
-        })
-
+          points,
+        });
       }
       // voyage.arrivalLoadPortTime = this.subTimeStr(voyage.arrivalLoadPortTime)
       // voyage.loadStartTime = this.subTimeStr(voyage.loadStartTime)
       // voyage.loadEndTime = this.subTimeStr(voyage.loadEndTime)
       // voyage.setSailTime = this.subTimeStr(voyage.setSailTime)
       // voyage.expectedArrivalTime = this.subTimeStr(voyage.expectedArrivalTime)
-      let dischargePortIds = voyage.dischargePortIds.split(',')
-      let dischargePorts = voyage.dischargePorts.split(',')
-      let discLength = dischargePortIds.length
+      let dischargePortIds = voyage.dischargePortIds.split(",");
+      let dischargePorts = voyage.dischargePorts.split(",");
+      let discLength = dischargePortIds.length;
 
       for (let item of voyage.voyageDetails) {
-
-        item.setSailTime = this.subTimeStr(item.setSailTime)
-        item.expectedArrivalTime = this.subTimeStr(item.expectedArrivalTime)
-        item.actualArrivalTime = this.subTimeStr(item.actualArrivalTime)
-        item.dischargeStartTime = this.subTimeStr(item.dischargeStartTime)
-        item.dischargeEndTime = this.subTimeStr(item.dischargeEndTime)
+        item.setSailTime = this.subTimeStr(item.setSailTime);
+        item.expectedArrivalTime = this.subTimeStr(item.expectedArrivalTime);
+        item.actualArrivalTime = this.subTimeStr(item.actualArrivalTime);
+        item.dischargeStartTime = this.subTimeStr(item.dischargeStartTime);
+        item.dischargeEndTime = this.subTimeStr(item.dischargeEndTime);
       }
       this.setData({
         coordinates,
@@ -129,15 +115,15 @@ Page({
         dischargePortIds,
         dischargePorts,
         discLength,
-        tab2disabled: voyage.voyageStatus == 2
-      })
-      this.getCarLoadRecordList()
-      this.getDischargeList()
+        tab2disabled: voyage.voyageStatus == 2,
+      });
+      this.getCarLoadRecordList();
+      this.getDischargeList();
     } else {
       wx.showToast({
-        title: '获取详情失败!',
-        icon: "error"
-      })
+        title: "获取详情失败!",
+        icon: "error",
+      });
     }
   },
   subTimeStr(str) {
@@ -148,41 +134,41 @@ Page({
 
   async getCarLoadRecordList(isScroll) {
     if (isScroll) {
-      this.data.truckLoadCurrentPage += 1
+      this.data.truckLoadCurrentPage += 1;
     } else {
-      this.data.truckLoadCurrentPage = 1
+      this.data.truckLoadCurrentPage = 1;
     }
     let res = await postApi("/voyage/getCarLoadRecordList", {
       portId: this.data.currentPortId,
       voyageId: this.data.id,
       size: this.data.pageSize,
       currentPage: this.data.truckLoadCurrentPage,
-      loginAccountId: wx.getStorageSync('loginAccountId')
-    })
+      loginAccountId: wx.getStorageSync("loginAccountId"),
+    });
     this.setData({
       truckLoadCurrentPage: this.data.truckLoadCurrentPage,
-    })
+    });
 
     if (0 == res.data.status) {
       if (isScroll) {
-        let truckLoadList = [...this.data.truckLoadList, ...res.data.result]
+        let truckLoadList = [...this.data.truckLoadList, ...res.data.result];
         for (let i of truckLoadList) {
-          i.weighTime = this.cutTimeString(i.weighTime)
+          i.weighTime = this.cutTimeString(i.weighTime);
         }
         this.setData({
           truckLoadList,
-          truckLoadTotal: res.data.total
-        })
+          truckLoadTotal: res.data.total,
+        });
       } else {
-        let truckLoadList = res.data.result
+        let truckLoadList = res.data.result;
 
         for (let i of truckLoadList) {
-          i.weighTime = this.cutTimeString(i.weighTime)
+          i.weighTime = this.cutTimeString(i.weighTime);
         }
         this.setData({
           truckLoadList,
-          truckLoadTotal: res.data.total
-        })
+          truckLoadTotal: res.data.total,
+        });
       }
     } else {
       // wx.showToast({
@@ -194,39 +180,42 @@ Page({
 
   async getDischargeList(isScroll) {
     if (isScroll) {
-      this.data.shipDischargeCurrentPage += 1
+      this.data.shipDischargeCurrentPage += 1;
     } else {
-      this.data.shipDischargeCurrentPage = 1
+      this.data.shipDischargeCurrentPage = 1;
     }
     let res = await postApi("/voyage/getDischargeList", {
       portId: this.data.currentPortId,
       voyageId: this.data.id,
       size: this.data.pageSize,
       currentPage: this.data.shipDischargeCurrentPage,
-      loginAccountId: wx.getStorageSync('loginAccountId')
-    })
+      loginAccountId: wx.getStorageSync("loginAccountId"),
+    });
     this.setData({
       shipDischargeCurrentPage: this.data.shipDischargeCurrentPage,
-    })
+    });
     if (0 == res.data.status) {
       if (isScroll) {
-        let shipDischargeList = [...this.data.shipDischargeList, ...res.data.result]
+        let shipDischargeList = [
+          ...this.data.shipDischargeList,
+          ...res.data.result,
+        ];
         for (let i of shipDischargeList) {
-          i.dischargeTime = this.cutTimeString(i.dischargeTime)
+          i.dischargeTime = this.cutTimeString(i.dischargeTime);
         }
         this.setData({
           shipDischargeList,
-          shipDischargeTotal: res.data.total
-        })
+          shipDischargeTotal: res.data.total,
+        });
       } else {
-        let shipDischargeList = res.data.result
+        let shipDischargeList = res.data.result;
         for (let i of shipDischargeList) {
-          i.dischargeTime = this.cutTimeString(i.dischargeTime)
+          i.dischargeTime = this.cutTimeString(i.dischargeTime);
         }
         this.setData({
           shipDischargeList,
-          shipDischargeTotal: res.data.total
-        })
+          shipDischargeTotal: res.data.total,
+        });
       }
     } else {
       // wx.showToast({
@@ -234,32 +223,26 @@ Page({
       //   title: res.data.msg,
       // })
     }
-
   },
 
   previewImage(e) {
-    let {
-      src,
-      files
-    } = e.currentTarget.dataset
-    let urls = []
+    let { src, files } = e.currentTarget.dataset;
+    let urls = [];
     if (this.data.infoType == "ship" && this.data.tab == 3) {
-      urls = files.map(item => {
-        return item.viewUrl
-      })
+      urls = files.map((item) => {
+        return item.viewUrl;
+      });
     } else {
-      urls = [src]
+      urls = [src];
     }
     wx.previewImage({
       current: src, // 当前显示图片的http链接
-      urls // 需要预览的图片http链接列表
-    })
+      urls, // 需要预览的图片http链接列表
+    });
   },
 
   changeInfoType(e) {
-    let {
-      type
-    } = e.currentTarget.dataset
+    let { type } = e.currentTarget.dataset;
     this.setData({
       infoType: type,
       truckLoadCurrentPage: 1,
@@ -268,120 +251,126 @@ Page({
       truckLoadList: [],
       shipDischargeTotal: 0,
       truckLoadTotal: 0,
-    })
+    });
     if (type == "ship") {
-      this.getDischargeList()
+      this.getDischargeList();
     } else {
-      this.getCarLoadRecordList()
+      this.getCarLoadRecordList();
     }
   },
 
   cutTimeString(str) {
-    let index = str.indexOf(' ')
-    return index == -1 ? str : str.substring(0, index)
+    let index = str.indexOf(" ");
+    return index == -1 ? str : str.substring(0, index);
   },
 
   changeBottomPage() {
     if (this.data.infoType == "ship") {
-      this.getDischargeList(true)
+      this.getDischargeList(true);
     } else {
-      this.getCarLoadRecordList(true)
+      this.getCarLoadRecordList(true);
     }
   },
 
   scrollShip() {
-    if (this.data.shipDischargeTotal == 0 || this.data.shipDischargeTotal <= this.data.pageSize * this.data.shipDischargeCurrentPage) return
-    this.getDischargeList(true)
+    if (
+      this.data.shipDischargeTotal == 0 ||
+      this.data.shipDischargeTotal <=
+        this.data.pageSize * this.data.shipDischargeCurrentPage
+    )
+      return;
+    this.getDischargeList(true);
   },
   scrollTruck() {
-    if (this.data.truckLoadTotal == 0 || this.data.truckLoadTotal <= this.data.pageSize * this.data.truckLoadCurrentPage) return
-    this.getCarLoadRecordList(true)
+    if (
+      this.data.truckLoadTotal == 0 ||
+      this.data.truckLoadTotal <=
+        this.data.pageSize * this.data.truckLoadCurrentPage
+    )
+      return;
+    this.getCarLoadRecordList(true);
   },
 
   changePort(e) {
-    let tab3CurrentDischargeIndex = e.detail
+    let tab3CurrentDischargeIndex = e.detail;
     this.setData({
       tab3CurrentDischargeIndex,
       currentPortId: this.data.voyageDetails[tab3CurrentDischargeIndex].portId,
       shipDischargeList: [],
       truckLoadList: [],
-    })
+    });
     if (this.data.infoType == "ship") {
-      this.getDischargeList()
+      this.getDischargeList();
     } else {
-      this.getCarLoadRecordList()
+      this.getCarLoadRecordList();
     }
-
   },
   showAddDischargePortModal() {
-    let beforePorts = [{
-      portName: this.data.loadPort,
-      portId: 0
-    }]
+    let beforePorts = [
+      {
+        portName: this.data.loadPort,
+        portId: 0,
+      },
+    ];
     for (let i in this.data.dischargePorts) {
       beforePorts.push({
         portName: this.data.dischargePorts[i],
-        portId: this.data.dischargePortIds[i]
-      })
+        portId: this.data.dischargePortIds[i],
+      });
     }
     this.setData({
       dischargeModal: true,
-      beforePorts
-    })
+      beforePorts,
+    });
   },
 
   onShareAppMessage() {
-    let id = wx.getStorageSync('voyageDetailId')
+    let id = wx.getStorageSync("voyageDetailId");
     return {
-      title: '真实 实时 精准',
-      path: `/pages/sharePage/sharePage?id=${id}`
-    }
+      title: "真实 实时 精准",
+      path: `/pages/sharePage/sharePage?id=${id}`,
+    };
   },
 
-  doNothing() {
-
-  },
+  doNothing() {},
 
   cancelAddDischargePort() {
     this.setData({
       dischargeModal: false,
-      currentDischargePortId: '',
-      currentDischargePort: '',
+      currentDischargePortId: "",
+      currentDischargePort: "",
       currentBeforePortIndex: 0,
-      beforePorts: []
-    })
+      beforePorts: [],
+    });
   },
   selectDischargePort(e) {
-    if (this.checkPort(e.detail.label, this.data.beforePorts, 'portName')) return
+    if (this.checkPort(e.detail.label, this.data.beforePorts, "portName"))
+      return;
     this.setData({
       currentDischargePortId: e.detail.value,
-      currentDischargePort: e.detail.label
-    })
+      currentDischargePort: e.detail.label,
+    });
   },
   deleteDischargePort(e) {
-    let {
-      index
-    } = e.currentTarget.dataset
+    let { index } = e.currentTarget.dataset;
     wx.showModal({
       title: `确认删除: ${this.data.dischargePorts[index]}?`,
       content: `此操作会同时删除当前港口下的记录`,
       success: async (res) => {
         if (res.confirm) {
-          let {
-            data
-          } = await postApi('/voyage/deletePort', {
+          let { data } = await postApi("/voyage/deletePort", {
             voyageId: this.data.id,
-            portId: this.data.dischargePortIds[index]
-          })
+            portId: this.data.dischargePortIds[index],
+          });
           if (data.status == 0) {
             wx.showToast({
-              title: '删除成功',
-            })
+              title: "删除成功",
+            });
           }
-          this.getVoyageDetail()
+          this.getVoyageDetail();
         }
-      }
-    })
+      },
+    });
   },
 
   checkPort(portName = -1, ports = [], attr) {
@@ -390,179 +379,170 @@ Page({
     });
     if (b) {
       wx.showToast({
-        title: '港口已存在',
-        icon: "error"
-      })
+        title: "港口已存在",
+        icon: "error",
+      });
     }
     return b;
   },
 
-
   async addDischargePort() {
-    let {
-      currentDischargePortId,
-      currentDischargePort
-    } = this.data
+    let { currentDischargePortId, currentDischargePort } = this.data;
     if (!currentDischargePortId || !currentDischargePort) {
       wx.showToast({
-        title: '请选择港口',
-        icon: "error"
-      })
-      return
+        title: "请选择港口",
+        icon: "error",
+      });
+      return;
     }
     let res = await postApi("/voyage/addNewPort", {
-      loginAccountId: wx.getStorageSync('loginAccountId'),
+      loginAccountId: wx.getStorageSync("loginAccountId"),
       voyageId: this.data.id,
-      previousPortId: this.data.beforePorts[this.data.currentBeforePortIndex].portId,
-      portId: this.data.currentDischargePortId
-    })
-    this.getVoyageDetail()
-    this.cancelAddDischargePort()
-
+      previousPortId: this.data.beforePorts[this.data.currentBeforePortIndex]
+        .portId,
+      portId: this.data.currentDischargePortId,
+    });
+    this.getVoyageDetail();
+    this.cancelAddDischargePort();
   },
 
   bindDischargePortChange(e) {
-    let {
-      index,
-      param
-    } = e.currentTarget.dataset
-    this.data.voyageDetails[index][param] = e.detail.value
+    let { index, param } = e.currentTarget.dataset;
+    this.data.voyageDetails[index][param] = e.detail.value;
     this.setData({
-      voyageDetails: this.data.voyageDetails
-    })
+      voyageDetails: this.data.voyageDetails,
+    });
   },
 
   changeDischargeTab(e) {
-    let {
-      detail: currentDischargeIndex
-    } = e
+    let { detail: currentDischargeIndex } = e;
     this.setData({
-      currentDischargeIndex
-    })
+      currentDischargeIndex,
+    });
   },
 
   async updateVoyage() {
     for (let i of this.data.voyageDetails) {
       Object.keys(i).forEach(function (key) {
-        if ((typeof i[key]) == 'string') {
-          i[key] = i[key].replaceAll('-', '/')
-          if (i[key].length == 10) i[key] = i[key] + " 00:00:00"
+        if (typeof i[key] == "string") {
+          i[key] = i[key].replaceAll("-", "/");
+          if (i[key].length == 10) i[key] = i[key] + " 00:00:00";
         }
-      })
+      });
     }
-    if (this.data.arrivalLoadPortTime && this.data.arrivalLoadPortTime.length == 10) this.data.arrivalLoadPortTime = this.data.arrivalLoadPortTime + " 00:00:00"
-    if (this.data.actualLoadTons && this.data.actualLoadTons.length == 10) this.data.actualLoadTons = this.data.actualLoadTons + " 00:00:00"
-    if (this.data.actualLoadPieces && this.data.actualLoadPieces.length == 10) this.data.actualLoadPieces = this.data.actualLoadPieces + " 00:00:00"
-    if (this.data.loadStartTime && this.data.loadStartTime.length == 10) this.data.loadStartTime = this.data.loadStartTime + " 00:00:00"
-    if (this.data.loadEndTime && this.data.loadEndTime.length == 10) this.data.loadEndTime = this.data.loadEndTime + " 00:00:00"
-
+    if (
+      this.data.arrivalLoadPortTime &&
+      this.data.arrivalLoadPortTime.length == 10
+    )
+      this.data.arrivalLoadPortTime =
+        this.data.arrivalLoadPortTime + " 00:00:00";
+    if (this.data.actualLoadTons && this.data.actualLoadTons.length == 10)
+      this.data.actualLoadTons = this.data.actualLoadTons + " 00:00:00";
+    if (this.data.actualLoadPieces && this.data.actualLoadPieces.length == 10)
+      this.data.actualLoadPieces = this.data.actualLoadPieces + " 00:00:00";
+    if (this.data.loadStartTime && this.data.loadStartTime.length == 10)
+      this.data.loadStartTime = this.data.loadStartTime + " 00:00:00";
+    if (this.data.loadEndTime && this.data.loadEndTime.length == 10)
+      this.data.loadEndTime = this.data.loadEndTime + " 00:00:00";
 
     let res = await postApi("/voyage/update", {
       ...this.data,
-      loginAccountId: wx.getStorageSync('loginAccountId')
-    })
+      loginAccountId: wx.getStorageSync("loginAccountId"),
+    });
     if (res.data.status == 0) {
       wx.showToast({
         title: res.data.msg,
-      })
+      });
     }
-    this.getVoyageDetail()
+    this.getVoyageDetail();
   },
   async uploadBill(e) {
-    let {
-      type
-    } = e.currentTarget.dataset
+    let { type } = e.currentTarget.dataset;
     let postData = {
       type,
-      voyageId: this.data.id
-    }
-    let res = await uploadImage("/voyage/uploadVoyageWayBill", postData)
-    this.getVoyageDetail()
+      voyageId: this.data.id,
+    };
+    let res = await uploadImage("/voyage/uploadVoyageWayBill", postData);
+    this.getVoyageDetail();
   },
   async completeVoyage() {
     wx.showModal({
       title: "确认完成航次?",
-      success: async e => {
+      success: async (e) => {
         if (e.confirm) {
           let res = await postApi("/voyage/finish", {
-            loginAccountId: wx.getStorageSync('loginAccountId'),
-            voyageId: this.data.id
-          })
+            loginAccountId: wx.getStorageSync("loginAccountId"),
+            voyageId: this.data.id,
+          });
           if (res.data.status == 0) {
             wx.showToast({
-              title: '成功!',
-            })
-            this.getVoyageDetail()
+              title: "成功!",
+            });
+            this.getVoyageDetail();
           }
         }
-      }
-    })
+      },
+    });
   },
   async cancelVoyage() {
     wx.showModal({
       title: "确认取消航次?",
-      success: async e => {
+      success: async (e) => {
         if (e.confirm) {
           let res = await postApi("/voyage/cancel", {
-            loginAccountId: wx.getStorageSync('loginAccountId'),
-            id: this.data.id
-          })
+            loginAccountId: wx.getStorageSync("loginAccountId"),
+            id: this.data.id,
+          });
           if (res.data.status == 0) {
             wx.showToast({
-              title: '取消成功!',
-            })
+              title: "取消成功!",
+            });
             wx.switchTab({
-              url: '/pages/voyageManage/voyageManage',
-            })
+              url: "/pages/voyageManage/voyageManage",
+            });
           }
         }
-      }
-    })
+      },
+    });
   },
   goTo(e) {
-    let {
-      url
-    } = e.currentTarget.dataset
-    let {
-      id,
-      currentPortId
-    } = this.data
+    let { url } = e.currentTarget.dataset;
+    let { id, currentPortId } = this.data;
     wx.navigateTo({
       url: `${url}?voyageId=${id}&portId=${currentPortId}`,
-    })
+    });
   },
 
   uploadBillCanvas() {
     wx.navigateTo({
       url: `/pages/voyageManage/takeBill/takeBill?type=1&voyageId=${this.data.id}`,
-    })
+    });
   },
 
   loadEndTimeChange(e) {
-    if (!this.data.voyageDetails[0].setSailTime) this.data.voyageDetails[0].setSailTime = e.detail.value
+    if (!this.data.voyageDetails[0].setSailTime)
+      this.data.voyageDetails[0].setSailTime = e.detail.value;
     this.setData({
-      voyageDetails: this.data.voyageDetails
-    })
+      voyageDetails: this.data.voyageDetails,
+    });
   },
   bindBeforePortChange(e) {
     this.setData({
-      currentBeforePortIndex: e.detail.value
-    })
+      currentBeforePortIndex: e.detail.value,
+    });
   },
   onLoad(options) {
-    let {
-      id
-    } = options
-    wx.setStorageSync('voyageDetailId', id)
+    let { id } = options;
+    wx.setStorageSync("voyageDetailId", id);
     this.setData({
-      id
-    })
-    this.getVoyageDetail()
+      id,
+    });
+    this.getVoyageDetail();
   },
   onShow() {
-    if (wx.getStorageSync('addStatus') == "success") {
-      this.getVoyageDetail()
-      wx.removeStorageSync('addStatus')
+    if (wx.getStorageSync("addStatus") == "success") {
+      this.getVoyageDetail();
+      wx.removeStorageSync("addStatus");
     }
-  }
-})
+  },
+});