} | } | ||||
activitySubmit(params) | activitySubmit(params) | ||||
.then(res=>{ | .then(res=>{ | ||||
console.log(res); | |||||
}) | }) | ||||
}, | }, | ||||
} | } | ||||
api_TiktokAdd(data).then(res => { | api_TiktokAdd(data).then(res => { | ||||
if (res.code === 0) { | if (res.code === 0) { | ||||
wx.reLaunch({ | |||||
url: '/package_first/pages/successPage/index', | |||||
wx.showToast({ | |||||
title: '您的图片已提交', | |||||
icon:'none' | |||||
}) | }) | ||||
setTimeout(()=>{ | |||||
wx.redirectTo({ | |||||
url: '../../pages/AttentionMethod/index', | |||||
}) | |||||
},2000) | |||||
} | } | ||||
}).finally(()=>{ | }).finally(()=>{ | ||||
wx.hideLoading(); | wx.hideLoading(); |
total, | total, | ||||
list, | list, | ||||
}) | }) | ||||
if(list.status == 0){ | |||||
data.entersList[0].isstudy = true | |||||
}else if(list.status == 1){ | |||||
data.entersList[1].isstudy = true | |||||
} | |||||
// if(list.status == 0){ | |||||
// data.entersList[0].isstudy = true | |||||
// }else if(list.status == 1){ | |||||
// data.entersList[1].isstudy = true | |||||
// } | |||||
}) | }) | ||||
}, | }, | ||||
handleDetail(e){ | handleDetail(e){ |
<view class="cotent"> | <view class="cotent"> | ||||
<view class="title"> | <view class="title"> | ||||
<view class="title_text">{{item.videoTitle}}</view> | <view class="title_text">{{item.videoTitle}}</view> | ||||
<view class="{{item.status==1?'item__tag sutdying':item.status==0?'item__tag no--sutdy':'item__tag is--sutdy'}}"> | |||||
{{item.status==1?'学习中':item.status==0?'待学习':'已学习'}} | |||||
<view class="{{item.status==2?'item__tag is--sutdy':'item__tag no--sutdy'}}"> | |||||
{{item.status==2?'已学习':'待学习'}} | |||||
</view> | </view> | ||||
</view> | </view> | ||||
<view class="title_content">{{item.videoBrief}}</view> | <view class="title_content">{{item.videoBrief}}</view> |
}else{ | }else{ | ||||
const data = { openid } | const data = { openid } | ||||
api_getIsApply(data).then(res=>{ | api_getIsApply(data).then(res=>{ | ||||
entersList[0].isJoin = res.data == 1 ? true:false | |||||
console.log(res); | |||||
entersList[0].isJoin = res.data == 2 ? true:false | |||||
this.setData({ entersList }) | this.setData({ entersList }) | ||||
}) | }) | ||||
} | } |
url: '/package_first/pages/VolunteerDetail/index?data='+ encodeURIComponent(data), | url: '/package_first/pages/VolunteerDetail/index?data='+ encodeURIComponent(data), | ||||
}) | }) | ||||
}, | }, | ||||
go_applypage(){ | |||||
wx.navigateTo({ | |||||
url: '/package_first/pages/ActivityApply/index', | |||||
}) | |||||
} | |||||
}) | }) |
</view> | </view> | ||||
<view class="activity_bottom"> | <view class="activity_bottom"> | ||||
<view> | <view> | ||||
<view class="apply" wx:if="{{item.status==2}}" bindtap="go_applypage">立即报名</view> | |||||
<view class="apply" wx:if="{{item.status==2}}" data-item="{{item}}" bindtap="showDetail">立即报名</view> | |||||
<view class="join" bindtap="showDetail" data-item="{{item}}">进入活动 》</view> | <view class="join" bindtap="showDetail" data-item="{{item}}">进入活动 》</view> | ||||
</view> | </view> | ||||
</view> | </view> |
control:false, | control:false, | ||||
statusList:{ | statusList:{ | ||||
0: '待学习', | 0: '待学习', | ||||
1: '学习中', | |||||
// 1: '学习中', | |||||
2: '已学习', | 2: '已学习', | ||||
}, | }, | ||||
classList:{ | classList:{ | ||||
0: 'no--study', | 0: 'no--study', | ||||
1: 'is--study', | |||||
// 1: 'is--study', | |||||
2: 'is--finish', | 2: 'is--finish', | ||||
}, | }, | ||||
detail: {} | detail: {} | ||||
}, | }, | ||||
onLoad(options){ | onLoad(options){ | ||||
let data = JSON.parse(decodeURIComponent(options.data)) | let data = JSON.parse(decodeURIComponent(options.data)) | ||||
data.status = data.status === 0 ? 1 : data.status | |||||
data.status = data.status === 0 ? 0 : data.status | |||||
const openid = wx.getStorageSync('openid') | const openid = wx.getStorageSync('openid') | ||||
this.setData({ | this.setData({ | ||||
detail:data, | detail:data, | ||||
openid, | openid, | ||||
control : data.status === 2 ? true : false, | control : data.status === 2 ? true : false, | ||||
}) | }) | ||||
console.log(this.data.detail) | |||||
this.getProgress() | |||||
}, | |||||
onHide(){ | |||||
this.handleEnded(this.data.detail.status) | |||||
}, | |||||
onUnload(){ | |||||
this.handleEnded(this.data.detail.status) | |||||
}, | }, | ||||
saveTime(e){ | saveTime(e){ | ||||
let time = e.detail.currentTime | let time = e.detail.currentTime | ||||
this.setData({ | this.setData({ | ||||
}) | }) | ||||
}, | }, | ||||
handleEnded(status){ | |||||
handleEnded(){ | |||||
const isNumber = typeof(status) === 'number' | const isNumber = typeof(status) === 'number' | ||||
const params = { | const params = { | ||||
status: status === 2 ? 2 : 1, | |||||
status: 2, | |||||
videoId: this.data.detail.id, | videoId: this.data.detail.id, | ||||
openid: this.data.openid, | openid: this.data.openid, | ||||
videoProgress: isNumber ? this.data.videoProgress : 0 | videoProgress: isNumber ? this.data.videoProgress : 0 |