Bladeren bron

添加出入库按钮节流

caojunjie 4 jaren geleden
bovenliggende
commit
3cabc6c5aa
3 gewijzigde bestanden met toevoegingen van 35 en 27 verwijderingen
  1. 1 1
      pages/me/Delivery-details/index.vue
  2. 33 25
      pages/me/Warehousing-details/index.vue
  3. 1 1
      pages/me/scancodequery/result.vue

+ 1 - 1
pages/me/Delivery-details/index.vue

@@ -9,7 +9,7 @@
 			 active-color="#fff" inactive-color="#ffffff" bg-color="#ffffff00"></u-tabs> -->
 			<view style="width: 340rpx;height: 80rpx;text-align: center;padding-top: 25rpx;padding-left: 20rpx;float: left;margin-top: 0;margin-left: 30rpx;">
 				<view style="float: left;">
-					<text @click="whole">全部</text>
+					<text @tap="$u.throttle(whole, 500)">全部</text>
 					<view v-if="bottoma == true" style="width: 100%;height: 1rpx;background-color: #FFFFFF;border-radius: 10rpx;"></view>
 					<view v-else></view>
 				</view>

+ 33 - 25
pages/me/Warehousing-details/index.vue

@@ -9,7 +9,7 @@
 			 active-color="#fff" inactive-color="#ffffff" bg-color="#ffffff00"></u-tabs> -->
 			<view style="width: 340rpx;height: 80rpx;text-align: center;padding-top: 25rpx;padding-left: 20rpx;float: left;margin-top: 0;margin-left: 30rpx;">
 				<view style="float: left;">
-					<text @click="whole">全部</text>
+					<text @tap="$u.throttle(whole, 500)">全部</text>
 					<view v-if="bottoma == true" style="width: 100%;height: 1rpx;background-color: #FFFFFF;border-radius: 10rpx;"></view>
 					<view v-else></view>
 				</view>
@@ -139,7 +139,7 @@
 			this.whole()
 		},
 		onBackPress(options) {
-			console.log(options)
+			// console.log(options)
 			if (options.from == 'backbutton') {
 				this.$u.route({
 					type: 'switchTab',
@@ -150,12 +150,12 @@
 		},
 		methods: {
 			content_s() {
-				console.log(this.keyword)
+				// console.log(this.keyword)
 			},
 			inputbox(e) {
 				this.page = 1
-				console.log(e)
-				console.log(this.length)
+				// console.log(e)
+				// console.log(this.length)
 				this.itemList = []
 				this.brandCode = null
 				this.beginDate = null
@@ -165,7 +165,7 @@
 					this.status = 'nomore';
 					this.getPage()
 				} else {
-					console.log("什么情况")
+					// console.log("什么情况")
 					this.getPage()
 				}
 			},
@@ -177,19 +177,19 @@
 				this.itemList = []
 				this.beginDate = e.startDate + " 00:00:00"
 				this.endDate = e.endDate + " 23:59:59"
-				console.log(e)
-				console.log("触发了")
-				console.log(this.show_d)
+				// console.log(e)
+				// console.log("触发了")
+				// console.log(this.show_d)
 				this.current = 0
 				this.getPage()
 			},
 			click(index) {
 				this.page = 1
-				console.log(`点击了第${index + 1}项,内容为:${this.list_a[index].brandCode}`)
+				// console.log(`点击了第${index + 1}项,内容为:${this.list_a[index].brandCode}`)
 				this.brandCode = this.list_a[index].brandCode
 				this.itemList = []
 				this.judge = true
-				console.log(this.judge)
+				// console.log(this.judge)
 				this.getPage()
 			},
 			whole() {
@@ -203,7 +203,7 @@
 				this.endDate = null
 				this.content = null
 				this.page = 1
-				console.log(this.brandCode)
+				// console.log(this.brandCode)
 				this.getPage()
 			},
 			brand() {
@@ -224,10 +224,10 @@
 							userId: this.$store.state.storeInfo.userId
 						}
 					}).then(res => {
-						console.log(res)
-						console.log(res.data.data)
+						// console.log(res)
+						// console.log(res.data.data)
 						for (let i = 0; i < res.data.data.length; i++) {
-							console.log(res.data.data[i].brandCode)
+							// console.log(res.data.data[i].brandCode)
 							this.list_a.push({
 								brandCode: res.data.data[i].brandCode,
 								text: res.data.data[i].brandName,
@@ -236,7 +236,11 @@
 							})
 						}
 					}).catch(err => {
-						console.log(err)
+						uni.showToast({
+							icon: 'none',
+							title: '网络繁忙,请稍后再试~',
+							position: "bottom"
+						})
 					}).finally(() => {
 						// Loading.close()
 					})
@@ -296,15 +300,14 @@
 			// 	console.log(this.current)
 			// },
 			getPage() {
-				console.log(this.page)
-				console.log(this.brandCode)
-				console.log(this.beginDate)
-				console.log(this.endDate)
-				console.log(this.content)
+				// console.log(this.page)
+				// console.log(this.brandCode)
+				// console.log(this.beginDate)
+				// console.log(this.endDate)
+				// console.log(this.content)
 				uni.showLoading({
 					title: '加载中...'
 				});
-				console.log("加载中")
 				setTimeout(function() {
 					uni.hideLoading();
 				}, 1000);
@@ -323,7 +326,7 @@
 						content: this.content //搜索内容
 					}
 				}).then(res => {
-					console.log(res)
+					// console.log(res)
 					if(res.data.code == 500){
 						uni.showToast({
 							icon: 'none',
@@ -341,11 +344,16 @@
 						} else {
 							this.judge = false
 						}
-						console.log(this.itemList)
+						// console.log(this.itemList)
 						return this.itemList
 					}
 				}).catch(err => {
-					console.log(err)
+					// console.log(err)
+					uni.showToast({
+						icon: 'none',
+						title: '网络繁忙,请稍后再试~',
+						position: "bottom"
+					})
 				}).finally(() => {
 					// Loading.close()
 				})

+ 1 - 1
pages/me/scancodequery/result.vue

@@ -2,7 +2,7 @@
 <template>
 	<view>
 		<view class="head">
-			<view class="tips" @click="scanning">
+			<view class="tips" @tap="$u.throttle(scanning, 500)">
 				<view>
 					<view><text>点击扫码</text></view>
 				</view>