Преглед изворни кода

应用市场云服务未连接提示release!

jyew2 пре 5 година
родитељ
комит
e9e5e088e5

+ 10 - 0
o2web/source/x_component_AppMarketV2/$Main/default/cloudConnectTip.html

@@ -0,0 +1,10 @@
+        <div class="o2_appmarket_error">
+            <div class="o2_appmarket_error_pic">
+                <img class="o2_appmarket_error_img" src="../x_component_AppMarketV2/$Main/default/icon/unconnectcloudserver.jpg"></img>
+                <div class="o2_appmarket_error_button" onclick="window.open('https://www.yuque.com/o2oa/course/vwgpbg')">点击这里查看配置说明</div>
+            </div>
+        </div>
+     
+
+
+       

BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/unconnectcloudserver.jpg


BIN
o2web/source/x_component_AppMarketV2/$Main/default/icon/unconnectcloudserver0.png


+ 39 - 2
o2web/source/x_component_AppMarketV2/$Main/default/style.css

@@ -315,7 +315,44 @@
 }
 
 .moduleLoading {
-    margin: "auto";
+    margin: auto;
     width: "100px";
     z-index:9999999999;
-},
+}
+
+.o2_appmarket_error{
+    width: 1000px;
+    height: 560px;
+    margin:200px auto auto auto;
+    text-align: center;
+    background:#ffffff;
+}
+.o2_appmarket_error_pic{
+    position:relative;
+}
+.o2_appmarket_error_img{
+    margin:auto;
+}
+.o2_appmarket_error_btndiv{
+    background: #4A90E2;
+    font-family: MicrosoftYaHei;
+    color: #ffffff;
+    height: 50px;
+    width:320px;
+    font-size: 20px;
+    margin:20px auto 20px auto;
+}
+.o2_appmarket_error_button{
+    height: 50px;
+    line-height: 50px;
+    cursor: pointer;
+    position: absolute;
+    left: 340px;
+    top: 450px;
+    background: #4A90E2;
+    color: #ffffff;
+    font-size: 20px;
+    width: 320px;
+    border-radius: 6px;
+
+}

+ 2 - 0
o2web/source/x_component_AppMarketV2/$Main/default/view.html

@@ -1,4 +1,6 @@
 <div class="o2_appmarket_content" data-o2-element="marketnode">
+    <div class="o2_appmarket_cloudconnecttip" data-o2-element="cloudConnectTipNode">
+    </div>
     <div class="o2_appmarket_recommend" data-o2-element="topRecommendNode">
     </div>
     <div style="clear:both;"></div>

+ 1 - 12
o2web/source/x_component_AppMarketV2/ApplicationsContent.js

