From a84f232f71f84d2fea1bb3666302fa9d812bf734 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 25 七月 2024 18:50:11 +0800
Subject: [PATCH] #

---
 pages/pakin/pakin.vue |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue
index 5bb8f9c..35edcfc 100644
--- a/pages/pakin/pakin.vue
+++ b/pages/pakin/pakin.vue
@@ -235,11 +235,7 @@
 				setTimeout(() => {
 					var len = this.barcode.length
 					if (len != 8) {
-						uni.showToast({
-							title: '鎵樼洏鐮佹湁璇閲嶈瘯',
-							icon: "none",
-							position: 'top'
-						});
+						uni.showToast({ title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top' });
 						this.barcodeFocuss()
 						return;
 					}
@@ -387,9 +383,8 @@
 			},
 			// 纭绉婚櫎
 			removeConfirm() {
-				this.messageText = "绉婚櫎鎴愬姛"
-				this.messageToggle('success')
 				this.dataList.splice(this.removeNum, 1)
+				uni.showToast({ title: '绉婚櫎鎴愬姛', icon: "error", position: 'top' });
 			},
 			// 鍙栨秷绉婚櫎
 			removeClose() {
@@ -400,8 +395,7 @@
 				this.dataList[this.rowNum].batch = this.batch
 				this.dataList[this.rowNum].weight = this.weight
 				this.matnr = ''
-				this.messageText = "淇敼鎴愬姛"
-				this.messageToggle('success')
+				uni.showToast({ title: '绉婚櫎鎴愬姛', icon: "success", position: 'top' });
 				this.$refs.revise.close()
 			},
 			reviseClose() {
@@ -423,19 +417,16 @@
 				uni.vibrateShort();
 				let that = this;
 				if (that.barcode === '') {
-					this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�"
-					this.messageToggle('error')
+					uni.showToast({ title: '璇锋壂鎻忔墭鐩樻潯鐮�', icon: "error", position: 'top' });
 					return;
 				}
 				if (that.dataList.length === 0) {
-					this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�"
-					this.messageToggle('error')
+					uni.showToast({ title: '璇锋坊鍔犲晢鍝佸垪琛�', icon: "error", position: 'top' });
 					return;
 				}
 				for (var i = 0; i < that.dataList.length; i++) {
 					if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
-						this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
-						this.messageToggle('error')
+						uni.showToast({ title: that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0', icon: "error", position: 'top' });
 						return;
 					}
 				}
@@ -461,16 +452,12 @@
 							innerAudioContext.src = '/static/music/pakinOk.mp3';
 							innerAudioContext.play()
 						} else if (res.code == 403) {
-							that.messageText = res.msg
-							that.messageToggle('error')
+							uni.showToast({ title: res.msg, icon: "error", position: 'top' });
 							setTimeout(() => {
-								uni.reLaunch({
-									url: '../login/login'
-								});
+								uni.reLaunch({ url: '../login/login' });
 							}, 1000);
 						} else {
-							that.messageText = res.msg
-							that.messageToggle('error')
+							uni.showToast({ title: res.msg, icon: "error", position: 'top' });
 						}
 					}
 				});

--
Gitblit v1.9.1