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({
fileList: [],
frontImage: '',
comment:"",
deleteDialog:false
},
/**
......@@ -129,46 +131,69 @@ Page({
//删除圈子
deleteCircle() {
//显示删除对话框
this.setData({
deleteDialog: true
})
return
//跳转到上传凭证页面
Dialog.confirm({
title: '',
message: '是否删除圈子以及相关数据?'
}).then(() => {
var that = this;
var config = wx.getStorageSync('config');
//调用删除接口
wx.request({
url: app.url + 'ajax_delete_circle.php',
data: {
unionId: config.unionId,
circleId: that.data.circleId,
zIndex:100
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
if (res.statusCode == 200) {
if (res.data.status == "OK") {
//删除成功以后跳转到圈子模块首页
wx.switchTab({
url: '../circle/circle',
})
} else {
Notify(res.data.message)
return
}
}
},
fail: function (res) { },
complete: function (res) { },
})
}).catch(() => {
});
},
//取消删除圈子
cancelDelete() {
this.setData({
deleteDialog: false
})
},
//确认删除圈子
confirmDelete() {
var that = this;
var config = wx.getStorageSync('config');
//调用删除接口
wx.request({
url: app.url + 'ajax_delete_circle.php',
data: {
unionId: config.unionId,
circleId: that.data.circleId,
zIndex: 100
},
header: { 'content-type': 'application/json' },
method: 'GET',
dataType: 'json',
success: function (res) {
console.log(res)
if (res.statusCode == 200) {
if (res.data.status == "OK") {
//删除成功以后跳转到圈子模块首页
wx.switchTab({
url: '../circle/circle',
})
} else {
Notify(res.data.message)
return
}
}
},
fail: function (res) { },
complete: function (res) {
that.setData({
deleteDialog: false
})
},
})
},
//提交数据【编辑】
editCircle() {
var that = this;
......
......@@ -34,16 +34,27 @@
</view>
</view>
<view class='quanziComment'>
<text style="margin-top:10px;">圈子简介:</text>
<textarea bindinput="onInputComment" value='{{comment}}'></textarea>
</view>
<view class='quanziComment'>
<text style="margin-top:10px;">圈子简介:</text>
<textarea bindinput="onInputComment" value='{{comment}}'></textarea>
</view>
<view class='buttons'>
<view class='buttonDelete' bindtap='deleteCircle'>删除</view>
<view class='buttonEdit' bindtap='editCircle'>下一步</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-notify id="van-notify" />
</view>
......@@ -8,6 +8,7 @@ page{
width: 100%;
margin: 0 auto;
background: #fff;
z-index: 0;
}
.top_newQuanzi{
width: 85%;
......@@ -127,4 +128,64 @@ page{
text-align: center;
background: #0D76ED;
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({
//判断上传的图片类型
beforeRead(event) {
const { file, callback } = event.detail;
if (file[0].path.indexOf('jpg') < 0) {
wx.showToast({ title: '请选择jpg图片上传', icon: 'none' });
if (file[0].path.indexOf('jpg') < 0 && file[0].path.indexOf('png') < 0 && file[0].path.indexOf('gif') < 0) {
wx.showToast({ title: '只能上传图片', icon: 'none' });
callback(false);
return;
}
......
......@@ -11,7 +11,8 @@ Page({
circleId: 0,
eventId:0,
active: 0,
buttonClass:'actionBtn',
volunteerEventDat:[],
isEnrollFinish:false,
isComplete: false,
......@@ -77,19 +78,22 @@ Page({
if (res.data.result.isMember == false && res.data.result.isEnrollFinish==false){
that.setData({
menuText:'报名参加',
showActionButton:true
showActionButton:true,
buttonClass:'actionBtn'
})
}
if (res.data.result.isMember == true && res.data.result.isEnrollFinish == false) {
that.setData({
menuText: '取消报名',
showActionButton: true
showActionButton: true,
buttonClass: 'cancelBtn'
})
}
if (res.data.result.isMember == true && res.data.result.isEnrollFinish == true && res.data.result.isComplete ==false) {
that.setData({
menuText: '上传凭证',
showActionButton: true
showActionButton: true,
buttonClass: 'actionBtn'
})
}
}
......@@ -163,39 +167,46 @@ Page({
}
if (that.data.menuText == "取消报名") {
//取消报名
wx.request({
url: app.url + 'ajax_cancel_volunteer_event.php',
data: {
unionId: config.unionId,
eventId: that.data.eventId
},
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") {
wx.redirectTo({
url: '../volunteers/volunteers?',
})
//跳转到上传凭证页面
Dialog.confirm({
title: '',
message: '是否取消报名?'
}).then(() => {
//取消报名处理
wx.request({
url: app.url + 'ajax_cancel_volunteer_event.php',
data: {
unionId: config.unionId,
eventId: that.data.eventId
},
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) { },
})
},
fail: function (res) {
Notify({ type: 'danger', message: res.data.result.message });
},
complete: function (res) { },
})
}).catch(() => {
});
}
if (that.data.menuText == "上传凭证") {
//跳转到上传凭证页面
Dialog.confirm({
title: '标题',
title: '',
message: '是否上传凭证?'
}).then(() => {
wx.navigateTo({
......
......@@ -67,7 +67,7 @@
</view>
</van-tab>
</van-tabs>
<view class='actionBtn' bindtap='userAction' wx:if="{{showActionButton}}">{{menuText}}</view>
<view class='{{buttonClass}}' bindtap='userAction' wx:if="{{showActionButton}}">{{menuText}}</view>
</view>
<view class="ownerAttendDialog" wx:if="{{showOwnerDialog}}">
......
......@@ -90,17 +90,27 @@
justify-content: center;
align-items: center;
}
.actionBtn{
width: 75%;
position:fixed;
bottom: 0;
width: 100%;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 14px;
margin: 10px auto;
background: #0D76ED;
margin-bottom: 10px;
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