|
@@ -44,7 +44,18 @@ Page({
|
|
userInfo: "",
|
|
userInfo: "",
|
|
hasUserInfo: false,
|
|
hasUserInfo: false,
|
|
code: "",
|
|
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.getBtnInfo()
|
|
this.getwallet();
|
|
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() {
|
|
getBtnInfo() {
|
|
this.setData({
|
|
this.setData({
|
|
btnInfo: app.globalData.btnInfo
|
|
btnInfo: app.globalData.btnInfo
|