*/ | */ | ||||
data: { | data: { | ||||
activityId: null, | activityId: null, | ||||
activityInfo:{}, | |||||
userInfo: { | userInfo: { | ||||
applyName: '', | applyName: '', | ||||
applyPhone: '' | applyPhone: '' | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad(options) { | onLoad(options) { | ||||
const activityId = options.id | |||||
const activityInfo = JSON.parse(decodeURIComponent(options.activityInfo)) | |||||
this.setData({ | this.setData({ | ||||
activityId | |||||
activityInfo | |||||
}) | }) | ||||
}, | }, | ||||
return | return | ||||
} | } | ||||
const openid = wx.getStorageSync('openid') | const openid = wx.getStorageSync('openid') | ||||
const userInfo = wx.getStorageSync('userInfo') | |||||
const params = { | const params = { | ||||
...this.data.userInfo, | ...this.data.userInfo, | ||||
openid, | openid, | ||||
activityId: this.data.activityId | |||||
nickname:userInfo.nickname, | |||||
activityId: this.data.activityInfo.id, | |||||
activityTitle:this.data.activityInfo.activityTitle | |||||
} | } | ||||
activitySubmit(params) | activitySubmit(params) | ||||
.then(res=>{ | .then(res=>{ | ||||
console.log(res); | |||||
if(res.code==0){ | |||||
wx.showToast({ | |||||
title: '报名成功', | |||||
icon:"none" | |||||
}), | |||||
setTimeout(()=>{ | |||||
wx.navigateBack() | |||||
} | |||||
,2000) | |||||
} | |||||
}) | }) | ||||
}, | }, | ||||
icon:'none' | icon:'none' | ||||
}) | }) | ||||
setTimeout(()=>{ | setTimeout(()=>{ | ||||
wx.redirectTo({ | |||||
url: '../../pages/AttentionMethod/index', | |||||
}) | |||||
wx.navigateBack() | |||||
},2000) | },2000) | ||||
} | } | ||||
}).finally(()=>{ | }).finally(()=>{ |
* 页面的初始数据 | * 页面的初始数据 | ||||
*/ | */ | ||||
data: { | data: { | ||||
status:null | |||||
}, | }, | ||||
/** | /** | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||
onLoad(options) { | onLoad(options) { | ||||
let status = options.status | |||||
this.setData({ | |||||
status | |||||
}) | |||||
}, | }, | ||||
/** | /** | ||||
}, | }, | ||||
goPage(e){ | goPage(e){ | ||||
console.log(); | |||||
if(this.data.status==1){ | |||||
wx.showToast({ | |||||
title: '您已参加该活动', | |||||
icon:"none" | |||||
}) | |||||
return | |||||
} | |||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url: `/package_first/pages/AddPicture/index`, | url: `/package_first/pages/AddPicture/index`, | ||||
}) | }) |
* 页面的初始数据 | * 页面的初始数据 | ||||
*/ | */ | ||||
data: { | data: { | ||||
tikStatus:null, | |||||
entersList:[ | entersList:[ | ||||
{ | { | ||||
title:'关注抖音', | title:'关注抖音', | ||||
}else{ | }else{ | ||||
const data = { openid } | const data = { openid } | ||||
api_getIsApply(data).then(res=>{ | api_getIsApply(data).then(res=>{ | ||||
console.log(res); | |||||
let tikStatus = res.data | |||||
entersList[0].isJoin = res.data == 2 ? true:false | entersList[0].isJoin = res.data == 2 ? true:false | ||||
this.setData({ entersList }) | |||||
this.setData({ entersList,tikStatus }) | |||||
}) | }) | ||||
} | } | ||||
}, | }, | ||||
goPage(e){ | goPage(e){ | ||||
const { path } = e.currentTarget.dataset | const { path } = e.currentTarget.dataset | ||||
wx.navigateTo({ | |||||
url: path | |||||
}) | |||||
if(path=='/package_first/pages/AttentionMethod/index'){ | |||||
wx.navigateTo({ | |||||
url: '/package_first/pages/AttentionMethod/index?status='+this.data.tikStatus | |||||
}) | |||||
}else{ | |||||
wx.navigateTo({ | |||||
url: path | |||||
}) | |||||
} | |||||
}, | }, | ||||
homepage(e){ | homepage(e){ | ||||
wx.switchTab({ | wx.switchTab({ |
}) | }) | ||||
return | return | ||||
} | } | ||||
if(this.data.status === 3){ | if(this.data.status === 3){ | ||||
let activityInfo = JSON.stringify(this.data.activityInfo) | |||||
wx.navigateTo({ | wx.navigateTo({ | ||||
url:"/package_first/pages/ActivityApply/index?id=" + this.data.activityInfo.id | |||||
url:"/package_first/pages/ActivityApply/index?activityInfo=" + encodeURIComponent(activityInfo) | |||||
}) | }) | ||||
} | } | ||||
}, | }, |