53 lines
		
	
	
		
			895 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			53 lines
		
	
	
		
			895 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 
								 | 
							
								/****
							 | 
						||
| 
								 | 
							
								author:wyw
							 | 
						||
| 
								 | 
							
								弹窗显示
							 | 
						||
| 
								 | 
							
								****/
							 | 
						||
| 
								 | 
							
								uni.$showMsg = function(title, icon, duration) {
							 | 
						||
| 
								 | 
							
									if (duration == undefined)
							 | 
						||
| 
								 | 
							
										duration = 1500
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									uni.showToast({
							 | 
						||
| 
								 | 
							
										title: title,
							 | 
						||
| 
								 | 
							
										duration: duration,
							 | 
						||
| 
								 | 
							
										icon: icon
							 | 
						||
| 
								 | 
							
									})
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								//demo checkPlanNotice
							 | 
						||
| 
								 | 
							
								//待办操作后 提示再返回
							 | 
						||
| 
								 | 
							
								uni.$showMsgFunc = function(title, func, icon, duration) {
							 | 
						||
| 
								 | 
							
									if (duration == undefined)
							 | 
						||
| 
								 | 
							
										duration = 1000
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									if (icon == undefined)
							 | 
						||
| 
								 | 
							
										icon = 'success'
							 | 
						||
| 
								 | 
							
									if (title == undefined)
							 | 
						||
| 
								 | 
							
										title = '操作成功!'
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									setTimeout(() => {
							 | 
						||
| 
								 | 
							
										uni.showToast({
							 | 
						||
| 
								 | 
							
											title: title,
							 | 
						||
| 
								 | 
							
											icon: icon
							 | 
						||
| 
								 | 
							
										});
							 | 
						||
| 
								 | 
							
										setTimeout(() => {
							 | 
						||
| 
								 | 
							
											uni.hideToast();
							 | 
						||
| 
								 | 
							
											func();
							 | 
						||
| 
								 | 
							
										}, duration)
							 | 
						||
| 
								 | 
							
									}, 0)
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								//错误提示 
							 | 
						||
| 
								 | 
							
								uni.$showErrorInfo = function(content, title) {
							 | 
						||
| 
								 | 
							
									if (title == undefined)
							 | 
						||
| 
								 | 
							
										title = '错误提示'
							 | 
						||
| 
								 | 
							
									if (content) {
							 | 
						||
| 
								 | 
							
										// error = error.substring(5)
							 | 
						||
| 
								 | 
							
										uni.showModal({
							 | 
						||
| 
								 | 
							
											title: title,
							 | 
						||
| 
								 | 
							
											content: content,
							 | 
						||
| 
								 | 
							
											showCancel: false,
							 | 
						||
| 
								 | 
							
										})
							 | 
						||
| 
								 | 
							
									} else {
							 | 
						||
| 
								 | 
							
										reject(content);
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
								}
							 |