ycm %!s(int64=2) %!d(string=hai) anos
pai
achega
2b5b84a24a

+ 2 - 1
app.json

@@ -21,7 +21,8 @@
         "pages/order/access/access",
         "pages/order/deposit/deposit",
         "pages/order/takeOut/takeOut",
-        "pages/order/coupon/coupon"
+        "pages/order/coupon/coupon",
+        "pages/my/pickupcode/pickupcode"
     ],
     "window": {
         "backgroundTextStyle": "light",

BIN=BIN
image/my/02.png


+ 2 - 2
pages/order/access/access.wxml

@@ -40,7 +40,7 @@
     </view>
 </view>
 
-<view class="footer flex">
+<!-- <view class="footer flex">
     <text>取件码取件</text>
     <van-icon name="arrow" />
-</view>
+</view> -->

+ 96 - 1
pages/tabber/my/index.js

@@ -44,7 +44,18 @@ Page({
         userInfo: "",
         hasUserInfo: false,
         code: "",
-        yue:0
+        yue:0,
+        
+        one:'',
+        two:'',
+        three:'',
+        four:'',
+        five:'',
+        six:'',
+        inputValue:'',
+        show:false,
+        focus:false,
+        nid: 0
     },
 
     /**
@@ -68,6 +79,90 @@ onShow(){
     this.getBtnInfo()
     this.getwallet();
 },
+    goqjm(){
+        let that = this
+        that.setData({
+            nid: 0,
+            inputValue:'',
+            one:'',
+            two:'',
+            three:'',
+            four:'',
+            five:'',
+            six:''
+        })
+        console.log(that.data.nid)
+        wx.scanCode({
+          onlyFromCamera: true,
+          success (res) {
+            console.log( res.result.substr(1));
+            var regstr = new RegExp('(^|&|/?)orde_num=([^&|/?]*)', 'i');  
+            var exp = res.result.match(regstr);  
+            console.log(exp[2]);
+            that.setData({nid: exp[2]})
+            that.onClose()
+          }
+        })
+    },
+    finish:function(e){
+        var that=this
+      var val=e.detail.value;
+      this.setData({
+          one:val.split('')[0]?val.split('')[0]:'',
+          two:val.split('')[1]?val.split('')[1]:'',
+          three:val.split('')[2]?val.split('')[2]:'',
+          four:val.split('')[3]?val.split('')[3]:'',
+          five:val.split('')[4]?val.split('')[4]:'',
+          six:val.split('')[5]?val.split('')[5]:''
+      })
+      if(val.length>=6){
+        that.submitValue()  
+      }
+          
+    },
+    submitValue:function(){
+        var that=this
+          if(that.data.inputValue=='')
+            return wx.showToast({title: '存衣码不能为空',icon:'none'})
+            console.log(that.data.inputValue)
+            wx.showLoading()
+          app.api.useApi(app.globalData.baseAppUrl + "api/open_temporary", {
+            temporary_code: that.data.inputValue,
+            device_id:this.data.nid
+          }, "post").then(function (res) {
+            wx.hideLoading();
+            wx.showToast({title: res.message.msg,icon:'none'})
+            if (res.code== 200) {
+                that.setData({
+                    show:!that.data.show,
+                    inputValue:'',
+                    one:'',
+                    two:'',
+                    three:'',
+                    four:'',
+                    five:'',
+                    six:''
+                })
+                wx.showModal({
+                    title: res.message.data.external_cabinet+'号柜门',
+                    content: '请尽快取走衣物',
+                    showCancel: false,
+                    success (ress) {
+                      if (ress.confirm) {
+                        // console.log('用户点击确定')
+                      }
+                    }
+                  })
+            } 
+          }).catch(function (err) {
+            console.log(222);
+          })
+    },
+    onClose(){
+      this.setData({
+        show:!this.data.show  
+      })
+    },
     getBtnInfo() {
         this.setData({
             btnInfo: app.globalData.btnInfo

+ 1 - 0
pages/tabber/my/index.json

@@ -1,5 +1,6 @@
 {
   "usingComponents": {
+    "van-popup": "@vant/weapp/popup/index",
     "van-grid": "@vant/weapp/grid/index",
     "van-grid-item": "@vant/weapp/grid-item/index",
     "dot":"/components/dot/dot",

+ 30 - 1
pages/tabber/my/index.wxml

@@ -71,6 +71,12 @@
                         </view>
                         <button open-type="contact"></button>
                     </van-grid-item>
+                    <van-grid-item use-slot class="kf">
+                        <view class="menuItem" style="width: 140rpx;" catchtap="goqjm">
+                            <image src="../../../image/my/02.png" class="icon"></image>
+                            <view class="tit">取件码取件</view>
+                        </view>
+                    </van-grid-item>
                     
                 </van-grid>
 
@@ -79,4 +85,27 @@
 
         <!-- <taskOrder value="3" bind:rightClick="rightClick"></taskOrder> -->
     </view>
-</view>
+</view>
+
+<van-popup show="{{ show }}" bind:close="onClose" custom-style="height: 40%;">
+  <view class="section10">
+    <view class="layer1">
+      <text lines="1" class="txt5">输入取件码</text>
+      <image src="" class="icon2"></image>
+    </view>
+    <view class="layer2">
+      <text lines="1" class="txt6">下方输入用户提供的六位数取件码</text>
+    </view>
+    <view class="layer3">
+      <view class="pic2">
+        <view class="input">{{one}}</view>
+        <view class="input">{{two}}</view>
+        <view class="input">{{three}}</view>
+        <view class="input">{{four}}</view>
+        <view class="input">{{five}}</view>
+        <view class="input">{{six}}</view>
+        <input auto-focus="{{focus}}" type="number" maxlength="6" model:value="{{inputValue}}" bindinput="finish"></input>
+      </view>
+    </view>
+  </view>
+</van-popup>

+ 102 - 0
pages/tabber/my/index.wxss

@@ -158,3 +158,105 @@
     height: 132rpx;
     opacity: 0;
 }
+
+
+.section10 {
+    height: 386rpx;
+    border-radius: 16rpx;
+    background-color: rgba(255,255,255,1);
+    width: 690rpx;
+    display: flex;
+    flex-direction: column;
+  }
+  .layer1 {
+    width: 405rpx;
+    height: 60rpx;
+    flex-direction: row;
+    display: flex;
+    justify-content: space-between;
+    margin: 20rpx 0 0 265rpx;
+  }
+  .txt5 {
+    width: 160rpx;
+    height: 32rpx;
+    display: block;
+    overflow-wrap: break-word;
+    color: rgba(51,51,51,1);
+    font-size: 32rpx;
+    font-family: PingFangSC-Medium;
+    white-space: nowrap;
+    line-height: 32rpx;
+    text-align: left;
+    margin-top: 28rpx;
+  }
+  .icon2 {
+    width: 32rpx;
+    height: 32rpx;
+  }
+  .layer2 {
+    width: 390rpx;
+    height: 26rpx;
+    display: flex;
+    flex-direction: row;
+    margin: 32rpx 0 0 150rpx;
+  }
+  .txt6 {
+    width: 390rpx;
+    height: 26rpx;
+    display: block;
+    overflow-wrap: break-word;
+    color: rgba(153,153,153,1);
+    font-size: 26rpx;
+    font-family: PingFangSC-Regular;
+    white-space: nowrap;
+    line-height: 26rpx;
+    text-align: left;
+  }
+  .layer3 {
+    width: 580rpx;
+    height: 120rpx;
+    display: flex;
+    flex-direction: row;
+    margin: 64rpx 0 64rpx 55rpx;
+  }
+  .pic2 {
+    width: 580rpx;
+    height: 120rpx;
+    display: flex;
+    flex-flow: row nowrap;
+    justify-content: space-between;
+    position: relative;
+  }
+  .cover{
+  
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    /* z-index: 99999; */
+    background: rgba(0,0,0,.3);
+    display: flex;
+    flex-flow: row nowrap;
+    justify-content: center;
+    align-items: center;
+  }
+  .pic2 .input{
+    background: #f2f2f2;
+    color: #222;
+    width: 14%;
+    height: 100rpx;
+    line-height: 100rpx;
+    text-align: center;
+  }
+  .pic2 input{
+    position: absolute;
+    height: 100rpx;
+    line-height: 100rpx;
+    opacity: 0;
+    width: 200%;
+    color: #fff0;
+    caret-color: #FFF;
+    left: -100%;
+    top: 0;
+  }