Bladeren bron

更新 我的航次

wzh 3 jaren geleden
bovenliggende
commit
71e7507c2b

+ 4 - 4
miniprogram/pages/voyageManage/createVoyage/createVoyage.js

@@ -62,28 +62,28 @@ Page({
     })
   },
   checkData() {
-    if (!this.data.shipId) {
+    if (!this.data.voyage.shipId) {
       wx.showToast({
         title: '请选择船舶',
         icon: "error"
       })
       return
     }
-    if (!this.data.cargoOwnerId) {
+    if (!this.data.voyage.cargoOwnerId) {
       wx.showToast({
         title: '请选择货主',
         icon: "error"
       })
       return
     }
-    if (!this.data.cargo) {
+    if (!this.data.voyage.cargo) {
       wx.showToast({
         title: '请选择货种',
         icon: "error"
       })
       return
     }
-    if (!this.data.loadPort || !this.data.loadPortId) {
+    if (!this.data.voyage.loadPort || !this.data.voyage.loadPortId) {
       wx.showToast({
         title: '请选择装货港',
         icon: "error"

+ 30 - 2
miniprogram/pages/voyageManage/voyageManage.js

@@ -33,7 +33,6 @@ Page({
       list: [],
       currentPage: 1
     })
-    if (!this.data.cargoOwnerId) return
     this.getList()
   },
   async getList(isScroll) {
@@ -42,6 +41,7 @@ Page({
     })
     let res = await postApi(this.data.currentApi, {
       loginAccountId: wx.getStorageSync('loginAccountId'),
+      cargoOwnerId: this.data.cargoOwnerId,
       status: this.data.status,
       currentPage: this.data.currentPage,
       size: this.data.size,
@@ -89,8 +89,30 @@ Page({
     let {
       id
     } = e.currentTarget.dataset
+    let path = ''
+    switch (this.data.maintab) {
+      case 1: {
+        path = "/voyages/detail/detail"
+        break
+      }
+      case 2: {
+        if (this.data.status == 2) {
+          wx.showToast({
+            title: '请联系船东拍照',
+            icon: "error"
+          })
+          return
+        }
+        path = "/voyageManage/myDaily/myDaily"
+        break
+      }
+      case 3: {
+        path = "/voyageManage/myBills/myBills"
+        break
+      }
+    }
     wx.navigateTo({
-      url: `/pages/voyages/detail/detail?id=${id}`,
+      url: `/pages${path}?id=${id}`,
     })
   },
   scrollList() {
@@ -106,6 +128,12 @@ Page({
     })
     this.getList()
   },
+
+  call(e) {
+    wx.makePhoneCall({
+      phoneNumber: e.currentTarget.dataset.phone
+    })
+  },
   onLoad() {
 
   }

+ 16 - 15
miniprogram/pages/voyageManage/voyageManage.wxml

@@ -4,25 +4,26 @@
     <RemotePicker bind:selectItem="selectCargoOwner" url="/user/cargoOwner/select" params="{{defaultParams}}" inputStyle="height:60rpx"></RemotePicker>
   </view>
 </view>
-<block wx:if="{{cargoOwnerId}}">
-  <view class="df aic jcsa tabs" wx:if="{{maintab!=3}}">
-    <view class="tabsview" bindtap="changeStatus" data-status="{{1}}" style="color:{{status==1?'#0d8fcc':''}};border-bottom:{{status==1?'4rpx solid #0d8fcc':''}}">{{maintab==1?'执行中':'已拍照'}}</view>
-    <view class="tabsview" bindtap="changeStatus" data-status="{{2}}" style="color:{{status==2?'#0d8fcc':''}};border-bottom:{{status==2?'4rpx solid #0d8fcc':''}}">{{maintab==1?'历史航次':'未拍照'}}</view>
+<!-- <block wx:if="{{cargoOwnerId}}"> -->
+<view class="df aic jcsa tabs" wx:if="{{maintab!=3}}">
+  <view class="tabsview" bindtap="changeStatus" data-status="{{1}}" style="color:{{status==1?'#0d8fcc':''}};border-bottom:{{status==1?'4rpx solid #0d8fcc':''}}">{{maintab==1?'执行中':'已拍照'}}</view>
+  <view class="tabsview" bindtap="changeStatus" data-status="{{2}}" style="color:{{status==2?'#0d8fcc':''}};border-bottom:{{status==2?'4rpx solid #0d8fcc':''}}">{{maintab==1?'历史航次':'未拍照'}}</view>
+</view>
+<scroll-view bindrefresherrefresh="scrollDownList" refresher-triggered="{{isFreshing}}" refresher-enabled="{{true}}" scroll-y="true" style="height:calc(100vh - {{height}}rpx);background: #fff;">
+  <view class="df aic jcsb list" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="goToDetail">
+    <view class="col-1">{{item.shipName}}</view>
+    <view class="col-2">{{item.loadPort}}-{{item.discPort}}</view>
+    <view class="col-3">{{item.cargo}}</view>
+    <view class="col-4">{{item.transStatusName}}</view>
+    <image class="col-5" mode="aspectFit" style="width: 52rpx;height: 52rpx;" catchtap="call" data-phone="{{item.shipOwnerPhone}}" src="../../images/phone.png"></image>
   </view>
-  <scroll-view bindrefresherrefresh="scrollDownList" refresher-triggered="{{isFreshing}}" refresher-enabled="{{true}}" scroll-y="true" style="height:calc(100vh - {{height}}rpx);background: #fff;">
-    <view class="df aic jcsb list" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="goToDetail">
-      <view class="col-1">{{item.shipName}}</view>
-      <view class="col-2">{{item.loadPort}}-{{item.discPort}}</view>
-      <view class="col-3">{{item.cargo}}</view>
-      <view class="col-4">{{item.transStatusName}}</view>
-    </view>
-    <view bindtap="scrollList" class="bottom-text">{{total==0?'暂无数据':(total>size*currentPage?'点击或滑动加载更多...':'已加载完毕')}}</view>
-  </scroll-view>
-</block>
+  <view bindtap="scrollList" class="bottom-text">{{total==0?'暂无数据':(total>size*currentPage?'点击或滑动加载更多...':'已加载完毕')}}</view>
+</scroll-view>
+<!-- </block> -->
 <view style="position: fixed;bottom: 0;">
   <view class="bottom-tabs df aic tac">
     <view bindtap="changeMainTab" data-maintab="{{1}}" class="maintab1" style="color:{{maintab==1?'#fff':''}};background:{{maintab==1?'#0094FE':''}}" data-api="/voyage/list">我的航次</view>
-    <view bindtap="changeMainTab" data-maintab="{{2}}" class="maintab2" style="color:{{maintab==2?'#fff':'/dayReport/list'}};background:{{maintab==2?'#0094FE':''}}" data-api="/dayReport/list">我的日报</view>
+    <view bindtap="changeMainTab" data-maintab="{{2}}" class="maintab2" style="color:{{maintab==2?'#fff':''}};background:{{maintab==2?'#0094FE':''}}" data-api="/dayReport/list">我的日报</view>
     <view bindtap="changeMainTab" data-maintab="{{3}}" class="maintab3" style="color:{{maintab==3?'#fff':''}};background:{{maintab==3?'#0094FE':''}}" data-api="/bill/list">我的单据</view>
   </view>
 </view>

+ 7 - 0
project.private.config.json

@@ -85,6 +85,13 @@
           "query": "id=110",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/voyageManage/createVoyage/createVoyage",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }