diff --git a/pages/activity_detail/activity_detail.js b/pages/activity_detail/activity_detail.js index fc0a1a4..9f5a58d 100644 --- a/pages/activity_detail/activity_detail.js +++ b/pages/activity_detail/activity_detail.js @@ -55,26 +55,7 @@ Page({ activityNo: options.activityNo == undefined ? "" : options.activityNo, groupNo: options.groupNo == undefined ? "" : options.groupNo, }); - var that = this; - wx.request({ - url: getApp().gw.hostUrl + '/mall/wxa/activity/group/wxa_code', - method: 'get', - data: { - groupNo: that.data.groupNo, - width: 80, - page: 'index/index' - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded', - 'sessionId': wx.getStorageSync('sessionId') - }, - success: function (res) { - console.log(res) - if (res.statusCode == 200) { - that.data.qrImageUrl = res.data.msg; - } - } - }) + }, /** * 生命周期函数--监听页面初次渲染完成 @@ -467,54 +448,58 @@ Page({ //打败Actionsheet,进行分享 openActionsheet: function () { - if (this.data.qrImageUrl.length == 0) { - wx.showLoading({ - title: '正在获取', - mask: true, - }); - var that = this; - wx.request({ - url: getApp().gw.hostUrl + '/mall/wxa/activity/group/wxa_code', - method: 'get', - data: { - groupNo: that.data.groupNo, - width: 80, - page: 'index/index' - }, - header: { - 'Content-Type': 'application/x-www-form-urlencoded', - 'sessionId': wx.getStorageSync('sessionId') - }, - success: function (res) { - wx.hideLoading(); - if (res.statusCode == 200) { - that.setData({ - qrImageUrl: res.data.msg, - show: true - }); - } else { - wx.showToast({ - title: '获取信息失败!', - icon: 'none', - duration: 1000 - }); - } - }, - fail: function (res) { - wx.hideLoading(); - wx.showToast({ - title: '网络错误!', - icon: 'none', - duration: 1000 - }); - } - }); - } else { - console.log("openActionsheet>>qrImageUrl:" + this.data.qrImageUrl) - this.setData({ - 'show': true - }); - } + // if (this.data.qrImageUrl.length == 0) { + // wx.showLoading({ + // title: '正在获取', + // mask: true, + // }); + // var that = this; + // wx.request({ + // url: getApp().gw.hostUrl + '/mall/wxa/activity/group/wxa_code', + // method: 'get', + // data: { + // groupNo: that.data.groupNo, + // width: 80, + // page: 'index/index' + // }, + // header: { + // 'Content-Type': 'application/x-www-form-urlencoded', + // 'sessionId': wx.getStorageSync('sessionId') + // }, + // success: function (res) { + // wx.hideLoading(); + // if (res.statusCode == 200) { + // that.setData({ + // qrImageUrl: res.data.msg, + // show: true + // }); + // } else { + // wx.showToast({ + // title: '获取信息失败!', + // icon: 'none', + // duration: 1000 + // }); + // } + // }, + // fail: function (res) { + // wx.hideLoading(); + // wx.showToast({ + // title: '网络错误!', + // icon: 'none', + // duration: 1000 + // }); + // } + // }); + // } else { + // console.log("openActionsheet>>qrImageUrl:" + this.data.qrImageUrl) + // this.setData({ + // 'show': true + // }); + // } + + this.setData({ + 'show': true + }); }, closeActionSheet: function () { @@ -542,8 +527,8 @@ Page({ */ onShareAppMessage: function () { return { - title: '1号家政', - imageUrl: this.data.qrImageUrl, + title: this.data.activityDetail.shareTitle, + imageUrl: this.data.activityDetail.sharePhoto, path: '/pages/activity_detail/activity_detail?activityNo=' + this.data.activityNo + '&groupNo=' + this.data.groupNo, }; }, diff --git a/pages/activity_detail/activity_detail.wxml b/pages/activity_detail/activity_detail.wxml index 2b0cf1d..acf77c8 100644 --- a/pages/activity_detail/activity_detail.wxml +++ b/pages/activity_detail/activity_detail.wxml @@ -57,7 +57,7 @@ - + 团长