ycm 2 years ago
parent
commit
7ee4434096

+ 2 - 1
app.json

@@ -20,7 +20,8 @@
         "pages/signFor/signRecord",
         "pages/take/opentask/opentask",
         "pages/cabinet/orderNum/orderNum",
-        "pages/take/blankorder/blankorder"
+        "pages/take/blankorder/blankorder",
+        "pages/signFor/storagenext"
     ],
     "window": {
         "backgroundTextStyle": "light",

+ 35 - 0
pages/cabinet/cell.js

@@ -38,6 +38,41 @@ show:function(){
     })
     }
 },
+updatacity(){
+    let that = this
+    wx.chooseLocation({
+        success: function (res) {
+          var latitude = res.latitude
+          var longitude = res.longitude
+          console.log(that.data.id,latitude,longitude)
+          app.api.useApi(app.globalData.baseAppUrl + "api/admin/edit_location", {
+              id: that.data.id,
+              lng: longitude,
+              lat: latitude
+            }, "post").then(function (res) {
+              console.log(res);
+              if (res.code != 200) {
+                  wx.showLoading({
+                      title: res.message.msg,
+                    })
+                    setTimeout(function () {
+                      wx.hideLoading();
+                    }, 1000);
+              } else {
+                wx.showLoading({
+                    title: res.message.msg,
+                  })
+                  setTimeout(function () {
+                    wx.hideLoading();
+                  }, 1000);
+              }
+            }).catch(function (err) {
+                
+              console.log(222);
+            })
+        }
+      })
+},
 gettaskdetail(id){
     var that=this
     app.api.useApi(app.globalData.baseAppUrl + "api/admin/BinDevicesList", {

+ 1 - 1
pages/cabinet/cell.wxml

@@ -10,7 +10,7 @@
           <view class="bd2" bindtap="goto">
             <text lines="1" class="txt1">下单码</text>
           </view>
-          <view class="bd3">
+          <view class="bd3" bindtap="updatacity">
             <text lines="1" class="word3">定位修正</text>
           </view>
           <view class="bd4" bindtap="show">

+ 14 - 1
pages/signFor/index.js

@@ -187,7 +187,20 @@ Page({
         that.setData({
           orderSn: res.result
         })
-        that.onSubmit()
+        console.log(res.result)
+        if(res.result.slice(0,4)=='http'){
+            var regstra = new RegExp('(^|&|/?)network_id=([^&|/?]*)', 'i');  
+            var expa = res.result.match(regstra);  
+            console.log(expa[2]);
+            var regstrb = new RegExp('(^|&|/?)orde_num=([^&|/?]*)', 'i');  
+            var expb = res.result.match(regstrb);  
+            console.log(expb[2]);
+           wx.navigateTo({
+             url: '/pages/signFor/storage?networkid='+expa[2]+'&ordernum='+expb[2],
+           })
+        }else{
+            that.onSubmit()
+        }
       }
 
     })

+ 55 - 10
pages/signFor/record.js

@@ -6,19 +6,48 @@ Page({
    * 页面的初始数据
    */
   data: {
-    content:[]
+      typeid: 0,
+      typelist:['未取','已取'],
+      selectitem: '',
+      selectInfo: [],
+      content:[]
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.getData()
+      this.getinfo()
+    this.getdata()
   },
-  getData:function(){
+  changeisselect(){
+      this.setData({isselect: !this.data.isselect})
+  },
+  chooseselect(e){
+      this.setData({selectitem: e.currentTarget.dataset.item})
+      this.changeisselect()
+      this.getdata()
+  },
+  getinfo(){
+      let that = this
+      app.api.useApi(app.globalData.baseAppUrl + "api/admin/shop_list", {}, "get").then(function (res) {
+          wx.hideLoading();
+          if (res.code== 200) {
+              that.setData({selectInfo:res.message.data})
+          }else{
+
+          }
+        }).catch(function (err) {
+          console.log(222);
+        })
+  },
+  getdata(){
     var that=this
-    app.api.useApi(app.globalData.baseAppUrl + "api/admin/SignFor", {
-      
+    wx.showLoading()
+    app.api.useApi(app.globalData.baseAppUrl + "api/admin/temporary_list", {
+        status: that.data.typeid,
+        network_id: that.data.selectitem.id || 0,
+        created_at: ''
     }, "get").then(function (res) {
       console.log(res);
       if (res.code != 200) {
@@ -30,10 +59,15 @@ Page({
             }, 1000);
             
       } else {
-        wx.hideLoading();
-        that.setData({
-          content:res.message.data
-        })
+        wx.hideLoading()
+        if (that.data.pageindex == 1) {
+          that.setData({content: []})
+        }
+        if (res.message.data.length > 0) {
+          that.setData({content: that.data.content.concat(res.message.data)})
+        } else {
+          that.setData({pageindex: that.data.pageindex -= 1})
+        }
         
       }
     }).catch(function (err) {
@@ -42,6 +76,16 @@ Page({
     })
 
   },
+  changetype(){
+      let that = this
+      wx.showActionSheet({
+        itemList: that.data.typelist,
+        success (res) {
+            that.setData({typeid: res.tapIndex})
+            that.getdata()
+        }
+      })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -81,7 +125,8 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-
+    this.setData({pageindex:this.data.pageindex+=1})
+    this.getdata()
   },
 
   /**

+ 7 - 4
pages/signFor/record.wxml

@@ -4,15 +4,15 @@
    
     <view class="outer3">
       <view class="main1">
-        <view class="bd1">
-          <text lines="1" class="word3">未取(2)</text>
+        <view class="bd1" bindtap="changetype">
+          <text lines="1" class="word3">{{typelist[typeid]}}(2)</text>
           <image src="https://636c-cloud1-7g2wlwzh596f43b6-1306306616.tcb.qcloud.la/ic_xiajiantou%402x.png?sign=905d492daa7cade003241039e4df3916&t=1645344121" class="label2"></image>
         </view>
       </view>
-      <view class="main2">
+      <view class="main2" bindtap="changeisselect">
         <view class="bd2">
           <view class="mod1"></view>
-          <text lines="1" class="txt1">全部柜子</text>
+          <text lines="1" class="txt1">{{selectitem!=''?selectitem.title:'请选择'}}</text>
           <image src="https://636c-cloud1-7g2wlwzh596f43b6-1306306616.tcb.qcloud.la/ic_xiajiantou%402x.png?sign=905d492daa7cade003241039e4df3916&t=1645344121" class="icon2"></image>
         </view>
       </view>
@@ -23,6 +23,9 @@
           <image src="https://636c-cloud1-7g2wlwzh596f43b6-1306306616.tcb.qcloud.la/ic_xiajiantou%402x.png?sign=905d492daa7cade003241039e4df3916&t=1645344121" class="icon3"></image>
         </view>
       </view>
+      <view wx:if="{{isselect}}" class="se_poview">
+            <view wx:for="{{selectInfo}}" wx:key="index" bindtap="chooseselect" data-item="{{item}}">{{item.title}}</view>
+        </view>
     </view>
     <view class="outer4">
       <view class="main4">

+ 23 - 8
pages/signFor/record.wxss

@@ -1,20 +1,16 @@
 /* pages/signFor/record.wxss */
 
-.page {
-  position: relative;
-  width: 750rpx;
+page {
   background-color: rgba(246,246,246,1);
-  overflow: hidden;
-  display: flex;
-  flex-direction: column;
 }
-.layer1 {
+/* .layer1 {
   width: 750rpx;
   display: flex;
   flex-direction: column;
-}
+} */
 
 .outer3 {
+    position: relative;
   width: 750rpx;
   height: 88rpx;
   flex-direction: row;
@@ -292,4 +288,23 @@
   white-space: nowrap;
   line-height: 26rpx;
   text-align: left;
+}
+.se_poview{
+    margin-bottom: 20rpx;
+    position: absolute;
+    top: 86rpx;
+    left: 20rpx;
+    z-index: 20;
+    width: calc(100% - 40rpx);
+    height: 500rpx;
+    overflow-y: scroll;
+    background: #fff;
+    border: 1rpx solid rgba(198,198,198,1);
+    border-radius: 14rpx;
+}
+.se_poview>view{
+    font-size: 28rpx;
+    color: #333;
+    padding: 20rpx 20rpx;
+    border-bottom: 1rpx solid #ddd;
 }

+ 83 - 12
pages/signFor/storage.js

@@ -1,18 +1,30 @@
 // pages/tabber/news/index.js
+const app = getApp()
 Page({
 
     /**
      * 页面的初始数据
      */
     data: {
-        selectInfo: {},
+        isselect: false,
+        selectitem: '',
+        selectInfo: "",
         show:false,
+        networkid: 0,
+        ordernum: 0,
+        sealno: '',
+        cftext: '',
+        externalcabinet: 0,
+        spotid: 0,
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
+        this.setData({
+            networkid:options.networkid,ordernum:options.ordernum
+        })
         class Select {
             in = 1
             getSelet(){
@@ -24,23 +36,82 @@ Page({
         var b = new Select();
         console.log(b.getSelet());
     },
-
+    onShow(){
+        this.getinfo()
+    },
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
     onReady: function () {
        
     },
-show:function(){
-    if(this.data.show){
-        this.setData({
-            show:false
+    gonext(){
+        let that = this
+        console.log(that.data.cftext)
+        wx.navigateTo({
+          url: '/pages/signFor/storagenext?network_id='+that.data.selectitem.id+'&device_id='+that.data.ordernum+'&seal_no='+that.data.sealno+'&spout_device_id='+that.data.spotid+'&remark='+that.data.cftext,
         })
-    }else{
-    this.setData({
-        show:true
-    })
-    }
-}
+    },
+    goshow:function(){
+        let that = this
+        if(this.data.show){
+            this.setData({
+                show:false
+            })
+        }else{
+            wx.showLoading()
+            if(that.data.selectitem!=''){
+                app.api.useApi(app.globalData.baseAppUrl + "api/admin/temporary", {
+                    device_id: that.data.ordernum,
+                    seal_no:that.data.sealno,
+                    network_id:that.data.selectitem.id
+                }, "post").then(function (res) {
+                    wx.hideLoading();
+                    wx.showToast({
+                      title: res.message.msg,
+                    })
+                    if (res.code== 200) {
+                        that.setData({
+                            show:true
+                        })
+                        that.setData({externalcabinet: res.message.data.external_cabinet,spotid:res.message.data.spot_id})
+                    }
+                }).catch(function (err) {
+                    console.log(222);
+                })
+            }else{
+                wx.showToast({
+                    title: '请选择目的地',
+                    icon: 'none'
+                })
+            }
+        }
+    },
+    changeisselect(){
+        this.setData({isselect: !this.data.isselect})
+    },
+    chooseselect(e){
+        this.setData({selectitem: e.currentTarget.dataset.item})
+        this.changeisselect()
+    },
+    changesealno(e){
+        this.setData({sealno:e.detail.value})
+    },
+    changecftext(e){
+        this.setData({cftext:e.detail.value})
+    },
+    getinfo(){
+        let that = this
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/shop_list", {}, "get").then(function (res) {
+            wx.hideLoading();
+            if (res.code== 200) {
+                that.setData({selectInfo:res.message.data})
+            }else{
+
+            }
+          }).catch(function (err) {
+            console.log(222);
+          })
+    },
 
 })

+ 12 - 9
pages/signFor/storage.wxml

@@ -3,15 +3,18 @@
     <view class="block3">
       <view class="bd2">
         <text lines="1" class="word4">选择目的地</text>
-        <view class="main1">
-          <view class="section1"></view>
+        <view class="popop_view">
+            <view bindtap="changeisselect">{{selectitem!=''?selectitem.title:'请选择'}} ▼</view>
+          <view wx:if="{{isselect}}" class="se_poview">
+            <view wx:for="{{selectInfo}}" wx:key="index" bindtap="chooseselect" data-item="{{item}}">{{item.title}}</view>
+          </view>
         </view>
         <text lines="1" class="word5">存放物品(选填)</text>
-        <input type="text" class="main2"/>
+        <input type="text" bindinput="changecftext" value="{{cftext}}" class="main2"/>
         <text lines="1" class="word6">绑定封签</text>
         <view class="main3">
           <view class="box1">
-            <input type="text" class="word7" style="width: 100%;height: 100%;" placeholder="扫描或人工输入物流单号"/>
+            <input type="text" bindinput="changesealno" value="{{sealno}}" class="word7" style="width: 100%;height: 100%;" placeholder="扫描或人工输入封签号"/>
             <view class="layer1"></view>
           </view>
           <view class="box2">
@@ -19,7 +22,7 @@
           </view>
         </view>
         <view class="main4">
-          <text lines="1" class="info2" bindtap="show">开柜暂存</text>
+          <text lines="1" class="info2" bindtap="goshow">开柜暂存</text>
         </view>
         <text lines="1" class="paragraph1">注意:<br/>1、请在干洗柜前操作,暂存后凭取件码开箱取件<br/>2、内部暂存会占用柜格,在物品取出前此柜格无<br/>法接单</text>
       </view>
@@ -30,19 +33,19 @@
         <view class="mod3"></view>
       </view>
     </navigator>
-    <view class="block5"></view>
+    <!-- <view class="block5"></view> -->
   </view>
 
   <view class="group11" wx:if="{{show}}">
     <view class="outer11">
       <view class="mod14">
-        <text lines="1" decode="true" class="word16">已分配&nbsp;8&nbsp;号柜门</text>
+        <text lines="1" decode="true" class="word16">已分配&nbsp;{{externalcabinet}}&nbsp;号柜门</text>
         <text lines="1" class="info15">柜门是否打开</text>
         <view class="group13">
-          <view class="outer12" bindtap="show">
+          <view class="outer12" bindtap="goshow">
             <text lines="1" class="info17">否</text>
           </view>
-          <view class="outer18">
+          <view class="outer18" bindtap="gonext">
             <text lines="1" class="word19">是</text>
           </view>
         </view>

+ 32 - 0
pages/signFor/storage.wxss

@@ -356,4 +356,36 @@
   background-color: rgba(248,248,248,1);
   display: flex;
   flex-direction: column;
+}
+
+.popop_view{
+    height: 80rpx;
+    border-radius: 8rpx;
+    border: 2rpx solid rgba(198,198,198,1);
+    margin-top: 24rpx;
+    width: 630rpx;
+    position: relative;
+}
+.popop_view>view:nth-child(1){
+    width: 100%;
+    line-height: 80rpx;
+    padding-left: 20rpx;
+    font-size: 30rpx;
+    color: #333;
+}
+.se_poview{
+    position: absolute;
+    top: 78rpx;
+    z-index: 20;
+    width: 100%;
+    height: 400rpx;
+    overflow-y: scroll;
+    background: #fff;
+    border: 1rpx solid rgba(198,198,198,1);
+}
+.se_poview>view{
+    font-size: 28rpx;
+    color: #333;
+    padding: 20rpx 20rpx;
+    border-bottom: 1rpx solid #ddd;
 }

+ 97 - 0
pages/signFor/storagenext.js

@@ -0,0 +1,97 @@
+// pages/signFor/storagenext.js
+const app = getApp()
+Page({
+
+    /**
+     * 页面的初始数据
+     */
+    data: {
+        networkid: 0,
+        deviceid: 0,
+        sealno: 0,
+        spoutdeviceid: 0,
+        remark: '',
+        info: ''
+    },
+
+    /**
+     * 生命周期函数--监听页面加载
+     */
+    onLoad(options) {
+        this.setData({   
+            networkid: options.network_id,
+            deviceid: options.device_id,
+            sealno: options.seal_no,
+            spoutdeviceid: options.spout_device_id,
+            remark: options.remark
+        })
+    },
+
+    getinfo(){
+        let that = this
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/temporary_submit", {
+            network_id: that.data.networkid,
+            device_id: that.data.deviceid,
+            seal_no: that.data.sealno,
+            spout_device_id: that.data.spoutdeviceid,
+            remark: that.data.remark
+        }, "post").then(function (res) {
+            wx.hideLoading();
+            if (res.code== 200) {
+                that.setData({info:res.message.data})
+            }else{
+
+            }
+          }).catch(function (err) {
+            console.log(222);
+          })
+    },
+    /**
+     * 生命周期函数--监听页面初次渲染完成
+     */
+    onReady() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面显示
+     */
+    onShow() {
+        this.getinfo()
+    },
+
+    /**
+     * 生命周期函数--监听页面隐藏
+     */
+    onHide() {
+
+    },
+
+    /**
+     * 生命周期函数--监听页面卸载
+     */
+    onUnload() {
+
+    },
+
+    /**
+     * 页面相关事件处理函数--监听用户下拉动作
+     */
+    onPullDownRefresh() {
+
+    },
+
+    /**
+     * 页面上拉触底事件的处理函数
+     */
+    onReachBottom() {
+
+    },
+
+    /**
+     * 用户点击右上角分享
+     */
+    onShareAppMessage() {
+
+    }
+})

+ 3 - 0
pages/signFor/storagenext.json

@@ -0,0 +1,3 @@
+{
+    "navigationBarTitleText": "内部暂存"
+}

+ 15 - 0
pages/signFor/storagenext.wxml

@@ -0,0 +1,15 @@
+<!--pages/signFor/storagenext.wxml-->
+<view class="centerdispley header_view">
+    <view>取件码</view>
+    <view>取件码</view>
+    <view>复制</view>
+    <view>请将此码发送给需要接收的用户</view>
+    <view></view>
+    <view>封签号:12-345678</view>
+    <view class="centerdispley">保存图片</view>
+</view>
+<view class="bot_text">
+    <view>注意:</view>
+    <view>1、将取件码发给需要收货的用户</view>
+    <view>2、如长时间未取需要送回工厂或仓库,使用取件码取出即可</view>
+</view>

+ 44 - 0
pages/signFor/storagenext.wxss

@@ -0,0 +1,44 @@
+/* pages/signFor/storagenext.wxss */
+page{
+    background: #f6f6f6;
+}
+.header_view{
+    margin: 20rpx;
+    border-radius: 8rpx;
+    background: #fff;
+}
+.header_view>view{
+    font-size: 28rpx;
+    color: #333;
+}
+.header_view>view:nth-child(1){
+    margin: 58rpx 0 16rpx;
+}
+.header_view>view:nth-child(2){
+    font-size: 48rpx;
+    margin: 0 0 30rpx;
+}
+.header_view>view:nth-child(3){
+    margin: 0 0 56rpx;
+}
+.header_view>view:nth-child(4){
+    margin: 0 0 290rpx;
+}
+.header_view>view:nth-child(6){
+    margin: 0 0 68rpx;
+}
+.header_view>view:nth-child(7){
+    margin: 0 40rpx 60rpx;
+    width: calc(100% - 80rpx);
+    height: 88rpx;
+    font-size: 32rpx;
+    color: #fff;
+    background: #3391EC;
+    border-radius: 8rpx;
+    box-shadow: 0px 10px 20px 0px rgba(51, 145, 236, 0.3);
+}
+.bot_text{
+    margin: 30rpx;
+    font-size: 26rpx;
+    color: #666;
+}

+ 16 - 3
pages/take/blankorder/blankorder.js

@@ -8,21 +8,34 @@ Page({
     data: {
         id: 0,
         reason: '',
-        issuccess: false
+        issuccess: false,
+        deviceId: 0,
+        spoutDeviceId: 0
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad(options) {
-
+        this.setData({deviceId: options.deviceId,spoutDeviceId: options.spoutDeviceId})
     },
     changereason(e){
         this.setData({reason: e.detail.value})
     },
     submitform(){
         let that = this
-        that.setData({issuccess: true})
+        wx.showLoading()
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/empty_order", {
+            device_id: that.data.deviceId,spout_device_id:that.data.spoutDeviceId,remark: that.data.reason
+          }, "post").then(function (res) {
+            wx.hideLoading();
+            if (res.code== 200) {
+                that.setData({issuccess: true})
+            }else
+             wx.showToast({title: res.message.msg,icon:'none'})
+          }).catch(function (err) {
+            console.log(222);
+          })
     },
     gobacksub(){
         wx.navigateBack({

+ 1 - 1
pages/take/opentask/opentask.js

@@ -31,7 +31,7 @@ Page({
     },
     blankorder(){
         wx.navigateTo({
-          url: '/pages/take/blankorder/blankorder',
+          url: '/pages/take/blankorder/blankorder?deviceId='+deviceId+'&spoutDeviceId='+spoutDeviceId,
         })
     },
     bindput(e){

+ 1 - 2
pages/take/opentask/opentask.wxml

@@ -58,8 +58,7 @@
         <view class="layer3"></view>
       </view>
       <text lines="1" class="word3">柜门未开</text>
-      <!-- bindtap="blankorder" -->
-      <text lines="1" class="word4">空单取消</text>
+      <text lines="1" bindtap="blankorder" class="word4">空单取消</text>
       <text lines="1" class="word5">联系用户</text>
     </view>
     <view class="mod4">

+ 1 - 1
project.config.json

@@ -19,7 +19,7 @@
         "uploadWithSourceMap": true,
         "compileHotReLoad": false,
         "lazyloadPlaceholderEnable": false,
-        "useMultiFrameRuntime": false,
+        "useMultiFrameRuntime": true,
         "babelSetting": {
             "ignore": [],
             "disablePlugins": [],