Commit 192c96f2 by biao

111111

111111
parent f981736f
<?php
// 指定删除圈子动态接口
require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...ajax_delete_circle_moment.php.php....Start.", 0);
//获取参数
$unionId = ParamUtil::getRequestString("unionId");
$momentId = ParamUtil::getRequestNumber("momentId", 0);//指定删除的用户ID
$circleId = ParamUtil::getRequestNumber("circleId", 0);//圈子id
$result = array();
//参数检查
if(empty($unionId) || empty($momentId) || empty($circleId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//判断用户是否存在
$param = array();
$param['unionid'] = $unionId;
$param['delete_flg'] = false;
$userList = UserMst::getList($param,'id','desc', 0, 1);
if(empty($userList)) {
$result["message"] = "用户不存在!";
responseNG($result);
}
$userMst = $userList[0];
//判断圈子是否存在
$circleDat = CircleDat::getById($circleId);
if(empty($circleDat)) {
$result["message"] = "圈子不存在!";
responseNG($result);
}
//只有圈主才可以删除动态
if($circleDat->owner_id != $userMst->id) {
$result["message"] = "只有圈主才可以删除!";
responseNG($result);
}
//删除动态处理
$param = array();
$param['circle_id'] = $circleDat->id;
$param['id'] = $momentId;
$param['delete_flg'] = false;
$momentList = CircleMomentDat::getList($param, "id", "asc", 0, 1);
if(!empty($momentList)) {
$momentList[0]->delete_flg = true;
$momentList[0]->save();
}
//组装返回数据
$result["message"] = "删除成功!";
ErrorLogger::doOutput("Compass...ajax_delete_circle_moment.php....End.", 0);
//返回结果
responseOK($result);
function responseNG($result) {
$result = array("status"=>"NG", "result"=>$result);
print json_encode($result);
exit;
}
function responseOK($result) {
$result = array("status"=>"OK", "result"=>$result);
print json_encode($result);
exit;
}
?>
\ No newline at end of file
...@@ -18,6 +18,8 @@ Page({ ...@@ -18,6 +18,8 @@ Page({
fileList: [], fileList: [],
frontImage: '', frontImage: '',
comment:"", comment:"",
deleteDialog:false
}, },
/** /**
...@@ -129,11 +131,32 @@ Page({ ...@@ -129,11 +131,32 @@ Page({
//删除圈子 //删除圈子
deleteCircle() { deleteCircle() {
//显示删除对话框
this.setData({
deleteDialog: true
})
return
//跳转到上传凭证页面 //跳转到上传凭证页面
Dialog.confirm({ Dialog.confirm({
title: '', title: '',
message: '是否删除圈子以及相关数据?' message: '是否删除圈子以及相关数据?'
}).then(() => { }).then(() => {
}).catch(() => {
});
},
//取消删除圈子
cancelDelete() {
this.setData({
deleteDialog: false
})
},
//确认删除圈子
confirmDelete() {
var that = this; var that = this;
var config = wx.getStorageSync('config'); var config = wx.getStorageSync('config');
//调用删除接口 //调用删除接口
...@@ -142,7 +165,7 @@ Page({ ...@@ -142,7 +165,7 @@ Page({
data: { data: {
unionId: config.unionId, unionId: config.unionId,
circleId: that.data.circleId, circleId: that.data.circleId,
zIndex:100 zIndex: 100
}, },
header: { 'content-type': 'application/json' }, header: { 'content-type': 'application/json' },
method: 'GET', method: 'GET',
...@@ -162,11 +185,13 @@ Page({ ...@@ -162,11 +185,13 @@ Page({
} }
}, },
fail: function (res) { }, fail: function (res) { },
complete: function (res) { }, complete: function (res) {
that.setData({
deleteDialog: false
})
},
}) })
}).catch(() => {
});
}, },
//提交数据【编辑】 //提交数据【编辑】
......
...@@ -44,6 +44,17 @@ ...@@ -44,6 +44,17 @@
<view class='buttonEdit' bindtap='editCircle'>下一步</view> <view class='buttonEdit' bindtap='editCircle'>下一步</view>
</view> </view>
<view class='comfirmDialogShadow' wx:if="{{deleteDialog}}">
</view>
<view class='comfirmDialog' wx:if="{{deleteDialog}}">
<text class="message">是否删除圈子以及相关数据?</text>
<view class='dialogButtons'>
<view class="cancelButton" bindtap='cancelDelete'>取消</view>
<view class="confirmButton" bindtap='confirmDelete'>确认</view>
</view>
</view>
<van-dialog id="van-dialog" zIndex="100"/> <van-dialog id="van-dialog" zIndex="100"/>
<van-notify id="van-notify" /> <van-notify id="van-notify" />
</view> </view>
...@@ -8,6 +8,7 @@ page{ ...@@ -8,6 +8,7 @@ page{
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
background: #fff; background: #fff;
z-index: 0;
} }
.top_newQuanzi{ .top_newQuanzi{
width: 85%; width: 85%;
...@@ -128,3 +129,63 @@ page{ ...@@ -128,3 +129,63 @@ page{
background: #0D76ED; background: #0D76ED;
color: #fff; color: #fff;
} }
.comfirmDialogShadow {
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
background: #000;
opacity:0.75;
z-index: 998;
}
.comfirmDialog {
position:fixed;
top: 32%;
left:5%;
width:90%;
height:100px;
background: #fff;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
border: 1rpx solid #f0f0f0;
border-radius: 16px;
z-index: 999;
}
.comfirmDialog .message{
width:100%;
margin: auto;
line-height: 60px;
height: 60px;
text-align: center;
border-bottom: 1rpx solid #f0f0f0;
}
.comfirmDialog .dialogButtons{
width: 100%;
height: 40px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
text-align: center;
}
.dialogButtons .cancelButton{
width: 50%;
height: 40px;
line-height: 40px;
border-right: 1rpx solid #f0f0f0;
}
.dialogButtons .confirmButton{
width: 50%;
height: 40px;
line-height: 40px;
}
\ No newline at end of file
...@@ -59,8 +59,8 @@ Page({ ...@@ -59,8 +59,8 @@ Page({
//判断上传的图片类型 //判断上传的图片类型
beforeRead(event) { beforeRead(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 && file[0].path.indexOf('png') < 0 && file[0].path.indexOf('gif') < 0) {
wx.showToast({ title: '请选择jpg图片上传', icon: 'none' }); wx.showToast({ title: '只能上传图片', icon: 'none' });
callback(false); callback(false);
return; return;
} }
......
...@@ -12,6 +12,7 @@ Page({ ...@@ -12,6 +12,7 @@ Page({
eventId:0, eventId:0,
active: 0, active: 0,
buttonClass:'actionBtn',
volunteerEventDat:[], volunteerEventDat:[],
isEnrollFinish:false, isEnrollFinish:false,
isComplete: false, isComplete: false,
...@@ -77,19 +78,22 @@ Page({ ...@@ -77,19 +78,22 @@ Page({
if (res.data.result.isMember == false && res.data.result.isEnrollFinish==false){ if (res.data.result.isMember == false && res.data.result.isEnrollFinish==false){
that.setData({ that.setData({
menuText:'报名参加', menuText:'报名参加',
showActionButton:true showActionButton:true,
buttonClass:'actionBtn'
}) })
} }
if (res.data.result.isMember == true && res.data.result.isEnrollFinish == false) { if (res.data.result.isMember == true && res.data.result.isEnrollFinish == false) {
that.setData({ that.setData({
menuText: '取消报名', menuText: '取消报名',
showActionButton: true showActionButton: true,
buttonClass: 'cancelBtn'
}) })
} }
if (res.data.result.isMember == true && res.data.result.isEnrollFinish == true && res.data.result.isComplete ==false) { if (res.data.result.isMember == true && res.data.result.isEnrollFinish == true && res.data.result.isComplete ==false) {
that.setData({ that.setData({
menuText: '上传凭证', menuText: '上传凭证',
showActionButton: true showActionButton: true,
buttonClass: 'actionBtn'
}) })
} }
} }
...@@ -163,7 +167,12 @@ Page({ ...@@ -163,7 +167,12 @@ Page({
} }
if (that.data.menuText == "取消报名") { if (that.data.menuText == "取消报名") {
//取消报名 //跳转到上传凭证页面
Dialog.confirm({
title: '',
message: '是否取消报名?'
}).then(() => {
//取消报名处理
wx.request({ wx.request({
url: app.url + 'ajax_cancel_volunteer_event.php', url: app.url + 'ajax_cancel_volunteer_event.php',
data: { data: {
...@@ -177,11 +186,9 @@ Page({ ...@@ -177,11 +186,9 @@ Page({
console.log(res) console.log(res)
if (res.statusCode == 200) { if (res.statusCode == 200) {
Notify({ type: 'success', message: res.data.result.message }); Notify({ type: 'success', message: res.data.result.message });
//如果取消成功,跳转到活动首页 //如果取消成功,停留在本页面
if (res.data.status =="OK") { if (res.data.status == "OK") {
wx.redirectTo({ that.onLoad();
url: '../volunteers/volunteers?',
})
} }
} }
}, },
...@@ -190,12 +197,16 @@ Page({ ...@@ -190,12 +197,16 @@ Page({
}, },
complete: function (res) { }, complete: function (res) { },
}) })
}).catch(() => {
});
} }
if (that.data.menuText == "上传凭证") { if (that.data.menuText == "上传凭证") {
//跳转到上传凭证页面 //跳转到上传凭证页面
Dialog.confirm({ Dialog.confirm({
title: '标题', title: '',
message: '是否上传凭证?' message: '是否上传凭证?'
}).then(() => { }).then(() => {
wx.navigateTo({ wx.navigateTo({
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</view> </view>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<view class='actionBtn' bindtap='userAction' wx:if="{{showActionButton}}">{{menuText}}</view> <view class='{{buttonClass}}' bindtap='userAction' wx:if="{{showActionButton}}">{{menuText}}</view>
</view> </view>
<view class="ownerAttendDialog" wx:if="{{showOwnerDialog}}"> <view class="ownerAttendDialog" wx:if="{{showOwnerDialog}}">
......
...@@ -90,17 +90,27 @@ ...@@ -90,17 +90,27 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.actionBtn{ .actionBtn{
width: 75%; position:fixed;
bottom: 0;
width: 100%;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
font-size: 14px;
margin: 10px auto;
background: #0D76ED; background: #0D76ED;
margin-bottom: 10px;
color: #fff; color: #fff;
border-radius: 15px; }
.cancelBtn{
position:fixed;
bottom: 0;
width: 100%;
height: 40px;
line-height: 40px;
text-align: center;
background: #8F8F8F;
color: #fff;
} }
/**圈主报名对话框**/ /**圈主报名对话框**/
......
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