瀏覽代碼

加节流限制

@dongkboy 1 年之前
父節點
當前提交
c68cf3c95a
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 2 0
      pages/user/authInfo.vue
  2. 7 1
      pages/user/practitionerInfo.vue

+ 2 - 0
pages/user/authInfo.vue

@@ -193,6 +193,7 @@
 		methods: {
 			async authSubmit() {
 				uni.showLoading({
+					mask: true,
 					title: '正在提交,请稍等片刻'
 				});
 				let res = await this.$http.post('/userAgent/agentAuth', this.authInfo);
@@ -202,6 +203,7 @@
 						url: "/pages/user/authResult?status=" + res.data.status + '&desc=' + res.data.desc
 					})
 				} else {
+					uni.hideLoading();
 					uni.showToast({
 						title: res.msg,
 						icon: 'none',

+ 7 - 1
pages/user/practitionerInfo.vue

@@ -96,7 +96,7 @@
 		<view class="footer">
 			<view class="btn dis j-c a-c"
 				:style="{background:disabled?'linear-gradient(90deg, #499DFF 0%, #0052FF 100%)':'linear-gradient(90deg, rgba(73, 157, 255, 0.4) 0%, rgba(0, 82, 255, 0.4) 100%)',pointerEvents:disabled?'auto':'none'}"
-				@click="authSubmit">提交申请</view>
+				@tap="$u.throttle(authSubmit,3000)">提交申请</view>
 		</view>
 	</view>
 </template>
@@ -174,12 +174,18 @@
 		},
 		methods: {
 			async authSubmit() {
+				uni.showLoading({
+					mask: true,
+					title: '正在提交,请稍等片刻'
+				});
 				let res = await this.$http.post('/userAgent/agentSubmit', this.bankInfo);
 				if (res.code == '200') {
+					uni.hideLoading();
 					uni.navigateTo({
 						url: "/pages/user/authResult1"
 					})
 				} else {
+					uni.hideLoading();
 					uni.showToast({
 						title: res.msg,
 						icon: 'none',