Bladeren bron

更新 卸货信息-样式

王智慧 3 jaren geleden
bovenliggende
commit
799bd3761f

+ 6 - 5
miniprogram/pages/voyages/detail/detail.js

@@ -9,7 +9,7 @@ import {
 Page({
   data: {
     id: '',
-    tab: 2,
+    tab: 3,
     shipDischargeCurrentPage: 1,
     truckLoadCurrentPage: 1,
     coordinates: [],
@@ -30,7 +30,7 @@ Page({
     }],
     markers: [],
     points: [],
-    pageSize: 20,
+    pageSize: 30,
     latitude: 31.891992,
     longitude: 120.551369,
     currentPortId: 0,
@@ -39,6 +39,7 @@ Page({
     currentDischargePort: '',
     tab2disabled: false,
     currentDischargeIndex: 0,
+    tab3CurrentDischargeIndex: 0,
     uploadBillVisable: true
   },
   changeTab(e) {
@@ -143,7 +144,6 @@ Page({
   },
 
   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 {
@@ -287,9 +287,10 @@ Page({
   },
 
   changePort(e) {
-    let currentPortId = e.target.dataset.id
+    let tab3CurrentDischargeIndex = e.detail
     this.setData({
-      currentPortId,
+      tab3CurrentDischargeIndex,
+      currentPortId: this.data.voyageDetails[tab3CurrentDischargeIndex].portId,
       shipDischargeList: [],
       truckLoadList: [],
     })

+ 37 - 37
miniprogram/pages/voyages/detail/detail.wxml

@@ -233,51 +233,51 @@
     </view>
     <view class="next" bindtap="uploadBill" data-type="{{1}}">上传运单</view>
   </view>
-  <view class="p30" wx:if="{{tab==3}}">
-    <scroll-view scroll-x="{{true}}" style="white-space: nowrap;">
-      <view class="{{['port-btns',currentPortId == item.portId?'current-port-btn':'','mr20']}}" wx:for="{{voyageDetails}}" bindtap="changePort" wx:key="portId" data-id="{{item.portId}}">{{item.portName}}</view>
-    </scroll-view>
-    <view class="df aic jcsb pb20">
-      <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 wx:if="{{tab==3}}">
+    <PortsBar arr="{{voyageDetails}}" key="portId" currentIndex="{{tab3CurrentDischargeIndex}}" label="portName" bind:tapTab="changePort"></PortsBar>
+    <view class="info-types df aic">
+      <view bindtap="changeInfoType" style="margin-right: 36rpx;" class="{{infoType=='ship'?'current-type':''}}" data-type="ship">船舶卸货记录</view>
+      <view bindtap="changeInfoType" class="{{infoType=='truck'?'current-type':''}}" data-type="truck">汽车装货记录</view>
     </view>
     <view class="ship-discharge-list" wx:if="{{infoType=='ship'}}">
-      <view class="df aic jcsb mb20 mt10 fs22">
-        <view>卸货时间</view>
-        <view>卸货吨位</view>
-        <view>卸货件数</view>
-        <view>磅单</view>
+      <view class="df aic jcsb th" wx:if="{{shipDischargeList.length}}">
+        <view class="tr tr-time">卸货时间</view>
+        <view class="tr tr-4">卸货吨位</view>
+        <view class="tr tr-4">卸货件数</view>
+        <view class="tr tr-2">磅单</view>
       </view>
-      <view wx:for="{{shipDischargeList}}" wx:key="index" class="df aic jcsb mb20 fs22">
-        <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 wx:else="" class="no-data">暂无数据</view>
+      <view wx:for="{{shipDischargeList}}" wx:key="index" class="df aic jcsb td">
+        <view class="tr tr-time">{{item.dischargeTime}}</view>
+        <view class="tr tr-4">{{item.dischargeTons||''}}</view>
+        <view class="tr tr-4">{{item.dischargePieces||''}}</view>
+        <view class="tr tr-2" wx:if="{{item.files&&item.files.length}}" style="color: #0089FD;" bindtap="previewImage" data-src="{{item.files[0].viewUrl}}" data-files="{{item.files}}">查看</view>
+        <view class="tr tr-2" wx:else>暂无</view>
       </view>
-      <view bindtap="scrollShip" class="bottom-text">{{shipDischargeTotal==0?'暂无数据':(shipDischargeTotal>pageSize*shipDischargeCurrentPage?'点击或滑动加载更多...':'已加载完毕')}}</view>
-      <view class="next" bindtap="goTo" data-url="/pages/voyages/uploadDischarge/uploadDischarge">上传磅单</view>
+      <!-- <view bindtap="scrollShip" class="bottom-text">{{shipDischargeTotal==0?'暂无数据':(shipDischargeTotal>pageSize*shipDischargeCurrentPage?'点击或滑动加载更多...':'已加载完毕')}}</view> -->
+      <view class="update" bindtap="goTo" data-url="/pages/voyages/uploadDischarge/uploadDischarge">上传磅单</view>
     </view>
     <view class="truck-load-list" wx:if="{{infoType=='truck'}}">
-      <view class="df aic jcsb mb20 mt10 fs22">
-        <view>车号</view>
-        <view>毛重</view>
-        <view>皮重</view>
-        <view>净重</view>
-        <view>称重时间</view>
-        <view>单据</view>
+      <view wx:if="{{truckLoadList.length}}" class="df aic jcsb th">
+        <view class="tr tr-car-num">车号</view>
+        <view class="tr tr-3">毛重</view>
+        <view class="tr tr-3">皮重</view>
+        <view class="tr tr-3">净重</view>
+        <view class="tr tr-time">称重时间</view>
+        <view class="tr tr-2">单据</view>
       </view>
-      <view wx:for="{{truckLoadList}}" wx:key="index" class="df aic jcsb mb20 fs22">
-        <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 wx:else="" class="no-data">暂无数据</view>
+      <view wx:for="{{truckLoadList}}" wx:key="index" class="df aic jcsb td">
+        <view class="tr tr-car-num">{{item.carNum}}</view>
+        <view class="tr tr-3">{{item.grossWeight}}</view>
+        <view class="tr tr-3">{{item.tare}}</view>
+        <view class="tr tr-3">{{item.netWeight}}</view>
+        <view class="tr tr-time">{{item.weighTime}}</view>
+        <view class="tr tr-2" wx:if="{{item.file}}" style="color: #0089FD;" bindtap="previewImage" data-src="{{item.file.viewUrl}}">查看</view>
+        <view class="tr tr-2" wx:else>暂无</view>
       </view>
-      <view bindtap="scrollTruck" class="bottom-text">{{truckLoadTotal==0?'暂无数据':(truckLoadTotal>pageSize*truckLoadCurrentPage?'点击或滑动加载更多...':'已加载完毕')}}</view>
-      <view class="next" bindtap="goTo" data-url="/pages/voyages/uploadCarLoadRecord/uploadCarLoadRecord">上传运单</view>
+      <!-- <view bindtap="scrollTruck" class="bottom-text">{{truckLoadTotal==0?'暂无数据':(truckLoadTotal>pageSize*truckLoadCurrentPage?'点击或滑动加载更多...':'已加载完毕')}}</view> -->
+      <view class="update" bindtap="goTo" data-url="/pages/voyages/uploadCarLoadRecord/uploadCarLoadRecord">上传运单</view>
     </view>
   </view>
   <view wx:if="{{tab==5}}">

+ 62 - 0
miniprogram/pages/voyages/detail/detail.wxss

@@ -218,4 +218,66 @@
 
 picker {
   width: 45vw;
+}
+
+.info-types {
+  margin-bottom: 33rpx;
+}
+
+.info-types>view {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #333333;
+}
+
+.current-type {
+  font-size: 30rpx !important;
+  font-weight: 500 !important;
+  color: #239AFE !important;
+}
+
+.th {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #BDC2C8;
+  margin-bottom: 22rpx;
+}
+
+.td {
+  font-size: 28rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #363F4A;
+  margin-bottom: 20rpx;
+}
+
+.tr {
+  text-align: center;
+}
+
+.tr-time {
+  width: 170rpx;
+}
+
+.tr-2 {
+  min-width: 56rpx;
+}
+
+.tr-3 {
+  width: 90rpx;
+}
+
+.tr-4 {
+  width: 112rpx;
+}
+
+.tr-car-num {
+  min-width: 160rpx;
+}
+
+.no-data {
+  text-align: center;
+  color: #9199A3;
 }