Browse Source

no message

feature/v1.1.0
xpz2018 7 years ago
parent
commit
0a353e2f43
1 changed files with 99 additions and 4 deletions
  1. 103
      pages/activity_detail/activity_detail.js

103
pages/activity_detail/activity_detail.js

@ -43,6 +43,7 @@ Page({
name: '朋友圈', name: '朋友圈',
icon: '../../images/moments_ico.png' icon: '../../images/moments_ico.png'
}], }],
qrImageUrl: "",
}, },
/** /**
@ -53,7 +54,26 @@ Page({
activityNo: options.activityNo == undefined ? "" : options.activityNo, activityNo: options.activityNo == undefined ? "" : options.activityNo,
groupNo: options.groupNo == undefined ? "" : options.groupNo, 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;
}
}
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
@ -312,7 +332,7 @@ Page({
this.groupOpenOrJoin(url); this.groupOpenOrJoin(url);
} else { } else {
//团长与参与人立即预约 //团长与参与人立即预约
this.openActionsheet();
} }
} else if (that.data.status == 90){ } else if (that.data.status == 90){
//拼团失败 //拼团失败
@ -433,10 +453,85 @@ 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 {
this.setData({
'show': true
});
}
},
closeActionSheet: function () {
this.setData({
'show': false
});
},
clickAction({ detail }) {
// 如果是分享按钮被点击, 不处理关闭
const { index } = detail;
if (index === 0) {
return
} else if (index == 1) {
// this.showMomentImage();
}
this.setData({
[`show`]: false,
[`actions[${index}].loading`]: false
});
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
}
return {
title: '1号家政',
imageUrl: this.data.qrImageUrl,
path: '/pages/index/index',
};
},
}) })
Loading…
Cancel
Save