瀏覽代碼

更新 静态资源路径

wzg 2 年之前
父節點
當前提交
0d14792d38

+ 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%;">

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

@@ -18,7 +18,7 @@
   </view>
 </block>
 <block wx:else>
-  <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%;">

+ 152 - 149
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: false,
-    id: '',
+    id: "",
     tab: 2,
     shipDischargeCurrentPage: 1,
     truckLoadCurrentPage: 1,
@@ -14,72 +12,64 @@ 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
+    currentPortId: 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({
@@ -87,14 +77,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,
@@ -102,7 +91,7 @@ Page({
       policys,
       voyage,
       waybills,
-    })
+    });
   },
   subTimeStr(str) {
     if (!str || typeof str != "string") return;
@@ -111,44 +100,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({
@@ -160,40 +154,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({
@@ -201,23 +198,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,
@@ -226,135 +218,146 @@ 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() {
-    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}`,
+    };
   },
 
   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 currentPortId = e.target.dataset.id
+    let currentPortId = e.target.dataset.id;
     this.setData({
       currentPortId,
       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
-    })
-    let loginAccountId = wx.getStorageSync('loginAccountId')
+      id,
+    });
+    let loginAccountId = wx.getStorageSync("loginAccountId");
     if (loginAccountId) {
       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: "暂无查看权限",
+        });
       }
     }
-
   },
-})
+});

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

@@ -150,7 +150,7 @@
   </scroll-view>
 </block>
 <block wx:else>
-  <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%;">

+ 123 - 128
miniprogram/pages/voyages/detail/detail.js

@@ -1,10 +1,8 @@
 // pages/voyages/detail/detail.js
-import {
-  postApi
-} from "../../../apis/api"
+import { postApi } from "../../../apis/api";
 Page({
   data: {
-    id: '',
+    id: "",
     tab: 1,
     shipDischargeCurrentPage: 1,
     truckLoadCurrentPage: 1,
@@ -13,72 +11,64 @@ 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
+    currentPortId: 0,
   },
   changeTab(e) {
-    let {
-      tab
-    } = e.currentTarget.dataset
+    let { tab } = e.currentTarget.dataset;
     this.setData({
-      tab
-    })
+      tab,
+    });
   },
 
   async getVoyageDetail() {
     let res = await postApi("/voyage/wx/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({
@@ -86,23 +76,21 @@ Page({
         markers: this.data.markers,
         // latitude: this.data.latitude,
         // longitude: this.data.lo fngitude,
-        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)
+    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);
 
     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,
@@ -110,10 +98,10 @@ Page({
       policys,
       voyage,
       waybills,
-      currentPortId: voyage?.voyageDetails[0].portId
-    })
-    this.getCarLoadRecordList()
-    this.getDischargeList()
+      currentPortId: voyage?.voyageDetails[0].portId,
+    });
+    this.getCarLoadRecordList();
+    this.getDischargeList();
   },
   subTimeStr(str) {
     if (!str || typeof str != "string") return;
@@ -122,44 +110,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({
@@ -171,40 +164,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({
@@ -212,23 +208,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,
@@ -237,70 +228,74 @@ 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 currentPortId = e.target.dataset.id
+    let currentPortId = e.target.dataset.id;
     this.setData({
       currentPortId,
       shipDischargeList: [],
       truckLoadList: [],
-    })
+    });
     if (this.data.infoType == "ship") {
-      this.getDischargeList()
+      this.getDischargeList();
     } else {
-      this.getCarLoadRecordList()
+      this.getCarLoadRecordList();
     }
-
   },
 
-
   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}`,
+    };
   },
 
-
   onLoad(options) {
-    let {
-      id
-    } = options
-    wx.setStorageSync('voyageDetailId', id)
+    let { id } = options;
+    wx.setStorageSync("voyageDetailId", id);
     this.setData({
-      id
-    })
-    this.getVoyageDetail()
-
+      id,
+    });
+    this.getVoyageDetail();
   },
-})
+});

+ 10 - 11
project.config.json

@@ -22,8 +22,6 @@
     "compileHotReLoad": false,
     "lazyloadPlaceholderEnable": false,
     "useMultiFrameRuntime": false,
-    "useApiHook": false,
-    "useApiHostProcess": false,
     "babelSetting": {
       "ignore": [],
       "disablePlugins": [],
@@ -39,11 +37,10 @@
     "showES6CompileOption": false,
     "useCompilerPlugins": false,
     "ignoreUploadUnusedFiles": true,
-    "localPlugins": false
+    "localPlugins": false,
+    "useApiHook": false,
+    "useApiHostProcess": false
   },
-  "appid": "wxd8fe7909b3471a51",
-  "projectname": "货主小程序",
-  "libVersion": "2.19.6",
   "cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
   "condition": {
     "search": {
@@ -69,13 +66,15 @@
     }
   },
   "compileType": "miniprogram",
-  "packOptions": {
-    "ignore": [],
-    "include": []
-  },
   "srcMiniprogramRoot": "miniprogram/",
   "editorSetting": {
     "tabIndent": "insertSpaces",
     "tabSize": 2
-  }
+  },
+  "libVersion": "2.19.6",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "appid": "wxd8fe7909b3471a51"
 }