...
|
...
|
@@ -2,11 +2,15 @@ |
|
|
var httpServer = require('../utils/jsonp');
|
|
|
|
|
|
var _weChatInterface = '//action.yoho.cn/api/share/getSignPackage';//签名等相关配置,yoho公众号
|
|
|
function wx() {
|
|
|
function wxCtrl() {
|
|
|
}
|
|
|
|
|
|
wx.prototype.wxSignature = function (fun) {
|
|
|
httpServer(_weChatInterface + "?pageurl=" + encodeURIComponent(location.href.split('#')[0])).then(function (json) {
|
|
|
wxCtrl.prototype.wxSignature = function (fun) {
|
|
|
httpServer({
|
|
|
url: _weChatInterface,
|
|
|
jsonp: 'callback',
|
|
|
data: {pageurl: location.href.split('#')[0]}
|
|
|
}).then(function (json) {
|
|
|
if (!json.appId) {
|
|
|
return false;
|
|
|
} else {
|
...
|
...
|
@@ -64,7 +68,7 @@ wx.prototype.wxSignature = function (fun) { |
|
|
})
|
|
|
};
|
|
|
|
|
|
wx.prototype.wxShare = function (shareDate) {
|
|
|
wxCtrl.prototype.wxShare = function (shareDate) {
|
|
|
this.wxSignature(function () {
|
|
|
var share_data = shareDate || {
|
|
|
title: '',
|
...
|
...
|
@@ -88,4 +92,4 @@ wx.prototype.wxShare = function (shareDate) { |
|
|
|
|
|
}
|
|
|
|
|
|
module.exports = wx; |
|
|
module.exports = wxCtrl; |
...
|
...
|
|