瀏覽代碼

新增 图片审核

wzh 3 年之前
父節點
當前提交
36be07a7bf

+ 5 - 6
miniprogram/app.json

@@ -13,8 +13,8 @@
     "pages/voyageManage/createVoyage/createVoyage",
     "pages/voyageManage/myBills/myBills",
     "pages/voyageManage/myDaily/myDaily",
-    "pages/voyageManage/myVoyages/myVoyages"
-
+    "pages/voyageManage/myVoyages/myVoyages",
+    "pages/voyageManage/myDaily/examine/examine"
   ],
   "window": {
     "backgroundColor": "#F6F6F6",
@@ -24,7 +24,8 @@
     "navigationBarTextStyle": "black"
   },
   "tabBar": {
-    "list": [{
+    "list": [
+      {
         "pagePath": "pages/index/index",
         "text": "首页",
         "iconPath": "images/tabBar/index.png",
@@ -61,9 +62,7 @@
       "desc": "你的位置信息将用于小程序位置接口的效果展示"
     }
   },
-  "useExtendedLib": {
-
-  },
+  "useExtendedLib": {},
   "usingComponents": {
     "RemotePicker": "/components/remotePicker/remotePicker"
   },

+ 12 - 0
miniprogram/app.wxss

@@ -208,4 +208,16 @@ picker {
 
 .back-red {
   background: #d90024;
+}
+
+.next {
+  text-align: center;
+  width: 300rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+  color: #fff;
+  background: #0094FE;
+  border-radius: 10rpx;
+  margin: 0 auto;
+  margin-top: 5vh;
 }

+ 3 - 1
miniprogram/pages/shipOwnerManage/shipOwnerList/shipOwnerList.js

@@ -17,8 +17,10 @@ Page({
       term: this.data.term
     })
     if (type) wx.stopPullDownRefresh()
+    let shipOwnerList = res.data.result
+    shipOwnerList.push(shipOwnerList.shift())
     this.setData({
-      shipOwnerList: res.data.result
+      shipOwnerList
     })
   },
   call(e) {

+ 71 - 0
miniprogram/pages/voyageManage/myDaily/examine/examine.js

@@ -0,0 +1,71 @@
+// pages/voyageManage/myDaily/examine/examine.js
+
+const {
+  postApi
+} = require("../../../../apis/api")
+
+const app = getApp()
+Page({
+  data: {
+    media: {},
+    voyageId: 0,
+    markers: [],
+    longitude: '',
+    latitude: '',
+    trans: ''
+  },
+
+  previewImage(e) {
+    let {
+      src
+    } = e.currentTarget.dataset
+    wx.previewImage({
+      current: src, // 当前显示图片的http链接
+      urls: [src] // 需要预览的图片http链接列表
+    })
+  },
+  async checkMedia(e) {
+    let res = await postApi('/dayReport/backstage/audit', {
+      audit: e.currentTarget.dataset.audit,
+      mediaId: this.data.media.id
+    })
+    wx.showToast({
+      title: res.data.msg,
+    })
+    wx.switchTab({
+      url: '/pages/voyageManage/voyageManage',
+    })
+  },
+  onLoad(options) {
+
+    this.setData({
+      voyageId: options.id,
+      trans: options.trans,
+    })
+  },
+
+  onReady() {
+    let media = app.globalData.currentExamineMedia
+    let {
+      latitude,
+      longitude
+    } = media
+    let markers = [{
+      id: "map",
+      latitude,
+      longitude,
+      iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/miniapp-static/red-circle.png?sign=6d208881376358fb4111aa6d7f1a7846&t=1647934972",
+      height: 20,
+      width: 20
+    }]
+    this.setData({
+      media,
+      markers,
+      latitude,
+      longitude,
+    })
+  },
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
miniprogram/pages/voyageManage/myDaily/examine/examine.json

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

+ 17 - 0
miniprogram/pages/voyageManage/myDaily/examine/examine.wxml

@@ -0,0 +1,17 @@
+<map enable-scroll="{{false}}" enable-zoom="{{false}}" markers="{{markers}}" latitude="{{latitude}}" latitude="{{latitude}}" style="width: 100%;height: 400rpx;" name="map"></map>
+<image bindtap="previewImage" style="width: 100%;height: 400rpx;" src="{{media.viewUrl}}" data-src="{{media.viewUrl}}" mode="aspectFill"></image>
+<block wx:if="{{trans=='运输中'}}">
+  <view class="df aic jscb">
+    <view bindtap="checkMedia" data-audit="{{1}}" class="next">通过</view>
+    <view bindtap="checkMedia" data-audit="{{2}}" class="next">不通过</view>
+  </view>
+  <view class="df aic jscb">
+    <view class="next">分享航次照片</view>
+    <view class="next">分享航行报告</view>
+  </view>
+</block>
+<block wx:if="{{trans=='卸货中'}}">
+  <view class="df aic jcc">
+    <view class="next">分享卸货报告</view>
+  </view>
+</block>

+ 1 - 0
miniprogram/pages/voyageManage/myDaily/examine/examine.wxss

@@ -0,0 +1 @@
+/* pages/voyageManage/myDaily/examine/examine.wxss */

+ 42 - 56
miniprogram/pages/voyageManage/myDaily/myDaily.js

@@ -1,65 +1,51 @@
+const {
+  postApi
+} = require("../../../apis/api")
+
 // pages/voyageManage/myDaily/myDaily.js
+const app = getApp()
 Page({
-
-  /**
-   * 页面的初始数据
-   */
   data: {
-
+    medias: [],
+    voyageId: 0,
+    trans: '',
+    currentIndex: -1
+  },
+
+  check(e) {
+    this.setData({
+      currentIndex: e.currentTarget.dataset.index,
+    })
+  },
+  async getMedias() {
+    let res = await postApi("/dayReport/getMedia", {
+      loginAccountId: wx.getStorageSync('loginAccountId'),
+      voyageId: this.data.voyageId
+    })
+    this.setData({
+      medias: res.data.result
+    })
   },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
   onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
+    this.setData({
+      voyageId: options.id,
+      trans: options.trans
+    })
+  },
+  examineMedia() {
+    if (this.data.currentIndex == -1) {
+      wx.showToast({
+        title: '请选择一张图片',
+        icon: "error"
+      })
+      return
+    }
+
+    app.globalData.currentExamineMedia = this.data.medias[this.data.currentIndex]
+    wx.navigateTo({
+      url: `/pages/voyageManage/myDaily/examine/examine?id=${this.data.voyageId}&trans=${this.data.trans}`,
+    })
   },
-
-  /**
-   * 用户点击右上角分享
-   */
   onShareAppMessage() {
 
   }

+ 13 - 2
miniprogram/pages/voyageManage/myDaily/myDaily.wxml

@@ -1,2 +1,13 @@
-<!--pages/voyageManage/myDaily/myDaily.wxml-->
-<text>pages/voyageManage/myDaily/myDaily.wxml</text>
+<view class="p40">
+  <view class="m30">
+    请选择需要处理的照片:
+  </view>
+  <block wx:for="{{medias}}">
+    <view class="df aic jcsb" style="margin: 30rpx 0;">
+      <checkbox bindtap="check" checked="{{index==currentIndex}}" data-index="{{index}}"></checkbox>
+      <image bindtap="check" style="width: 75vw;height: 260rpx;" src="{{item.viewUrl}}" data-index="{{index}}"></image>
+    </view>
+  </block>
+
+  <view bindtap="examineMedia" class="next">下一步</view>
+</view>

+ 22 - 9
miniprogram/pages/voyageManage/voyageManage.js

@@ -2,20 +2,23 @@ const {
   postApi
 } = require("../../apis/api")
 
+const app = getApp()
+
 Page({
   data: {
     cargoOwnerId: 0,
     defaultParams: {
       loginAccountId: wx.getStorageSync('loginAccountId')
     },
-    maintab: 1,
+    maintab: 2,
     status: 1,
     currentPage: 1,
     size: 20,
     list: [],
     total: 0,
     isFreshing: false,
-    currentApi: "/voyage/list"
+    currentApi: "/dayReport/list"
+    // currentApi: "/voyage/list"
   },
   selectCargoOwner(e) {
     this.setData({
@@ -89,10 +92,10 @@ Page({
     let {
       id
     } = e.currentTarget.dataset
-    let path = ''
+    let url = ''
     switch (this.data.maintab) {
       case 1: {
-        path = "/voyages/detail/detail"
+        url = `/pages/voyages/detail/detail?id=${id}`
         break
       }
       case 2: {
@@ -103,16 +106,25 @@ Page({
           })
           return
         }
-        path = "/voyageManage/myDaily/myDaily"
+        let {
+          medias,
+          trans
+        } = e.currentTarget.dataset
+        if (medias.length == 1) {
+          app.globalData.currentExamineMedia = medias[0]
+          url = `/pages/voyageManage/myDaily/examine/examine?id=${id}&trans=${trans}`
+        } else {
+          url = `/pages/voyageManage/myDaily/myDaily?id=${id}&trans=${trans}`
+        }
         break
       }
       case 3: {
-        path = "/voyageManage/myBills/myBills"
+        url = `/pages/voyageManage/myBills/myBills?id=${id}`
         break
       }
     }
     wx.navigateTo({
-      url: `/pages${path}?id=${id}`,
+      url
     })
   },
   scrollList() {
@@ -134,7 +146,8 @@ Page({
       phoneNumber: e.currentTarget.dataset.phone
     })
   },
-  onLoad() {
-
+  onLoad() {},
+  onShow() {
+    this.getList()
   }
 })

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

@@ -10,7 +10,7 @@
   <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="df aic jcsb list" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="goToDetail" data-medias="{{item.medias}}" data-trans="{{item.transStatusName}}">
     <view class="col-1">{{item.shipName}}</view>
     <view class="col-2">{{item.loadPort}}-{{item.discPort}}</view>
     <view class="col-3">{{item.cargo}}</view>

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

@@ -377,11 +377,11 @@ Page({
         }
       })
     }
-    if (this.data.arrivalLoadPortTime.length == 10) this.data.arrivalLoadPortTime = this.data.arrivalLoadPortTime + " 00:00:00"
-    if (this.data.actualLoadTons.length == 10) this.data.actualLoadTons = this.data.actualLoadTons + " 00:00:00"
-    if (this.data.actualLoadPieces.length == 10) this.data.actualLoadPieces = this.data.actualLoadPieces + " 00:00:00"
-    if (this.data.loadStartTime.length == 10) this.data.loadStartTime = this.data.loadStartTime + " 00:00:00"
-    if (this.data.loadEndTime.length == 10) this.data.loadEndTime = this.data.loadEndTime + " 00:00:00"
+    if (this.data.arrivalLoadPortTime && this.data.arrivalLoadPortTime.length == 10) this.data.arrivalLoadPortTime = this.data.arrivalLoadPortTime + " 00:00:00"
+    if (this.data.actualLoadTons && this.data.actualLoadTons.length == 10) this.data.actualLoadTons = this.data.actualLoadTons + " 00:00:00"
+    if (this.data.actualLoadPieces && this.data.actualLoadPieces.length == 10) this.data.actualLoadPieces = this.data.actualLoadPieces + " 00:00:00"
+    if (this.data.loadStartTime && this.data.loadStartTime.length == 10) this.data.loadStartTime = this.data.loadStartTime + " 00:00:00"
+    if (this.data.loadEndTime && this.data.loadEndTime.length == 10) this.data.loadEndTime = this.data.loadEndTime + " 00:00:00"
 
 
     let res = await postApi("/voyage/backstage/update", {
@@ -404,6 +404,47 @@ Page({
 
     console.log(res)
   },
+  async completeVoyage() {
+    wx.showModal({
+      title: "确认完成航次?",
+      success: async e => {
+        if (e.confirm) {
+          let res = await postApi("/voyage/backstage/finish", {
+            loginAccountId: wx.getStorageSync('loginAccountId'),
+            voyageId: this.data.id
+          })
+          if (res.data.status == 0) {
+            wx.showToast({
+              title: '成功!',
+            })
+            this.getVoyageDetail()
+          }
+        }
+      }
+    })
+  },
+  async cancelVoyage() {
+    wx.showModal({
+      title: "确认取消航次?",
+      success: async e => {
+        if (e.confirm) {
+          let res = await postApi("/voyage/backstage/cancel", {
+            loginAccountId: wx.getStorageSync('loginAccountId'),
+            id: this.data.id
+          })
+          if (res.data.status == 0) {
+            wx.showToast({
+              title: '取消成功!',
+            })
+            wx.switchTab({
+              url: '/pages/voyageManage/voyageManage',
+            })
+          }
+        }
+      }
+    })
+  },
+
   onLoad(options) {
     let {
       id

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

@@ -1,7 +1,7 @@
 <map enable-zoom="{{false}}" enable-scroll="{{false}}" markers="{{markers}}" include-points="{{points}}" style="width: 100%;height: 400rpx;" name="map"></map>
 <view class="df aic jcfe p10 fs24">
-  <view wx:if="{{canComplete}}" class="voyage-btn back-blue">完成航次</view>
-  <view class="voyage-btn back-red">取消航次</view>
+  <view wx:if="{{canComplete}}" bindtap="completeVoyage" class="voyage-btn back-blue">完成航次</view>
+  <view bindtap="cancelVoyage" class="voyage-btn back-red">取消航次</view>
 </view>
 <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>
@@ -111,7 +111,7 @@
         <view class="line-full-title">装货结束时间:</view>
         <picker disabled="{{tab2disabled}}" mode="date" model:value="{{loadEndTime}}" style="width: 40vw;">
           <view>
-            {{loadStartTime||"请选择"}}
+            {{loadEndTime||"请选择"}}
           </view>
         </picker>
       </view>

+ 5 - 68
project.private.config.json

@@ -4,64 +4,8 @@
       "list": [
         {
           "name": "",
-          "pathName": "pages/me/me",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/login/login",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyages/detail/detail",
-          "query": "id=155",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/share/sharePage",
-          "query": "id=42",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/sharePage/sharePage",
-          "query": "id=159",
-          "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/voyageManage/createVoyage/createVoyage",
-          "query": "",
+          "pathName": "pages/voyageManage/myDaily/myDaily",
+          "query": "id=170",
           "launchMode": "default",
           "scene": null
         },
@@ -74,22 +18,15 @@
         },
         {
           "name": "",
-          "pathName": "pages/voyages/detail/detail",
-          "query": "id=169",
+          "pathName": "pages/voyageManage/myDaily/examine/examine",
+          "query": "id=170",
           "launchMode": "default",
           "scene": null
         },
         {
           "name": "",
           "pathName": "pages/voyages/detail/detail",
-          "query": "id=110",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyageManage/createVoyage/createVoyage",
-          "query": "",
+          "query": "id=170",
           "launchMode": "default",
           "scene": null
         }