From b4a3d4a5a200a8e4e1a4ec7050981b3999d33f2d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Mon, 20 Jun 2016 16:04:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/build/app.min.js | 2 +- public/javascripts/wechat/directives/alert.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/javascripts/wechat/build/app.min.js b/public/javascripts/wechat/build/app.min.js index 57664c550..c41e0bb7b 100644 --- a/public/javascripts/wechat/build/app.min.js +++ b/public/javascripts/wechat/build/app.min.js @@ -11,7 +11,7 @@ app.controller("IssueController",["$scope","$http","$routeParams","auth","common app.controller("JournalsController",["$scope","$http","$routeParams","auth","common",function(o,a,e,l,n){n.init({id:e.id,scope:o,type:"journal_for_messages",replyType:"JournalsForMessage",loadCallback:function(a){o.message=a.data},replyCallback:function(){}})}]); app.controller("LoginController",["$scope","$http","$location","$routeParams","alertService","config","auth","session",function(e,o,t,i,a,n,s,r){s.isBind().then(function(){t.path("/activities")}),i.code&&r.save("code",i.code);var l=e;l.loginFailed=!1,l.alertService=a.create(),l.findPwdDialog=a.create(),l.login=function(i,a){return i.$setSubmitted(),console.log(a),i.$valid?(console.log(apiUrl+"auth"),void s.openid().then(function(e){return o.post(n.apiUrl+"users/wxbind",{login:a.login,password:a.password,openid:e})}).then(function(o){console.log(o.data),l.loginFailed=0!=o.data.status,e.loginFailed?l.alertService.showMessage("出错了",o.data.message):l.alertService.showMessage("提示",o.data.message,function(){t.path("/activities")})})["catch"](function(e){l.alertService.showMessage("出错了",e)})):void console.log(i.$error)},l.showBox=function(){l.findPwdDialog.showMessage("提示","请访问www.trustie.net获取密码,谢谢!")},l.goReg=function(){t.path("/reg")}}]); app.controller("RegController",["$scope","$http","$location","alertService",function(e,o,a,r){var s=e;s.errDialog=r.create(),s.goLogin=function(){a.path("/login")},s.isagreed=!0,s.agreed=function(e){s.isagreed=!e},s.reg=function(e,a){return e.$setSubmitted(),console.log(e),e.$valid?(console.log(a),void o.post(apiUrl+"users",{login:a.username,password:a.password,mail:a.email}).then(function(e){0!=e.data.status?s.errDialog.showMessage("出错了",e.data.message):s.errDialog.showMessage("提示","注册且绑定微信成功")},function(e){s.errDialo.showMessage("出错了",e.data)})):void console.log(e.$error)}}]); -app.directive("myAlert",["config",function(t){return{templateUrl:t.rootPath+"templates/alert.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){"function"==typeof t.cb&&t.cb()}}}}]); +app.directive("myAlert",["config",function(t){return{templateUrl:t.rootPath+"templates/alert.html",scope:{title:"=",message:"=",visible:"=",cb:"="},link:function(t){t.dismiss=function(){t.visible=!1,"function"==typeof t.cb&&t.cb()}}}}]); app.directive("pwdconfirm",function(){return{require:"ngModel",link:function(r,n,i,e){e.$validators.pwdconfirm=function(n,i){return r.user&&r.user.password==i}}}}); app.directive("inputAuto",function(){return{restrict:"A",scope:{},link:function(n,t){var e=t.parent().children().eq(0),i=t.parent().next();t.on("input",function(){console.log(i),e.html(t[0].value);var n=e[0].scrollHeight;t.css("height",n+"px")}),i.on("click",function(){t.css("height","28px")})}}}); app.directive("loadingSpinner",["$http",function(i){return{restrict:"A",replace:!0,template:'
加载中...
'}}]); diff --git a/public/javascripts/wechat/directives/alert.js b/public/javascripts/wechat/directives/alert.js index 332ec65bf..f53ecdb5a 100644 --- a/public/javascripts/wechat/directives/alert.js +++ b/public/javascripts/wechat/directives/alert.js @@ -9,6 +9,7 @@ app.directive('myAlert', ['config', function(config){ }, link: function(scope){ scope.dismiss = function(){ + scope.visible = false; if(typeof scope.cb === 'function'){ scope.cb(); }