From e178ff6976784e3bdaa1bd274f0a1e756d79cda9 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期四, 21 七月 2022 09:09:20 +0800 Subject: [PATCH] # --- pages/basics/checkout.vue | 40 +++++++++++++++++++++++----------------- 1 files changed, 23 insertions(+), 17 deletions(-) diff --git a/pages/basics/checkout.vue b/pages/basics/checkout.vue index 35c74a0..70e0790 100644 --- a/pages/basics/checkout.vue +++ b/pages/basics/checkout.vue @@ -100,6 +100,13 @@ // this.getMatListLen() },1000) }, + onLoad() { + // #ifdef APP + setInterval(()=>{ + uni.hideKeyboard() + },20) + // #endif + }, mounted(){ const UIP = uni.getStorageSync('UIP'); this.baseIP = UIP; @@ -108,14 +115,6 @@ }, methods: { - huanghang() { - this.matnr = '' - this.focus = false; - this.$nextTick(function() { - this.focus = true; - }); - - }, messageToggle(type) { this.msgType = type this.messageText = `杩欐槸涓�鏉�${type}娑堟伅鎻愮ず` @@ -141,6 +140,16 @@ this.$nextTick(function() { this.barcodeFocus = true; }); + }, + foucss() { + // #ifdef APP + let that = this; + that.focus = false; + setTimeout(()=>{ + that.matnr = ''; + that.focus = true; + }, 100); + // #endif }, removeMatnr() { this.matnr = '' @@ -189,22 +198,20 @@ 'token':uni.getStorageSync('token'), }, success(result) { - console.log(result) let res = result.data; if (res.code === 200) { if (res.data.ioType === 101) { that.matList = res.data.list.concat(that.matList) that.listLen = that.matList.length; + that.foucss(); return; } if (res.data.ioType === 103 || res.data.ioType === 104 || res.data.ioType === 107) { that.matCount = res.data.list.length that.wrkNo = res.data.list[0].wrkNo + that.foucss(); return; } - // if (res.data) { - // that.matCount = res.data.length - // } } else if (res.code === 403) { uni.showToast({title: res.msg, icon: "none", position: 'top'}) setTimeout(() => { @@ -232,14 +239,13 @@ 'token':uni.getStorageSync('token') }, success(result) { - console.log(result) var res = result.data; if(res.code === 200 ) { if(res.data) { if (that.matList.length == 0) { that.matList.push(res.data) that.listLen = that.matList.length; - that.huanghang(); + that.foucss(); return; } for(let i = 0;i<that.matList.length;i++) { @@ -247,18 +253,18 @@ if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data)) { that.messageToggle('warn'); that.messageText = '璇ュ晢鍝佸凡娣诲姞'; - that.huanghang(); + that.foucss(); return; } else { that.matList.unshift(res.data); that.listLen = that.matList.length; - that.huanghang(); + that.foucss(); return; } } else { that.messageToggle('warn'); that.messageText = '宸插嚭鍏ㄩ儴鍟嗗搧锛岃纭鍑哄簱'; - that.huanghang(); + that.foucss(); return; } } -- Gitblit v1.9.1