;(function($){ "use strict"; var base = 'https://www.17xs.org'; var dataUrl = { projList: base + '/project/findProjectsByIds.do', //项目列表 }; var vm = new Vue({ el: '#pageContainer', data: { projList: [], }, create(){ }, }); var project = { init: function(){ $.ajax({ type: "post", url: dataUrl.projList, data: { ids:[5023,5024,5027,5028,5029,5033,5038] }, success: function(res) { // projList vm.projList=res.data $.ajax({ type: "get", url: 'https://www.17xs.org/vote/share.do', data: {url: location.href}, success: function(res){ if(res.code == 1){ var r = res.result; vm.appId = r.appId; vm.timestamp = r.timestamp; vm.noncestr = r.noncestr; vm.signature = r.signature; project.wxShare(); }else{ this.showTips('分享参数出错!'); } } }); } }); }, tab:function () { }, wxShare:function(){ wx.config({ debug : false, appId : vm.appId, timestamp : vm.timestamp, nonceStr : vm.noncestr, signature : vm.signature, jsApiList : [ 'onMenuShareAppMessage', 'onMenuShareTimeline','previewImage' ] }); wx.ready(function(){ wx.onMenuShareAppMessage({ title : "“山茶花开”甬城公益人赋能训练营", // 分享标题 desc : "提升社会组织筹资能力,促进公益慈善事业发展", // 分享描述 link : 'https://www.17xs.org/webhtml/view/h5/special-subject/flower-page.html', // 分享链接 imgUrl :"https://www.17xs.org/res/images/special-img/top.gif", // 分享图标 type : 'link', // 分享类型,music、video或link,不填默认为link dataUrl : '', // 如果type是music或video,则要提供数据链接,默认为空 success : function() { //用户确认分享后执行的回调函数 }, cancel : function() { //用户取消分享后执行的回调函数 } }); wx.onMenuShareTimeline({ title :"“山茶花开”甬城公益人赋能训练营", // 分享标题 link : 'https://www.17xs.org/webhtml/view/h5/special-subject/flower-page.html', // 分享链接 imgUrl : "https://www.17xs.org/res/images/special-img/top.gif", // 分享图标 success : function() { }, cancel : function() { // 用户取消分享后执行的回调函数 } }); }); }, }; $(function(){ project.init(); }); })(jQuery);