修改bug,修改活动相关

This commit is contained in:
Renpc-kilig 2020-07-15 17:13:45 +08:00
parent 6d7a054d66
commit 98a4feffd7
9 changed files with 309 additions and 12 deletions

View File

@ -72,7 +72,15 @@ Page({
}
}, function(code, data) {
if('200' == code) {
data.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + data.activityImage;
var imageArr = data.activityImage.split(',')
if(imageArr.length > 1) {
for(var item of data.activityImage.split(',')) {
item = app.activityUrl + '/route/file/downloadfile/true/' + item
}
}else {
data.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + data.activityImage
}
self.setData({
dataMap: data
})

View File

@ -41,9 +41,9 @@
</view>
</view>
</view>
<view class="sign-box" bindtap="goSign" data-id="{{dataMap.activityLibraryId}}" wx-if="{{dataMap.activityState == '3' && dataMap.isEnroll == ''}}">
<view class="sign-box" bindtap="goSign" data-id="{{dataMap.activityLibraryId}}" wx-if="{{dataMap.activityState == '3'}}">
<view class="sign-btn">报名</view>
</view>
<view class="sign-box" bindtap="cancel" data-id="{{dataMap.activityLibraryId}}" wx-if="{{dataMap.activityState != '6' && dataMap.activityState != '7' && dataMap.activityState != '99' && dataMap.isEnroll != ''}}">
<!-- <view class="sign-box" bindtap="cancel" data-id="{{dataMap.activityLibraryId}}" wx-if="{{dataMap.activityState != '6' && dataMap.activityState != '7' && dataMap.activityState != '99' && dataMap.isEnroll != ''}}">
<view class="sign-btn">取消报名</view>
</view>
</view> -->

View File

@ -76,12 +76,15 @@ Page({
}, function(code, data) {
console.log(data)
if('200' == code) {
wx.navigateTo({
url: '../activitySign/activitySign?id=' + self.data.activityId
})
app.dialog.msg('报名成功');
setTimeout(function(){
wx.navigateTo({
url: '../index/index'
})
}, 1000)
}
}, function() {
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
})
@ -109,7 +112,14 @@ Page({
}
}, function(code, data) {
if('200' == code) {
data.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + data.activityImage;
var imageArr = data.activityImage.split(',')
if(imageArr.length > 1) {
for(var item of data.activityImage.split(',')) {
item = app.activityUrl + '/route/file/downloadfile/true/' + item
}
}else {
data.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + data.activityImage
}
self.setData({
dataMap: data
})

View File

@ -104,6 +104,14 @@ Page({
},
})
},
/**
* 跳转到我的活动
*/
toMyJoinActivity: function() {
wx.navigateTo({
url: '../myActivity/myActivity',
})
},
/**
* 跳转到我的预订列表
*/

View File

@ -19,9 +19,9 @@
<image src="../../images/friend.png"></image>
<view class="title">我的发布</view>
</view> -->
<view class="main-box">
<view class="main-box" bindtap="toMyJoinActivity">
<image src="../../images/my-sign.png"></image>
<view class="title">我的报名</view>
<view class="title">我的活动</view>
</view>
<!-- <view class="main-box">
<image src="../../images/my-comment.png"></image>

View File

@ -0,0 +1,147 @@
// pages/volunteer/volunteer.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
token: '',
dataMap: [],
type: '1'
},
getToken: function() {
var self = this;
return new Promise(resolve =>{
wx.getStorage({
key: 'token',
success(res) {
self.setData({
token: res.data
})
return resolve();
}
})
})
},
myjoinActivity: function() {
var self = this;
app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/myjoinactivity', []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
console.log(data)
self.setData({
dataMap: data.rows
})
}
}, function() {
}, function() {
})
},
/**
*
* @param {查看活动详情} e
*/
activityDetail: function(e) {
var id = e.currentTarget.dataset.activityid;
wx.navigateTo({
url: '../activityDetail/activityDetail?id=' + id
})
},
/**
*
* @param {取消报名} e
*/
cancelApply: function(e) {
var applyId = e.currentTarget.dataset.applyid;
var activityId = e.currentTarget.dataset.activityid;
wx.showModal({
title: '提示',
content: '确定要退出吗?',
success: function (sm) {
if (sm.confirm) {
app.restAjax.get(app.restAjax.path(app.activityUrl + '/app/activityuserapply/cancelapply/' + activityId + '/' + applyId, []),
{}, {
headers: {
token: self.data.token
}
}, function(code, data) {
if('200' == code) {
self.onLoad()
}
}, function() {
}, function() {
})
} else if (sm.cancel) {
}
}
})
var self = this;
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getToken().then(result => {
this.myjoinActivity();
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"enablePullDownRefresh": true
}

View File

@ -0,0 +1,15 @@
<view class="team">
<view class="team-box" bindtap="toTeamDetail"
wx:for="{{dataMap}}">
<view class="name-join">
<view class="name">{{item.activityTitle}}</view>
</view>
<view class="slogan">活动地址:{{item.activityAddress}}</view>
<view class="area">时间:{{item.startTime}}-{{item.endTime}}</view>
<view class="area">报名人:{{item.userName}}</view>
<view class="area">身份证号:{{item.userIdCard}}</view>
<view class="cancel-btn" data-activityid="{{item.activityLibraryId}}" bindtap="activityDetail">活动详情</view>
<view class="cancel-btn" data-activityid="{{item.activityLibraryId}}"
data-applyid="{{item.activityUserApplyId}}" bindtap="cancelApply">取消报名</view>
</view>
</view>

View File

@ -0,0 +1,105 @@
.top-tab{
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
box-shadow:0 0 17rpx 0 rgba(0,0,0,0.1);
border-radius:0 0 31rpx 31rpx;
background: #fff;
}
.tab-box{
display: flex;
justify-content: center;
align-items: center;
flex: 1;
position: relative;
height: 90rpx;
font-size: 30rpx;
color: #242424;
}
.tab-box.active{
color: #9F1512;
}
.tab-box image{
position: absolute;
width: 15rpx;
height: 40rpx;
top: 50%;
margin-top: -20rpx;
display: none;
}
.tab-box.active image{
display: block;
}
.tab-box image.selected-l{
left: 100rpx;
}
.tab-box image.selected-r{
right: 100rpx;
}
.team{
padding: 0 30rpx;
}
.team-box{
padding: 20rpx 0;
border-bottom: 1px solid #EBEBEB;
}
.name-join{
display: flex;
justify-content: space-between;
height: 40rpx;
line-height: 40rpx;
font-size: 32rpx;
color: #242424;
}
.name{
width: 70%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.join{
padding: 0 10rpx;
background: rgba(159,21,18,.1);
color: #9F1512;
font-size: 28rpx;
border-radius: 10rpx;
}
.slogan, .area{
color: #949494;
font-size: 26rpx;
margin-top: 10rpx;
}
.new-team{
position: fixed;
background: #fff;
bottom: 0;
left: 0;
right: 0;
padding: 15rpx 30rpx;
border-top: 1px solid #EBEBEB;
}
.new-team-btn{
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 30rpx;
color: #fff;
background: #9F1512;
border-radius: 10rpx;
}
.cancel-btn{
width: 150rpx;
height: 55rpx;
text-align: center;
font-size: 28rpx;
background: #9F1512;
border-radius: 10rpx;
line-height: 55rpx;
color: #fff;
margin-top: 10rpx;
display: inline-block;
margin-right: 10rpx;
}