/* //#ifdef H5 const url = encodeURIComponent(window.location.href.split('#')[0]); let params = 'url='+url getWeixinShareParams(params).then(res => { let {data,status,msg} = res; if(status === 10000){ let s = data; that.$wx.config({ debug: false, // 開啟調試模式,調用的所有api的返回值會在客戶端alert出來,若要查看傳入的參數,可以在pc端打開,參數信息會通過log打出,僅在pc端時才會打印。 appId: s.appid, // 必填,公眾號的唯一標識 timestamp: s.timestamp, // 必填,生成簽名的時間戳 nonceStr: s.noncestr, // 必填,生成簽名的隨機串 signature: s.signature,// 必填,簽名 jsApiList: ['onMenuShareAppMessage', 'onMenuShareTimeline'] // 必填,需要使用的JS接口列表 }); that.$wx.ready(function () { //分享到朋友 that.$wx.onMenuShareAppMessage({ title: "快戳我啊!讓您享受白菜價網購的快感", // 分享標題 desc: "先領優惠券再下單享受折上折,各種大額優惠券讓你領到手軟呦!快戳我!快戳我!", // 分享描述 link: window.location.href, // 分享鏈接 imgUrl: "https://himg.bdimg.com/sys/portrait/item/wise.1.ce97d70.5dsprhrSJv7ZbQlgHusPsg.jpg?time=4105", // 分享圖標 type: 'link', // 分享類型,music、video或link,不填默認為link success: function () { //alert("分享成功"); that.$message.success('分享成功'); }, cancel: function () { //alert("未分享!"); that.$message.success('分享取消'); } }); that.$wx.onMenuShareTimeline({ title: "快戳我!讓您享受白菜價網購的快感", // 分享標題 desc: "先領優惠券再下單享受折上折,各種大額優惠券讓你領到手軟呦!快戳我!快戳我!", // 分享描述 link: window.location.href, // 分享鏈接 imgUrl: "https://himg.bdimg.com/sys/portrait/item/wise.1.ce97d70.5dsprhrSJv7ZbQlgHusPsg.jpg?time=4105", // 分享圖標 trigger: function (res) { }, success: function (res) { that.$message.success('分享成功'); }, cancel: function (res) { that.$message.success('分享取消'); }, fail: function (res) { } }); }); } }); //#endif */