Commit c8dbe0c0 by biao

111111

parent df92b8ec
...@@ -7,6 +7,7 @@ ErrorLogger::doOutput("Compass...ajax_get_my_event_list.php....Start.", 0); ...@@ -7,6 +7,7 @@ ErrorLogger::doOutput("Compass...ajax_get_my_event_list.php....Start.", 0);
//获取参数 //获取参数
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$page = ParamUtil::getRequestNumber("page", 0);//翻页
$result = array(); $result = array();
...@@ -16,6 +17,8 @@ if(empty($unionId)) { ...@@ -16,6 +17,8 @@ if(empty($unionId)) {
responseNG($result); responseNG($result);
} }
//判断用户是否存在 //判断用户是否存在
$param = array(); $param = array();
$param['unionid'] = $unionId; $param['unionid'] = $unionId;
...@@ -28,23 +31,37 @@ if(empty($userList)) { ...@@ -28,23 +31,37 @@ if(empty($userList)) {
$userMst = $userList[0]; $userMst = $userList[0];
//每页显示条数
$rowCount = 10;
$offset = $page * $rowCount;
$pageCount = 0;
//查询用户参加的活动列表 //查询用户参加的活动列表
$myEventList = array(); $volunteerEventList = array();
$param = array(); $param = array();
$param['user_id'] = $userMst->id; $param['user_id'] = $userMst->id;
$param['delete_flg'] = false; $param['delete_flg'] = false;
$volunteerEventMemberList = VolunteerEventMemberDat::getList($param,'id','desc'); $volunteerEventMemberList = VolunteerEventMemberDat::getList($param,'id','desc', $offset, $rowCount);
$allCount = VolunteerEventMemberDat::getListCount($param);
$pageCount = ceil($allCount/$rowCount);
//组装数据
if(!empty($volunteerEventMemberList)) { if(!empty($volunteerEventMemberList)) {
foreach($volunteerEventMemberList as $tmp) { foreach($volunteerEventMemberList as $tmp) {
$volunteerEventDat = VolunteerEventDat::getById($tmp->volunteer_event_id); $volunteerEventDat = VolunteerEventDat::getById($tmp->volunteer_event_id);
if(!empty($volunteerEventDat)) { if(!empty($volunteerEventDat)) {
$myEventList[] = $volunteerEventDat; $volunteerEventDat->status_title = EventStatus::getTitleByName($volunteerEventDat->status);
$volunteerEventDat->scope = "校内";
if($volunteerEventDat->include_social_user) {
$volunteerEventDat->scope = "校内.社会人士";
}
$volunteerEventList[] = $volunteerEventDat;
} }
} }
} }
//组装返回数据 //组装返回数据
$result["myEventList"] = $myEventList; $result["pageCount"] = $pageCount;
$result["volunteerEventList"] = $volunteerEventList;
ErrorLogger::doOutput("Compass...ajax_get_my_event_list.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_my_event_list.php....End.", 0);
......
...@@ -7,15 +7,13 @@ ErrorLogger::doOutput("Compass...ajax_get_volunteer_event_list.php....Start.", 0 ...@@ -7,15 +7,13 @@ ErrorLogger::doOutput("Compass...ajax_get_volunteer_event_list.php....Start.", 0
//获取参数 //获取参数
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$page = ParamUtil::getRequestNumber("page", 0);//翻页
//用户所在【省市区】 //用户所在【省市区】
$province = ParamUtil::getRequestString("province"); $province = ParamUtil::getRequestString("province");
$city = ParamUtil::getRequestString("city"); $city = ParamUtil::getRequestString("city");
$district = ParamUtil::getRequestString("district"); $district = ParamUtil::getRequestString("district");
//翻页
$page = ParamUtil::getRequestNumber("page", 0);//翻页
$result = array(); $result = array();
//参数检查 //参数检查
...@@ -78,7 +76,7 @@ $result["abilityPoint"] = $abilityPoint; ...@@ -78,7 +76,7 @@ $result["abilityPoint"] = $abilityPoint;
//设置状态和招募范围 //设置状态和招募范围
foreach($tmpVolunteerEventList as $tmp) { foreach($tmpVolunteerEventList as $tmp) {
$tmp->status_title = "征集中"; $tmp->status_title = EventStatus::getTitleByName($tmp->status);
$tmp->scope = "校内"; $tmp->scope = "校内";
if($tmp->include_social_user) { if($tmp->include_social_user) {
$tmp->scope = "校内.社会人士"; $tmp->scope = "校内.社会人士";
......
...@@ -6,32 +6,19 @@ Page({ ...@@ -6,32 +6,19 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
volunteerEventList: [],
page: 0,//当前页数
pageCount: 0,//总页数
//数据加载loading
showLoading: false,
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this; this.getEventList();
var config = wx.getStorageSync('config');
wx: wx.request({
url: app.url + 'ajax_get_my_event_list.php',
data: {
unionId: config.unionId
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
if (res.statusCode == 200) {
}
},
fail: function (res) { },
complete: function (res) { },
})
}, },
/** /**
...@@ -49,31 +36,58 @@ Page({ ...@@ -49,31 +36,58 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 页面上拉触底事件的处理函数
*/ */
onHide: function () { onReachBottom: function () {
//触底以后加载更多
if ((this.data.page + 1) < this.data.pageCount) {
var pageIndex = this.data.page + 1
this.setData({
page: pageIndex
})
this.getEventList();
} else {
wx.showToast({
title: '没有更多消息啦。',
icon: 'success',
duration: 2000
});
}
}, },
/** //检索我的志愿者活动列表
* 生命周期函数--监听页面卸载 getEventList() {
*/ var that = this;
onUnload: function () { var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_my_event_list.php',
data: {
unionId: config.unionId,
page: 0
}, },
header: { 'content-type': 'application/json' },
/** method: 'GET',
* 页面相关事件处理函数--监听用户下拉动作 dataType: 'json',
*/ success: function (res) {
onPullDownRefresh: function () { if (res.statusCode == 200) {
console.log(res)
that.setData({
pageCount: res.data.result.pageCount,
volunteerEventList: res.data.result.volunteerEventList,
})
}
},
fail: function (res) { },
complete: function (res) { },
})
}, },
/** //志愿者活动详情页面
* 页面上拉触底事件的处理函数 volunteersEventDetail(e) {
*/ let eventId = e.currentTarget.dataset['id'];
onReachBottom: function () { wx.navigateTo({
url: '../volunteersEventDetail/volunteersEventDetail?eventId=' + eventId,
})
}, },
/** /**
......
<!--pages/activeManagement/activeManagement.wxml--> <!--pages/activeManagement/activeManagement.wxml-->
<view class='activeManagement'> <view class='volunteers'>
<view class='listVolunteers'> <view class='volunteersActive'>
<view> <view style='font-size:14px;padding-left:15px'>
<view class='left_listVolunteers'> <image src='../../img/sanjiao.png'></image>志愿者活动
<image src='../../img/3.jpg'></image>
<text>征集中</text>
<view>(市)</view>
</view>
<view class='right_listVolunteers'>
<text>周末图书馆清洁活动</text>
<view>
<text>征集范围:校内\n</text>
<text>征集人数:10人\n</text>
<text>发布单位:南京市教育局\n</text>
<text>报名截止:2019.10.10</text>
</view>
</view> </view>
</view> </view>
<view> <view class='listVolunteers'>
<view class='left_listVolunteers'> <view class='activelist' bindtap='volunteersEventDetail' wx:for="{{volunteerEventList}}" data-id='{{item.id}}'>
<image src='../../img/3.jpg'></image>
<text>征集中</text>
<view>(校)</view>
</view>
<view class='right_listVolunteers'>
<text>敬老院探望老人活动</text>
<view>
<text>征集范围:校内\n</text>
<text>征集人数:15人\n</text>
<text>发布单位:南京市教育局\n</text>
<text>报名截止:2019.11.10</text>
</view>
</view>
</view>
<view>
<view class='left_listVolunteers'>
<image src='../../img/3.jpg'></image>
<text>征集中</text>
<view>(市)</view>
</view>
<view class='right_listVolunteers'>
<text>周末图书馆清洁活动</text>
<view>
<text>征集范围:校内\n</text>
<text>征集人数:10人\n</text>
<text>发布单位:南京市教育局\n</text>
<text>报名截止:2019.10.10</text>
</view>
</view>
</view>
<view>
<view class='left_listVolunteers'> <view class='left_listVolunteers'>
<image src='../../img/3.jpg'></image> <image src='{{item.front_image}}'></image>
<text>已结束</text> <text>{{item.status_title}}</text>
<view>(社)</view>
</view> </view>
<view class='right_listVolunteers'> <view class='right_listVolunteers'>
<text>敬老院探望老人活动</text> <text>{{item.title}}</text>
<view> <view>
<text>征集范围:校内\n</text> <text>征集范围:{{item.scope}}\n</text>
<text>征集人数:15人\n</text> <text>征集人数:{{item.max_member}}人\n</text>
<text>发布单位:南京市教育局\n</text> <text>发布单位:{{item.author}}\n</text>
<text>报名截止:2019.11.10</text> <text>报名截止:{{item.enroll_time}}</text>
</view> </view>
</view> </view>
<text></text>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file
/* pages/activeManagement/activeManagement.wxss */ /* pages/activeManagement/activeManagement.wxss */
.volunteersTitle{
display: block;
width: 100%;
text-align: left;
font-size: 14px;
box-sizing: border-box;
padding-left: 15px;
margin-top: 20px;
}
.volunteersActive{
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
margin-bottom: 10px;
}
.volunteersActive>view{
display: flex;
align-items: center;
}
.volunteersActive>view>image{
width: 10px;
height: 10px;
}
.left_listVolunteers{
margin-left: 10px;
}
\ No newline at end of file
...@@ -5,6 +5,6 @@ ...@@ -5,6 +5,6 @@
<view style="background:{{age==1?'#3AAB69':'#fff'}}" bindtap='selectAge' data-index="1">3~6岁</view> <view style="background:{{age==1?'#3AAB69':'#fff'}}" bindtap='selectAge' data-index="1">3~6岁</view>
<view style="background:{{age==2?'#3AAB69':'#fff'}}" bindtap='selectAge' data-index="2">7岁以上</view> <view style="background:{{age==2?'#3AAB69':'#fff'}}" bindtap='selectAge' data-index="2">7岁以上</view>
<view class='button' style='border:none'> <view class='button' style='border:none'>
<van-button type="default" style="margin:0 auto" bindtap="updateAge">提交</van-button> <view style="width:100%;height:100%;background:#0D76ED;color:#fff" bindtap="updateAge">提交</view>
</view> </view>
</view> </view>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment