Commit 54c648dc by biao

11

parent d8f0b87a
...@@ -260,6 +260,7 @@ CREATE TABLE IF NOT EXISTS user_message_dat( ...@@ -260,6 +260,7 @@ CREATE TABLE IF NOT EXISTS user_message_dat(
attach_dat_id int8 NOT NULL DEFAULT '0', attach_dat_id int8 NOT NULL DEFAULT '0',
attach_dat_path text, attach_dat_path text,
is_read tinyint(1) NOT NULL DEFAULT '0', is_read tinyint(1) NOT NULL DEFAULT '0',
is_operated tinyint(1) NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
) ENGINE = INNODB DEFAULT CHARSET=utf8mb4; ) ENGINE = INNODB DEFAULT CHARSET=utf8mb4;
...@@ -300,7 +301,7 @@ CREATE TABLE IF NOT EXISTS social_event_member_dat( ...@@ -300,7 +301,7 @@ CREATE TABLE IF NOT EXISTS social_event_member_dat(
user_id int8 NOT NULL, user_id int8 NOT NULL,
comment text NOT NULL, comment text NOT NULL,
front_image text, front_image text,
images text NOT NULL, images text,
status varchar(64) NOT NULL DEFAULT '0', status varchar(64) NOT NULL DEFAULT '0',
point int8 NOT NULL DEFAULT '0', point int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
...@@ -342,7 +343,7 @@ CREATE TABLE IF NOT EXISTS family_event_member_dat( ...@@ -342,7 +343,7 @@ CREATE TABLE IF NOT EXISTS family_event_member_dat(
family_event_id int8 NOT NULL, family_event_id int8 NOT NULL,
user_id int8 NOT NULL, user_id int8 NOT NULL,
comment text NOT NULL, comment text NOT NULL,
images text NOT NULL, images text,
status varchar(64) NOT NULL DEFAULT '0', status varchar(64) NOT NULL DEFAULT '0',
point int8 NOT NULL DEFAULT '0', point int8 NOT NULL DEFAULT '0',
delete_flg tinyint(1) NOT NULL DEFAULT '0' delete_flg tinyint(1) NOT NULL DEFAULT '0'
......
...@@ -99,7 +99,7 @@ class FamilyEventMemberDat extends CompassDynamicData ...@@ -99,7 +99,7 @@ class FamilyEventMemberDat extends CompassDynamicData
ParamUtil::copyObj2Array($v_param, $this, "family_event_id"); ParamUtil::copyObj2Array($v_param, $this, "family_event_id");
ParamUtil::copyObj2Array($v_param, $this, "user_id"); ParamUtil::copyObj2Array($v_param, $this, "user_id");
ParamUtil::copyObj2Array($v_param, $this, "comment"); ParamUtil::copyObj2Array($v_param, $this, "comment");
ParamUtil::copyObj2Array($v_param, $this, "images"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "images");
ParamUtil::copyObj2Array($v_param, $this, "status"); ParamUtil::copyObj2Array($v_param, $this, "status");
ParamUtil::copyObj2Array($v_param, $this, "point"); ParamUtil::copyObj2Array($v_param, $this, "point");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg"); ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
......
...@@ -99,7 +99,7 @@ class SocialEventMemberDat extends CompassDynamicData ...@@ -99,7 +99,7 @@ class SocialEventMemberDat extends CompassDynamicData
ParamUtil::copyObj2Array($v_param, $this, "social_event_id"); ParamUtil::copyObj2Array($v_param, $this, "social_event_id");
ParamUtil::copyObj2Array($v_param, $this, "user_id"); ParamUtil::copyObj2Array($v_param, $this, "user_id");
ParamUtil::copyObj2Array($v_param, $this, "comment"); ParamUtil::copyObj2Array($v_param, $this, "comment");
ParamUtil::copyObj2Array($v_param, $this, "images"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "images");
ParamUtil::copyObj2Array($v_param, $this, "status"); ParamUtil::copyObj2Array($v_param, $this, "status");
ParamUtil::copyObj2Array($v_param, $this, "point"); ParamUtil::copyObj2Array($v_param, $this, "point");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg"); ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
......
...@@ -15,6 +15,7 @@ class UserMessageDat extends CompassDynamicData ...@@ -15,6 +15,7 @@ class UserMessageDat extends CompassDynamicData
var $attach_dat_id; var $attach_dat_id;
var $attach_dat_path; var $attach_dat_path;
var $is_read; var $is_read;
var $is_operated;
var $delete_flg; var $delete_flg;
/** /**
...@@ -34,6 +35,7 @@ class UserMessageDat extends CompassDynamicData ...@@ -34,6 +35,7 @@ class UserMessageDat extends CompassDynamicData
$this->attach_dat_id = $record["attach_dat_id"]; $this->attach_dat_id = $record["attach_dat_id"];
$this->attach_dat_path = $record["attach_dat_path"]; $this->attach_dat_path = $record["attach_dat_path"];
$this->is_read = $record["is_read"]; $this->is_read = $record["is_read"];
$this->is_operated = $record["is_operated"];
$this->delete_flg = $record["delete_flg"]; $this->delete_flg = $record["delete_flg"];
} }
...@@ -105,6 +107,7 @@ class UserMessageDat extends CompassDynamicData ...@@ -105,6 +107,7 @@ class UserMessageDat extends CompassDynamicData
ParamUtil::copyObj2Array($v_param, $this, "attach_dat_id"); ParamUtil::copyObj2Array($v_param, $this, "attach_dat_id");
ParamUtil::copyObj2ArrayNullField($v_param, $this, "attach_dat_path"); ParamUtil::copyObj2ArrayNullField($v_param, $this, "attach_dat_path");
ParamUtil::copyObj2Array($v_param, $this, "is_read"); ParamUtil::copyObj2Array($v_param, $this, "is_read");
ParamUtil::copyObj2Array($v_param, $this, "is_operated");
ParamUtil::copyObj2Array($v_param, $this, "delete_flg"); ParamUtil::copyObj2Array($v_param, $this, "delete_flg");
// 保存 // 保存
......
...@@ -22,10 +22,10 @@ class WxPayConfig ...@@ -22,10 +22,10 @@ class WxPayConfig
* 获取地址:https://mp.weixin.qq.com/advanced/advanced?action=dev&t=advanced/dev&token=2005451881&lang=zh_CN * 获取地址:https://mp.weixin.qq.com/advanced/advanced?action=dev&t=advanced/dev&token=2005451881&lang=zh_CN
* @var string * @var string
*/ */
const APPID = WECHAT_APP_ID_58; const APPID = WECHAT_APP_ID;
const MCHID = WECHAT_PAY_MCHID_58; const MCHID = WECHAT_PAY_MCHID;
const KEY = WECHAT_PAY_KEY_58; const KEY = WECHAT_PAY_KEY;
const APPSECRET = WECHAT_APP_SECRET_58; const APPSECRET = WECHAT_APP_SECRET;
//=======【证书路径设置】===================================== //=======【证书路径设置】=====================================
/** /**
......
...@@ -50,6 +50,11 @@ define("WECHAT_PAY_KEY","a1b2c3defghijKlmnopqrstuvwx4y5z6"); ...@@ -50,6 +50,11 @@ define("WECHAT_PAY_KEY","a1b2c3defghijKlmnopqrstuvwx4y5z6");
define("LBS_KEY","TMJBZ-MTX3G-MPFQT-INGZP-VQVTK-WLFM3"); define("LBS_KEY","TMJBZ-MTX3G-MPFQT-INGZP-VQVTK-WLFM3");
define("LBS_SECRET","BYLkXP9bZaQhI1ELr6HWkHRuKm1YPU"); define("LBS_SECRET","BYLkXP9bZaQhI1ELr6HWkHRuKm1YPU");
//完成活动奖励能力分
define("ABILITY_POINT",20);
//完成活动奖励服务分
define("SERVICE_POINT",20);
// 固定テンプレート用ディレクトリ // 固定テンプレート用ディレクトリ
define("SCHOOL_TEMPLATE_DIR", COMPASS_ROOT . "/school/templates"); define("SCHOOL_TEMPLATE_DIR", COMPASS_ROOT . "/school/templates");
// 固定テンプレート用ディレクトリ // 固定テンプレート用ディレクトリ
......
...@@ -37,6 +37,13 @@ if(empty($circleDat)) { ...@@ -37,6 +37,13 @@ if(empty($circleDat)) {
responseNG($result); responseNG($result);
} }
//消息改为已经处理过
$userMessageDat = UserMessageDat::getById($msgId);
if(empty($userMessageDat)) {
$userMessageDat->is_operated = true;
$userMessageDat->save();
}
//用户是否已经加入圈子 //用户是否已经加入圈子
$param = array(); $param = array();
$param['circle_id'] = $circleDat->id; $param['circle_id'] = $circleDat->id;
...@@ -62,6 +69,7 @@ $circleDat->save(); ...@@ -62,6 +69,7 @@ $circleDat->save();
$userMsgDat = UserMessageDat::getById($msgId); $userMsgDat = UserMessageDat::getById($msgId);
if(!empty($userMsgDat)) { if(!empty($userMsgDat)) {
$userMsgDat->is_read = true; $userMsgDat->is_read = true;
$userMsgDat->is_operated = true;
$userMsgDat->save(); $userMsgDat->save();
} }
......
...@@ -91,7 +91,7 @@ if(!empty($tmpCircleMemberList)) { ...@@ -91,7 +91,7 @@ if(!empty($tmpCircleMemberList)) {
//添加附件附件 //添加附件附件
$userMessageDat->attach_dat_type = "VOLUNTEER"; $userMessageDat->attach_dat_type = "VOLUNTEER";
$userMessageDat->attach_dat_id = $circleDat->id; $userMessageDat->attach_dat_id = $circleDat->id;
$userMessageDat->attach_dat_path = "pages/volunteersEventDetail/volunteersEventDetail?eventId={$volunteerDat->id}&circleId={$circleDat->id}"; $userMessageDat->attach_dat_path = "/pages/volunteersEventDetail/volunteersEventDetail?eventId={$volunteerDat->id}&circleId={$circleDat->id}";
} }
} }
......
...@@ -23,6 +23,8 @@ if(empty($tmpUserMstList)) { ...@@ -23,6 +23,8 @@ if(empty($tmpUserMstList)) {
responseNG("参数错误!"); responseNG("参数错误!");
} }
$userMst = $tmpUserMstList[0];
//调用支付 //调用支付
//生成临时订单 //生成临时订单
$orderNo = "B" . date("YmdHis") . "_" . $userMst->id; $orderNo = "B" . date("YmdHis") . "_" . $userMst->id;
...@@ -33,7 +35,7 @@ $input = new WxPayUnifiedOrder(); ...@@ -33,7 +35,7 @@ $input = new WxPayUnifiedOrder();
$input->SetBody("志愿者会员购买"); $input->SetBody("志愿者会员购买");
$input->SetAttach("志愿者会员购买"); $input->SetAttach("志愿者会员购买");
$input->SetOut_trade_no($orderNo); $input->SetOut_trade_no($orderNo);
$input->SetTotal_fee($200 * 100);//折算到分 $input->SetTotal_fee(200 * 100);//折算到分
$input->SetTime_start(date("YmdHis")); $input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 800)); $input->SetTime_expire(date("YmdHis", time() + 800));
$input->SetGoods_tag("志愿者会员购买"); $input->SetGoods_tag("志愿者会员购买");
......
...@@ -38,12 +38,12 @@ if(empty($sociaEventDat)) { ...@@ -38,12 +38,12 @@ if(empty($sociaEventDat)) {
//todo 获取已完成和未完成人员名单 //todo 获取已完成和未完成人员名单
$finishUserList = array(); $finishUserList = array();
$finishUserList[] = "家校用户1"; $finishUserList[] = array("name"=>"家校用户1", "head_img"=>"http://zgzyz.cyol.com/tplimg/25049.files/zt_ewm2.gif");
$finishUserList[] = "家校用户2"; $finishUserList[] = array("name"=>"家校用户2", "head_img"=>"http://zgzyz.cyol.com/tplimg/25049.files/zt_ewm2.gif");
$unfinishUserList = array(); $unfinishUserList = array();
$unfinishUserList[] = "家校用户3"; $unfinishUserList[] = array("name"=>"家校用户3", "head_img"=>"http://zgzyz.cyol.com/tplimg/25049.files/zt_ewm2.gif");
$unfinishUserList[] = "家校用户4"; $unfinishUserList[] = array("name"=>"家校用户4", "head_img"=>"http://zgzyz.cyol.com/tplimg/25049.files/zt_ewm2.gif");
//组装返回数据 //组装返回数据
......
...@@ -24,17 +24,17 @@ if(empty($userList)) { ...@@ -24,17 +24,17 @@ if(empty($userList)) {
$result["message"] = "用户不存在!"; $result["message"] = "用户不存在!";
responseNG($result); responseNG($result);
} }
$userId = $userList[0]->id; $userMst = $userList[0];
//查询消息数据 //查询消息数据
$param = array(); $param = array();
$param['user_id'] = $userId; $param['user_id'] = $userMst->id;
$param['id'] = $messageId; $param['id'] = $messageId;
$param['delete_flg'] = false; $param['delete_flg'] = false;
$userMessageList = UserMessageDat::getList($param,'id','desc', 0, 1); $userMessageList = UserMessageDat::getList($param,'id','desc', 0, 1);
//更新 //更新
if(!empty($userMessageList) && !$userMessageList[0]->is_read) { if(!empty($userMessageList) && $userMessageList[0]->is_read==false) {
$userMessageList[0]->is_read = true; $userMessageList[0]->is_read = true;
$userMessageList[0]->save(); $userMessageList[0]->save();
} }
...@@ -45,6 +45,16 @@ $userMessageDat = $userMessageList[0]; ...@@ -45,6 +45,16 @@ $userMessageDat = $userMessageList[0];
if($userMessageDat->attach_dat_type == "VOLUNTEER") { if($userMessageDat->attach_dat_type == "VOLUNTEER") {
$attachDat = VolunteerEventDat::getById($userMessageDat->attach_dat_id); $attachDat = VolunteerEventDat::getById($userMessageDat->attach_dat_id);
//数据加工
$status_title = "征集中";
if($attachDat->status == "FINISH") {
$status_title = "活动结束";
}
$attachDat->status_title = $status_title;
$attachDat->scope = "校内";
if($attachDat->include_social_user) {
$attachDat->scope = "校内.社会人士";
}
} }
if($userMessageDat->attach_dat_type == "CIRCLE") { if($userMessageDat->attach_dat_type == "CIRCLE") {
$attachDat = CircleDat::getById($userMessageDat->attach_dat_id); $attachDat = CircleDat::getById($userMessageDat->attach_dat_id);
......
...@@ -51,7 +51,8 @@ if($tmpCount >= 1) { ...@@ -51,7 +51,8 @@ if($tmpCount >= 1) {
//拒绝加入圈子处理,删除本条消息 //拒绝加入圈子处理,删除本条消息
$userMsgDat = UserMessageDat::getById($msgId); $userMsgDat = UserMessageDat::getById($msgId);
if(!empty($userMsgDat)) { if(!empty($userMsgDat)) {
$userMsgDat->delete_flg = true; $userMsgDat->is_read = true;
$userMsgDat->is_operated = true;
$userMsgDat->save(); $userMsgDat->save();
} }
......
...@@ -13,7 +13,7 @@ $comment = ParamUtil::getRequestString("comment");//说明 ...@@ -13,7 +13,7 @@ $comment = ParamUtil::getRequestString("comment");//说明
$result = array(); $result = array();
//参数检查 //参数检查
if(empty($unionId || empty($eventId) || empty($comment))) { if(empty($unionId || empty($eventId))) {
$result["message"] = "参数错误!"; $result["message"] = "参数错误!";
responseNG($result); responseNG($result);
} }
...@@ -39,23 +39,47 @@ if(empty($socialEventDat)) { ...@@ -39,23 +39,47 @@ if(empty($socialEventDat)) {
$userMst = $userList[0]; $userMst = $userList[0];
//添加用户完成情况 //添加用户完成情况
$socialEventMemberDat = new SocialEventMemberDat[0]; if(!empty($comment)) {
$socialEventMemberDat->social_event_id = $socialEventDat->id; //没有图片,只有感想的情况
$socialEventMemberDat->user_id = $userMst->id; $socialEventMemberDat = new SocialEventMemberDat();
$socialEventMemberDat->comment = $comment; $socialEventMemberDat->social_event_id = $socialEventDat->id;
$socialEventMemberDat->save(); $socialEventMemberDat->user_id = $userMst->id;
$socialEventMemberDat->comment = $comment;
//处理上传图片 $socialEventMemberDat->point = ABILITY_POINT;
$aliHandler = new AliUploadHandler(); $socialEventMemberDat->save();
if(!empty($_FILES['photo']['tmp_name'])){
//给用户添加能力分(todo)
$userMst->ability_point += ABILITY_POINT;
$userMst->save();
} else {
//批量接受上传图
$param = array();
$param['social_event_id'] = $socialEventDat->id;
$param['user_id'] = $userMst->id;
$param['delete_flg'] = false;
$tmpList = SocialEventMemberDat::getList($param,'id','desc', 0, 1);
if(!empty($tmpList)) {
$socialEventMemberDat = $tmpList[0];
//接受图片并更新
//处理上传图片
$aliHandler = new AliUploadHandler();
if(!empty($_FILES['photo']['tmp_name'])){
$upload_file = FileUploadUtil::getScalarFile(@$_FILES['photo']); $upload_file = FileUploadUtil::getScalarFile(@$_FILES['photo']);
$tmp_file_name = date("Ymd") . "_" . trim(basename($upload_file->name));//保存的名字自定义,这里如果图片的名字原来的是aa.jp,保存成20200220_aa.jpg $tmp_file_name = date("Ymd") . "_" . trim(basename($upload_file->name));//保存的名字自定义,这里如果图片的名字原来的是aa.jp,保存成20200220_aa.jpg
$url = $aliHandler->uploadImg($tmp_file_name, $upload_file->tmp_name); $url = $aliHandler->uploadImg($tmp_file_name, $upload_file->tmp_name);
//这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg //这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg
ErrorLogger::doOutput("Compass...ajax_set_social_event_result.php....images=" . $socialEventMemberDat->images, 0);
if(empty($socialEventMemberDat->images)) {
$socialEventMemberDat->images = $url; $socialEventMemberDat->images = $url;
} else {
$socialEventMemberDat->images = $socialEventMemberDat->images . "|" . $url;
}
$socialEventMemberDat->save();
}
}
} }
$socialEventMemberDat->save();
//todo 改为通知家校系统用户 //todo 改为通知家校系统用户
......
...@@ -59,7 +59,7 @@ if($circleDat->need_check) { ...@@ -59,7 +59,7 @@ if($circleDat->need_check) {
//添加附件附件 //添加附件附件
$userMessageDat->attach_dat_type = "CIRCLE"; $userMessageDat->attach_dat_type = "CIRCLE";
$userMessageDat->attach_dat_id = $circleDat->id; $userMessageDat->attach_dat_id = $circleDat->id;
$userMessageDat->attach_dat_path = "pages/checkJoinCircle/checkJoinCircle?userId={$userMst->id}&circleId={$circleDat->id}"; //$userMessageDat->attach_dat_path = "pages/checkJoinCircle/checkJoinCircle?userId={$userMst->id}&circleId={$circleDat->id}";
$result["message"] = "申请成功,请等待圈主审核!"; $result["message"] = "申请成功,请等待圈主审核!";
responseOK($result); responseOK($result);
......
...@@ -56,7 +56,7 @@ foreach($tmpList as $tmp) { ...@@ -56,7 +56,7 @@ foreach($tmpList as $tmp) {
} }
print_r($tmpList); print_r($tmpList);
*/
$param = array(); $param = array();
$param['delete_flg'] = false; $param['delete_flg'] = false;
...@@ -70,6 +70,29 @@ foreach($tmpList as $tmp) { ...@@ -70,6 +70,29 @@ foreach($tmpList as $tmp) {
} }
print_r($tmpList); print_r($tmpList);
$param = array();
$param['delete_flg'] = false;
$tmpList = UserMessageDat::getList($param, 'id', 'asc');
$index = 0;
foreach($tmpList as $tmp) {
if($tmp->attach_dat_type == "CIRCLE") {
$tmp->title = "您的圈子有一条加入申请";
$tmp->comment = "嘀嘀嘀![聪明的一休]申请加入您的圈子!";
$tmp->save();
}
}
*/
$param = array();
$param['delete_flg'] = false;
$tmpList = SocialEventDat::getList($param, 'id', 'asc');
$index = 0;
foreach($tmpList as $tmp) {
$tmp->content = "<font style='color:red'>此处富文本</font><img src='https://www.baidu.com/img/baidu_jgylogo3.gif'/>";
$tmp->save();
}
ErrorLogger::doOutput("Compass...test.php....End.", 0); ErrorLogger::doOutput("Compass...test.php....End.", 0);
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "圈子"
} }
\ No newline at end of file
// pages/testCircle/testCircle.js // pages/circleDetail/circleDetail.js
var app = getApp(); var app = getApp();
Page({ Page({
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "公益课堂"
} }
\ No newline at end of file
...@@ -39,7 +39,7 @@ Page({ ...@@ -39,7 +39,7 @@ Page({
console.log(res) console.log(res)
if (res.statusCode == 200) { if (res.statusCode == 200) {
that.setData({ that.setData({
familyEventList: res.data.result.familyEventList eventDat: res.data.result.sociaEventDat
}) })
} }
}, },
...@@ -96,9 +96,12 @@ Page({ ...@@ -96,9 +96,12 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
//跳转到亲子活动详情页面
familyEventDetail() { familyEventDetail() {
var eventId = e.currentTarget.dataset['index']
wx.navigateTo({ wx.navigateTo({
url: '../familyEventDetail/familyEventDetail', url: '../familyEventDetail/familyEventDetail?eventid=' + eventId,
}) })
}, },
loadMore() { loadMore() {
......
...@@ -8,6 +8,8 @@ Page({ ...@@ -8,6 +8,8 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
eventId: '',
eventDat: '',
active: 0 active: 0
}, },
......
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "观看记录"
} }
\ No newline at end of file
// pages/uploadDocuments/uploadDocuments.js // pages/joinSocialEvent/joinSocialEvent.js
var app = getApp(); import Notify from '../../dist/notify/notify';
var app = getApp()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
value:'', eventId: '',
fileList: [], eventTitle:'',
eventId:'',
img:'' comment:'',
fileList1: [],
fileList2: [],
fileList3: [],
imgPaths:[],
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
//获取参数
this.setData({ this.setData({
eventId:options.eventId eventId:options.eventId,
eventTitle: options.eventTitle
}) })
}, },
...@@ -73,22 +81,51 @@ Page({ ...@@ -73,22 +81,51 @@ Page({
// event.detail 为当前输入的值 // event.detail 为当前输入的值
console.log(event.detail); console.log(event.detail);
}, },
delete(event) { //第1张图片
delete1(event) {
const { index, name } = event.detail;
const fileList = this.data[`fileList1`];
fileList.splice(index, 1);
this.setData({ [`fileList1`]: fileList });
},
afterRead1(event) {
const { file, name } = event.detail;
const fileList = this.data[`fileList1`];
const images = this.data.imgPaths;
this.setData({
[`fileList1`]: fileList.concat(file),
imgPaths: images.concat(file[0].path)
});
},
beforeRead1(event) {
const { file, callback } = event.detail;
if (file[0].path.indexOf('jpg') < 0) {
wx.showToast({ title: '请选择jpg图片上传', icon: 'none' });
callback(false);
return;
}
callback(true);
},
//第2张图片
delete2(event) {
const { index, name } = event.detail; const { index, name } = event.detail;
const fileList = this.data[`fileList`]; const fileList = this.data[`fileList2`];
fileList.splice(index, 1); fileList.splice(index, 1);
this.setData({ [`fileList`]: fileList }); this.setData({ [`fileList2`]: fileList });
}, },
afterRead(event) { afterRead2(event) {
const { file, name } = event.detail; const { file, name } = event.detail;
const fileList = this.data[`fileList`]; const fileList = this.data[`fileList2`];
const images = this.data.imgPaths;
this.setData({ this.setData({
[`fileList`]: fileList.concat(file), [`fileList2`]: fileList.concat(file),
img:file[0].path imgPaths: images.concat(file[0].path)
}); });
}, },
beforeRead(event) { beforeRead2(event) {
const { file, callback } = event.detail; const { file, callback } = event.detail;
if (file[0].path.indexOf('jpg') < 0) { if (file[0].path.indexOf('jpg') < 0) {
wx.showToast({ title: '请选择jpg图片上传', icon: 'none' }); wx.showToast({ title: '请选择jpg图片上传', icon: 'none' });
...@@ -97,30 +134,106 @@ Page({ ...@@ -97,30 +134,106 @@ Page({
} }
callback(true); callback(true);
}, },
shangchuan(){
//第3张图片
delete3(event) {
const { index, name } = event.detail;
const fileList = this.data[`fileList3`];
fileList.splice(index, 1);
this.setData({ [`fileList3`]: fileList });
},
afterRead3(event) {
const { file, name } = event.detail;
const fileList = this.data[`fileList3`];
const images = this.data.imgPaths;
this.setData({
[`fileList3`]: fileList.concat(file),
imgPaths: images.concat(file[0].path)
});
},
beforeRead3(event) {
const { file, callback } = event.detail;
if (file[0].path.indexOf('jpg') < 0) {
wx.showToast({ title: '请选择jpg图片上传', icon: 'none' });
callback(false);
return;
}
callback(true);
},
//上传素材
upload(){
var that = this; var that = this;
//感想必须输入
if (that.data.comment == null || that.data.comment.trim() == "") {
Notify('请输入感想')
return
}
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
wx: wx.request({ wx.request({
url: app.url + 'ajax_set_social_event_result.php', url: app.url + 'ajax_set_social_event_result.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
eventId: that.data.eventId, eventId: that.data.eventId,
comment:that.data.value, comment: that.data.comment,
photo:that.data.img
}, },
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) //循环上传图片
var completeCount = 0;
for (var i = 0;i <that.data.imgPaths.length;i++) {
//停顿1秒
var imgPath = that.data.imgPaths[i];
setTimeout(function () {
wx.uploadFile({
url: app.url + 'ajax_set_social_event_result.php?unionId=' + config.unionId + "&eventId=" + that.data.eventId,
filePath: imgPath,
name: 'photo',
header: { 'content-type': 'multipart/form-data' },
success: function (res) {
},
fail: function (res) {
console.log(res, '上传失败')
},
complete: function (res) {
completeCount++;
},
})
}, 1000) //延迟时间 这里是1秒
}
//循环执行等待全部结束
var a = setInterval(function () {
//循环执行代码
if (that.data.imgPaths.length == completeCount) {
//跳转到首页
wx.showToast({
title: '上传成功!',
icon: 'success',
duration: 2000
});
clearInterval(a)
//跳转到社会实践页面
wx.navigateTo({
url: '../socialEvent/socialEvent',
});
}
}, 1000) //循环时间 这里是1秒
}, },
fail: function (res) { }, fail: function (res) { },
complete: function (res) { }, complete: function (res) { },
}) })
}, },
changeinp(event){
//获取输入的感想
inputComment(event){
this.setData({ this.setData({
value: event.detail.value comment: event.detail.value
}) })
} }
}) })
\ No newline at end of file
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "社会实践"
} }
\ No newline at end of file
<!--pages/uploadDocuments/uploadDocuments.wxml--> <!--pages/uploadDocuments/uploadDocuments.wxml-->
<view class='uploadDocuments'> <view class='uploadDocuments'>
<view class='uploadDocuments_title'>活动名称:马群xxxxxxxx</view> <view class='uploadDocuments_title'>活动名称:{{eventTitle}}</view>
<view class='uploadDocuments_ganwu'> <view class='uploadDocuments_ganwu'>
活动感悟:<textarea class='inpGanwu' bindinput="changeinp" value='{{value}}'></textarea> 活动感悟:<textarea class='inpGanwu' bindinput="inputComment" value='{{comment}}'></textarea>
</view> </view>
<view style="width:100%;margin-top:10px;">活动图片(3张即可):</view>
<view class='uploadDocuments_img'> <view class='uploadDocuments_img'>
活动图片:
<view> <view>
<van-uploader file-list="{{ fileList }}" <van-uploader file-list="{{ fileList1 }}"
max-count="1" max-count="1"
multiple multiple
bind:after-read="afterRead" bind:after-read="afterRead1"
bind:before-read="beforeRead" bind:before-read="beforeRead1"
use-before-read="{{ true }}" use-before-read="{{ true }}"
bind:delete="delete"/> bind:delete="delete1"/>
<text style='font-size:12px;color:#666'>仅支持jpg格式</text> <text style='font-size:12px;color:#666'>仅支持jpg格式</text>
</view> </view>
<text style='font-size:14px;color:#666'>(3张即可)</text> <view>
<van-uploader file-list="{{ fileList2 }}"
max-count="1"
multiple
bind:after-read="afterRead2"
bind:before-read="beforeRead2"
use-before-read="{{ true }}"
bind:delete="delete2"/>
<text style='font-size:12px;color:#666'>仅支持jpg格式</text>
</view>
<view>
<van-uploader file-list="{{ fileList3 }}"
max-count="1"
multiple
bind:after-read="afterRead3"
bind:before-read="beforeRead3"
use-before-read="{{ true }}"
bind:delete="delete3"/>
<text style='font-size:12px;color:#666'>仅支持jpg格式</text>
</view>
<text style='font-size:14px;color:#666'></text>
</view> </view>
<view style='width:100%;display:flex;justify-content: center;'> <view style='width:100%;display:flex;justify-content: center;'>
<van-button type="default" bind:click="shangchuan">确认上传</van-button> <view class="actionBtn" bindtap="upload">确认上传</view>
</view> </view>
<van-notify id="van-notify" />
</view> </view>
...@@ -22,10 +22,23 @@ ...@@ -22,10 +22,23 @@
} }
.uploadDocuments_img{ .uploadDocuments_img{
display: flex; display: flex;
height: 320px; height: 240px;
margin-top: 20px; margin-top: 10px;
} }
.uploadDocuments_img>view{ .uploadDocuments_img>view{
width: 100px; width: 100px;
height: 100px; height: 100px;
} }
.actionBtn{
width: 75%;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
margin: 10px auto;
background: #0D76ED;
margin-bottom: 10px;
color: #fff;
border-radius: 15px;
}
\ No newline at end of file
...@@ -50,13 +50,9 @@ Page({ ...@@ -50,13 +50,9 @@ Page({
//跳转到社会实践详情页面 //跳转到社会实践详情页面
socialEventDetail(e){ socialEventDetail(e){
var eventId = e.currentTarget.dataset['eventid'] var eventId = e.currentTarget.dataset['index']
wx.navigateTo({ wx.navigateTo({
url: '../socialEventDetail/socialEventDetail?eventid='+eventId, url: '../socialEventDetail/socialEventDetail?eventId='+eventId,
})
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#00C56B'
}) })
}, },
......
...@@ -8,8 +8,12 @@ Page({ ...@@ -8,8 +8,12 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
active: 0, eventId: '',
eventId:'' eventDat: '',
finishUserList:[],
unfinishUserList: [],
active: 0
}, },
/** /**
...@@ -17,27 +21,29 @@ Page({ ...@@ -17,27 +21,29 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
this.setData({ this.setData({
eventId:options.eventId eventId: options.eventId
}) })
var that = this; var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
var jingweidu = wx.getStorageSync('jingweidu');
wx: wx.request({ //调用接口获取数据
wx.request({
url: app.url + 'ajax_get_social_event_detail.php', url: app.url + 'ajax_get_social_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,
// circleList: res.data.result.circleList finishUserList: res.data.result.finishUserList,
// }) unfinishUserList: res.data.result.unfinishUserList
// } })
}
}, },
fail: function (res) { }, fail: function (res) { },
complete: function (res) { }, complete: function (res) { },
...@@ -59,13 +65,6 @@ Page({ ...@@ -59,13 +65,6 @@ Page({
}, },
/** /**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
...@@ -92,13 +91,16 @@ Page({ ...@@ -92,13 +91,16 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
onChange(event) { onChange(event) {
}, },
btnBaoming(){
//参加
attend(){
var that=this; var that=this;
wx.navigateTo({ wx.navigateTo({
url: '../joinSocialEvent/joinSocialEvent?eventId='+that.data.eventId, url: '../joinSocialEvent/joinSocialEvent?eventId=' + that.data.eventId + "&eventTitle=" + that.data.eventDat.title,
}) })
} }
......
<view class='activeDetails'> <view class='activeDetails'>
<view class='top_socialEventDetail'> <view class='top_socialEventDetail'>
<view>初一(5)班七年级48期:爱心土豆番茄汤</view> <view>{{eventDat.title}}</view>
<text>作者:家校共育指导老师 发表时间:2020-01-07</text> <text>作者:{{eventDat.author}} 发表时间:{{eventDat.publish_time}}</text>
</view> </view>
<view class='con_socialEventDetail'> <view class='con_socialEventDetail'>
<view class='title_socialEventDetail'> <rich-text nodes="{{eventDat.content}}"></rich-text>
<view class='top_title'>
<view>《活动目标》</view>
<text></text>
</view>
<view class='neirong_title'>
寒假快要到了,孩子也有时间为家人做一份简单味美的私家食疗菜--土豆番茄食疗汤。主料只有土豆和番茄,红黄相称,汤鲜开胃,清淡爽口。
1.了解土豆番茄食疗汤的做法;
2.知道菜系的功效,讲给老人听一听,提高表达能力;
3.营造家庭和谐的氛围,做一个关心家人的好少年。
</view>
<text></text>
</view>
<view class='title_socialEventDetail'>
<view class='top_title'>
<view>《活动准备》</view>
<text></text>
</view>
<view class='neirong_title'>
1.食材:土豆1个,番茄1-个,香葱1根;
2.佐料:盐1/2茶匙(3g),鸡精1/2茶匙(3g),油(15ml);
</view>
<text></text>
</view>
<view class='title_socialEventDetail'>
<view class='top_title'>
<view>《活动过程》</view>
<text></text>
</view>
<view class='neirong_title'>
一、亲子聊天室:
1.番茄--植物中的黄金:番茄含有丰富的番茄红素,它是目前自然界植物中被发现的最强的抗氧化剂之一,被称为"植物中的黄金"。烧熟的西红柿中番茄红素比生西红柿更高,更加有益于人的健康。
<image src='../../img/1.jpg'></image>
2.土豆--地下苹果:土豆浑身是宝,享有"地下苹果"的美誉。以土豆为代表的含钾蔬果有利于降血压,每天坚持吃一个中等大小的土豆,可以使脑卒中的发病率降低40%。
<image src='../../img/1.jpg'></image>
3.土豆搭配番茄,这两种食材一起做汤时绝配,不仅功效强大,还很好喝,因此颇受大家欢迎。
</view>
<text></text>
</view>
</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>
...@@ -64,22 +20,16 @@ ...@@ -64,22 +20,16 @@
</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/socialEventDetail/socialEventDetail.wxss */ /* pages/socialEventDetail/socialEventDetail.wxss */
.top_socialEventDetail{ .top_socialEventDetail{
box-sizing: border-box; box-sizing: border-box;
padding: 15px 5px padding: 15px 5px;
text-align: center;
} }
.top_socialEventDetail>view{ .top_socialEventDetail>view{
font-size: 14px; font-size: 14px;
...@@ -11,6 +12,7 @@ ...@@ -11,6 +12,7 @@
.top_socialEventDetail>text{ .top_socialEventDetail>text{
font-size: 12px; font-size: 12px;
color: #666; color: #666;
} }
.con_socialEventDetail{ .con_socialEventDetail{
box-sizing: border-box; box-sizing: border-box;
...@@ -61,7 +63,11 @@ ...@@ -61,7 +63,11 @@
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
.activebeijing{ .activebeijing{
background: #00C56B; 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;
...@@ -98,13 +104,15 @@ ...@@ -98,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
...@@ -189,12 +189,12 @@ Page({ ...@@ -189,12 +189,12 @@ Page({
} }
//法人行密名必须输入 //法人行密名必须输入
if (that.data.legalPerson == null || that.data.legalPerson.trim() == "") { if (that.data.legalPerson == null || that.data.legalPerson.trim() == "") {
Notify('请输法人姓名') Notify('请输法人姓名')
return return
} }
//法人行密名必须输入 //法人行密名必须输入
if (that.data.organizationContact == null || that.data.organizationContact.trim() == "") { if (that.data.organizationContact == null || that.data.organizationContact.trim() == "") {
Notify('请输法人手机') Notify('请输法人手机')
return return
} }
wx.request({ wx.request({
......
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