Skip to content

Commit

Permalink
v1.2.0 update to WX_JSSDK1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cycjimmy committed Oct 7, 2018
1 parent 081ebaa commit eab8ac1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 39 deletions.
27 changes: 15 additions & 12 deletions build/WxShare.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/WxShare.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/WxShare.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "weixin-share",
"version": "1.0.1",
"version": "1.2.0",
"description": "Easier way to call Wechat share on web page.",
"main": "build/WxShare.js",
"scripts": {
Expand All @@ -24,22 +24,22 @@
},
"homepage": "https://github.com/cycdpo/weixin-share#readme",
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/core": "^7.1.2",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.0",
"@babel/preset-env": "^7.1.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.4",
"clean-webpack-plugin": "^0.1.19",
"cross-env": "^5.2.0",
"jest": "^23.5.0",
"uglify-js": "^3.4.8",
"uglifyjs-webpack-plugin": "^1.3.0",
"webpack": "^4.17.1",
"webpack-cli": "^3.1.0"
"jest": "^23.6.0",
"uglify-js": "^3.4.9",
"uglifyjs-webpack-plugin": "^2.0.1",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.2"
},
"dependencies": {
"awesome-js-funcs": "^0.1.2",
"awesome-js-funcs": "^0.1.4",
"object-assign": "^4.1.1"
}
}
20 changes: 8 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
_instance = new CreateInstance()
;

const WX_JSSDK_URL = 'https://res.wx.qq.com/open/js/jweixin-1.3.2.js';
const WX_JSSDK_URL = 'https://res.wx.qq.com/open/js/jweixin-1.4.0.js';

export default class WxShare {
constructor() {
Expand All @@ -21,7 +21,7 @@ export default class WxShare {
this.readyCallBack = null;

this.defaultShare = {
title: '',
title: document.title,
desc: '',
link: window.location.href.replace(/(\?|#).*/g, ''),
imgUrl: '',
Expand Down Expand Up @@ -54,7 +54,7 @@ export default class WxShare {
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareQZone',
'onMenuShareWeibo'
'onMenuShareWeibo',
]
}) {
this.wxConfig = {
Expand Down Expand Up @@ -94,20 +94,14 @@ export default class WxShare {
* share
* @param shareData
* {
* imgUrl: '',
* link: '',
* title: '',
* link: '',
* desc: '',
* type: '', music/video/link(default)
* dataUrl: '', if music/video type
* trigger:() => {},
* success:() => {},
* cancel:() => {},
* fail:() => {},
* imgUrl: ''
* }
*/
share(shareData = {}) {
if(!this._isInitDefaultShare) {
if (!this._isInitDefaultShare) {
this.setDefaultShare(shareData);
} else {
shareData = objectAssign({}, this.defaultShare, shareData);
Expand All @@ -124,6 +118,8 @@ export default class WxShare {
this.wx.onMenuShareQQ(shareData);
this.wx.onMenuShareQZone(shareData);
this.wx.onMenuShareWeibo(shareData);
this.wx.updateAppMessageShareData(shareData, (res) => console.log(res));
this.wx.updateTimelineShareData(shareData, (res) => console.log(res));
});
};

Expand Down

0 comments on commit eab8ac1

Please sign in to comment.