import { NavController , Toast , Alert } from 'ionic-angular' ; export class Helper { constructor ( private nav ) { } presentToast ( text ) { let toast = Toast . create ( { message : text , duration : 2000 , position : 'bottom' } ) ; toast . onDismiss ( ( ) => { } ) ; this . nav . present ( toast ) ; } headleAjaxBodyParam ( param ) { let bodyStr = [ ] ; for ( let item in param ) { bodyStr . push ( item + '=' + param [ item ] ) ; } return bodyStr . join ( '&' ) ; } presentConfirm ( text ) { let alert = Alert . create ( { title : '提示' , message : text , buttons : [ { text : '确定' , role : 'cancel' , } ] } ) ; this . nav . present ( alert ) ; } }