From 4fd23adb1d116d0b50a1648e155904bc91b9945b Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期四, 05 十月 2023 09:10:12 +0800 Subject: [PATCH] # --- pages/pakin/pakin.vue | 55 +++++++++++++++++++++++-------------------------------- 1 files changed, 23 insertions(+), 32 deletions(-) diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue index 6988352..f1b680a 100644 --- a/pages/pakin/pakin.vue +++ b/pages/pakin/pakin.vue @@ -4,7 +4,7 @@ <view class="item"> <view class="code-decs">鎵樼洏鐮�:</view> <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus" - @input="barcodeInput()"> + @input="checkedBarcode()"> </view> <view class="item"> <view class="code-decs">鐗╂枡鐮�:</view> @@ -175,6 +175,28 @@ this.token = uni.getStorageSync('token'); }, methods: { + checkedBarcode() { + let that = this + uni.request({ + url: that.baseUrl + '/barcode/auth', + data: { + barcode: that.barcode, + }, + header: { + 'token':uni.getStorageSync('token') + }, + success(result) { + console.log(result); + var res = result.data + if (res.code === 500) { + that.barcodeFocuss() + uni.showToast({title: res.msg, icon: "none", position: 'top'}); + } else if(res.code === 200) { + that.barcodeInput() + } + } + }) + }, messageToggle(type) { this.msgType1 = type this.$refs.message.open() @@ -291,37 +313,6 @@ }); that.matNo = '' }, - // checkMat(mat) { - // var len = this.dataList.length - // var add = true ,sameItem = false - // for (var i = 0; i < len; i++) { - // if (mat.matno == this.dataList[i].matno) { - // for (var j = 0; j < len; j++) { - // if (mat.batch == this.dataList[j].batch) { - // sameItem = true - // } - // } - // // 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿 鏂板姞鍒楄〃 - // if (mat.batch != this.dataList[i].batch) { - // this.$forceUpdate() // 寮哄埗鍒锋柊 - // if (sameItem) { - // add = false - // } else { - // add = true - // } - - // } else { - // // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞 - // this.dataList[i].anfme += mat.anfme - // this.$forceUpdate() // 寮哄埗鍒锋柊 - // add = false - // } - // } - // } - // if (add) { - // this.dataList.unshift(mat) - // } - // }, checkMat(mat) { var len = this.dataList.length var add = true ,sameItem = false -- Gitblit v1.9.1