|
@@ -43,6 +43,37 @@
|
|
<{/if}>
|
|
<{/if}>
|
|
<{if !$notShowWeixinShare && !$weixinShare.notAllow}>
|
|
<{if !$notShowWeixinShare && !$weixinShare.notAllow}>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
|
|
+
|
|
|
|
+function share_button(e, title, url, img, content) {
|
|
|
|
+ console.log(title);
|
|
|
|
+ var u = navigator.userAgent.toLowerCase();
|
|
|
|
+ var isApple = /iphone|ipad|ipod|ios/i.test(u);
|
|
|
|
+ var isAndroid = /android/i.test(u);
|
|
|
|
+ if (isApple) {
|
|
|
|
+ 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);
|
|
|
|
+ })
|
|
|
|
+ } 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;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function share_android(title, url, img, content) {
|
|
|
|
+ window.AndroidBridge.openShare(title, url, img, content);
|
|
|
|
+}
|
|
|
|
+
|
|
var URL = window.location.href, site;
|
|
var URL = window.location.href, site;
|
|
site = 1;
|
|
site = 1;
|
|
|
|
|
|
@@ -73,25 +104,38 @@ new brickjs.MShare({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+if ($('.share_button').length) {
|
|
|
|
+ share_button($('.share_button'), '<{$weixinShare.title}>', '<{$web_cfg.url}>', '<{$weixinShare.imgUrl}>', '<{$weixinShare.content}>');
|
|
|
|
+}
|
|
<{else}>
|
|
<{else}>
|
|
|
|
+
|
|
|
|
+var url = '<{if $weixinShare.jump_url}><{$weixinShare.jump_url}><{else}><{$web_cfg.url}><{/if}>';
|
|
|
|
+var title = '<{if $weixinShare.title}><{$weixinShare.title}><{else}><{$platform.weixinShare_title}><{/if}>';
|
|
|
|
+var img = '<{if $weixinShare.imgUrl}><{$weixinShare.imgUrl}><{else}><{$platform.weixinShare_img_url}><{/if}>';
|
|
|
|
+var content = '<{if $weixinShare.content}><{$weixinShare.content}><{else}><{$platform.weixinShare_content}><{/if}>';
|
|
|
|
+
|
|
|
|
+if ($('.share_button').length) {
|
|
|
|
+ share_button($('.share_button'), title, url, img, content);
|
|
|
|
+}
|
|
|
|
+
|
|
new brickjs.MShare({
|
|
new brickjs.MShare({
|
|
website : 'sg',
|
|
website : 'sg',
|
|
site: site,
|
|
site: site,
|
|
catalog: "",
|
|
catalog: "",
|
|
- sUrl: "<{if $weixinShare.jump_url}><{$weixinShare.jump_url}><{else}><{$web_cfg.url}><{/if}>", //分享地址
|
|
+ sUrl: url, //分享地址
|
|
- title: "<{if $weixinShare.title}><{$weixinShare.title}><{else}><{$platform.weixinShare_title}><{/if}>",
|
|
+ title: title,
|
|
- imgUrl: "<{if $weixinShare.imgUrl}><{$weixinShare.imgUrl}><{else}><{$platform.weixinShare_img_url}><{/if}>",
|
|
+ imgUrl: img,
|
|
imgWidth: "640",
|
|
imgWidth: "640",
|
|
imgHeight: "640",
|
|
imgHeight: "640",
|
|
source_id : 1,
|
|
source_id : 1,
|
|
source_table : 'onepage',
|
|
source_table : 'onepage',
|
|
- desc: "<{if $weixinShare.content}><{$weixinShare.content}><{else}><{$platform.weixinShare_content}><{/if}>",
|
|
+ desc: content,
|
|
appKey: {
|
|
appKey: {
|
|
tsina: "2412621184"
|
|
tsina: "2412621184"
|
|
},
|
|
},
|
|
ralateUid: '1658402750',
|
|
ralateUid: '1658402750',
|
|
wxGuide: {
|
|
wxGuide: {
|
|
- imgUrl: '<{if $weixinShare.imgUrl}><{$weixinShare.imgUrl}><{else}><{$platform.weixinShare_img_url}><{/if}>',
|
|
+ imgUrl: img,
|
|
width: 100,
|
|
width: 100,
|
|
height: 100,
|
|
height: 100,
|
|
style: {
|
|
style: {
|