Commit d8f4ae9f by biao

11111

parent e78ec180
<?php
/**
* 志愿者活动状态
* $Id$
* @author zongbiao
* @package jp.fishow.entity.definition
*/
class EventStatus
{
public $id;
public $name;
public $title;
function __construct($record) {
$this->id = $record["id"];
$this->name = $record["name"];
$this->title = $record["title"];
}
/**
* 返回示例的列表
* @return array ImageType一覧
*/
public static function getList() {
static $result;
if ((!is_array($result)) || (count($result) < 1)) {
$data = array();
$tmp = array("id"=>1, "name"=>"NEW", "title"=>"审核中");
array_push($data, $tmp);
$tmp = array("id"=>2, "name"=>"NG", "title"=>"审核不通过");
array_push($data, $tmp);
$tmp = array("id"=>3, "name"=>"OK", "title"=>"征集中");
array_push($data, $tmp);
$tmp = array("id"=>4, "name"=>"FINISH", "title"=>"已结束");
array_push($data, $tmp);
$result = array();
foreach ($data as $row) {
$tmp2 = new EventStatus($row);
array_push($result, $tmp2);
}
}
return $result;
}
/**
* 通过定义名称获取object
* @return EventStatus 对应实例。没有的时候返回null。
*/
public static function getByName($name) {
$list = EventStatus::getList();
foreach ($list as $tmp) {
if ($tmp->name == $name) {
return $tmp;
}
}
return null;
}
/**
* 通过定义名称获取title
*/
public static function getTitleByName($name) {
$list = EventStatus::getList();
foreach ($list as $tmp) {
if ($tmp->name == $name) {
return $tmp->title;
}
}
return null;
}
}
\ No newline at end of file
...@@ -65,6 +65,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/OrganizationStatu ...@@ -65,6 +65,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/OrganizationStatu
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/AcountModule.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/AcountModule.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/OrderStatus.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/OrderStatus.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/CourseParentCategory.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/CourseParentCategory.inc");
require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/EventStatus.inc");
// Action // Action
require_once(COMPASS_LIB_ROOT . "/cn/compass/action/TemplateAction.inc"); require_once(COMPASS_LIB_ROOT . "/cn/compass/action/TemplateAction.inc");
......
...@@ -64,7 +64,7 @@ $pageCount = ceil($volunteerEvenCount/$rowCount); ...@@ -64,7 +64,7 @@ $pageCount = ceil($volunteerEvenCount/$rowCount);
if(!empty($tmpVolunteerEventList)) { if(!empty($tmpVolunteerEventList)) {
//设置状态和招募范围 //设置状态和招募范围
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 = "校内.社会人士";
......
...@@ -53,7 +53,7 @@ video, live-player, live-pusher, open-data, web-view { ...@@ -53,7 +53,7 @@ video, live-player, live-pusher, open-data, web-view {
margin: 0 auto; margin: 0 auto;
} }
.activelist{ .activelist{
width: 92%; width: 95%;
height: 110px; height: 110px;
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
......
...@@ -65,7 +65,8 @@ ...@@ -65,7 +65,8 @@
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
font-size: 14px; font-size: 14px;
border: 1px solid #ccc; background: #0D76ED;
color: #fff;
border-radius: 15px; border-radius: 15px;
margin: 20px auto; margin: 20px auto;
} }
\ No newline at end of file
...@@ -104,9 +104,8 @@ Page({ ...@@ -104,9 +104,8 @@ Page({
console.log(res) console.log(res)
if (res.statusCode == 200) { if (res.statusCode == 200) {
that.setData({ that.setData({
page: res.data.result.page,
pageCount: res.data.result.pageCount, pageCount: res.data.result.pageCount,
volunteerEventList: res.data.result.volunteerEventList, volunteerEventList: that.data.volunteerEventList.concat(res.data.result.volunteerEventList),
isOwner: res.data.result.isOwner isOwner: res.data.result.isOwner
}) })
} }
...@@ -116,6 +115,13 @@ Page({ ...@@ -116,6 +115,13 @@ Page({
}) })
}, },
//发布活动
newCircleEvent() {
wx.navigateTo({
url: '../newCircleEvent/newCircleEvent?circleId=' + this.data.circleId,
})
},
//志愿者活动详情页面 //志愿者活动详情页面
volunteersEventDetail(e) { volunteersEventDetail(e) {
let eventId = e.currentTarget.dataset['id']; let eventId = e.currentTarget.dataset['id'];
......
{ {
"usingComponents": {}, "usingComponents": {},
"navigationBarTitleText": "圈子活动管理" "navigationBarTitleText": "圈子活动管理",
"onReachBottomDistance": 100
} }
\ No newline at end of file
<!--pages/circleEvents/circleEvents.wxml--> <!--pages/circleEvents/circleEvents.wxml-->
<view class='activeManagement'> <view class='activeManagement'>
<view class='cicle'> <view class='publishButton'bindtap="newCircleEvent" wx:if="{{isOwner}}">
活动发布
</view>
<view class='circleEventList'>
<view class='circleEventTitleArea'> <view class='circleEventTitleArea'>
<view style='font-size:14px;padding-left:15px'> <view style='font-size:14px;padding-left:15px'>
<image src='../../img/sanjiao.png'></image>志愿者活动 <image src='../../img/sanjiao.png'></image>志愿者活动
</view> </view>
</view> </view>
<view class='activelist' bindtap='volunteersEventDetail' wx:for="{{volunteerEventList}}" wx:key="{{volunteerEventList[index].id}}" data-id='{{item.id}}'> <view class='activelist' bindtap='volunteersEventDetail' wx:for="{{volunteerEventList}}" data-id='{{item.id}}'>
<view class='left_listVolunteers'> <view class='left_listVolunteers'>
<image src='{{item.front_image}}'></image> <image src='{{item.front_image}}'></image>
<text>{{item.status_title}}</text> <text>{{item.status_title}}</text>
......
/* pages/circleEvents/circleEvents.wxss */ /* pages/circleEvents/circleEvents.wxss */
.circleEventList{
margin-top: 10px;
margin-bottom: 50px;
width: 95%;
display: flex;
flex-direction:column;
justify-content : space-between;
align-items:center;
font-size: 14px;
}
.circleEventTitleArea{ .circleEventTitleArea{
display: flex; display: flex;
align-items: center; align-items: center;
width:94%; width:94%;
height:50px; height:20px;
} }
.circleEventTitleArea>view>image{ .circleEventTitleArea>view>image{
width: 10px; width: 10px;
height: 10px; height: 10px;
} }
.publishButton{
position: fixed;
bottom: 0;
left: 0;
font-size:14px;
color:#fff;
background: #0D76ED;
width: 100%;
height: 40px;
line-height: 40px;
text-align: center;
z-index: 99;
}
\ No newline at end of file
...@@ -78,12 +78,12 @@ Page({ ...@@ -78,12 +78,12 @@ Page({
var that = this; var that = this;
//内容必须输入 //内容必须输入
if (that.data.title == null || that.data.title.trim() == "") { if (that.data.title == null || that.data.title.trim() == "") {
Notify('请公告标题') Notify('请输入公告标题')
return return
} }
//内容必须输入 //内容必须输入
if (that.data.comment == null || that.data.comment.trim() == "") { if (that.data.comment == null || that.data.comment.trim() == "") {
Notify('请公告内容') Notify('请输入公告内容')
return return
} }
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
......
// pages/newCircleEvent/newCircleEvent.js // pages/newCircleEvent/newCircleEvent.js
var app = getApp()
import Notify from '../../dist/notify/notify';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
circleId: 0,
isOwner: false,
title:'',
comment:'',
startTime:'',
finishTime:'',
enrollTime:'',
frontImage:'',
position: '',
includeSocialUser:false,
maxMember:0,
timeLength:'',//活动时长
leaderName:'',//联系人
leaderContact: '',//联系方式
venue: '',//集合地点
venueTime: '',//集合时间
fileList: [], fileList: [],
checked: true
}, },
/** /**
...@@ -30,40 +51,9 @@ Page({ ...@@ -30,40 +51,9 @@ Page({
}, },
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
}, //图片处理
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
delete(event) { delete(event) {
const { index, name } = event.detail; const { index, name } = event.detail;
const fileList = this.data[`fileList`]; const fileList = this.data[`fileList`];
...@@ -78,8 +68,89 @@ Page({ ...@@ -78,8 +68,89 @@ Page({
// headerImg: file[0].path // headerImg: file[0].path
}); });
}, },
onChange({ detail }) { //获取活动标题输入
inputTitle(event) {
this.setData({
title: event.detail.value
})
},
//获取输入的活动描述
inputComment(event) {
this.setData({
comment: event.detail.value
})
},
//获取是否允许社会人士参加输入
onChangeIncludeSocialUser({ detail }) {
// 需要手动对 checked 状态进行更新 // 需要手动对 checked 状态进行更新
this.setData({ checked: detail }); this.setData({ includeSocialUser: detail });
},
//提交审核
applyEvent() {
var that = this;
//标题必须输入
if (that.data.title == null || that.data.title.trim() == "") {
Notify('请输入活动标题')
return
}
//内容必须输入
if (that.data.comment == null || that.data.comment.trim() == "") {
Notify('请输入活动描述')
return
}
var config = wx.getStorageSync('config');
wx.request({
url: app.url + 'ajax_set_circle_notice_new.php',
data: {
unionId: config.unionId,
circleId: that.data.circleId,
title: that.data.title,
comment: that.data.comment,
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
if (that.data.imagePath != null && that.data.imagePath != undefined) {
wx.uploadFile({
url: app.url + 'ajax_set_circle_notice_new.php?unionId=' + config.unionId + "&circleId=" + that.data.circleId,
filePath: that.data.imagePath,
name: 'image',
header: { 'content-type': 'multipart/form-data' },
success: function (res) {
Notify('发布成功!')
//循环执行等待全部结束
var a = setInterval(function () {
//跳转到圈子首页
wx.navigateTo({
url: '../circleDetails/circleDetails?circleId=' + that.data.circleId,
});
//循环执行代码
clearInterval(a)
}, 1000) //循环时间 这里是1秒
},
fail: function (res) {
console.log(res, '上传失败')
},
complete: function (res) {
},
})
} }
},
fail: function (res) { },
complete: function (res) { },
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
}) })
\ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "活动发布"
} }
\ No newline at end of file
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<view class='con_newCircleEvent'> <view class='con_newCircleEvent'>
<view> <view>
<view>活动标题</view> <view>活动标题</view>
<input placeholder='请输入活动标题'></input> <input placeholder='请输入活动标题' bindinput="inputTitle" value='{{title}}'></input>
</view> </view>
<view> <view>
<view>活动描述</view> <view>活动描述</view>
<input placeholder='请输入活动描述'></input> <input placeholder='请输入活动描述' bindinput="inputComment" value='{{comment}}'></input>
</view> </view>
<view> <view>
<view>活动开始时间</view> <view>活动开始时间</view>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</view> </view>
<view> <view>
<view>允许社会人士参加</view> <view>允许社会人士参加</view>
<van-switch checked="{{ checked }}" bind:change="onChange" size="20px" /> <van-switch checked="{{ includeSocialUser }}" bind:change="onChangeIncludeSocialUser" size="20px" />
</view> </view>
<view> <view>
<view>最大人数</view> <view>最大人数</view>
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<view>集合地点</view> <view>集合地点</view>
<input placeholder='请输入集合地点'></input> <input placeholder='请输入集合地点'></input>
</view> </view>
<text class='tijiao'>提交审核</text> <text class='applyButton' bindtap="applyEvent">提交审核</text>
</view> </view>
<van-notify id="van-notify" />
</view> </view>
...@@ -38,14 +38,15 @@ page{ ...@@ -38,14 +38,15 @@ page{
box-sizing: border-box; box-sizing: border-box;
padding-left: 5px; padding-left: 5px;
} }
.tijiao{
.applyButton{
display: block; display: block;
width: 110px; width: 110px;
height: 30px; height: 30px;
text-align: center; text-align: center;
line-height: 30px; line-height: 30px;
border-radius: 5px; border-radius: 5px;
background: rgb(91,155,213); background: #0D76ED;
color: #fff; color: #fff;
margin: 20px auto; margin: 20px auto;
font-size: 14px; font-size: 14px;
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "用户注册"
} }
\ No newline at end of file
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