webpackJsonp([12],{

/***/ 310:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModifyPasswordModule", function() { return ModifyPasswordModule; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modifyPassword__ = __webpack_require__(336);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};



var ModifyPasswordModule = (function () {
    function ModifyPasswordModule() {
    }
    ModifyPasswordModule = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["I" /* NgModule */])({
            declarations: [
                __WEBPACK_IMPORTED_MODULE_2__modifyPassword__["a" /* ModifyPasswordPage */],
            ],
            imports: [
                __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["h" /* IonicPageModule */].forChild(__WEBPACK_IMPORTED_MODULE_2__modifyPassword__["a" /* ModifyPasswordPage */]),
            ],
        })
    ], ModifyPasswordModule);
    return ModifyPasswordModule;
}());

//# sourceMappingURL=modifyPassword.module.js.map

/***/ }),

/***/ 336:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ModifyPasswordPage; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_ionic_angular__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_http__ = __webpack_require__(35);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ionic_storage__ = __webpack_require__(28);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__service_appHttpService__ = __webpack_require__(19);
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};





var ModifyPasswordPage = (function () {
    function ModifyPasswordPage(navCtrl, navParams, storage, alertCtrl, loadingCtrl, http, appService) {
        var _this = this;
        this.navCtrl = navCtrl;
        this.navParams = navParams;
        this.storage = storage;
        this.alertCtrl = alertCtrl;
        this.loadingCtrl = loadingCtrl;
        this.http = http;
        this.appService = appService;
        this.myreg = /^(?![^a-zA-Z]+$)(?!\\D+$).{8,16}$/;
        this.user = {
            mobile: '',
            password: ''
        };
        this.passwordInfo = {
            formerPassword: '',
            modifyPassword: '',
            sureModifyPassword: ''
        };
        this.storage.get("userLoginInfo").then(function (value) {
            _this.user = value;
        });
    }
    ModifyPasswordPage.prototype.sureModifyPassword = function () {
        var _this = this;
        console.log("修改密码！");
        if (this.passwordInfo.formerPassword == '' ||
            this.passwordInfo.modifyPassword == '' ||
            this.passwordInfo.sureModifyPassword == '') {
            console.log("请输入完整信息");
            this.appService.popToastView("请输入完整信息！", 'top', 2000);
            return;
        }
        if (this.passwordInfo.formerPassword != '') {
            if (this.user.password != this.passwordInfo.formerPassword) {
                console.log("原密码输入有误！");
                this.appService.popToastView("原密码输入有误！", 'top', 2000);
                return;
            }
        }
        if (!this.myreg.test(this.passwordInfo.modifyPassword)) {
            console.log('新密码由8到16位数字和字母组成！');
            this.appService.popToastView('新密码由8到16位数字和字母组成！', 'top', 2000);
            return false;
        }
        if (this.passwordInfo.modifyPassword != this.passwordInfo.sureModifyPassword) {
            console.log("两次输入的密码不一致");
            this.appService.popToastView("两次输入的密码不一致", 'top', 2000);
            return;
        }
        else {
            console.log("到后台！");
            this.appService.ObserverHttpPost("/wisdomgroup/manager/updatePassword", { "password": this.passwordInfo.modifyPassword })
                .subscribe(function (res) {
                _this.appService.popToastView("修改成功！", 'top', 2000);
                //将缓存中密码密码修改
                _this.user.password = _this.passwordInfo.modifyPassword;
                console.log(_this.user);
                _this.storage.set('userLoginInfo', _this.user);
                //退出后台
                _this.logoutApp();
                //退出到登录页
                _this.navCtrl.setRoot("LoginPage");
            }, function (error) {
                _this.appService.alert('网络异常！');
            });
        }
    };
    ModifyPasswordPage.prototype.logoutApp = function () {
        var _this = this;
        this.appService.ObserverHttpGet("/wisdomgroup/app/logout", null)
            .subscribe(function (res) {
            var data = res.json();
        }, function (error) {
            _this.appService.alert('网络异常！');
        });
    };
    ModifyPasswordPage = __decorate([
        Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["m" /* Component */])({
            selector: 'page-modifyPassword',template:/*ion-inline-start:"/Users/ben/gitLab-project/wisdom-ces/src/pages/modifyPassword/modifyPassword.html"*/'<ion-header>\n\n	<ion-toolbar>\n\n		<div class="searchToolBar">\n\n			<button ion-button clear small navPop style="padding: 0;">\n\n				<img class="back-btn" src="./assets/imgs/back.png" />\n\n			</button>\n\n			<ion-title text-center>\n\n				修改密码\n\n			</ion-title>\n\n		</div>\n\n\n\n	</ion-toolbar>\n\n</ion-header>\n\n<ion-content class="content-box">\n\n	<div class="pwd-item">\n\n		<img src="./assets/imgs/icon-password.png" class="pwd-img">\n\n		<input [(ngModel)]="passwordInfo.formerPassword" class="pwd-content" type="password" required placeholder="原密码" />\n\n	</div>\n\n	<div class="pwd-item">\n\n		<img src="./assets/imgs/icon-password-new.png" class="pwd-img">\n\n		<input [(ngModel)]="passwordInfo.modifyPassword" class="pwd-content" type="password" required placeholder="新密码（8到16位，包含字母与数字）"\n\n		/>\n\n	</div>\n\n	<div class="pwd-item">\n\n		<img src="./assets/imgs/icon-password-confirm.png" class="pwd-img">\n\n		<input [(ngModel)]="passwordInfo.sureModifyPassword" class="pwd-content" type="password" required placeholder="再次输入新密码" />\n\n	</div>\n\n	<div class="modify-btn">\n\n		<button ion-button block class="modify" (click)="sureModifyPassword()">确认修改</button>\n\n	</div>\n\n\n\n</ion-content>'/*ion-inline-end:"/Users/ben/gitLab-project/wisdom-ces/src/pages/modifyPassword/modifyPassword.html"*/
        }),
        __metadata("design:paramtypes", [__WEBPACK_IMPORTED_MODULE_1_ionic_angular__["j" /* NavController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["k" /* NavParams */],
            __WEBPACK_IMPORTED_MODULE_3__ionic_storage__["b" /* Storage */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["a" /* AlertController */],
            __WEBPACK_IMPORTED_MODULE_1_ionic_angular__["i" /* LoadingController */],
            __WEBPACK_IMPORTED_MODULE_2__angular_http__["b" /* Http */],
            __WEBPACK_IMPORTED_MODULE_4__service_appHttpService__["b" /* AppService */]])
    ], ModifyPasswordPage);
    return ModifyPasswordPage;
}());

//# sourceMappingURL=modifyPassword.js.map

/***/ })

});
//# sourceMappingURL=12.js.map