Commit f21dbba2 by biao

11

parent 512be874
...@@ -39,6 +39,7 @@ class FamilyEventDat extends CompassDynamicData ...@@ -39,6 +39,7 @@ class FamilyEventDat extends CompassDynamicData
$this->original_source = $record["original_source"]; $this->original_source = $record["original_source"];
$this->title = $record["title"]; $this->title = $record["title"];
$this->author = $record["author"]; $this->author = $record["author"];
$this->publish_time = $record["publish_time"];
$this->front_image = $record["front_image"]; $this->front_image = $record["front_image"];
$this->images = $record["images"]; $this->images = $record["images"];
$this->images = $record["images"]; $this->images = $record["images"];
......
...@@ -58,7 +58,7 @@ if(!empty($tmpList)) { ...@@ -58,7 +58,7 @@ if(!empty($tmpList)) {
//组装返回数据 //组装返回数据
$result["rowCount"] = $rowCount; $result["rowCount"] = $rowCount;
$result["page"] = $page; $result["page"] = $page;
$result["familyEventCount"] = $familyEventCount; $result["pageCount"] = $pageCount;
$result["familyEventList"] = $familyEventList; $result["familyEventList"] = $familyEventList;
ErrorLogger::doOutput("Compass...ajax_get_family_event_list.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_family_event_list.php....End.", 0);
......
...@@ -211,9 +211,7 @@ video, live-player, live-pusher, open-data, web-view { ...@@ -211,9 +211,7 @@ video, live-player, live-pusher, open-data, web-view {
line-height: 20px; line-height: 20px;
} }
.right_listPractice>text{ .right_listPractice>text{
display: block; color: #000;
text-align: right;
margin-top: 20px;
} }
.listPublicWelfare>view{ .listPublicWelfare>view{
width: 94%; width: 94%;
......
...@@ -17,35 +17,7 @@ Page({ ...@@ -17,35 +17,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this; this.familyEventList()
that.setData({
showLoading: true,
});
var config = wx.getStorageSync('config');
var location = wx.getStorageSync('location');
wx: wx.request({
url: app.url + 'ajax_get_family_event_list.php',
data: {
unionId: config.unionId,
age: 4,
province: location.province,
city: location.city,
district: location.district
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
if (res.statusCode == 200) {
that.setData({
eventDat: res.data.result.sociaEventDat
})
}
},
fail: function (res) { },
complete: function (res) { },
})
}, },
/** /**
...@@ -70,20 +42,6 @@ Page({ ...@@ -70,20 +42,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
...@@ -97,19 +55,52 @@ Page({ ...@@ -97,19 +55,52 @@ Page({
}, },
// 社会实践列表
familyEventList() {
var that = this;
that.setData({
showLoading: true,
});
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_get_family_event_list.php',
data: {
unionId: config.unionId,
page: that.data.page
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
if (res.statusCode == 200) {
that.setData({
pageCount: res.data.result.pageCount,
familyEventList: res.data.result.familyEventList
})
}
},
fail: function (res) { },
complete: function (res) { },
})
},
//跳转到亲子活动详情页面 //跳转到亲子活动详情页面
familyEventDetail() { familyEventDetail(e) {
var eventId = e.currentTarget.dataset['index'] var eventId = e.currentTarget.dataset['index']
wx.navigateTo({ wx.navigateTo({
url: '../familyEventDetail/familyEventDetail?eventid=' + eventId, url: '../familyEventDetail/familyEventDetail?eventId=' + eventId,
}) })
}, },
//加载更多
loadMore() { loadMore() {
if ((this.data.page + 1) < this.data.pageCount) { if ((this.data.page + 1) < this.data.pageCount) {
var pageIndex = this.data.page + 1 var pageIndex = this.data.page + 1
this.setData({ this.setData({
page: pageIndex page: pageIndex
}) })
this.familyEventList()
} else { } else {
wx.showToast({ wx.showToast({
title: '没有更多内容啦。', title: '没有更多内容啦。',
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "亲子活动"
} }
\ No newline at end of file
<!--pages/familyEvent/familyEvent.wxml--> <!--pages/familyEvent/familyEvent.wxml-->
<view class='familyEvent'> <view class='familyEvent'>
<view class='titleqinzi'>
<image src='../../img/sanjiao.png'></image>亲子活动
</view>
<view class='listPractice'> <view class='listPractice'>
<scroll-view scroll-y="true" style='height:1100rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'> <scroll-view scroll-y="true" style='height:1100rpx;bottom:10rpx;' class="listPublicWelfare" bindscrolltolower='loadMore'>
<view class='activelist' wx:for="{{familyEventList}}" wx:key="{{familyEventList[index].id}}" bindtap='familyEventDetail'> <view class='activelist' wx:for="{{familyEventList}}" wx:key="{{familyEventList[index].id}}" bindtap='familyEventDetail' data-index='{{item.id}}'>
<view class='left_listPractice'> <view class='left_listPractice'>
<image src='{{item.images}}'></image> <image src='{{item.front_image}}'></image>
</view> </view>
<view class='right_listPractice'> <view class='right_listPractice'>
<text>{{item.class_title}}{{item.title}}\n</text>
<view> <view>
<text>{{item.title}}\n</text> <text>发布人:{{item.author}}\n</text>
<text>{{item.content}}</text> <text>发布时间:{{item.publish_time}}\n</text>
</view> </view>
<text>{{item.author}}</text>
</view> </view>
<text class='activeLine'></text> <text class='activeLine'></text>
</view> </view>
......
...@@ -10,6 +10,8 @@ Page({ ...@@ -10,6 +10,8 @@ Page({
data: { data: {
eventId: '', eventId: '',
eventDat: '', eventDat: '',
finishUserList: [],
unfinishUserList: [],
active: 0 active: 0
}, },
...@@ -18,24 +20,29 @@ Page({ ...@@ -18,24 +20,29 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this; var that = this;
that.setData({
eventId: options.eventId
})
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var location = wx.getStorageSync('location');
wx: wx.request({ //调用接口获取数据
wx.request({
url: app.url + 'ajax_get_family_event_detail.php', url: app.url + 'ajax_get_family_event_detail.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
eventId: 1 eventId: that.data.eventId
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
dataType: 'json', dataType: 'json',
success: function (res) { success: function (res) {
console.log(res) if (res.statusCode == 200) {
// if (res.statusCode == 200) { that.setData({
// that.setData({ eventDat: res.data.result.sociaEventDat,
// familyEventList: res.data.result.familyEventList finishUserList: res.data.result.finishUserList,
// }) unfinishUserList: res.data.result.unfinishUserList
// } })
}
}, },
fail: function (res) { }, fail: function (res) { },
complete: function (res) { }, complete: function (res) { },
...@@ -93,18 +100,13 @@ Page({ ...@@ -93,18 +100,13 @@ Page({
onChange(event) { onChange(event) {
}, },
btnBaoming() {
Dialog.confirm({ //参加
title: '标题', attend() {
message: '是否报名!' var that = this;
}).then(() => {
wx.navigateTo({ wx.navigateTo({
url: '../joinFamilyEvent/joinFamilyEvent', url: '../joinFamilyEvent/joinFamilyEvent?eventId=' + that.data.eventId + "&eventTitle=" + that.data.eventDat.title,
}) })
}).catch(() => { }
// on cancel
Notify({ type: 'danger', message: '取消报名' });
});
},
}) })
\ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "亲子活动详情"
} }
\ No newline at end of file
<!--pages/familyEventDetail/familyEventDetail.wxml-->
<!--pages/activeDetails/activeDetails.wxml-->
<view class='activeDetails'> <view class='activeDetails'>
<image src='../../img/1.jpg'></image> <view class='top_familyEventDetail'>
<view class='con_activeDetails'> <view>{{eventDat.title}}</view>
<text>活动名称:马群街道卫生清理</text> <text>作者:{{eventDat.author}} 发表时间:{{eventDat.publish_time}}</text>
<text>活动地点:马群区2号地铁站南出口处</text>
<text>征集范围:不限</text>
<text>活动人数:30人</text>
<text>活动时长:2.5h</text>
<text>活动期限:2019.10.11-2019.10.30</text>
</view>
<view class='botCon_activeDetails'>
<view>
<text>联系人:邵帅</text>
<text>联系方式:19308903183</text>
<text>集合地点:马群街道</text>
<text>集合时间:2019.11.10 12:00</text>
</view> </view>
</view> <view class='con_familyEventDetail'>
<view class='activejieshao'> <rich-text nodes="{{eventDat.content}}"></rich-text>
活动介绍:*************
</view> </view>
<view class='avtiveTab'> <view class='avtiveTab'>
<van-tabs active="{{ active }}" bind:change="onChange" tab-active-class="activebeijing"> <van-tabs active="{{ active }}" bind:change="onChange" tab-active-class="activebeijing">
<van-tab title="圈子报名"> <van-tab title="已完成">
<view class='quanzi'> <view class='quanzi'>
<view wx:for='{{finishUserList}}' >
<view> <view>
<view> <image src='{{item.head_img}}'></image>{{item.name}}
<image src='../../img/3.jpg'></image>梁天同学
</view>
<text>已报名</text>
</view>
<view>
<view>
<image src='../../img/3.jpg'></image>梁天同学
</view> </view>
<text>已报名</text> <text>已报名</text>
</view> </view>
</view> </view>
</van-tab> </van-tab>
<van-tab title="个人报名"> <van-tab title="未完成">
<view class='quanzi'> <view class='quanzi'>
<view wx:for='{{unfinishUserList}}' >
<view> <view>
<view> <image src='{{item.head_img}}'></image>{{item.name}}
<image src='../../img/3.jpg'></image>小天同学
</view>
<text>已报名</text>
</view>
<view>
<view>
<image src='../../img/3.jpg'></image>小天同学
</view> </view>
<text>已报名</text> <text>已报名</text>
</view> </view>
</view> </view>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<view class='btnBaoming' bindtap='btnBaoming'>报名参加</view> <view class='actionBtn' bindtap='attend'>参加</view>
</view> </view>
</view> </view>
<van-dialog id="van-dialog" /> <van-dialog id="van-dialog" />
......
/* pages/familyEventDetail/familyEventDetail.wxss */ /* pages/familyEventDetail/familyEventDetail.wxss */
.activeDetails>image{ .top_familyEventDetail{
width: 100%; box-sizing: border-box;
height: 100px; padding: 15px 5px;
text-align: center;
} }
.con_activeDetails{ .top_familyEventDetail>view{
width: 80%; font-size: 14px;
margin: 30px auto; color: #000;
text-indent: 2rem;
} }
.con_activeDetails>text{ .top_familyEventDetail>text{
display: block;
width: 100%;
font-size: 12px; font-size: 12px;
margin-bottom: 15px; color: #666;
}
.con_familyEventDetail{
box-sizing: border-box;
padding: 15px 5px;
} }
.botCon_activeDetails{ .top_title{
width: 100%; width: 100%;
height: 76px; height: 40px;
border-bottom: 1px solid #ccc; display: flex;
align-items: center;
}
.top_title>view{
width: 100px;
height: 30px;
font-size: 14px;
line-height: 30px;
text-align: center;
color: #fff;
background: #698FBB;
}
.top_title>text{
display: block;
flex: 1;
height: 1px;
background: #698FBB;
} }
.botCon_activeDetails>view{ .neirong_title{
width: 150px; font-size: 12px;
float: right;
color: #666; color: #666;
font-size: 10px;
} }
.botCon_activeDetails>view>text{ .neirong_title>image{
width: 100%;
height: 260px;
}
.title_familyEventDetail>text{
display: block; display: block;
margin-bottom: 5px; width: 100%;
height: 2px;
background: #698FBB;
margin: 10px auto;
} }
.activejieshao{ .activejieshao{
width: 100%; width: 100%;
...@@ -37,7 +63,11 @@ ...@@ -37,7 +63,11 @@
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
.activebeijing{ .activebeijing{
background: #666; background: #0D76ED;
color: #fff!important;
}
.avtiveTab .van-tabs__wrap{
border-bottom: 1px solid #0D76ED;
} }
.avtiveTab .van-tabs__line{ .avtiveTab .van-tabs__line{
display: none; display: none;
...@@ -74,13 +104,15 @@ ...@@ -74,13 +104,15 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.btnBaoming{ .actionBtn{
width: 100%; width: 75%;
height: 30px; height: 40px;
line-height: 30px; line-height: 40px;
text-align: center; text-align: center;
font-size: 13px; font-size: 14px;
border-top: 1px solid #ccc; margin: 10px auto;
border-bottom: 1px solid #ccc; background: #0D76ED;
margin-bottom: 3px; margin-bottom: 10px;
color: #fff;
border-radius: 15px;
} }
\ No newline at end of file
...@@ -76,6 +76,7 @@ Page({ ...@@ -76,6 +76,7 @@ Page({
console.log(res) console.log(res)
if (res.statusCode == 200) { if (res.statusCode == 200) {
that.setData({ that.setData({
pageCount: res.data.result.pageCount,
socialEventEventList: res.data.result.socialEventEventList socialEventEventList: res.data.result.socialEventEventList
}) })
} }
...@@ -92,6 +93,7 @@ Page({ ...@@ -92,6 +93,7 @@ Page({
this.setData({ this.setData({
page: pageIndex page: pageIndex
}) })
this.socialList()
} else { } else {
wx.showToast({ wx.showToast({
title: '没有更多内容啦。', title: '没有更多内容啦。',
......
...@@ -20,10 +20,10 @@ Page({ ...@@ -20,10 +20,10 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ var that = this;
that.setData({
eventId: options.eventId eventId: options.eventId
}) })
var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
//调用接口获取数据 //调用接口获取数据
......
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