Commit a93a2acd by biao

1111111

11
parent 192c96f2
...@@ -94,6 +94,11 @@ class PayNotifyCallBack extends WxPayNotify ...@@ -94,6 +94,11 @@ class PayNotifyCallBack extends WxPayNotify
$userDonation->status = "SUCCESS"; $userDonation->status = "SUCCESS";
$userDonation->save(); $userDonation->save();
//更新募集资金总额
$donationsEventDat = DonationsEventDat::getById($userDonation->donation_id);
$donationsEventDat->money += $userDonation->money;
$donationsEventDat->save();
//添加用户支付记录汇总 //添加用户支付记录汇总
$userMst = UserMst::getById($userDonation->user_id); $userMst = UserMst::getById($userDonation->user_id);
$userPayLog = new UserPayLog(); $userPayLog = new UserPayLog();
......
...@@ -7,7 +7,7 @@ ErrorLogger::doOutput("Compass...ajax_get_donation_event_list.php....Start.", 0) ...@@ -7,7 +7,7 @@ ErrorLogger::doOutput("Compass...ajax_get_donation_event_list.php....Start.", 0)
//获取参数 //获取参数
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$eventId = ParamUtil::getRequestNumber("eventId", 0); $donationId = ParamUtil::getRequestNumber("donationId", 0);
//判断用户是否存在 //判断用户是否存在
$param = array(); $param = array();
...@@ -20,7 +20,7 @@ if(empty($userList)) { ...@@ -20,7 +20,7 @@ if(empty($userList)) {
} }
//判断募捐活动是否存在 //判断募捐活动是否存在
$donationEventDat = DonationsEventDat::getById($eventId); $donationEventDat = DonationsEventDat::getById($donationId);
if(empty($donationEventDat)) { if(empty($donationEventDat)) {
$result["message"] = "参数错误!"; $result["message"] = "参数错误!";
responseNG($result); responseNG($result);
...@@ -35,9 +35,9 @@ $param['delete_flg'] = false; ...@@ -35,9 +35,9 @@ $param['delete_flg'] = false;
$tmpList = UserDonationDat::getList($param,'id','desc'); $tmpList = UserDonationDat::getList($param,'id','desc');
if(!empty($tmpList)) { if(!empty($tmpList)) {
foreach($tmpList as $tmp) { foreach($tmpList as $tmp) {
$userMst = UserMst::getById($tmp->id); $userMst = UserMst::getById($tmp->user_id);
if(!empty($userMst)) { if(!empty($userMst)) {
$userDonationList[] = array("name"=>$userMst->name, "money"=>$tmp->money); $userDonationList[] = array("name"=>$userMst->name, "header_img"=>$userMst->header_img, "money"=>$tmp->money, "comment"=>$tmp->comment);
} }
} }
} }
...@@ -46,7 +46,6 @@ if(!empty($tmpList)) { ...@@ -46,7 +46,6 @@ if(!empty($tmpList)) {
$result["donationDat"] = $donationEventDat; $result["donationDat"] = $donationEventDat;
$result["userDonationList"] = $userDonationList; $result["userDonationList"] = $userDonationList;
ErrorLogger::doOutput("Compass...ajax_get_donation_event_list.php....End.", 0); ErrorLogger::doOutput("Compass...ajax_get_donation_event_list.php....End.", 0);
......
...@@ -17,8 +17,6 @@ if(empty($unionId)) { ...@@ -17,8 +17,6 @@ if(empty($unionId)) {
responseNG($result); responseNG($result);
} }
//判断用户是否存在 //判断用户是否存在
$param = array(); $param = array();
$param['unionid'] = $unionId; $param['unionid'] = $unionId;
...@@ -49,7 +47,11 @@ if(!empty($volunteerEventMemberList)) { ...@@ -49,7 +47,11 @@ 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)) {
$volunteerEventDat->status_title = EventStatus::getTitleByName($volunteerEventDat->status); if($volunteerEventDat->status == "OK") {
$volunteerEventDat->status_title = "已报名";
} else {
$volunteerEventDat->status_title = "已结束";
}
$volunteerEventDat->scope = "校内"; $volunteerEventDat->scope = "校内";
if($volunteerEventDat->include_social_user) { if($volunteerEventDat->include_social_user) {
$volunteerEventDat->scope = "校内.社会人士"; $volunteerEventDat->scope = "校内.社会人士";
......
...@@ -34,6 +34,10 @@ if(empty($volunteerDat)) { ...@@ -34,6 +34,10 @@ if(empty($volunteerDat)) {
responseNG($result); responseNG($result);
} }
//加工开始和结束时间
$volunteerDat->start_time = substr($volunteerDat->start_time, 0, 10);
$volunteerDat->finish_time = substr($volunteerDat->finish_time, 0, 10);
$userMst = $userList[0]; $userMst = $userList[0];
//是否已经报名参加 //是否已经报名参加
...@@ -72,9 +76,9 @@ if(date("Y-m-d H:i:s") >= $volunteerDat->enroll_time) { ...@@ -72,9 +76,9 @@ if(date("Y-m-d H:i:s") >= $volunteerDat->enroll_time) {
$personalMemberList = array(); $personalMemberList = array();
$circleMemberList = array(); $circleMemberList = array();
$param = array(); $param = array();
//【个人】 //【个人已经报名
$param = array(); $param = array();
$param['volunteer_event_id'] = $userMst->id; $param['volunteer_event_id'] = $eventId;
$param['circle_id'] = 0; $param['circle_id'] = 0;
$param['delete_flg'] = false; $param['delete_flg'] = false;
$tmpMemberList1 = VolunteerEventMemberDat::getList($param, "id", "desc"); $tmpMemberList1 = VolunteerEventMemberDat::getList($param, "id", "desc");
...@@ -86,22 +90,22 @@ if(!empty($tmpMemberList1)) { ...@@ -86,22 +90,22 @@ if(!empty($tmpMemberList1)) {
} }
} }
//【圈子已报名成员 //【圈子已报名】
$param = array(); $param = array();
$param['volunteer_event_id'] = $userMst->id; $param['volunteer_event_id'] = $eventId;
$param['circle_id_MIN'] = 1; $param['circle_id_MIN'] = 1;
$param['is_owner'] = true; $param['is_owner'] = true;
$param['delete_flg'] = false; $param['delete_flg'] = false;
$tmpMemberList2 = VolunteerEventMemberDat::getList($param, "id", "desc"); $tmpMemberList2 = VolunteerEventMemberDat::getList($param, "id", "desc");
if(!empty($tmpMemberList2)) { if(!empty($tmpMemberList2)) {
foreach($tmpMemberList2 as $tmpMember) { foreach($tmpMemberList2 as $tmpMember) {
$tmpUser = UserMst::getById($tmpMember->user_id); $tmpCircle = CircleDat::getById($tmpMember->circle_id);
$param2 = array(); $param2 = array();
$param2['volunteer_event_id'] = $userMst->id; $param2['volunteer_event_id'] = $eventId;
$param2['circle_id'] = $tmpMember->circle_id; $param2['circle_id'] = $tmpMember->circle_id;
$param2['delete_flg'] = false; $param2['delete_flg'] = false;
$tmpMemberCount = VolunteerEventMemberDat::getListCount($param2); $tmpMemberCount = VolunteerEventMemberDat::getListCount($param2);
$tmpArray= array("name"=>$tmpUser->name, "enrollCount"=>$tmpMemberCount); $tmpArray= array("title"=>$tmpCircle->title, "front_image"=>$tmpCircle->front_image, "enroll_count"=>$tmpMemberCount);
$circleMemberList[] = $tmpArray; $circleMemberList[] = $tmpArray;
} }
} }
......
...@@ -8,12 +8,13 @@ ErrorLogger::doOutput("Compass...ajax_set_user_donation_dat.php.php....Start.", ...@@ -8,12 +8,13 @@ ErrorLogger::doOutput("Compass...ajax_set_user_donation_dat.php.php....Start.",
//获取参数 //获取参数
$unionId = ParamUtil::getRequestString("unionId"); $unionId = ParamUtil::getRequestString("unionId");
$donationId = ParamUtil::getRequestNumber("donationId", 0); $donationId = ParamUtil::getRequestNumber("donationId", 0);
$comment = ParamUtil::getRequestString("comment");
$money = ParamUtil::getRequestNumber("money", 0); $money = ParamUtil::getRequestNumber("money", 0);
$result = array(); $result = array();
//参数检查 //参数检查
if(empty($unionId) || empty($circleId)|| empty($title)|| empty($comment)) { if(empty($unionId) || empty($donationId)|| empty($comment)|| empty($money)) {
$result["message"] = "参数错误!"; $result["message"] = "参数错误!";
responseNG($result); responseNG($result);
} }
...@@ -32,49 +33,45 @@ if(empty($userList)) { ...@@ -32,49 +33,45 @@ if(empty($userList)) {
$userMst = $userList[0]; $userMst = $userList[0];
//募捐项目是否存在 //募捐项目是否存在
$donationEventDat = DonationsEventDat::getById($donationId);
if(empty($donationEventDat)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//调用支付 //调用支付
//生成临时订单 //生成临时订单
$orderNo = "D" . date("YmdHis") . "_" . $userMst->id; $orderNo = "D" . date("YmdHis") . "_" . $userMst->id;
$userMediaDat = new UserMediaDat(); $userDonationDat = new UserDonationDat();
$userMediaDat->user_id = $userMst->id; $userDonationDat->user_id = $userMst->id;
$userMediaDat->course_id = $courseMediaDat->course_id; $userDonationDat->donation_id = $donationEventDat->id;
$userMediaDat->media_id = $courseMediaDat->id; $userDonationDat->comment = $comment;
$userMediaDat->is_free = $courseMediaDat->is_free; $userDonationDat->money = $money;
$userMediaDat->money = $courseMediaDat->price; $userDonationDat->order_no = $orderNo;
$userMediaDat->order_no = $orderNo; $userDonationDat->status = "NEW";
$userMediaDat->status = "NEW"; $userDonationDat->save();
$userMediaDat->save();
//判断是否为圈主 //调用微信支付接口
if($circleDat->owner_id != $userMst->id) { $tools = new JsApiPay();
$result["message"] = "圈主才有权限发公告!"; $input = new WxPayUnifiedOrder();
responseNG($result); $input->SetBody("慈善募捐");
} $input->SetAttach("慈善募捐");
$input->SetOut_trade_no($orderNo);
$input->SetTotal_fee($money * 100);//折算到分
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 800));
$input->SetGoods_tag("慈善募捐");
$input->SetNotify_url("https://" . SSL_PATH . "/api/api_wx_pay_notify.php");
$input->SetTrade_type("JSAPI");
$input->SetOpenid($userMst->openid);
//发布公告 $order = WxPayApi::unifiedOrder($input);
$noticeDat = new CircleNoticeDat();
$noticeDat->circle_id = $circleDat->id;
$noticeDat->title = $title;
$noticeDat->comment = $comment;
//上传图片到阿里云oss
$aliHandler = new AliUploadHandler();
if(!empty($_FILES['image']['tmp_name'])){
$upload_file = FileUploadUtil::getScalarFile(@$_FILES['image']);
$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); $jsApiParameters = $tools->GetJsApiParameters($order);
ErrorLogger::doOutput($url); ErrorLogger::doOutput($jsApiParameters);
//这里的url就是http://compass-dev.oss-cn-beijing.aliyuncs.com/20200220_aa.jpg ErrorLogger::doOutput("Compass...ajax_set_user_donation_dat.php....End.", 0);
$noticeDat->image = $url;
}
$noticeDat->save();
ErrorLogger::doOutput("Compass...ajax_set_user_donation_dat.php.php....End.", 0);
//返回结果 responseOK($jsApiParameters);
$result["message"] = "发布成功!";
responseOK($result);
function responseNG($result) { function responseNG($result) {
$result = array("status"=>"NG", "result"=>$result); $result = array("status"=>"NG", "result"=>$result);
......
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
<view class='top_conQuanzi'> <view class='top_conQuanzi'>
<image src='../../img/sanjiao.png'></image>附近志愿者圈子 <image src='../../img/sanjiao.png'></image>附近志愿者圈子
</view> </view>
<view class='quanziSearch' wx:if="{{showNearCircles==0}}"> <view class='quanziSearch'>
<view class='con_quanziSearch' bindtap='searchCircleNearby'>搜索</view> <view class='con_quanziSearch' bindtap='searchCircleNearby'>搜索</view>
</view> </view>
<view class='con_conQuanzi' wx:if="{{showNearCircles==1}}"> <view class='con_conQuanzi'>
<view class='listNull' wx:if="{{circleList==''}}"> <view class='listNull' wx:if="{{circleList==''}}">
<image src='../../img/null.png'></image> <image src='../../img/null.png'></image>
<view style='width:180px'>附近还没有圈子,快新建一个吧!</view> <view style='width:180px'>附近还没有圈子,快新建一个吧!</view>
......
...@@ -147,8 +147,9 @@ page{ ...@@ -147,8 +147,9 @@ page{
margin-right: 10px; margin-right: 10px;
} }
.quanziSearch{ .quanziSearch{
margin-top: -25px;
width: 100%; width: 100%;
height: 200px; height: 60px;
position: relative; position: relative;
} }
.con_quanziSearch{ .con_quanziSearch{
...@@ -166,9 +167,10 @@ page{ ...@@ -166,9 +167,10 @@ page{
} }
.con_conQuanzi{ .con_conQuanzi{
width: 100%; width: 100%;
height: 32vh; min-height: 150px;
box-sizing: border-box; box-sizing: border-box;
padding: 10px; padding: 10px;
margin-bottom: 10px;
} }
.quanziList{ .quanziList{
width: 100%; width: 100%;
......
// pages/circleMoment/circleMoment.js // pages/circleMoment/circleMoment.js
import Dialog from '../../dist/dialog/dialog';
import Notify from '../../dist/notify/notify';
var app = getApp(); var app = getApp();
Page({ Page({
...@@ -19,9 +21,15 @@ Page({ ...@@ -19,9 +21,15 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this; var that = this;
if (options != undefined && options.circleId) {
that.setData({ that.setData({
circleId: options.circleId circleId: options.circleId
}) })
}
that.setData({
page:0,
momentList:[]
})
this.getMomentList(); this.getMomentList();
}, },
...@@ -60,7 +68,7 @@ Page({ ...@@ -60,7 +68,7 @@ Page({
} }
}, },
//发布动态 //获取动态列表
getMomentList() { getMomentList() {
var that = this; var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
...@@ -96,5 +104,46 @@ Page({ ...@@ -96,5 +104,46 @@ Page({
}); });
}, },
//删除
deleteMoment(e) {
var that = this;
let momentId = e.currentTarget.dataset['index']
var config = wx.getStorageSync('config');
Dialog.confirm({
title: '',
message: '是否删除动态?'
}).then(() => {
//取消报名处理
wx.request({
url: app.url + 'ajax_delete_circle_moment.php',
data: {
unionId: config.unionId,
circleId: that.data.circleId,
momentId: momentId
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
if (res.statusCode == 200) {
Notify({ type: 'success', message: res.data.result.message });
//刷新本页面
if (res.data.status == "OK") {
that.onLoad();
}
}
},
fail: function (res) {
Notify({ type: 'danger', message: res.data.result.message });
},
complete: function (res) { },
})
}).catch(() => {
});
}
}) })
\ No newline at end of file
...@@ -8,5 +8,10 @@ ...@@ -8,5 +8,10 @@
<view class="images"> <view class="images">
<image src='{{item}}' wx:for="{{momentDat.images}}" mode="aspectFit"></image> <image src='{{item}}' wx:for="{{momentDat.images}}" mode="aspectFit"></image>
</view> </view>
<view class="actionRow" wx:if="{{isOwner}}">
<image src='../../img/delete.png' mode="widthFix" bindtap="deleteMoment" data-index="{{momentDat.id}}"></image>
</view>
</view> </view>
</view> </view>
<van-notify id="van-notify" />
<van-dialog id="van-dialog" />
...@@ -42,3 +42,15 @@ ...@@ -42,3 +42,15 @@
margin-right: 5px; margin-right: 5px;
} }
.momentItem .actionRow{
width: 100%;
margin-bottom: 10px;
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
}
.momentItem .actionRow>image{
width: 60px;
}
...@@ -19,6 +19,7 @@ Page({ ...@@ -19,6 +19,7 @@ Page({
play:0, play:0,
fufeiPage:0, fufeiPage:0,
playUrl:'', playUrl:'',
detailComment: '',
money:0 money:0
}, },
...@@ -86,7 +87,8 @@ Page({ ...@@ -86,7 +87,8 @@ Page({
if (resp.data.result.courseMediaDat.haveBuy && !resp.data.result.courseMediaDat.is_free || resp.data.result.courseMediaDat.is_free){ if (resp.data.result.courseMediaDat.haveBuy && !resp.data.result.courseMediaDat.is_free || resp.data.result.courseMediaDat.is_free){
that.setData({ that.setData({
play:1, play:1,
playUrl:resp.data.result.courseMediaDat.media playUrl:resp.data.result.courseMediaDat.media,
detailComment: resp.data.result.courseMediaDat.comment
}) })
}else{ }else{
that.setData({ that.setData({
......
...@@ -27,8 +27,15 @@ ...@@ -27,8 +27,15 @@
</view> </view>
<view class='play' wx:if="{{play==1}}"> <view class='play' wx:if="{{play==1}}">
<video class='video' src="{{playUrl}}"></video> <video class='video' src="{{playUrl}}"></video>
<view style='font-size:14px;padding-left:5px;margin-top:10px;'>
<image src='../../img/sanjiao.png'></image>课程简介
</view>
<view style='font-size:14px;padding-left:5px;margin-top:5px;'>
{{detailComment}}
</view>
<!-- <view class='backplay' bindtap='backplay'>返回</view> --> <!-- <view class='backplay' bindtap='backplay'>返回</view> -->
<view style="text-align:center;"> <view class="backButton" style="text-align:center;">
<van-button type="warning" bind:click="backplay" size='large'>返回</van-button> <van-button type="warning" bind:click="backplay" size='large'>返回</van-button>
</view> </view>
</view> </view>
......
...@@ -112,7 +112,13 @@ page{ ...@@ -112,7 +112,13 @@ page{
width: 100%; width: 100%;
max-height: 500px; max-height: 500px;
} }
.play>view{
.play>view>image{
width: 10px;
height: 10px;
}
.play .backButton{
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 40px; height: 40px;
......
// pages/donationDetail/donationDetail.js // pages/donationDetail/donationDetail.js
import Notify from '../../dist/notify/notify';
var app = getApp(); var app = getApp();
Page({ Page({
...@@ -6,11 +8,12 @@ Page({ ...@@ -6,11 +8,12 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
donationId:0,
donationDat:null, donationDat:null,
userDonationList:[], userDonationList:[],
value1:'', money:'',
value2:'', comment:'',
juankuanshow:0 showDilog:0
}, },
/** /**
...@@ -18,13 +21,19 @@ Page({ ...@@ -18,13 +21,19 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this; var that = this;
if (options != null) {
that.setData({
donationId: options.donationId,
})
}
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
//获取详细信息 //获取详细信息
wx.request({ wx.request({
url: app.url + 'ajax_get_donation_event_detail.php', url: app.url + 'ajax_get_donation_event_detail.php',
data: { data: {
unionId: config.unionId, unionId: config.unionId,
eventId:1 donationId: that.data.donationId
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
...@@ -47,42 +56,24 @@ Page({ ...@@ -47,42 +56,24 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
}, },
/** /**
...@@ -91,36 +82,113 @@ Page({ ...@@ -91,36 +82,113 @@ Page({
onShareAppMessage: function () { onShareAppMessage: function () {
}, },
changeinp1(event){
onInputMoney(event){
this.setData({ this.setData({
value1: event.event.detail.value money: event.detail.value
}) })
}, },
changeinp2(event) { onInputComment(event) {
this.setData({ this.setData({
value2: event.event.detail.value comment: event.detail.value
}) })
}, },
//取消捐款 //取消捐款
cancelDonation(){ cancelDonation(){
this.setData({ this.setData({
juankuanshow:0 showDilog:0
}) })
}, },
//显示捐款对话框 //显示捐款对话框
donationAction(){ donationAction(){
this.setData({ this.setData({
juankuanshow: 1 showDilog: 1
}) })
}, },
//捐款支付 //捐款支付
donationPay(){ donationPay(){
var that=this; var that=this;
wx:wx.navigateTo({ //金额必须输入
url: '../userDonation/userDonation?money='+that.data.value1+'&comment='+that.data.value2 if (that.data.money == null || that.data.money.trim() == "") {
Notify('请输入捐款金额')
return
}
//金额必须是数字
var isMoney = this.isPriceNumber(that.data.money)
if (!isMoney) {
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_user_donation_dat.php',
data: {
unionId: config.unionId,
donationId: that.data.donationId,
comment: that.data.comment,
money: that.data.money
},
success: function (resp) {
console.log(resp)
if (resp.data.status == 'OK') {
var result = JSON.parse(resp.data.result);
wx.requestPayment({
timeStamp: result.timeStamp,
nonceStr: result.nonceStr,
package: result.package,
signType: 'MD5',
paySign: result.paySign,
success(res) {
//刷新本页面
Notify('捐赠成功!')
that.setData({
money: '',
comment: '',
showDilog: 0,
})
that.onLoad();
},
fail(res) {
Notify('支付失败!')
}
}) })
} }
}
})
},
//判断金额
isPriceNumber(_keyword){
if(_keyword == "0" || _keyword == "0." || _keyword == "0.0" || _keyword == "0.00"){
_keyword = "0"; return true;
}else {
var index = _keyword.indexOf("0");
var length = _keyword.length;
if (index == 0 && length > 1) {/*0开头的数字串*/
var reg = /^[0]{1}[.]{1}[0-9]{1,2}$/;
if (!reg.test(_keyword)) {
return false;
} else {
return true;
}
} else {/*非0开头的数字*/
var reg = /^[1-9]{1}[0-9]{0,10}[.]{0,1}[0-9]{0,2}$/;
if (!reg.test(_keyword)) {
return false;
} else {
return true;
}
}
return false;
}
}
}) })
\ No newline at end of file
...@@ -4,28 +4,49 @@ ...@@ -4,28 +4,49 @@
<view class='frontImg'> <view class='frontImg'>
<image src="{{donationDat.front_image}}" /> <image src="{{donationDat.front_image}}" />
</view> </view>
<view class="row">
<text class="titleText">募捐事由:</text><text class="dataText">{{donationDat.title}}</text>
</view>
<view class="row">
<text class="titleText">募捐说明:</text><text class="dataText">{{donationDat.comment}}</text>
</view>
<view class="row">
<text class="titleText">发布单位:</text><text class="dataText">{{donationDat.author}}</text>
</view>
<view class="row">
<text class="titleText">募捐金额:</text><text class="dataText">{{donationDat.money}}/{{donationDat.max_money}}</text>
</view>
<view class="row">
<text class="titleText">募捐期限:</text><text class="dataText">{{donationDat.start_time}}-{{donationDat.finish_time}}</text>
</view>
</view> </view>
<view class="labelRow"> <view class="labelRow">
<image src='../../img/sanjiao.png'></image>捐款人 <image src='../../img/sanjiao.png'></image>爱心人士
</view> </view>
<view class='donationUser_list'> <view class='donationUser_list'>
<view wx:for="{{userDonationList}}" wx:key="{{index}}"> <view class="userDonationItem" wx:for="{{userDonationList}}">
<text>{{item.name}}</text> <view class="userInfo">
<text style='color:red'>{{item.money}}</text> <view class="profile">
<image src="{{item.header_img}}" />
<text class="name">{{item.name}}</text>
</view>
<text class="money">¥{{item.money}}</text>
</view>
<text class="comment">捐赠留言:{{item.comment}}</text>
</view> </view>
</view> </view>
<view class='actionBtn' bindtap='donationAction'>捐款</view> <view class='actionBtn' bindtap='donationAction'>捐款</view>
<view class='donationDialog' wx:if="{{juankuanshow==1}}"> <view class='donationDialog' wx:if="{{showDilog==1}}">
<view class='con_juankuan'> <view class='con_juankuan'>
<view style="margin-top:15px;"> <view style="margin-top:15px;">
<text>金额</text> <text>金额</text>
<input placeholder='请输入金额' bindinput="changeinp1" value='{{value1}}'></input> <input placeholder='请输入金额' bindinput="onInputMoney" value='{{money}}'></input>
<text>元</text> <text>元</text>
</view> </view>
<view> <view>
<text>赠言</text> <text>赠言</text>
<input placeholder='请输入赠言' bindinput="changeinp2" value='{{value2}}'></input> <input placeholder='请输入赠言' bindinput="onInputComment" value='{{comment}}'></input>
</view> </view>
<view class='buttons'> <view class='buttons'>
<view style='background:#8F8F8F; color:#fff' bindtap='cancelDonation'>取消</view> <view style='background:#8F8F8F; color:#fff' bindtap='cancelDonation'>取消</view>
...@@ -33,6 +54,5 @@ ...@@ -33,6 +54,5 @@
</view> </view>
</view> </view>
</view> </view>
<van-dialog id="van-dialog" />
<van-notify id="van-notify" /> <van-notify id="van-notify" />
</view> </view>
...@@ -17,11 +17,37 @@ donationDetail{ ...@@ -17,11 +17,37 @@ donationDetail{
.donationInfo{ .donationInfo{
width:90; width:90;
margin: 10px auto; margin: 0px auto;
}
.donationInfo .row{
width: 100%;
padding-left:2%;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
text-align: left;
margin-top: 5px;
margin-bottom: 5px;
}
.donationInfo .row .titleText{
display:flex;
flex-wrap: nowrap;
color:#4F4F4F;
width:100px;
}
.donationInfo .row .dataText{
display:flex;
width:100%;
flex-wrap: wrap;
color:#969696;
} }
.labelRow { .labelRow {
width:90%; width:96%;
margin: 10px auto; margin: 10px auto;
height:30px; height:30px;
line-height: 30px; line-height: 30px;
...@@ -34,17 +60,50 @@ donationDetail{ ...@@ -34,17 +60,50 @@ donationDetail{
.donationUser_list{ .donationUser_list{
width:90%; width:90%;
margin: 10px auto; margin: 10px auto 50px auto;
font-size: 12px;
} }
.donationUser_list>view{ .donationUser_list .userDonationItem{
margin-top: 5px;
margin-bottom: 5px;
display: flex; display: flex;
flex-direction: column;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; border-bottom: 1rpx solid #ccc;
padding: 5px 10px;
} }
.donationUser_list>view>text{
font-size: 12px; .donationUser_list .userDonationItem .userInfo{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.userInfo .profile {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.profile>image {
width:30px;
height: 30px;
border-radius: 15px;
}
.name {
margin-left: 5px;
}
.money {
color:red;
}
.comment {
margin-top: 5px;
margin-bottom: 5px;
} }
.donationDialog{ .donationDialog{
......
...@@ -257,9 +257,9 @@ Page({ ...@@ -257,9 +257,9 @@ Page({
} }
}) })
} else { } else {
//跳转到圈子动态 //跳转到圈子首页
wx.navigateTo({ wx.navigateTo({
url: '../newCircleMoment/newCircleMoment?circleId=' + that.data.circleId, url: '../circleDetails/circleDetails?circleId=' + that.data.circleId,
}) })
} }
} }
......
...@@ -138,7 +138,7 @@ Page({ ...@@ -138,7 +138,7 @@ Page({
success: function (resp1) { success: function (resp1) {
//成功以后跳转到下一页面[圈子动态] //成功以后跳转到下一页面[圈子动态]
wx.redirectTo({ wx.redirectTo({
url: '../newCircleMoment/newCircleMoment?circleId=' + circleId, url: '../newCircleMoment/newCircleMoment?isNewCircle=true&circleId=' + circleId,
}) })
}, },
fail: function (err) { fail: function (err) {
......
...@@ -7,6 +7,7 @@ Page({ ...@@ -7,6 +7,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
isNewCircle: false,
comment:'', comment:'',
fileList:[], fileList:[],
circleId:0, circleId:0,
...@@ -20,6 +21,11 @@ Page({ ...@@ -20,6 +21,11 @@ Page({
this.setData({ this.setData({
circleId: options.circleId circleId: options.circleId
}) })
if (options.isNewCircle != undefined) {
this.setData({
isNewCircle: options.isNewCircle,
})
}
}, },
/** /**
...@@ -144,6 +150,13 @@ Page({ ...@@ -144,6 +150,13 @@ Page({
}) })
}, },
//取消添加动态
circleMomentCancel() {
wx.redirectTo({
url: '/pages/circleDetails/circleDetails?circleId=' + this.data.circleId,
})
},
//结束上传 //结束上传
finish(){ finish(){
var that=this; var that=this;
......
...@@ -20,6 +20,13 @@ ...@@ -20,6 +20,13 @@
<text>(可上传3张图片)</text> <text>(可上传3张图片)</text>
</view> </view>
</view> </view>
<view class='btnCircle' bindtap='circleMomentNew'>保存进圈</view>
<view class='buttons' wx:if="{{isNewCircle}}">
<view class='momentCreate' bindtap='circleMomentNew'>保存进圈</view>
<view class='momentCancel' bindtap='circleMomentCancel'>跳过 >></view>
</view>
<view class='buttons' wx:if="{{!isNewCircle}}">
<view class='momentCreate2' bindtap='circleMomentNew'>保存进圈</view>
</view>
</view> </view>
<van-notify id="van-notify" /> <van-notify id="van-notify" />
...@@ -92,12 +92,42 @@ ...@@ -92,12 +92,42 @@
width: 90%; width: 90%;
margin: 15px auto; margin: 15px auto;
} }
.btnCircle{
.buttons{
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 40px; height: 40px;
display:flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.momentCreate{
width: 60%;
height: 40px;
font-size: 14px;
line-height: 40px;
text-align: center;
background: #0D76ED;
color: #fff;
}
.momentCancel{
width: 40%;
height: 40px;
font-size: 14px;
line-height: 40px;
text-align: center;
background: #8F8F8F;
color: #fff;
}
.momentCreate2{
width: 100%;
height: 40px;
font-size: 14px; font-size: 14px;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
......
...@@ -3,64 +3,55 @@ ...@@ -3,64 +3,55 @@
<image src='{{volunteerEventDat.front_image}}'></image> <image src='{{volunteerEventDat.front_image}}'></image>
<view class='con_activeDetails'> <view class='con_activeDetails'>
<view class="row"> <view class="row">
<text class="titleText">活动名称</text><text class="dataText">{{volunteerEventDat.title}}</text> <text class="titleText">活动名称:</text><text class="dataText">{{volunteerEventDat.title}}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="titleText">活动地点:</text><text class="dataText">{{volunteerEventDat.position}}</text> <text class="titleText">活动说明:</text><text class="dataText">{{volunteerEventDat.comment}}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="titleText">征集范围:</text><text class="dataText">{{volunteerEventDat.scope}}\n</text> <text class="titleText">活动期限:</text><text class="dataText">{{volunteerEventDat.start_time}}-{{volunteerEventDat.finish_time}}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="titleText">活动人数:</text><text class="dataText">{{volunteerEventDat.max_member}}人</text> <text class="titleText">活动地点:</text><text class="dataText">{{volunteerEventDat.position}}</text>
</view> </view>
<view class="row"> <view class="row">
<text class="titleText">活动时长:</text><text class="dataText">{{volunteerEventDat.time_length}}</text> <text class="titleText">征集范围:</text><text class="dataText">{{volunteerEventDat.scope}}\n</text>
</view> </view>
<view class="row"> <view class="row">
<text class="titleText">活动期限:</text><text class="dataText">{{volunteerEventDat.start_time}}至\n{{volunteerEventDat.finish_time}}</text> <text class="titleText">活动人数:</text><text class="dataText">{{volunteerEventDat.max_member}}人</text>
</view> </view>
<view class="row">
<text class="titleText">联系人:</text><text class="dataText">{{volunteerEventDat.leader_name}}</text>
</view> </view>
<view class='botCon_activeDetails'> <view class="row">
<view> <text class="titleText">联系方式:</text><text class="dataText">{{volunteerEventDat.leader_contact}}</text>
<text>联系人:{{volunteerEventDat.leader_name}}</text>
<text>联系方式:{{volunteerEventDat.leader_contact}}</text>
<text>集合地点:{{volunteerEventDat.venue}}</text>
<text>集合时间:{{volunteerEventDat.venue_time}}</text>
</view> </view>
<view class="row">
<text class="titleText">集合地点:</text><text class="dataText">{{volunteerEventDat.venue}}</text>
</view> </view>
<view class='activejieshao'> <view class="row">
活动介绍:{{volunteerEventDat.comment}} <text class="titleText">集合时间:</text><text class="dataText">{{volunteerEventDat.venue_time}}</text>
</view> </view>
</view>
<view class='avtiveTab'> <view class='avtiveTab'>
<van-tabs active="{{ active }}" border="{{false}}" bind:change="onChange" tab-active-class="activebeijing"> <van-tabs active="{{ active }}" border="{{false}}" bind:change="onChange" tab-active-class="activebeijing">
<van-tab title="圈子报名"> <van-tab title="圈子报名">
<view class='quanzi'> <view class='quanzi'>
<view wx:for="{{circleMemberList}}">
<view> <view>
<view> <image src='{{item.front_image}}'></image>{{item.title}}
<image src='../../img/3.jpg'></image>梁天同学
</view> </view>
<text>已报名</text> <text>{{item.enroll_count}}人报名</text>
</view>
<view>
<view>
<image src='../../img/3.jpg'></image>梁天同学
</view>
<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="{{personalMemberList}}">
<view> <view>
<view> <image src='{{item.header_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>
......
/* pages/activeDetails/activeDetails.wxss */ /* pages/activeDetails/activeDetails.wxss */
.activeDetails>image{ .activeDetails>image{
width: 100%; width: 100%;
min-height: 50px;
} }
.con_activeDetails{ .con_activeDetails{
position: relative;
width: 92%; width: 92%;
margin: 30px auto; margin-top: -40px;
margin-left: 4%;
margin-bottom: 20px;
background: #fff;
border: 1rpx solid #969696;
border-radius: 5px;
} }
.con_activeDetails .row{ .con_activeDetails .row{
width: 100%; width: 100%;
padding:1%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
text-align: left; text-align: left;
margin-top: 5px;
margin-bottom: 5px;
} }
.con_activeDetails .row .titleText{ .con_activeDetails .row .titleText{
display:flex;
flex-wrap: nowrap;
color:#4F4F4F; color:#4F4F4F;
wdith:100px; width:100px;
margin-bottom: 15px;
} }
.con_activeDetails .row .dataText{ .con_activeDetails .row .dataText{
display:flex;
width:100%;
flex-wrap: wrap;
color:#969696; color:#969696;
margin-bottom: 15px;
} }
.botCon_activeDetails{ .botCon_activeDetails{
width: 100%; width: 100%;
...@@ -41,13 +55,6 @@ ...@@ -41,13 +55,6 @@
margin-bottom: 5px; margin-bottom: 5px;
} }
.activejieshao{
width: 100%;
height: 80px;
box-sizing: border-box;
padding: 10px;
font-size: 12px;
}
.activebeijing{ .activebeijing{
background: #0D76ED; background: #0D76ED;
color: #fff!important; color: #fff!important;
......
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