Authored by huangyi

stage2完成

This diff could not be displayed because it is too large.
... ... @@ -25,10 +25,7 @@
// console.log(r)
// window.yo_sdk.wxShare(shareData)
// })
window.yo_sdk.wxSignature(window.yo_sdk.wxShare(shareData));
window.yo_sdk.wxShare(shareData);
</script>
</body>
</html>
... ...
... ... @@ -45,7 +45,6 @@
"eslint-loader": "^1.7.1",
"eslint-plugin-html": "^2.0.3",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"fetch-jsonp": "^1.1.3",
"file-loader": "^1.1.11",
"uglifyjs-webpack-plugin": "^2.0.1",
"url-loader": "^1.0.1",
... ...
... ... @@ -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;
... ...