From 60d0fc6639903a606274a07dbad8205a804456d0 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期三, 25 九月 2024 16:11:10 +0800 Subject: [PATCH] # --- pages/home/home.vue | 6 +++--- manifest.json | 4 ++-- pages/pakin/pakin.vue | 40 ++++++++++++++++++++++++++++++---------- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/manifest.json b/manifest.json index b92ee7f..d670f45 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "涓壃WMS", "appid" : "__UNI__DA5854D", "description" : "", - "versionName" : "240529A", - "versionCode" : 102, + "versionName" : "240925A", + "versionCode" : 103, "transformPx" : false, /* 5+App鐗规湁鐩稿叧 */ "app-plus" : { diff --git a/pages/home/home.vue b/pages/home/home.vue index 34dc1ee..82cce21 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -22,8 +22,8 @@ baseUrl: '', token: '', icon: '', - elements: [], - elements2: [ + elements2: [], + elements: [ { title: '缁勬墭鍏ュ簱', name: 'pakin', @@ -130,7 +130,7 @@ onShow() { this.baseUrl = uni.getStorageSync('baseUrl'); this.token = uni.getStorageSync('token'); - this.getAuth() + // this.getAuth() }, methods: { getAuth() { diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue index 5612110..0b06525 100644 --- a/pages/pakin/pakin.vue +++ b/pages/pakin/pakin.vue @@ -225,19 +225,39 @@ asBarcodeInput() { // this.asBarcode = this.asBarcode.replace(/\s+/g, '') setTimeout(() => { - // var len = this.asBarcode.length - // if (len != 12) { - // uni.showToast({ - // title: 'AS400鏈夎璇烽噸璇�', - // icon: "none", - // position: 'top' - // }); - // this.asBarcodeFocuss() - // return; - // } + var len = this.asBarcode.length + if (this.checkCode(this.asBarcode)) { + // && this.asBarcode.length != 8 + + uni.showToast({ + title: 'AS400鏈夎璇烽噸璇�', + icon: "none", + position: 'top' + }); + this.asBarcodeFocuss() + return; + } this.focuss() }, 200) }, + checkCode(code) { + // console.log(this.isNum(code.substring(0, 1))) + // console.log(!this.isNum(code.substring(1, 2))) + // console.log(code.length == 8,code.length) + let flag = true + if (code.substring(0, 2) == 'PM' ) { + flag = false + } else if ( + this.isNum(code.substring(0, 1)) + && !this.isNum(code.substring(1, 2)) + && code.length == 8 ) { + flag = false + } + return flag + }, + isNum(value) { + return typeof value === 'string' ? /^\d+$/.test(value) : typeof value === 'number' && !isNaN(value); + }, // 鎵樼洏鐮佹湁璇噸缃� barcodeFocuss() { let that = this; -- Gitblit v1.9.1