|
@@ -139,11 +139,91 @@ MShare.prototype = {
|
|
|
sendMessageCallback: this._cfgs.sendMessageCallback,
|
|
|
shareQQCallback: this._cfgs.shareQQCallback
|
|
|
}
|
|
|
- var url = VG.conf.root_domain + '?c=WeixinJsSDK&a=AjaxConfigData&site=' + wxCfgs.site + '&thisPageUrl=' + encodeURIComponent(location.href) + '&callback=?';
|
|
|
- alert(url);
|
|
|
- $.getJSON(url, function(d) {
|
|
|
+
|
|
|
+ var url = VG.conf.root_domain + '?c=WeixinJsSDK&a=AjaxConfigData';
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ dataType:'jsonp',
|
|
|
+ jsonp: 'jsonp_cb',
|
|
|
+ url: url,
|
|
|
+ data: {"thisPageUrl":encodeURIComponent(location.href)},
|
|
|
+ success:function(data){
|
|
|
+ var d = data.msg;
|
|
|
+ wx.config({
|
|
|
+
|
|
|
+ appId: d.appId,
|
|
|
+ timestamp: d.timestamp,
|
|
|
+ nonceStr: d.nonceStr,
|
|
|
+ signature: d.signature,
|
|
|
+ jsApiList: [
|
|
|
+ 'onMenuShareTimeline',
|
|
|
+ 'onMenuShareAppMessage',
|
|
|
+ 'onMenuShareQQ'
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ wx.ready(function() {
|
|
|
+ wx.onMenuShareAppMessage({
|
|
|
+ title: wxCfgs.title,
|
|
|
+ desc: wxCfgs.desc,
|
|
|
+ link: wxCfgs.link,
|
|
|
+ imgUrl: wxCfgs.img_url,
|
|
|
+ success: function(res) {
|
|
|
+ wxCfgs.sendMessageCallback('success', res)
|
|
|
+ self._shareLog(0, 1);
|
|
|
+ },
|
|
|
+ cancel: function(res) {
|
|
|
+ wxCfgs.sendMessageCallback('cancel', res)
|
|
|
+ self._shareLog(0, 2);
|
|
|
+ },
|
|
|
+ fail: function(res) {
|
|
|
+ wxCfgs.sendMessageCallback('fail', res)
|
|
|
+ self._shareLog(0, 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ wx.onMenuShareTimeline({
|
|
|
+ title: wxCfgs.title,
|
|
|
+ link: wxCfgs.link,
|
|
|
+ imgUrl: wxCfgs.img_url,
|
|
|
+ success: function(res) {
|
|
|
+ wxCfgs.timelineCallback('success', res)
|
|
|
+ self._shareLog(1, 1);
|
|
|
+ },
|
|
|
+ cancel: function(res) {
|
|
|
+ wxCfgs.timelineCallback('cancel', res)
|
|
|
+ self._shareLog(1, 2);
|
|
|
+ },
|
|
|
+ fail: function(res) {
|
|
|
+ wxCfgs.timelineCallback('fail', res)
|
|
|
+ self._shareLog(1, 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ wx.onMenuShareQQ({
|
|
|
+ title: wxCfgs.title,
|
|
|
+ link: wxCfgs.link,
|
|
|
+ imgUrl: wxCfgs.img_url,
|
|
|
+ success: function(res) {
|
|
|
+ wxCfgs.shareQQCallback('success', res)
|
|
|
+ self._shareLog(2, 1);
|
|
|
+ },
|
|
|
+ cancel: function(res) {
|
|
|
+ wxCfgs.shareQQCallback('cancel', res)
|
|
|
+ self._shareLog(2, 2);
|
|
|
+ },
|
|
|
+ fail: function(res) {
|
|
|
+ wxCfgs.shareQQCallback('fail', res)
|
|
|
+ self._shareLog(2, 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async:'true',
|
|
|
+ timeout: 3000
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ $.getJSON(VG.conf.root_domain + '?c=WeixinJsSDK&a=AjaxConfigData&site=' + wxCfgs.site + '&thisPageUrl=' + encodeURIComponent(location.href) + '&callback=?', function(d) {
|
|
|
var d = d.msg;
|
|
|
- alert(d)
|
|
|
if (d) {
|
|
|
wx.config({
|
|
|
|
|
@@ -213,6 +293,7 @@ MShare.prototype = {
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
+ */
|
|
|
|
|
|
},
|
|
|
|