Explorar el Código

更新 添加卸货记录逻辑

王智慧 hace 3 años
padre
commit
903e1800e4

+ 18 - 0
miniprogram/pages/voyages/uploadDischarge/uploadDischarge.js

@@ -61,6 +61,24 @@ Page({
     wx.setStorageSync('addStatus', 'success')
     wx.navigateBack()
   },
+  preview(e) {
+    wx.previewImage({
+      urls: [e.currentTarget.dataset.src],
+    })
+  },
+  remove(e) {
+    wx.showModal({
+      content: "移除当前图片?",
+      success: res => {
+        if (res.confirm) {
+          this.data.fileList.splice(e.currentTarget.dataset.index, 1)
+          this.setData({
+            fileList: this.data.fileList
+          })
+        }
+      }
+    })
+  },
   onLoad(options) {
     this.setData({
       voyageId: options.voyageId,

+ 28 - 19
miniprogram/pages/voyages/uploadDischarge/uploadDischarge.wxml

@@ -1,26 +1,35 @@
-<view class="box">
-  <view class="df jcsb line">
-    <view>卸货时间</view>
-    <view>
-      <picker mode="date" model:value="{{dischargeTime}}" style="width: 40vw;">
-        <view style="border: 1rpx solid grey;">
-          {{dischargeTime ||"请选择"}}
-        </view>
-      </picker>
+<view class="type2">
+  <view class="line">
+    <view class="line-full-item jcsb">
+      <view class="df aic">
+        <view class="line-full-title">卸货时间:</view>
+        <picker mode="date" model:value="{{dischargeTime}}">
+          <view>
+            {{dischargeTime||"请选择卸货时间"}}
+          </view>
+        </picker>
+      </view>
+      <image class="arrow" src="../../../images/newUI/right-arrow.png"></image>
     </view>
   </view>
-  <view class="df jcsb line">
-    <view>卸货吨位</view>
-    <view><input model:value="{{dischargeTons}}" type="text" placeholder="必填" /></view>
+  <view class="line">
+    <view class="line-full-item">
+      <view class="line-full-title">卸货吨位:</view>
+      <input class="e-input" model:value="{{dischargeTons}}" type="digit" />
+      <view class="unit">吨</view>
+    </view>
   </view>
-  <view class="df jcsb line">
-    <view>卸货件数</view>
-    <view><input model:value="{{dischargePieces}}" type="number" /></view>
+  <view class="line">
+    <view class="line-full-item">
+      <view class="line-full-title">卸货件数:</view>
+      <input class="e-input" model:value="{{dischargePieces}}" type="number" />
+      <view class="unit">件</view>
+    </view>
   </view>
   <view>
-    <view>卸货记录</view>
-    <image wx:for="{{fileList}}" class="upload-image" src="{{item.viewUrl}}"></image>
-    <view class="next" style="width: 200rpx;height: 60rpx;line-height: 60rpx;font-size: 26rpx;" bindtap="uploadBill" data-type="{{2}}">上传磅单</view>
-    <view class="next" bindtap="submit">提交</view>
+    <image wx:for="{{fileList}}" class="upload-image" bindtap="preview" bindlongtap="remove" data-type="{{2}}" data-src="{{item.viewUrl}}" data-index="{{index}}" src="{{item.viewUrl}}"></image>
+    <view class="update" bindtap="uploadBill" data-type="{{2}}" style="margin-top: 275rpx;">上传磅单</view>
+    <view class="update submit" bindtap="submit">提交</view>
+    <view style="height: 20rpx;"></view>
   </view>
 </view>

+ 77 - 46
miniprogram/pages/voyages/uploadDischarge/uploadDischarge.wxss

@@ -1,64 +1,95 @@
-/* pages/voyages/uploadDischarge/uploadDischarge.wxss */
-/* pages/shipOwnerManage/addShipOnwer/addShipOnwer.wxss */
-.box {
-  width: 80vw;
-  border: 2rpx solid grey;
-  border-radius: 10rpx;
-  text-align: center;
-  margin: 0 auto;
-  padding: 5vw 0;
+.line {
+  margin-bottom: 20rpx;
 }
 
-.ship-owner-phone {
-  width: 400rpx;
-  height: 60rpx;
-  border: 1rpx solid grey;
-  margin: 0 auto;
-  border-radius: 6rpx;
-  padding-left: 20rpx;
+.line-full-item {
+  display: flex;
+  align-items: center;
 }
 
-.line {
-  width: 80%;
-  margin: 30rpx auto;
-  font-size: 28rpx;
+.line-full-title {
+  width: 240rpx;
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #BDC2C8;
 }
 
-.line view {
-  line-height: 48rpx;
+.line-text {
+  flex: 1;
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #6C6C6C;
+}
 
+.type2 {
+  padding: 0 30rpx;
 }
 
-.line input {
-  border: 1px solid grey;
-  height: 48rpx;
+.type2 .line-full-item {
+  padding: 32rpx 0;
+  border-bottom: 1rpx solid #EBEBEB;
 }
 
-.upload {
-  width: 68vw;
-  height: 32vw;
-  border: 1px solid grey;
-  margin: 3vw auto;
+.type2 .line {
+  margin-bottom: 0;
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #6C6C6C;
 }
 
-page {
-  padding-top: 5vw;
+.type2 .line-full-title {
+  width: 260rpx;
+  color: #20252E;
 }
 
-.upload-image {
-  width: 68vw;
-  height: 32vw;
-  border: 1px solid grey;
-  margin: 3vw auto;
+.arrow {
+  width: 20rpx;
+  height: 20rpx;
+  margin-right: 30rpx;
 }
 
-.next {
-  width: 300rpx;
-  height: 80rpx;
-  line-height: 80rpx;
-  color: #fff;
-  background: #0094FE;
-  border-radius: 10rpx;
-  margin: 0 auto;
-  margin-top: 8vw;
+.d-input {
+  width: 30vw;
+}
+
+.e-input {
+  width: 20vw;
+}
+
+.update {
+  width: 590rpx;
+  height: 96rpx;
+  background: linear-gradient(270deg, #0089FD 0%, #43A9FF 100%);
+  border-radius: 20rpx;
+  text-align: center;
+  line-height: 96rpx;
+  font-size: 34rpx;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #FFFFFF;
+  margin: 32rpx auto;
+}
+
+.type2 .unit {
+  color: #333;
+}
+
+picker {
+  width: 45vw;
+}
+
+.submit {
+  border: 2rpx solid #028AFD;
+  background: #FFFFFF;
+  color: #0089FD;
+}
+
+.upload-image {
+  display: block;
+  margin: 40rpx auto;
+  height: 240rpx;
+  width: 90%;
 }

+ 2 - 65
project.private.config.json

@@ -4,71 +4,8 @@
       "list": [
         {
           "name": "",
-          "pathName": "pages/voyageManage/myBills/myLab/myLab",
-          "query": "id=266",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/index/weather/weatherList",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/me/me",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/shipOwnerManage/shipOwnerList/shipOwnerList",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/shipOwnerManage/addShipOnwer/addShipOnwer",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/index/declarePort/voyageList",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/index/declarePort/detail",
-          "query": "id=267",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyageManage/voyageManage",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyages/detail/detail",
-          "query": "id=270",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyages/detail/detail",
-          "query": "id=270",
+          "pathName": "pages/voyages/uploadDischarge/uploadDischarge",
+          "query": "voyageId=270&portId=1",
           "launchMode": "default",
           "scene": null
         }