diff --git a/config/config.js b/config/config.js index e91985d..20d00f3 100755 --- a/config/config.js +++ b/config/config.js @@ -155,6 +155,10 @@ var config = { * 描述 */ getWeapNote:'/mall/getWeapNote', + /** + * 商场信息(小程序分享) + */ + getMallInfo: '/mall/mallInfo', /** * 小程序获取游戏路径 */ diff --git a/pages/main/index.js b/pages/main/index.js index ce6d665..6c8700f 100644 --- a/pages/main/index.js +++ b/pages/main/index.js @@ -34,6 +34,8 @@ Page({ alphaData: null, swiperCurrent: 0, title: null, + weappShareTitle:'',//分享标题 + weappShareCoverImg:'',//分享图片 desc: null, scrollTop: 0, showGame: false, @@ -365,6 +367,7 @@ Page({ that.getUserInfo(); that.getBannerlist(); that.topicShow(); + that.getMallInfo(app.globalData.token); if (app.couponChannelListCallback) { app.couponChannelListCallback(app.globalData.token); } @@ -460,6 +463,28 @@ Page({ this.alphaClick(); }) }, + /** + * mallinfo + */ + getMallInfo: function (token) { + let that = this; + Http.get({ + url: config.api.getMallInfo, + data: { + token: token, + } + }).then(res => { + console.log(res.data+"eeee"); + that.setData({ + weappShareTitle: res.data.weappShareTitle, + weappShareCoverImg: res.data.weappShareCoverImg, + }); + }) + .catch(err => { + + }) + ; + }, /** * banner */ @@ -617,8 +642,9 @@ Page({ // 用户点击右上角分享 onShareAppMessage: function() { return { - title: this.data.title, - desc: this.data.desc, + title: this.data.weappShareTitle, + imageUrl: this.data.weappShareCoverImg, + // desc: this.data.desc, success: function(res) { wx.showToast({ title: "分享成功",