|
@@ -7,7 +7,7 @@ Page({
|
|
|
go() {
|
|
|
// + this.data.activeId,
|
|
|
wx.navigateTo({
|
|
|
- url: '/pages/onSiteActivity/onSiteActivity?id='+ this.data.activeId
|
|
|
+ url: '/pages/onSiteActivity/onSiteActivity?id=' + this.data.activeId
|
|
|
})
|
|
|
},
|
|
|
// getNum() {
|
|
@@ -28,29 +28,44 @@ Page({
|
|
|
// }
|
|
|
// })
|
|
|
// },
|
|
|
- sign(){
|
|
|
+ sign() {
|
|
|
wx.request({
|
|
|
url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.activeId + '/sign',
|
|
|
method: "get",
|
|
|
success: (res) => {
|
|
|
- console.log(res,'我签到的结果')
|
|
|
+ console.log(res, '我签到的结果')
|
|
|
if (res.data.code == 0) {
|
|
|
- this.setData({
|
|
|
- myNum: res.data.activeNumber
|
|
|
- })
|
|
|
+ if (res.data.activeNumber == 0) {
|
|
|
+ wx.showModal({
|
|
|
+ title: '您未报名此活动',
|
|
|
+ content: '请联系客服呦',
|
|
|
+ showCancel: false,
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ wx.redirectTo({
|
|
|
+ url: '/pages/index/index',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ myNum: res.data.activeNumber
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
onLoad: function (options) {
|
|
|
- console.log(decodeURIComponent(options.q),'我是签到页带过来的参数');
|
|
|
- let url=decodeURIComponent(options.q);
|
|
|
+ console.log(decodeURIComponent(options.q), '我是签到页带过来的参数');
|
|
|
+ let url = decodeURIComponent(options.q);
|
|
|
let after = url.split('id=')[1];
|
|
|
tool.openidStatus().then(result => {
|
|
|
this.setData({
|
|
|
openid: result[0],
|
|
|
sessionkey: result[1],
|
|
|
- activeId:after
|
|
|
+ activeId: after
|
|
|
})
|
|
|
this.sign();
|
|
|
})
|