zgg vor 4 Monaten
Ursprung
Commit
41aef60640
3 geänderte Dateien mit 32 neuen und 3 gelöschten Zeilen
  1. 5 1
      App.vue
  2. 12 1
      pages/index/add.vue
  3. 15 1
      pages/index/reAdd.vue

+ 5 - 1
App.vue

@@ -44,7 +44,7 @@
 				app.globalData.userinfo.orgId = 0;
 			}
 		// app.globalData.userinfo.orgId = 3;
-		// app.globalData.userinfo.token = '74915012521612';
+		// app.globalData.userinfo.token = '74915013303370';
 		// app.globalData.userinfo.userId = 60;
 			this.checkLogin();
 		},
@@ -159,6 +159,10 @@
 								icon: 'none',
 								duration: 2000
 							})
+							if (app.ajaxReadyCallback2) { //在onShow中调用数据的,添加在onShow方法内,防止不同页面覆盖
+								res.data['apiname'] = apiname;
+								app.ajaxReadyCallback2(res)
+							}
 						}
 					},
 					fail: function (err) {

+ 12 - 1
pages/index/add.vue

@@ -196,7 +196,8 @@
 				cateShow: false,
 				filterCates:[],
 				wx: null,
-				isFirst:1
+				isFirst:1,
+				saveFlag:false
 			}
 		},
 		onLoad(option) {
@@ -292,6 +293,12 @@
 					}
 				}
 			}
+			app.ajaxReadyCallback2 = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				if(apiname == 'order'){
+					that.saveFlag = false;
+				}
+			}
 			
 			this.getDep();
 			this.getCate();
@@ -507,6 +514,10 @@
 					this.showSign = true;
 					return false;
 				}
+				if(this.saveFlag){
+					return;
+				}
+				this.saveFlag = true;
 				let param = {
 					contact: this.contact,
 					phone: this.phone,

+ 15 - 1
pages/index/reAdd.vue

@@ -196,7 +196,8 @@
 				cateShow: false,
 				filterCates:[],
 				wx: null,
-				isFirst:1
+				isFirst:1,
+				saveFlag:false
 			}
 		},
 		onLoad(option) {
@@ -300,6 +301,13 @@
 				}
 			}
 			
+			app.ajaxReadyCallback2 = res => {  //各个接口统一回调方法
+				var apiname = res.data.apiname;
+				if(apiname == 'order'){
+					that.saveFlag = false;
+				}
+			}
+			
 			this.getDep();
 			this.getCate();
 			this.getProtocol();
@@ -542,6 +550,12 @@
 					this.showSign = true;
 					return false;
 				}
+				
+				if(this.saveFlag){
+					return;
+				}
+				this.saveFlag = true;
+				
 				let param = {
 					contact: this.contact,
 					phone: this.phone,