فهرست منبع

增加loading

tanxue 1 ماه پیش
والد
کامیت
7573f7d26e
1فایلهای تغییر یافته به همراه13 افزوده شده و 2 حذف شده
  1. 13 2
      pages/admin/kehu/kehuInfo.vue

+ 13 - 2
pages/admin/kehu/kehuInfo.vue

@@ -72,6 +72,7 @@ function saveBtn(){
 
 // 新增
 function htAdd(){
+	
 	let arr = [];
 	if (!formData.realName) {
 		arr.push('姓名');
@@ -87,6 +88,10 @@ function htAdd(){
 		return;
 	}
 	
+	uni.showLoading({
+	      title: '新增中...',
+	      mask: true
+	    });
 	const opt = {
 		realName: formData.realName,
 		userName: formData.userName,
@@ -101,6 +106,8 @@ function htAdd(){
 			})
 			goUpPage();
 		}
+	}).finally(()=>{
+		uni.hideLoading()
 	})
 }
 
@@ -136,7 +143,10 @@ function htEditor(){
 		})
 		return;
 	}
-	
+	uni.showLoading({
+	      title: '更新中...',
+	      mask: true
+	    });
 	const opt = {
 		userId: formData.userId,
 		realName: formData.realName,
@@ -145,7 +155,6 @@ function htEditor(){
 		idcard: formData.idcard,
 		jutidizhi: formData.jutidizhi,
 	}
-	console.log('opt',opt);
 	khApi.getKehuUpdate(opt).then(res => {
 		if (res.data) {
 			uni.showToast({
@@ -153,6 +162,8 @@ function htEditor(){
 			})
 			goUpPage();
 		}
+	}).finally(()=>{
+		uni.hideLoading()
 	})
 }