Authored by 梁志锋

modify css

@@ -11,6 +11,19 @@ module.exports = function(flag) { @@ -11,6 +11,19 @@ module.exports = function(flag) {
11 case 'newfestival': 11 case 'newfestival':
12 return [ 12 return [
13 { 13 {
  14 + share :{
  15 + id: "1",
  16 + title: "新品节欢迎你",
  17 + share_title_main: "新品节",
  18 + share_title_sub: "哈哈哈和哈哈哈",
  19 + share_image: "http://img12.static.yhbimg.com/taobaocms/2015/08/28/10/02076e3caed758a1c18c91a0e9cae3368f.jpg?imageView/{mode}/w/{width}/h/{height}",
  20 + share_url: "http://cuxiao.m.yohobuy.com/newfestival/index?act_title=新品节&islogin=Y&share_id=1&client_type=android",
  21 + status: "1",
  22 + create_time: "1440730186",
  23 + update_time: "1440757410"
  24 + }
  25 + },
  26 + {
14 slider: { 27 slider: {
15 imgs: [ 28 imgs: [
16 { 29 {
@@ -9,6 +9,8 @@ new Swiper('.swiper-container', { @@ -9,6 +9,8 @@ new Swiper('.swiper-container', {
9 autoplay: 3000 9 autoplay: 3000
10 }); 10 });
11 11
  12 +require('./wxshare')();
  13 +
12 /** 14 /**
13 * 初始化页面功能 15 * 初始化页面功能
14 */ 16 */
  1 +var $ = require('yoho.jquery');
  2 +/**
  3 + * 微信分享
  4 + */
  5 +module.exports = function() {
  6 + var _weChatInterface = 'http://www.yohoshow.com/api/wechat/getSignPackage';
  7 +
  8 + $.getJSON(_weChatInterface + '?pageurl=' +
  9 + encodeURIComponent(location.href.split('#')[0]) + '&callback=?', function (json) {
  10 + var _appId, _timestamp, _nonceStr, _signature;
  11 +
  12 + if (json !== undefined && json !== '') {
  13 + _appId = json.appId.toString();
  14 + _timestamp = json.timestamp;
  15 + _nonceStr = json.nonceStr.toString();
  16 + _signature = json.signature.toString();
  17 +
  18 + wx.config({
  19 + debug: false,
  20 + appId: _appId,
  21 + timestamp: _timestamp,
  22 + nonceStr: _nonceStr,
  23 + signature: _signature,
  24 + jsApiList: [
  25 + 'checkJsApi',
  26 + 'onMenuShareTimeline',
  27 + 'onMenuShareAppMessage',
  28 + 'onMenuShareQQ',
  29 + 'onMenuShareWeibo',
  30 + 'hideMenuItems',
  31 + 'showMenuItems',
  32 + 'hideAllNonBaseMenuItem',
  33 + 'showAllNonBaseMenuItem',
  34 + 'translateVoice',
  35 + 'startRecord',
  36 + 'stopRecord',
  37 + 'onRecordEnd',
  38 + 'playVoice',
  39 + 'pauseVoice',
  40 + 'stopVoice',
  41 + 'uploadVoice',
  42 + 'downloadVoice',
  43 + 'chooseImage',
  44 + 'previewImage',
  45 + 'uploadImage',
  46 + 'downloadImage',
  47 + 'getNetworkType',
  48 + 'openLocation',
  49 + 'getLocation',
  50 + 'hideOptionMenu',
  51 + 'showOptionMenu',
  52 + 'closeWindow',
  53 + 'scanQRCode',
  54 + 'chooseWXPay',
  55 + 'openProductSpecificView',
  56 + 'addCard',
  57 + 'chooseCard',
  58 + 'openCard'
  59 + ]
  60 + });
  61 + }
  62 + });
  63 +
  64 + wx.ready(function () {
  65 + var shareTitle = $('#shareTitle').val();
  66 + var shareImg = $('#shareImg').val();
  67 + var shareDesc = $('#shareDesc').val();
  68 + var shareLink = $('#shareLink').val();
  69 + var shareData = {
  70 + title: shareTitle,
  71 + desc: shareDesc,
  72 + imgUrl: shareImg,
  73 + link: shareLink
  74 + };
  75 +
  76 + wx.onMenuShareAppMessage(shareData);
  77 + wx.onMenuShareTimeline(shareData);
  78 + wx.onMenuShareQQ(shareData);
  79 + wx.onMenuShareWeibo(shareData);
  80 + });
  81 +};
@@ -16,5 +16,14 @@ @@ -16,5 +16,14 @@
16 {{# newArrival}} 16 {{# newArrival}}
17 {{> newfestival/newfestival_home_newarrival}} 17 {{> newfestival/newfestival_home_newarrival}}
18 {{/ newArrival}} 18 {{/ newArrival}}
  19 +
  20 + {{# share}}
  21 + <input id="shareLink" type="hidden" value="{{share_url}}">
  22 + <input id="shareDesc" type="hidden" value="{{share_title_sub}}">
  23 + <input id="shareImg" type="hidden" value="{{share_image}}">
  24 + <input id="shareTitle" type="hidden" value="{{share_title_main}}">
  25 + {{/ share}}
  26 +
  27 +
19 {{/ data}} 28 {{/ data}}
20 </div> 29 </div>