소스 검색

更新 分享页

wzh 3 년 전
부모
커밋
8b3cab0e2d

+ 5 - 2
miniprogram/app.json

@@ -4,7 +4,9 @@
     "pages/voyages/voyages",
     "pages/me/me",
     "pages/login/login",
-    "pages/voyages/detail/detail"
+    "pages/voyages/detail/detail",
+    "pages/share/sharePage",
+    "pages/sharePage/sharePage"
   ],
   "window": {
     "backgroundColor": "#F6F6F6",
@@ -14,7 +16,8 @@
     "navigationBarTextStyle": "black"
   },
   "tabBar": {
-    "list": [{
+    "list": [
+      {
         "pagePath": "pages/index/index",
         "text": "首页",
         "iconPath": "images/tabBar/index.png",

+ 4 - 0
miniprogram/app.wxss

@@ -198,4 +198,8 @@ cover-view {
 
 .scrolly {
   overflow-y: scroll;
+}
+
+.c3 {
+  color: #333;
 }

+ 16 - 7
miniprogram/components/voyages/voyages.js

@@ -16,13 +16,13 @@ Component({
     size: 20,
     list: [],
     total: 0,
-    cargoOwnerId: 0,
+    loginAccountId: 0,
     isFreshing: false
   },
   methods: {
     async getVoyageList(isScroll) {
-      let cargoOwnerId = wx.getStorageSync('cargoOwnerId')
-      if (!cargoOwnerId) {
+      let loginAccountId = wx.getStorageSync('loginAccountId')
+      if (!loginAccountId) {
         this.setData({
           list: [{
             shipName: '体验船舶#1',
@@ -60,7 +60,7 @@ Component({
         return
       } else {
         this.setData({
-          cargoOwnerId,
+          loginAccountId,
           list: []
         })
       }
@@ -68,7 +68,7 @@ Component({
         isFreshing: true
       })
       let res = await postApi('/voyage/list', {
-        cargoOwnerId: wx.getStorageSync('cargoOwnerId'),
+        loginAccountId: wx.getStorageSync('loginAccountId'),
         term: this.data.term,
         status: this.data.status,
         currentPage: this.data.currentPage,
@@ -111,14 +111,23 @@ Component({
       this.getVoyageList()
     },
     goToDetail(e) {
-      let cargoOwnerId = wx.getStorageSync('cargoOwnerId')
-      if (!cargoOwnerId) {
+      let loginAccountId = wx.getStorageSync('loginAccountId')
+      if (!loginAccountId) {
         wx.showToast({
           icon: "none",
           title: '为了保证数据安全,请注册或登录',
         })
         return
       }
+      let rolePermission = wx.getStorageSync('rolePermission')
+
+      if (rolePermission.indexOf('VOYAGEDETAIL') == -1) {
+        wx.showToast({
+          icon: "none",
+          title: '暂无权限,请联系管理员',
+        })
+        return
+      }
       let {
         id
       } = e.currentTarget.dataset

+ 9 - 0
miniprogram/pages/index/index.js

@@ -32,6 +32,15 @@ Page({
         cargoOwnerId
       })
     }
+    let rolePermission = wx.getStorageSync('rolePermission')
+
+    if (rolePermission.indexOf('VOYAGELIST') == -1) {
+      wx.showToast({
+        icon: "none",
+        title: '暂无权限,请联系管理员',
+      })
+      return
+    }
     const child = this.selectComponent('.voyages');
     child.getVoyageList()
   }

+ 44 - 0
miniprogram/pages/share/sharePage.js

@@ -0,0 +1,44 @@
+// 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)
+  },
+})

+ 3 - 0
miniprogram/pages/share/sharePage.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 68 - 0
miniprogram/pages/share/sharePage.wxml

@@ -0,0 +1,68 @@
+<map scale="8" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}" style="width: 100%;height: 400rpx;" name="map"></map>
+<view class="card">
+  <view style="padding: 10rpx 0;border-bottom: 4rpx solid #ddd;">{{shipName}}</view>
+  <view>
+    <view class="df aic mt30 fz28 c3">
+      <view class="df item">
+        <view>装货港</view> <text class="mr20">:</text> {{loadPort}}
+      </view>
+      <view class="df item">
+        <view>卸货港</view> <text class="mr20">:</text> {{discPort}}
+      </view>
+    </view>
+    <view class="df aic mt30 fz28 c3">
+      <view class="df item">
+        <view>货种</view> <text class="mr20">:</text> {{cargo}}
+      </view>
+      <view class="df item">
+        <view>吨位</view> <text class="mr20">:</text> {{tons}}
+      </view>
+    </view>
+  </view>
+</view>
+<view style="position: relative;">
+  <scroll-view class="card" scroll-y="true" style="height:calc(100vh - 730rpx);position: relative;z-index: 20;" lower-threshold="50">
+    <view class="{{['df','mb20','mb50']}}" style="position: relative;z-index: 2;">
+      <view class="{{['mr30','title-circle']}}" style="background: green;"></view>
+      <view class="text">
+        <view class="card-title">卸货港</view>
+        <view class="in-text df">
+          <view style="width: 250rpx;margin-right: 30rpx;">沙市</view>
+          <view>预计到港时间{{expectedArrivalTime}}</view>
+        </view>
+      </view>
+    </view>
+    <view class="{{['df','mb20',index==transInfos.length-1?'mb50':'']}}" style="position: relative;z-index: 2;" wx:for="{{transInfos}}" wx:key="index">
+      <view class="{{['mr30',index==0?'title-circle transInfos':'circle']}}"></view>
+      <view class="text">
+        <view wx:if="{{index==0}}" class="card-title">运输中</view>
+        <view class="in-text df">
+          <view style="width: 250rpx;margin-right: 30rpx;">{{item.createTime}}</view>
+          <view>{{item.province}}/{{item.city}}/{{item.district}}</view>
+        </view>
+      </view>
+    </view>
+    <view class="{{['df','mb20',index==loadingInfos.length-1?'mb50':'']}}" style="position: relative;z-index: 2;" wx:for="{{loadingInfos}}" wx:key="index">
+      <view class="{{['mr30',index==0?'title-circle':'circle']}}"></view>
+      <view class="text">
+        <view wx:if="{{index==0}}" class="card-title">装货中</view>
+        <view class="in-text df">
+          <view style="width: 250rpx;margin-right: 30rpx;">{{item.createTime}}</view>
+          <view>{{item.province}}/{{item.city}}/{{item.district}}</view>
+        </view>
+      </view>
+    </view>
+    <view class="{{['df','mb20','mb50']}}" style="position: relative;z-index: 2;">
+      <view class="{{['mr30','title-circle']}}"></view>
+      <view class="text">
+        <view class="card-title">开航</view>
+        <view class="in-text df">
+          <view style="width: 250rpx;margin-right: 30rpx;">{{setSailTime}}</view>
+          <view></view>
+        </view>
+      </view>
+    </view>
+  </scroll-view>
+  <view class="long-line"></view>
+
+</view>

+ 69 - 0
miniprogram/pages/share/sharePage.wxss

@@ -0,0 +1,69 @@
+page {
+  box-sizing: border-box;
+}
+
+.item {
+  padding: 0 20rpx;
+  width: 50%;
+}
+
+.item>view {
+  width: 90rpx;
+  text-align: justify;
+  text-align-last: justify;
+  margin-right: 16rpx;
+}
+
+.card {
+  padding: 20rpx 30rpx;
+  border: 2rpx solid #ddd;
+  width: 95%;
+  margin: 20rpx auto;
+  border-radius: 20rpx;
+  box-shadow: 3rpx 1rpx 5px #ddd;
+}
+
+.circle {
+  width: 20rpx;
+  height: 20rpx;
+  border-radius: 50%;
+  background: #999;
+  position: relative;
+  left: 4rpx;
+  margin-right: 38rpx;
+  z-index: 20;
+}
+
+.title-circle {
+  width: 28rpx;
+  height: 28rpx;
+  border-radius: 50%;
+  background: #999;
+  position: relative;
+  z-index: 20;
+}
+
+
+.in-text {
+  font-size: 22rpx;
+  color: #666;
+}
+
+.long-line {
+  border: 2rpx solid #ddd;
+  height: calc(100vh - 780rpx);
+  position: absolute;
+  left: 62rpx;
+  top: 24rpx;
+  z-index: 0;
+}
+
+.card-title {
+  font-size: 26rpx;
+  margin-bottom: 8rpx;
+  line-height: 30rpx;
+}
+
+.transInfos {
+  background: rgb(197, 56, 56);
+}

+ 283 - 0
miniprogram/pages/sharePage/sharePage.js

@@ -0,0 +1,283 @@
+// pages/voyages/detail/detail.js
+import {
+  postApi
+} from "../../apis/api"
+Page({
+  data: {
+    id: '',
+    tab: 2,
+    shipDischargeCurrentPage: 1,
+    truckLoadCurrentPage: 1,
+    coordinates: [],
+    medias: [],
+    policys: [],
+    voyage: [],
+    waybills: [],
+    infoType: 'ship',
+    shipDischargeList: [],
+    truckLoadList: [],
+    shipDischargeTotal: 0,
+    truckLoadTotal: 0,
+    polyline: [{
+      points: [],
+      width: 2,
+      dottedLine: true,
+      color: "#eb2f06"
+    }],
+    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
+    }],
+    pageSize: 20,
+    latitude: 31.891992,
+    longitude: 120.551369,
+  },
+  changeTab(e) {
+    let {
+      tab
+    } = e.currentTarget.dataset
+    this.setData({
+      tab
+    })
+  },
+
+  async getVoyageDetail() {
+    let res = await postApi("/voyage/detail", {
+      voyageId: this.data.id,
+    })
+
+    let {
+      coordinates,
+      medias,
+      policys,
+      voyage,
+      waybills
+    } = res.data.result
+    if (coordinates.length) {
+      let points = []
+      for (let i of coordinates) {
+        points.push({
+          latitude: i.latitude,
+          longitude: i.longitude
+        })
+      }
+      let {
+        latitude,
+        longitude
+      } = points[points.length - 1]
+      this.data.latitude = latitude
+      this.data.longitude = longitude
+      this.data.markers[0].latitude = latitude
+      this.data.markers[0].longitude = longitude
+      this.data.polyline[0].points = points
+
+      this.setData({
+        polyline: this.data.polyline,
+        markers: this.data.markers,
+        latitude: this.data.latitude,
+        longitude: this.data.longitude,
+      })
+
+    }
+    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,
+      medias,
+      policys,
+      voyage,
+      waybills,
+    })
+  },
+  subTimeStr(str) {
+    if (!str || typeof str != "string") return;
+    let index = str.indexOf(" ");
+    return str.substring(0, index);
+  },
+
+  async getCarLoadRecordList(isScroll) {
+    if (this.data.truckLoadTotal != 0 && this.data.truckLoadTotal < this.data.pageSize * this.data.truckLoadCurrentPage) return
+    if (isScroll) {
+      this.data.truckLoadCurrentPage += 1
+    } else {
+      this.data.truckLoadCurrentPage = 1
+    }
+    let res = await postApi("/voyage/getCarLoadRecordList", {
+      voyageId: this.data.id,
+      size: this.data.pageSize,
+      currentPage: this.data.truckLoadCurrentPage
+    })
+    this.setData({
+      truckLoadCurrentPage: this.data.truckLoadCurrentPage,
+    })
+
+    if (0 == res.data.status) {
+      if (isScroll) {
+        let truckLoadList = [...this.data.truckLoadList, ...res.data.result]
+        for (let i of truckLoadList) {
+          i.weighTime = this.cutTimeString(i.weighTime)
+        }
+        this.setData({
+          truckLoadList,
+          truckLoadTotal: res.data.total
+        })
+      } else {
+        let truckLoadList = res.data.result
+
+        for (let i of truckLoadList) {
+          i.weighTime = this.cutTimeString(i.weighTime)
+        }
+        this.setData({
+          truckLoadList,
+          truckLoadTotal: res.data.total
+        })
+      }
+    } else {
+      wx.showToast({
+        icon: 'none',
+        title: res.data.msg,
+      })
+    }
+  },
+
+  async getDischargeList(isScroll) {
+    if (isScroll) {
+      this.data.shipDischargeCurrentPage += 1
+    } else {
+      this.data.shipDischargeCurrentPage = 1
+    }
+    let res = await postApi("/voyage/getDischargeList", {
+      voyageId: this.data.id,
+      size: this.data.pageSize,
+      currentPage: this.data.shipDischargeCurrentPage
+    })
+    this.setData({
+      shipDischargeCurrentPage: this.data.shipDischargeCurrentPage,
+    })
+    if (0 == res.data.status) {
+      if (isScroll) {
+        let shipDischargeList = [...this.data.shipDischargeList, ...res.data.result]
+        for (let i of shipDischargeList) {
+          i.dischargeTime = this.cutTimeString(i.dischargeTime)
+        }
+        this.setData({
+          shipDischargeList,
+          shipDischargeTotal: res.data.total
+        })
+      } else {
+        let shipDischargeList = res.data.result
+        for (let i of shipDischargeList) {
+          i.dischargeTime = this.cutTimeString(i.dischargeTime)
+        }
+        this.setData({
+          shipDischargeList,
+          shipDischargeTotal: res.data.total
+        })
+      }
+    } else {
+      wx.showToast({
+        icon: "none",
+        title: res.data.msg,
+      })
+    }
+
+  },
+
+  previewImage(e) {
+    let {
+      src
+    } = e.currentTarget.dataset
+    wx.previewImage({
+      current: src, // 当前显示图片的http链接
+      urls: [src] // 需要预览的图片http链接列表
+    })
+  },
+
+  changeInfoType(e) {
+    let {
+      type
+    } = e.currentTarget.dataset
+    this.setData({
+      infoType: type,
+      truckLoadCurrentPage: 1,
+      shipDischargeCurrentPage: 1,
+      shipDischargeList: [],
+      truckLoadList: [],
+      shipDischargeTotal: 0,
+      truckLoadTotal: 0,
+    })
+    if (type == "ship") {
+      this.getDischargeList()
+    } else {
+      this.getCarLoadRecordList()
+    }
+  },
+
+  cutTimeString(str) {
+    let index = str.indexOf(' ')
+    return index == -1 ? str : str.substring(0, index)
+  },
+
+  changeBottomPage() {
+    if (this.data.infoType == "ship") {
+      this.getDischargeList(true)
+    } else {
+      this.getCarLoadRecordList(true)
+    }
+  },
+
+  scrollShip() {
+    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)
+  },
+
+
+  onShareAppMessage() {
+    let id = wx.getStorageSync('voyageDetailId')
+    return {
+      title: '真实 实时 精准',
+      path: `/pages/share/sharePage?id=${id}`
+    }
+  },
+
+  async getNewDetail(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
+    })
+  },
+
+
+  onLoad(options) {
+    let {
+      id
+    } = options
+    wx.setStorageSync('voyageDetailId', id)
+    this.setData({
+      id
+    })
+    this.getNewDetail(id)
+    this.getVoyageDetail()
+    this.getCarLoadRecordList()
+    this.getDischargeList()
+  },
+})

+ 3 - 0
miniprogram/pages/sharePage/sharePage.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 143 - 0
miniprogram/pages/sharePage/sharePage.wxml

@@ -0,0 +1,143 @@
+<map scale="8" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}" style="width: 100%;height: 400rpx;" name="map"></map>
+<view class="df aic jcsb p20" style="border-bottom: 1px solid #999;border-top: 1px solid #999;">
+  <view class="tabsview" bindtap="changeTab" data-tab="{{2}}" style="color:{{tab==2?'#0d8fcc':''}};border-bottom:{{tab==2?'2rpx solid #0d8fcc':''}}">航次信息</view>
+  <view class="tabsview" bindtap="changeTab" data-tab="{{3}}" style="color:{{tab==3?'#0d8fcc':''}};border-bottom:{{tab==3?'2rpx solid #0d8fcc':''}}">单据信息</view>
+  <view class="tabsview" bindtap="changeTab" data-tab="{{4}}" style="color:{{tab==4?'#0d8fcc':''}};border-bottom:{{tab==4?'2rpx solid #0d8fcc':''}}">卸货信息</view>
+  <view class="tabsview" bindtap="changeTab" data-tab="{{5}}" style="color:{{tab==5?'#0d8fcc':''}};border-bottom:{{tab==5?'2rpx solid #0d8fcc':''}}">航次照片</view>
+</view>
+<view class="type2" wx:if="{{tab==2}}">
+  <view class="card">
+    <view style="padding: 10rpx 0;border-bottom: 4rpx solid #ddd;">{{shipName}}</view>
+    <view>
+      <view class="df aic mt20 fz24 c3">
+        <view class="df item">
+          <view>装货港</view> <text class="mr20">:</text> {{loadPort}}
+        </view>
+        <view class="df item">
+          <view>卸货港</view> <text class="mr20">:</text> {{discPort}}
+        </view>
+      </view>
+      <view class="df aic mt10 fz24 c3">
+        <view class="df item">
+          <view>货种</view> <text class="mr20">:</text> {{cargo}}
+        </view>
+        <view class="df item">
+          <view>吨位</view> <text class="mr20">:</text> {{tons}}
+        </view>
+      </view>
+    </view>
+  </view>
+  <view style="position: relative;">
+    <scroll-view class="card" scroll-y="true" style="height:calc(100vh - 760rpx);position: relative;z-index: 20;" lower-threshold="50">
+      <view class="{{['df','mb20','mb40']}}" style="position: relative;z-index: 2;">
+        <view class="{{['mr30','title-circle']}}" style="background: green;"></view>
+        <view class="text">
+          <view class="in-text df">
+            <view class="card-title" style="color:#000;width: 250rpx;margin-right: 30rpx;">卸货港</view>
+            <view class="card-title" style="color: #000;">预计到港时间</view>
+          </view>
+          <view class="in-text df">
+            <view style="width: 250rpx;margin-right: 30rpx;">{{discPort}}</view>
+            <view>{{expectedArrivalTime}}</view>
+          </view>
+        </view>
+      </view>
+      <view class="{{['df','mb20',index==transInfos.length-1?'mb40':'']}}" style="position: relative;z-index: 2;" wx:for="{{transInfos}}" wx:key="index">
+        <view class="{{['mr30',index==0?'title-circle transInfos':'circle']}}"></view>
+        <view class="text">
+          <view wx:if="{{index==0}}" class="card-title">运输中</view>
+          <view class="in-text df">
+            <view style="width: 250rpx;margin-right: 30rpx;">{{item.createTime}}</view>
+            <view>{{item.province}}/{{item.city}}/{{item.district}}</view>
+          </view>
+        </view>
+      </view>
+      <view class="{{['df','mb20',index==loadingInfos.length-1?'mb40':'']}}" style="position: relative;z-index: 2;" wx:for="{{loadingInfos}}" wx:key="index">
+        <view class="{{['mr30',index==0?'title-circle':'circle']}}"></view>
+        <view class="text">
+          <view wx:if="{{index==0}}" class="card-title">装货中</view>
+          <view class="in-text df">
+            <view style="width: 250rpx;margin-right: 30rpx;">{{item.createTime}}</view>
+            <view>{{item.province}}/{{item.city}}/{{item.district}}</view>
+          </view>
+        </view>
+      </view>
+      <view class="{{['df','mb20','mb40']}}" style="position: relative;z-index: 2;">
+        <view class="{{['mr30','title-circle']}}"></view>
+        <view class="text">
+          <view class="card-title">开航</view>
+          <view class="in-text df">
+            <view style="width: 250rpx;margin-right: 30rpx;">{{setSailTime}}</view>
+            <view></view>
+          </view>
+        </view>
+      </view>
+    </scroll-view>
+    <view class="long-line"></view>
+  </view>
+</view>
+<scroll-view wx:else scroll-y="true" style="height:calc(100vh - 494rpx);padding: 30rpx 50rpx;font-size: 28rpx;color:#222" lower-threshold="50" bindscrolltolower="test">
+
+
+  <view wx:if="{{tab==3}}">
+    <view>保险单</view>
+    <view wx:for="{{policys}}" wx:key="index" style="text-align: center;">
+      <image data-src="{{item.viewUrl}}" bindtap="previewImage" src="{{item.viewUrl}}" style="width: 60%;height: 240rpx;" mode="aspectFit"></image>
+      <view wx:if="{{policys.length&&policys.length!=1}}" class="mt10 mb10" style="border-bottom: 2rpx solid #eee;"></view>
+    </view>
+    <view class="mt30 mb30" style="border-bottom: 2rpx solid #ccc;"></view>
+    <view>运单</view>
+    <view wx:for="{{waybills}}" wx:key="index" style="text-align: center;">
+      <image data-src="{{item.viewUrl}}" bindtap="previewImage" src="{{item.viewUrl}}" style="width: 60%;height: 240rpx;" mode="aspectFit"></image>
+      <view wx:if="{{waybills.length&&waybills.length!=1}}" class="mt10 mb10" style="border-bottom: 2rpx solid #eee;"></view>
+    </view>
+  </view>
+  <view wx:if="{{tab==4}}">
+    <view class="df aic jcsb pb20" style="border-bottom: 2rpx solid #ddd;">
+      <view bindtap="changeInfoType" data-type="ship" style="color:{{infoType=='ship'?'#0d8fcc':''}};border-bottom:{{infoType=='ship'?'2rpx solid #0d8fcc':''}}">船舶卸货记录</view>
+      <view bindtap="changeInfoType" data-type="truck" style="color:{{infoType=='truck'?'#0d8fcc':''}};border-bottom:{{infoType=='truck'?'2rpx solid #0d8fcc':''}}">汽车装货记录</view>
+    </view>
+    <view class="ship-discharge-list" wx:if="{{infoType=='ship'}}">
+      <view class="df aic jcsb mb20 mt10 fz22">
+        <view>卸货时间</view>
+        <view>卸货吨位</view>
+        <view>卸货件数</view>
+        <view>磅单</view>
+      </view>
+      <view wx:for="{{shipDischargeList}}" wx:key="index" class="df aic jcsb mb20 fz22">
+        <view>{{item.dischargeTime}}</view>
+        <view>{{item.dischargeTons||''}}</view>
+        <view>{{item.dischargePieces||''}}</view>
+        <view wx:if="{{item.files&&item.files.length}}" bindtap="previewImage" data-src="{{item.files[0].viewUrl}}" data-files="{{item.files}}">查看</view>
+        <view wx:else>暂无</view>
+      </view>
+      <view bindtap="scrollShip" class="bottom-text">{{shipDischargeTotal==0?'暂无数据':(shipDischargeTotal>pageSize*shipDischargeCurrentPage?'点击或滑动加载更多...':'已加载完毕')}}</view>
+    </view>
+    <view class="truck-load-list" wx:if="{{infoType=='truck'}}">
+      <view class="df aic jcsb mb20 mt10 fz22">
+        <view>车号</view>
+        <view>毛重</view>
+        <view>皮重</view>
+        <view>净重</view>
+        <view>称重时间</view>
+        <view>单据</view>
+      </view>
+      <view wx:for="{{truckLoadList}}" wx:key="index" class="df aic jcsb mb20 fz22">
+        <view>{{item.carNum}}</view>
+        <view>{{item.grossWeight}}</view>
+        <view>{{item.tare}}</view>
+        <view>{{item.netWeight}}</view>
+        <view>{{item.weighTime}}</view>
+        <view wx:if="{{item.file}}" bindtap="previewImage" data-src="{{item.file.viewUrl}}">查看</view>
+        <view wx:else>暂无</view>
+      </view>
+      <view bindtap="scrollTruck" class="bottom-text">{{truckLoadTotal==0?'暂无数据':(truckLoadTotal>pageSize*truckLoadCurrentPage?'点击或滑动加载更多...':'已加载完毕')}}</view>
+    </view>
+  </view>
+  <view wx:if="{{tab==5}}">
+    <view wx:for="{{medias}}" wx:key="index" style="margin-bottom:50rpx;">
+      <view style="color: #0c81b8;padding-bottom: 10rpx;margin-bottom: 20rpx; border-bottom: 4rpx dashed rgb(197, 194, 194);">{{item.createTime}}</view>
+      <image data-src="{{item.viewUrl}}" bindtap="previewImage" src="{{item.viewUrl}}" style="width: 90%;" mode="aspectFit"></image>
+    </view>
+  </view>
+</scroll-view>

+ 189 - 0
miniprogram/pages/sharePage/sharePage.wxss

@@ -0,0 +1,189 @@
+/* components/voyages/Voyages.wxss */
+page {
+  background: #fff;
+}
+
+.df {
+  display: flex;
+}
+
+.jcsb {
+  justify-content: space-between;
+}
+
+.jcc {
+  justify-content: center;
+}
+
+.jcfe {
+  justify-content: flex-end;
+}
+
+.jcsa {
+  justify-content: space-around;
+}
+
+.aic {
+  align-items: center;
+}
+
+.search {
+  border: 1rpx solid grey;
+  width: 80%;
+  background: #fff;
+}
+
+.tabs {
+  width: 100%;
+  height: 100rpx;
+  background: #fff;
+  box-shadow: rgb(209, 206, 206) 5rpx 5rpx 10rpx;
+  border-bottom: 2rpx solid grey;
+}
+
+.tabsview {
+  width: 130rpx;
+  height: 50rpx;
+  font-size: 28rpx;
+  text-align: center;
+  color: #333;
+}
+
+.line {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 30rpx;
+  color: #333;
+}
+
+.line-item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  width: 45%;
+}
+
+.line-full-item {
+  width: 100%;
+  display: flex;
+  align-items: center;
+}
+
+.line-full-title {
+  width: 25%;
+}
+
+
+.line-title,
+.line-text {
+  width: 50%;
+}
+
+.line-title,
+.line-full-title {
+  color: #444;
+}
+
+.type2 .line-full-title {
+  width: 50%;
+}
+
+.ship-discharge-list>view:first-child {
+  font-size: 26rpx;
+}
+
+.ship-discharge-list>view>view {
+  width: 160rpx;
+  text-align: center;
+  color: #444;
+}
+
+.truck-load-list>view:first-child {
+  font-size: 26rpx;
+}
+
+.truck-load-list>view>view {
+  width: 160rpx;
+  text-align: center;
+  color: #444;
+}
+
+
+.bottom-text {
+  text-align: center;
+  padding-top: 30rpx;
+  padding-bottom: 50rpx;
+  font-size: 22rpx;
+  color: #777;
+}
+
+page {
+  box-sizing: border-box;
+}
+
+.item {
+  padding: 0 20rpx;
+  width: 50%;
+}
+
+.item>view {
+  width: 90rpx;
+  text-align: justify;
+  text-align-last: justify;
+  margin-right: 16rpx;
+}
+
+.card {
+  padding: 20rpx 30rpx;
+  border: 2rpx solid #ddd;
+  width: 95%;
+  margin: 20rpx auto;
+  border-radius: 20rpx;
+  box-shadow: 3rpx 1rpx 5px #ddd;
+}
+
+.circle {
+  width: 20rpx;
+  height: 20rpx;
+  border-radius: 50%;
+  background: #999;
+  position: relative;
+  left: 4rpx;
+  margin-right: 38rpx;
+  z-index: 20;
+}
+
+.title-circle {
+  width: 28rpx;
+  height: 28rpx;
+  border-radius: 50%;
+  background: #999;
+  position: relative;
+  z-index: 20;
+}
+
+
+.in-text {
+  font-size: 22rpx;
+  color: #666;
+}
+
+.long-line {
+  border: 2rpx solid #ddd;
+  height: calc(100vh - 800rpx);
+  position: absolute;
+  left: 62rpx;
+  top: 24rpx;
+  z-index: 0;
+}
+
+.card-title {
+  font-size: 26rpx;
+  margin-bottom: 8rpx;
+  line-height: 30rpx;
+}
+
+.transInfos {
+  background: rgb(197, 56, 56);
+}

+ 19 - 1
miniprogram/pages/voyages/detail/detail.js

@@ -28,7 +28,7 @@ Page({
       id: 999,
       latitude: '',
       longitude: '',
-      iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/web-static/ship-red-icon.png",
+      iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
       height: 20,
       width: 20
     }],
@@ -83,6 +83,10 @@ Page({
       })
 
     }
+    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,
@@ -92,6 +96,11 @@ Page({
       waybills,
     })
   },
+  subTimeStr(str) {
+    if (!str || typeof str != "string") return;
+    let index = str.indexOf(" ");
+    return str.substring(0, index);
+  },
 
   async getCarLoadRecordList(isScroll) {
     if (this.data.truckLoadTotal != 0 && this.data.truckLoadTotal < this.data.pageSize * this.data.truckLoadCurrentPage) return
@@ -234,6 +243,15 @@ Page({
   },
 
 
+  onShareAppMessage() {
+    let id = wx.getStorageSync('voyageDetailId')
+    return {
+      title: '真实 实时 精准',
+      path: `/pages/sharePage/sharePage?id=${id}`
+    }
+  },
+
+
   onLoad(options) {
     let {
       id

+ 7 - 5
miniprogram/pages/voyages/detail/detail.wxml

@@ -1,4 +1,4 @@
-<map scale="8" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}" polyline="{{polyline}}" style="width: 100%;height: 400rpx;" name="map"></map>
+<map scale="8" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}" style="width: 100%;height: 400rpx;" name="map"></map>
 <view class="df aic jcsb p20" style="border-bottom: 1px solid #999;border-top: 1px solid #999;">
   <view class="tabsview" bindtap="changeTab" data-tab="{{1}}" style="color:{{tab==1?'#0d8fcc':''}};border-bottom:{{tab==1?'2rpx solid #0d8fcc':''}}">航次信息</view>
   <view class="tabsview" bindtap="changeTab" data-tab="{{2}}" style="color:{{tab==2?'#0d8fcc':''}};border-bottom:{{tab==2?'2rpx solid #0d8fcc':''}}">航次详情</view>
@@ -15,12 +15,14 @@
       </view>
     </view>
     <view class="line">
-      <view class="line-item">
-        <view class="line-title">船舶名称:</view>
+      <view class="line-full-item">
+        <view class="line-full-title">船舶名称:</view>
         <view class="line-text">{{voyage.shipName}}</view>
       </view>
-      <view class="line-item">
-        <view class="line-title">MMSI:</view>
+    </view>
+    <view class="line">
+      <view class="line-full-item">
+        <view class="line-full-title">MMSI:</view>
         <view class="line-text">{{voyage.shipMmsi}}</view>
       </view>
     </view>

+ 9 - 0
miniprogram/utils/utils.js

@@ -0,0 +1,9 @@
+function subTimeStr(str) {
+  if (!str || typeof str != "string") return;
+  let index = str.indexOf(" ");
+  return str.substring(0, index);
+}
+
+export {
+  subTimeStr
+};

+ 14 - 0
project.private.config.json

@@ -22,6 +22,20 @@
           "query": "id=42",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/share/sharePage",
+          "query": "id=42",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/sharePage/sharePage",
+          "query": "id=42",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }