Authored by xuqi

Merge branch 'hotfix/wxshare'

... ... @@ -8,6 +8,11 @@ module.exports = function(flag) {
//"逛"页面模拟数据
case 'saunter':
return {
shareLink: '',
shareDesc: '',
shareImg: '',
shareTitle: '',
//上为微信分享相关
author: {
avatar: 'http://7xidk0.com1.z0.glb.clouddn.com/avater.png',
name: '山本耀司',
... ...
... ... @@ -8,6 +8,7 @@ var $ = require('jquery'),
Mustache = require('mustache'),
ellipsis = require('mlellipsis');
require('./wxshare')();
require('lazyload');
/**
... ...
... ... @@ -3,11 +3,11 @@
* @author: yue.liu@yoho.cn
* @date;2015/3/31
*/
var $ = require('jquery'),
IScroll = require('iscroll/iscroll-probe'),
ellipsis = require('mlellipsis');
require('./wxshare')();
require('lazyload');
//lazyLoad-Fn
... ... @@ -27,6 +27,7 @@ function lazyLoad(imgs, options) {
}
$imgs.lazyload(setting);
}
/**
* 初始化Android页面
*/
... ...
... ... @@ -10,6 +10,7 @@ var $ = require('jquery'),
Mustache = require('mustache'),
timer = null;
require('./wxshare')();
require('lazyload');
/**
... ...
var $ = require('jquery');
/**
* 微信分享
*/
module.exports = function() {
var _weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage';
$.getJSON(_weChatInterface + "?pageurl=" + encodeURIComponent(location.href.split('#')[0]) + "&callback=?", function (json) {
if (json !== undefined && json !== '') {
var _appId = json.appId.toString();
var _timestamp = json.timestamp;
var _nonceStr = json.nonceStr.toString();
var _signature = json.signature.toString();
wx.config({
debug: false,
appId: _appId,
timestamp: _timestamp,
nonceStr: _nonceStr,
signature: _signature,
jsApiList: [
'checkJsApi',
'onMenuShareTimeline',
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'hideMenuItems',
'showMenuItems',
'hideAllNonBaseMenuItem',
'showAllNonBaseMenuItem',
'translateVoice',
'startRecord',
'stopRecord',
'onRecordEnd',
'playVoice',
'pauseVoice',
'stopVoice',
'uploadVoice',
'downloadVoice',
'chooseImage',
'previewImage',
'uploadImage',
'downloadImage',
'getNetworkType',
'openLocation',
'getLocation',
'hideOptionMenu',
'showOptionMenu',
'closeWindow',
'scanQRCode',
'chooseWXPay',
'openProductSpecificView',
'addCard',
'chooseCard',
'openCard'
]
});
}
});
wx.ready(function () {
var shareTitle = $('#shareTitle').val();
var shareImg = $('#shareImg').val();
var shareDesc = $('#shareDesc').val();
var shareLink = $('#shareLink').val();
var shareData = {
title: shareTitle,
desc: shareDesc,
imgUrl: shareImg,
link: shareLink,
};
wx.onMenuShareAppMessage(shareData);
wx.onMenuShareTimeline(shareData);
wx.onMenuShareQQ(shareData);
wx.onMenuShareWeibo(shareData);
});
};
\ No newline at end of file
... ...
... ... @@ -51,5 +51,10 @@
</div>
</div>
{{/ article}}
{{! 微信分享相关 }}
<input id="shareLink" type="hidden" value="{{shareLink}}">
<input id="shareDesc" type="hidden" value="{{shareDesc}}">
<input id="shareImg" type="hidden" value="{{shareImg}}">
<input id="shareTitle" type="hidden" value="{{shareTitle}}">
{{/ data}}
</div>
\ No newline at end of file
... ...
... ... @@ -6,6 +6,11 @@
{{> saunter/related_brand}}
{{> saunter/article_tag}}
{{> saunter/related_post}}
{{! 微信分享相关 }}
<input id="shareLink" type="hidden" value="{{shareLink}}">
<input id="shareDesc" type="hidden" value="{{shareDesc}}">
<input id="shareImg" type="hidden" value="{{shareImg}}">
<input id="shareTitle" type="hidden" value="{{shareTitle}}">
{{/ data}}
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -87,5 +87,10 @@
<input id="promotion" type="hidden" value="{{promotionId}}">
<input id="client-type" type="hidden" value="{{clientType}}">
<input id="content-code" type="hidden" value="{{contentCode}}">
{{! 微信分享相关 }}
<input id="shareLink" type="hidden" value="{{shareLink}}">
<input id="shareDesc" type="hidden" value="{{shareDesc}}">
<input id="shareImg" type="hidden" value="{{shareImg}}">
<input id="shareTitle" type="hidden" value="{{shareTitle}}">
{{/ data}}
</div>
\ No newline at end of file
... ...
<script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
<script>
seajs.config({
... ...