dever hace 6 años
padre
commit
8f7ac8bb62
Se han modificado 3 ficheros con 10 adiciones y 9 borrados
  1. 4 0
      kissy/public/share/mshare.js
  2. 5 8
      tm/template_dir/bottom.html
  3. 1 1
      tm/template_dir/header.html

+ 4 - 0
kissy/public/share/mshare.js

@@ -1,3 +1,7 @@
+function WX_share(b,c,d,e){var f=navigator.userAgent,g=-1<f.indexOf("Android")||-1<f.indexOf("Adr");f.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)&&(function(a){window.WebViewJavascriptBridge?a(WebViewJavascriptBridge):document.addEventListener("WebViewJavascriptBridgeReady",function(){a(WebViewJavascriptBridge)},!1)}(function(a){a.init(function(a,b){alert("Received message: "+a);b&&b("Right back atcha")});a.send({url:b,typeid:8,depict:c,title:d,picture:e});a.send("Please respond to this",function(a){alert("Javascript got its response",
+a)})}),window.webkit.messageHandlers.JS_Call_OC_login.postMessage({url:b,typeid:8,depict:c,title:d,picture:e}));g&&Android.share(b,c,d,e)};
+
+
 ;(function($, window, document, undefined) {
     function regist(mName, module) {
         if (typeof window.brickjs === "undefined") {

+ 5 - 8
tm/template_dir/bottom.html

@@ -49,23 +49,19 @@ function share_button(e, title, url, img, content) {
     var u = navigator.userAgent.toLowerCase();
     var isApple = /iphone|ipad|ipod|ios/i.test(u);
     var isAndroid = /android/i.test(u);
-    if (isApple) {
+    if (isApple || isAndroid) {
         e.show();
         e.click(function()
         {
-            share_ios(title, url, img, content);
-        })
-    } else if(isAndroid && window.AndroidBridge) {
-        e.show();
-        e.click(function()
-        {
-            share_android(title, url, img, content);
+            WX_share(url, content, title, img);
         })
+        
     } else {
         e.hide();
     }
 }
 
+/*
 function share_ios(title, url, img, content) {
     window.location = 'myscheme://share_title/' + title + '/share_url/' + url + '/share_img/' + img + '/share_content/' + content;
 }
@@ -73,6 +69,7 @@ function share_ios(title, url, img, content) {
 function share_android(title, url, img, content) {
     window.AndroidBridge.openShare(title, url, img, content);
 }
+*/
 
 var URL = window.location.href, site;
 site = 1;

+ 1 - 1
tm/template_dir/header.html

@@ -36,5 +36,5 @@
 </script>
 <script src="<{$web_cfg.cdn}>/public/share/zepto.min.js"></script>
 <script src="<{$web_cfg.cdn}>/public/share/jweixin.js?2"></script>
-<script src="<{$web_cfg.cdn}>/public/share/mshare.js?21"></script>
+<script src="<{$web_cfg.cdn}>/public/share/mshare.js?22"></script>
 <body id="body">