diff --git a/fangija-zsyf/config.js b/fangija-zsyf/config.js index 2107923..1131d53 100644 --- a/fangija-zsyf/config.js +++ b/fangija-zsyf/config.js @@ -1,6 +1,7 @@ /**服务端地址**/ //var BASE_PATH = "http://192.168.10.128:8084"; -var BASE_PATH = "http://192.168.10.53:8084"; +//var BASE_PATH = "http://192.168.10.53:8084"; //var BASE_PATH = "http://192.168.10.170:8084"; +var BASE_PATH = "http://192.168.10.171:8084"; /**是否显示过启动页面**/ var lauchFlag = false; \ No newline at end of file diff --git a/fangija-zsyf/js/shara/shara.js b/fangija-zsyf/js/shara/shara.js new file mode 100644 index 0000000..b77d07e --- /dev/null +++ b/fangija-zsyf/js/shara/shara.js @@ -0,0 +1,60 @@ +plus.share.getServices(function(s) { + shares = ss; + for (var i in ss ) { + var s = ss[i]; + var item = document.createElement("li"); + item.setAttribute("class", "ditem"); + item.setAttribute("onclick", (s.id == "weixin") ? "shareWeiXin(this.plusShare)" : "shareAction(this.plusShare)"); + item.innerText = s.description; + item.plusShare = s; + list.appendChild(item); + } +}, function(e) { + alert("获取分享服务列表失败:" + e.message); +}); + +function shareAction(s, ex) { + outSet("分享操作:"); + if (!s) { + outLine("无效的分享服务!"); + return; + } + if (s.authenticated) { + outLine("---已授权---"); + shareMessage(s, ex); + } else { + outLine("---未授权---"); + s.authorize(function() { + shareMessage(s, ex); + }, function(e) { + outLine("认证授权失败:" + e.code + " - " + e.message); + }); + } +} + +function shareMessage(s,ex){ + var msg={content:sharecontent.value,extra:{scene:ex}}; + if(pic&&pic.realUrl){ + msg.pictures=[pic.realUrl]; + } + + s.send( msg, function(){ + alert( "分享到\""+s.description+"\"成功! " ); + }, function(e){ + alert( "分享到\""+s.description+"\"失败: "+e.code+" - "+e.message ); + } ); +} + +function cancelAuth(){try{ + + for ( var i in shares ) { + var s = shares[i]; + if ( s.authenticated ) { + outLine( "取消\""+s.description+"\""); + } + s.forbid(); + } + // 取消授权后需要更新服务列表 + updateServices(); + outLine( "操作成功!" );}catch(e){alert(e);} +} \ No newline at end of file diff --git a/fangija-zsyf/manifest.json b/fangija-zsyf/manifest.json index c5b82b8..0a96b48 100644 --- a/fangija-zsyf/manifest.json +++ b/fangija-zsyf/manifest.json @@ -1496,7 +1496,9 @@ "fonts/mui.ttf", "images/icon-clear.png" ], - "refer": [], + "refer": [ + "views/news/newsDetail.html" + ], "priority": 0 } }, diff --git a/fangija-zsyf/views/news/newsDetail.html b/fangija-zsyf/views/news/newsDetail.html index 32af709..62d7638 100644 --- a/fangija-zsyf/views/news/newsDetail.html +++ b/fangija-zsyf/views/news/newsDetail.html @@ -23,6 +23,7 @@ +

@@ -50,6 +51,7 @@ $.config = {router: false} +