agreement-checker.js 1.33 KB
define(["mk7/url","css!cmpts/agreement-checker/agreement-checker.css"],function(e){$$=Dom7;var n={};return n.initServiceVersion=function(){var n=this;$$.ajax({method:"GET",url:e.to("/user/default/get-service-version"),dataType:"json",beforeSend:function(){},success:function(e){e.success&&n.checkServiceAgreementVersion(e)},error:function(e){},complete:function(e){}})},n.checkServiceAgreementVersion=function(n){var o=this;return 0!=n.showAgreement&&($$("#index").hide(),$$("#index-tabbar").hide(),o.readAgreementEvent(),void $$.ajax({method:"GET",url:e.to("/support/legal"),data:{},dataType:"html",beforeSend:function(){},success:function(e){var n=$$('<div id="jw-overplay"></div>'),o=$$('<div id="jw-model-in"></div>'),r=$$('<div id="agree-box-div"><a href="javascript:void(0)" id="jw-close-cls">已阅读并同意</a></div>');o.append(e),$$("body").append(n),$$("body").append(o),$$("body").append(r)},error:function(e){},complete:function(e){}}))},n.readAgreementEvent=function(){$$("body").on("click","#jw-close-cls",function(n){$$("#jw-overplay").remove(),$$("#jw-model-in").remove(),$$("#agree-box-div").remove(),$$("#index").show(),$$("#index-tabbar").show(),$$.ajax({method:"GET",url:e.to("/user/default/read-service-agreement"),data:{},dataType:"json",beforeSend:function(){},success:function(e){},error:function(e){},complete:function(e){}})})},n});