@@ -101,12 +101,10 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
         
     },
     load: function(){
-        debugger;
         this.loadAppCategorys();
         this.loadApplications();
     },
     loadAppCategorys: function(){
-        debugger;
         this.actions.MarketAction.listCategory(function(json){
             if (json.data && json.data.valueList){
                 this.showCategorys(json.data.valueList);
@@ -115,11 +113,9 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
         }.bind(this));
     },
     loadApplications: function(){
-        debugger;
         this.emptyLoadContent();
         this.actions.MarketAction.listPaging(this.page, this.pageSize, this.content.querydata,function(json){
             if (json.data && json.data.length){
-                debugger;
                 this.content.currentcategory["name"] = this.content.querydata.category==""||!(this.content.querydata.category)?"全部":this.content.querydata.category;
                 this.content.currentcategory["count"] = json.count;
                 this.showApplications(json.data);
@@ -143,7 +139,6 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
         this.content.isLoading = false;
     },
     showCategorys:function(data){
-        debugger;
         var categorysdiv = this.content.appCategory;
         categorysdiv.empty();
         this.loadCertainCategory(categorysdiv,"全部")
@@ -153,7 +148,6 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
 
     },
     loadCertainCategory:function(categorysdiv,d){
-        debugger;
         var _self = this;
         
         var categorydiv = new Element("span",{"text":d,"class":"o2_appmarket_appcategory"}).inject(categorysdiv);
@@ -165,7 +159,6 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
         }
         categorydiv.addEvents({
             "mouseover":function(){
-                debugger;
                 this.addClass("o2_appmarket_appcategory_tab_over");
             },
             "mouseout":function(){
@@ -187,7 +180,6 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
         })
     },
     showApplications: function(data){
-        debugger;
         //show category count
         //this.content.appCategory_count.empty();
         //new Element("div",{"text":this.content.currentcategory.name+"("+this.content.currentcategory.count+")"}).inject(this.content.appCategory_count);        
@@ -200,7 +192,6 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
             rowappnum = rowappnum -1;
             rowappmargin = (appsdivwidth/240-rowappnum)  * 240  / (rowappnum-1)
         }
-        debugger;
         //appsdiv.setStyle("width","calc("+appwidth+"px)");
         //appsdiv.setStyle("margin-left","10px");
         data.each(function(d, i){
@@ -208,7 +199,6 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
         }.bind(this));
     },
     loadCertainApplication: function(appsdiv, d, i,rowappnum,rowappmargin){
-        debugger;
         //app 排列 begin
        var applicationdiv = new Element("div",{"class":"o2_appmarket_application"}).inject(appsdiv);
  
@@ -295,7 +285,6 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
                 }.bind(_self),
                 function( json ){ 
                     data = json.data; 
-                    debugger;
                     _self.app.unmask();
                     //this.clearLoading()
                 }.bind(_self),
@@ -309,10 +298,10 @@ MWF.xApplication.AppMarketV2.ApplicationsContent.Applications= new Class({
     open: function(e, d){
         var apppar = {};
         apppar["appid"] = d.id;
+        apppar["appname"] = d.name;
         layout.openApplication(e, "AppMarketV2.Application", apppar);
     },
     createLoading: function(node,mask){
-        debugger;
         //alert("createloading")
         this.app.content.mask({
             "destroyOnHide": true,

+ 19 - 0
o2web/source/x_component_AppMarketV2/CloudConnectTip.js

@@ -0,0 +1,19 @@
+MWF.xApplication.AppMarketV2.CloudConnectTip = new Class({
+    Implements: [Options, Events],
+    options: {
+        "view": "cloudConnectTip.html"
+    },
+    initialize: function(app, container, options){
+        this.setOptions(options);
+        this.app = app;
+        this.container = container;
+        this.viewPath = this.app.path+this.app.options.style+"/"+this.options.view;
+        debugger;
+        this.load();
+    },
+    load: function(){
+        debugger;
+        this.container.loadHtml(this.viewPath, {"bind": {"lp": this.app.lp}, "module": this}, function(){
+        }.bind(this));
+    }
+});

+ 18 - 5
o2web/source/x_component_AppMarketV2/Main.js

@@ -42,14 +42,18 @@ MWF.xApplication.AppMarketV2.Main = new Class({
 						//检查是否在云服务器上已注册
 						this.actions.CollectAction.login(//平台封装好的方法
 							function( json ){ //服务调用成功的回调函数, json为服务传回的数据
-								//alert(json.type)
-								if (json.type && json.type=="error"){
-									o2.xDesktop.notice("error", {x: "right", y:"top"}, json.message+"请至系统配置——云服务配置——连接配置注册并连接到O2云");
-								}
 								if (json.type && json.type=="success"){
 									this.loadApp(callback);
 								}
-							}.bind(this),null,false //同步执行 
+							}.bind(this),
+							function( json ){ //服务调用成功的回调函数, json为服务传回的数据
+								errtype = JSON.parse(json.response).type;
+								if (errtype && errtype=="error"){
+									//o2.xDesktop.notice("error", {x: "right", y:"top"}, JSON.parse(json.response).message+"请至系统配置——云服务配置——连接配置注册并连接到O2云");
+									this.loadCloudConnectTip(callback);
+								}
+							}.bind(this)
+							,false //同步执行 
 						);
 						
 					}.bind(this));
@@ -71,6 +75,15 @@ MWF.xApplication.AppMarketV2.Main = new Class({
 		this.loadRecommondContent(function(){ this.recommondLoaded = true; this.checkAppLoaded(callback); }.bind(this));
 		this.loadApplicationsContent(function(){ this.applicationsLoaded = true; this.checkAppLoaded(callback); }.bind(this));
 	},
+	loadCloudConnectTip:function(callback){
+		this.initNodeSize();
+		o2.requireApp("AppMarketV2", "CloudConnectTip", function(){
+			this.cloudTip = new MWF.xApplication.AppMarketV2.CloudConnectTip(this, this.cloudConnectTipNode, {
+				"onLoad": function(){if (callback) callback();}
+			});
+		}.bind(this));
+		
+	},
 	checkAppLoaded: function(callback){
 		if (this.recommondLoaded && this.applicationsLoaded){
 			if (callback) callback();

+ 1 - 13
o2web/source/x_component_AppMarketV2/RecommendContent.js

@@ -8,11 +8,9 @@ MWF.xApplication.AppMarketV2.RecommendContent = new Class({
         this.app = app;
         this.container = container;
         this.viewPath = this.app.path+this.app.options.style+"/"+this.options.view;
-        debugger;
         this.load();
     },
     load: function(){
-        debugger;
         this.container.loadHtml(this.viewPath, {"bind": {"lp": this.app.lp}, "module": this}, function(){
             this.loadRecommend(function(){
                 this.fireEvent("load");
@@ -21,7 +19,6 @@ MWF.xApplication.AppMarketV2.RecommendContent = new Class({
     },    
 
     loadRecommend: function(callback){
-        debugger;
         if (!this.isLoading){
             if (!this.topRecommendContentV){
                 this.topRecommendContentV = new MWF.xApplication.AppMarketV2.RecommendContent.Recommend(this, {
@@ -52,11 +49,9 @@ MWF.xApplication.AppMarketV2.RecommendContent.Recommend= new Class({
         
     },
     load: function(){
-        debugger;
         this.loadItemsRes();
     },
     loadItemsRes: function(){
-        debugger;
         this.actions.MarketAction.listPaging(this.page, this.pageSize, this.querydata,function(json){
             if (json.data && json.data.length){
                 this.loadItems(json.data);
@@ -82,12 +77,6 @@ MWF.xApplication.AppMarketV2.RecommendContent.Recommend= new Class({
         this.content.isLoading = false;
     },
     loadItems: function(data){
-        debugger;
-        //var recommendWidth = this.content.topRecommendContent.clientWidth;
-        //var recommendLeftWidth = (recommendWidth - 80-10)*0.65;
-        //var recommendRightWidth = (recommendWidth - 80-10)*0.35;
-        //this.content.leftCoverNode.setStyle("width",recommendLeftWidth+"px");
-        //this.content.rightCoverNode.setStyle("width",recommendRightWidth+"px");
         data.each(function(d, i){
             this.loadItem(d, i);
         }.bind(this));
@@ -95,7 +84,6 @@ MWF.xApplication.AppMarketV2.RecommendContent.Recommend= new Class({
     loadItem: function(d, i){
         var app;
         var apppar;
-        debugger;
         if (i==0){
             app = this.content.recommendBiggestPic;
             apptext = this.content.recommendBiggestTitle;
@@ -113,7 +101,6 @@ MWF.xApplication.AppMarketV2.RecommendContent.Recommend= new Class({
         }
         //获取对应indexPic图片
         this.actions.MarketAction.getCoverPic(d.id,function(json){
-            debugger;
             if (json.data && json.data.value){
                 app.setStyle("background-image", "url(data:image/png;base64,"+json.data.value+")");
             }
@@ -140,6 +127,7 @@ MWF.xApplication.AppMarketV2.RecommendContent.Recommend= new Class({
         debugger;
         var apppar = {};
         apppar["appid"] = d.id;
+        apppar["appname"] = d.name;
         layout.openApplication(e, "AppMarketV2.Application", apppar);
     },
 

+ 6 - 44
o2web/source/x_component_AppMarketV2_Application/Main.js

@@ -22,10 +22,11 @@ MWF.xApplication.AppMarketV2.Application.Main = new Class({
 		this.viewPath = this.path+this.options.style+"/"+this.options.view;
 		this.iconPath = this.path+this.options.style+"/icon/";
 		this.collectToken = "";
-        this.collectUrl = "";
+		this.collectUrl = "";
 		if (!this.status) {
         } else {
-            this.options.appid = this.status.appid;
+			this.options.appid = this.status.appid;
+			this.options.appname = this.status.appname;			
         }
 		this.appdata = {};
 	},
@@ -78,12 +79,12 @@ MWF.xApplication.AppMarketV2.Application.Main = new Class({
 		this.introducenode.setStyle("height", ""+height+"px");
 	},
 	loadIntroduce:function(callback){
-		debugger;
 		this.initNodeSize();
 		if (this.options.appid){
 			this.actions.MarketAction.get(this.options.appid,function(json){
-				if (json.data && json.data.icon){
+				if (json.data && json.data.icon){					
 					this.appdata = json.data;
+					this.setTitle(MWF.xApplication.AppMarketV2.Application.LP.title+"_"+this.appdata.name);
 					var applicationicon = new Element("div",{"class":"o2_appmarket_application_introduce_icon"}).inject(this.applicationintroduceiconcontain);
 					applicationicon.setStyle("background-image", "url(data:image/png;base64,"+this.appdata.icon+")");
 					if (this.applicationintroduceiconcontain.clientWidth<300){
@@ -156,7 +157,6 @@ MWF.xApplication.AppMarketV2.Application.Main = new Class({
         //e.currentTarget.removeClass("mainColor_border").removeClass("mainColor_color");
 	},
 	mouseover:function(){
-		debugger;
 		this.addClass("o2_appmarket_appcategory_tab_over");
 	},
 	mouseout:function(){
@@ -182,7 +182,6 @@ MWF.xApplication.AppMarketV2.Application.Main = new Class({
 			}.bind(_self),
 			function( json ){ 
 				data = json.data; 
-				debugger;
 				_self.unmask();
 				//this.clearLoading()
 			}.bind(_self),
@@ -195,7 +194,6 @@ MWF.xApplication.AppMarketV2.Application.Main = new Class({
 	},
 
 	loadIntroduceInfo: function(callback){
-		debugger;
 		var _self = this;
 		this.applicationintroducesinfoTab.getParent().getElements(".o2_appmarket_application_introduce_tab_current").removeClass("mainColor_color").removeClass("o2_appmarket_application_introduce_tab_current").addClass("o2_appmarket_application_introduce_tab");
 		this.applicationintroducesinfoTab.removeClass("o2_appmarket_application_introduce_tab").addClass("mainColor_color").addClass("o2_appmarket_application_introduce_tab_current");
@@ -240,7 +238,6 @@ MWF.xApplication.AppMarketV2.Application.Main = new Class({
 	},
 	
 	loadIntroduceDemand:function(callback){
-		debugger;
 		this.applicationintroducedemandTab.getParent().getElements(".o2_appmarket_application_introduce_tab_current").removeClass("mainColor_color").removeClass("o2_appmarket_application_introduce_tab_current").addClass("o2_appmarket_application_introduce_tab");
 		this.applicationintroducedemandTab.removeClass("o2_appmarket_application_introduce_tab").addClass("mainColor_color").addClass("o2_appmarket_application_introduce_tab_current");
 		this.applicationintroducecontent.set("html","");
@@ -250,7 +247,6 @@ MWF.xApplication.AppMarketV2.Application.Main = new Class({
 
 	},
 	loadIntroduceComment:function(callback){
-		debugger;
 		this.applicationintroducecommentTab.getParent().getElements(".o2_appmarket_application_introduce_tab_current").removeClass("mainColor_color").removeClass("o2_appmarket_application_introduce_tab_current").addClass("o2_appmarket_application_introduce_tab");
 		this.applicationintroducecommentTab.removeClass("o2_appmarket_application_introduce_tab").addClass("mainColor_color").addClass("o2_appmarket_application_introduce_tab_current");
 		this.applicationintroducecontent.set("html","");
@@ -262,43 +258,9 @@ MWF.xApplication.AppMarketV2.Application.Main = new Class({
 			});
 		}.bind(this));
 	},
-	/*
-	openLargeImage:function(e,id){
-		//alert(this.collectUrl)
-		if (this.collectUrl=="" || this.collectToken==""){
-			this.actions.CollectAction.login(//平台封装好的方法
-				function( json ){ //服务调用成功的回调函数, json为服务传回的数据
-					if (json.type && json.type=="success"){
-						data = json.data; //为变量data赋值
-						this.collectUrl = data.collectUrl;
-						this.collectToken = data.collectToken;						
-						//download large image by attimageid
-						this.openLargeImageDl(id);
-					}					
-				}.bind(this),null,false //同步执行 	
-			)    
-		}else{
-			this.openLargeImageDl(id);
-		}		
-	},
-	openLargeImageDl:function(id){
-		var downloadurl = this.collectUrl +'/o2_collect_assemble/jaxrs/attachment/download/'+id+"?c-token="+this.collectToken;
-		var content = new Element("div", {"styles": {"overflow": "auto"}});
-				var largepicdiv = new Element("div", {"styles": {"overflow": "hidden"}}).inject(content);
-				new Element("img",{"src":downloadurl}).inject(largepicdiv);
-				o2.DL.open({
-					"title": "",
-					"content": content,
-					"width": 1200,
-					"height": 800,
-					"buttonList": [
-					]
-				});
-	},
-	*/
 	recordStatus: function(){
 	    debugger;
-        return {"appid": this.options.appid};x
+        return {"appid": this.options.appid,"appname":this.options.appname};x
     },
     numberFix:function(data,n){
         var numbers = '';