Authored by 梁志锋

modify css

... ... @@ -11,6 +11,19 @@ module.exports = function(flag) {
case 'newfestival':
return [
{
share :{
id: "1",
title: "新品节欢迎你",
share_title_main: "新品节",
share_title_sub: "哈哈哈和哈哈哈",
share_image: "http://img12.static.yhbimg.com/taobaocms/2015/08/28/10/02076e3caed758a1c18c91a0e9cae3368f.jpg?imageView/{mode}/w/{width}/h/{height}",
share_url: "http://cuxiao.m.yohobuy.com/newfestival/index?act_title=新品节&islogin=Y&share_id=1&client_type=android",
status: "1",
create_time: "1440730186",
update_time: "1440757410"
}
},
{
slider: {
imgs: [
{
... ...
... ... @@ -9,6 +9,8 @@ new Swiper('.swiper-container', {
autoplay: 3000
});
require('./wxshare')();
/**
* 初始化页面功能
*/
... ...
var $ = require('yoho.jquery');
/**
* 微信分享
*/
module.exports = function() {
var _weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage';
$.getJSON(_weChatInterface + '?pageurl=' +
encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function (json) {
var _appId, _timestamp, _nonceStr, _signature;
if (json !== undefined && json !== '') {
_appId = json.appId.toString();
_timestamp = json.timestamp;
_nonceStr = json.nonceStr.toString();
_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
... ...
... ... @@ -16,5 +16,14 @@
{{# newArrival}}
{{> newfestival/newfestival_home_newarrival}}
{{/ newArrival}}
{{# share}}
<input id="shareLink" type="hidden" value="{{share_url}}">
<input id="shareDesc" type="hidden" value="{{share_title_sub}}">
<input id="shareImg" type="hidden" value="{{share_image}}">
<input id="shareTitle" type="hidden" value="{{share_title_main}}">
{{/ share}}
{{/ data}}
</div>
\ No newline at end of file
... ...