Browse Source

Merge branch 'xieying' of gitadmin/tuoheng_qmhh_web into develop

xieying
xieying 1 year ago
parent
commit
5a438990b5
5 changed files with 45 additions and 16 deletions
  1. +17
    -4
      package_first/pages/ActivityApply/index.js
  2. +1
    -3
      package_first/pages/AddPicture/index.js
  3. +13
    -2
      package_first/pages/AttentionMethod/index.js
  4. +12
    -5
      package_first/pages/ProtectionActivity/index.js
  5. +2
    -2
      package_first/pages/VolunteerDetail/index.js

+ 17
- 4
package_first/pages/ActivityApply/index.js View File

*/ */
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)
}
}) })
}, },



+ 1
- 3
package_first/pages/AddPicture/index.js View File

icon:'none' icon:'none'
}) })
setTimeout(()=>{ setTimeout(()=>{
wx.redirectTo({
url: '../../pages/AttentionMethod/index',
})
wx.navigateBack()
},2000) },2000)
} }
}).finally(()=>{ }).finally(()=>{

+ 13
- 2
package_first/pages/AttentionMethod/index.js View File

* 页面的初始数据 * 页面的初始数据
*/ */
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`,
}) })

+ 12
- 5
package_first/pages/ProtectionActivity/index.js View File

* 页面的初始数据 * 页面的初始数据
*/ */
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({

+ 2
- 2
package_first/pages/VolunteerDetail/index.js View File

}) })
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)
}) })
} }
}, },

Loading…
Cancel
Save