Commit 305604f7 by zong

111111

parent d2bd5c1d
......@@ -51,6 +51,7 @@ $front_image = $course_mst->front_image;
$title = $course_mst->title;
$teacher_name = $course_mst->teacher_name;
$teacher_profile = $course_mst->teacher_profile;
$price = $course_mst->price;
$new_sub_category_list = [];
foreach ($sub_category_list as $tmp){
if($tmp->parent_id == $parent_category_id){
......
......@@ -31,6 +31,7 @@ $parent_category_id = ParamUtil::getRequestNumber("parent_category_id");
$sub_category_id = ParamUtil::getRequestNumber("sub_category_id");
$teacher_name = ParamUtil::getRequestString("teacher_name");
$teacher_profile = ParamUtil::getRequestString("teacher_profile");
$price = ParamUtil::getRequestNumber("price");
//创建的时候
if($action_type == "new") {
......@@ -71,6 +72,7 @@ $course_mst->parent_category_id = $parent_category_id;
$course_mst->sub_category_id = $sub_category_id;
$course_mst->teacher_name = $teacher_name;
$course_mst->teacher_profile = $teacher_profile;
$course_mst->price = $price;
$course_mst->save();
// 页面表示
......
......@@ -36,7 +36,12 @@ if ($volunteer_event_dat == null) {
}
if(!empty($volunteer_event_dat->circle_id)){
$volunteer_event_dat->author = CircleDat::getById($volunteer_event_dat->circle_id)->title;
$circleDat = CircleDat::getById($volunteer_event_dat->circle_id);
if(!empty($circleDat)) {
$volunteer_event_dat->author = $circleDat->title;
} else {
$volunteer_event_dat->author = "[不存在的数据]";
}
}
// ページ
......
......@@ -87,7 +87,12 @@ if ($volunteer_event_count > 0) {
}
foreach ($volunteer_event_list as $tmp){
if(!empty($tmp->circle_id)){
$tmp->author = CircleDat::getById($tmp->circle_id)->title;
$circleDat = CircleDat::getById($tmp->circle_id);
if(!empty($circleDat)) {
$tmp->author = $circleDat->title;
} else {
$tmp->author = "[已删除数据]";
}
}
}
......
<?php
// 指定置顶志愿者活动
require_once ("../manager_include.inc");
ErrorLogger::doOutput("Compass...ajax_setrecommend_event.php....Start.", 0);
//获取参数
$eventId = ParamUtil::getRequestNumber("eventId", 0);
$result = array();
//参数检查
if(empty($eventId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//视频是否存在
$param = array();
$param['id'] = $eventId;
$param['delete_flg'] = false;
$tmpList = VolunteerEventDat::getList($param,'id','desc', 0, 1);
if(empty($tmpList)) {
$result["message"] = "数据不存在!";
responseNG($result);
}
$tmpList[0]->is_recommend = !$tmpList[0]->is_recommend;
$tmpList[0]->save();
//组装返回数据
$result["message"] = "推荐设置成功!";
responseOK($result);
ErrorLogger::doOutput("Compass...ajax_setrecommend_event.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
<?php
// 指定置顶公益课堂
require_once ("../manager_include.inc");
ErrorLogger::doOutput("Compass...ajax_setrecommend_media.php....Start.", 0);
//获取参数
$mediaId = ParamUtil::getRequestNumber("mediaId", 0);
$result = array();
//参数检查
if(empty($mediaId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//视频是否存在
$param = array();
$param['id'] = $mediaId;
$param['delete_flg'] = false;
$tmpList = CourseMediaDat::getList($param,'id','desc', 0, 1);
if(empty($tmpList)) {
$result["message"] = "数据不存在!";
responseNG($result);
}
$tmpList[0]->is_recommend = !$tmpList[0]->is_recommend;
$tmpList[0]->save();
//组装返回数据
$result["message"] = "推荐设置成功!";
responseOK($result);
ErrorLogger::doOutput("Compass...ajax_setrecommend_media.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
<?php
// 指定置顶公益课堂
require_once ("../manager_include.inc");
ErrorLogger::doOutput("Compass...ajax_settop_media.php....Start.", 0);
//获取参数
$mediaId = ParamUtil::getRequestNumber("mediaId", 0);
$result = array();
//参数检查
if(empty($mediaId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//视频是否存在
$param = array();
$param['id'] = $mediaId;
$param['delete_flg'] = false;
$tmpList = CourseMediaDat::getList($param,'id','desc', 0, 1);
if(empty($tmpList)) {
$result["message"] = "数据不存在!";
responseNG($result);
}
$tmpList[0]->is_top = !$tmpList[0]->is_top;
$tmpList[0]->save();
//组装返回数据
$result["message"] = "置顶设置成功!";
responseOK($result);
ErrorLogger::doOutput("Compass...ajax_settop_media.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
......@@ -48,6 +48,21 @@ if($course_media_mst->course_id != 0){
$course_media_mst->delete_flg = true;
$course_media_mst->save();
//更新合集视频数量
$param = array();
$param['delete_flg'] = false;
$courseList = CourseMst::getList($param);
if(!empty($courseList)) {
foreach($courseList as $courseMst) {
$param = array();
$param['delete_flg'] = false;
$param['course_id'] = $courseMst->id;
$mediaCount = CourseMediaDat::getListCount($param);
$courseMst->media_count = $mediaCount;
$courseMst->save();
}
}
// 跳到一览页
header("Location:media_list.php?search_flg=true");
exit;
......@@ -94,6 +94,21 @@ if($media_type == 1){
}
$course_media_dat->save();
//更新合集视频数量
$param = array();
$param['delete_flg'] = false;
$courseList = CourseMst::getList($param);
if(!empty($courseList)) {
foreach($courseList as $courseMst) {
$param = array();
$param['delete_flg'] = false;
$param['course_id'] = $courseMst->id;
$mediaCount = CourseMediaDat::getListCount($param);
$courseMst->media_count = $mediaCount;
$courseMst->save();
}
}
// 页面表示
$layout_pages = array();
$layout_pages["left"] = "menu.inc";
......
......@@ -47,6 +47,31 @@ function isAlpaNum(str) {
}
function isMoneyNumber(_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;
}
}
function checkFileName(str) {
var strLen;
......
......@@ -45,6 +45,7 @@
<p><b>讲师名称:</b><el-input v-model="teacher_name" name="teacher_name" class="input_200"></el-input></p>
<p><b>讲师介绍:</b><textarea v-model="teacher_profile" name="teacher_profile" rows="5"></textarea><br /></p>
<p><b>收费价格:</b><el-input v-model="price" name="price" type="number" class="input_200"></el-input></p>
<el-button type="primary" @click="edit()" class="edit_btn" style="margin-left: 100px;">编辑</el-button>
<el-button type="primary" @click="back()" class="edit_btn">返回</el-button>
......@@ -55,6 +56,30 @@
<script type="text/javascript">
function isMoneyNumber(_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;
}
}
new Vue({
el:'#change',
......@@ -66,6 +91,7 @@
front_image:'<?=$front_image?>',
teacher_name:'<?=$teacher_name?>',
teacher_profile:'<?=$teacher_profile?>',
price:'<?=$price?>',
sub_category_list:<?=json_encode($sub_category_list)?>,
new_sub_category_list:<?=json_encode($new_sub_category_list)?>,
parent_category_list:<?=json_encode($parent_category_list)?>
......@@ -115,6 +141,13 @@
});
return;
}
if(!isMoneyNumber(this.price)){
this.$message({
type: 'error',
message: '请输入正确的价格!'
});
return;
}
$("input[name='parent_category_id']").val(this.parent_category_id);
$("input[name='sub_category_id']").val(this.sub_category_id);
$('#collection_media_edit').submit();
......
......@@ -30,6 +30,7 @@ global $school_title;
<el-table :data="tableData" border>
<el-table-column prop="title" label="合集名称" width=""></el-table-column>
<el-table-column prop="media_count" label="视频数量" width=""></el-table-column>
<el-table-column prop="price" label="合集价格" width=""></el-table-column>
<el-table-column prop="view_count" label="观看人数" width=""></el-table-column>
<el-table-column prop="upload_date" label="最新上传" width=""></el-table-column>
<el-table-column label="操作" width="150">
......@@ -62,6 +63,7 @@ require_once("page_common.inc");
id:<?=$tmp["id"] ?>,
title:'<?=$tmp["title"]?>',
media_count:'<?=$tmp["media_count"]?>',
price:'<?=$tmp["price"]?>',
upload_date:'<?=!empty($tmp["upload_date"])?$tmp["upload_date"]:"-"?>',
view_count:'<?=!empty($tmp["view_count"])?$tmp["view_count"]:0?>'
};
......
<?php
/**
* 活动列表
* $Id: event_list.inc,v 1.1 2015/10/08 11:18:50 wanggb Exp $
* $Id: event_list.inc,v 1.1 2020/10/08 11:18:50 wanggb Exp $
* @author netvillage
* @access public
* @package manager.templates
......@@ -11,26 +11,31 @@
<div id="classSetting">
<div class="list_title">活动列表</div>
<br />
<form id="refresh_form" action="event_list.php" method="post" style="padding-left: 43px;font-size: 14px;">
<input type="hidden" name="page_num" value="<?=$page_num?>"/>
</form>
<div class="result_list">
<div class="block" v-for="tmp in tableData" style="padding-left: 100px;">
<table style="border-spacing:10px">
<table style="border-spacing:1px">
<tr>
<td rowspan="4" style="width: 125px;height: 125px;position: relative;">
<a href="javascript:void(0);"@click="toDetail(tmp)"><el-image class="list_img" :src="tmp.front_image" style="object-fit: contain;"></el-image></a>
</td>
</tr>
<tr>
<td>
<td width="300">
<span><a href="javascript:void(0);"@click="toDetail(tmp)" style="color:#000;">{{tmp.title}}</a></span>
<el-tag :type="tmp.status_type" v-if="tmp.status !=''" style="line-height:18px;height:18px;padding:0px;margin-left:5px;" effect="dark">{{tmp.status}}</el-tag>
<el-tag :type="tmp.time_status" v-if="tmp.status ==''" style="line-height:18px;height:18px;padding:0px;margin-left:5px;" effect="dark">{{tmp.event_status}}</el-tag>
<span>是否推荐:{{tmp.is_recommend}}</span>
</td>
</tr>
<tr>
<td>
<span>活动时间: </span>{{tmp.start_time}} — {{tmp.finish_time}}
<el-button v-if="tmp.event_status=='NEW' || tmp.event_status=='NG'" type="primary" size="mini" @click="editChange(tmp)" style="margin-left:10px;">修改</el-button>
<el-button type="primary" size="mini" @click="editChange(tmp)" style="margin-left:10px;">修改</el-button>
<el-button type="primary" size="mini" @click="deleteRow(tmp)"style="margin-left:10px;">删除</el-button>
<el-button type="primary" size="mini" @click="setRecommend(tmp)"style="margin-left:10px;">轮播推荐</el-button>
<el-button type="primary" size="mini" @click="handleDetail(tmp)"style="margin-left:10px;">查看数据</el-button>
</td>
</tr>
......@@ -61,6 +66,10 @@ if ($event_count > 0) {
var list=[];
<?
foreach ( $event_list as $tmp ) {
$is_recommend = "x";
if($tmp["is_recommend"]) {
$is_recommend = "o";
}
?>
var data={
id:<?=$tmp["id"] ?>,
......@@ -75,7 +84,8 @@ foreach ( $event_list as $tmp ) {
event_status:'<?=date("Y-m-d H:i:s") > $tmp["finish_time"]?"已结束":(date("Y-m-d H:i:s") < $tmp["start_time"]?"未开始":"进行中")?>',
status:'<?=$tmp["status"]=="NEW"?"未审核":($tmp["status"]=="NG"?"审核未通过":($tmp["status"]=="FINISH"?"活动结束":""))?>',
status_type:'<?=$tmp["status"]=="NEW"?"warning":($tmp["status"]=="NG"?"danger":($tmp["status"]=="FINISH"?"info":""))?>',
event_status:'<?=$tmp["status"]?>'
event_status:'<?=$tmp["status"]?>',
is_recommend:'<?=$is_recommend?>'
};
list.push(data);
<?
......@@ -116,6 +126,24 @@ foreach ( $event_list as $tmp ) {
});
});
},
setRecommend(row) {
var eventId = row.id;
axios.get('./if/ajax_setrecommend_event.php', {
params:{
eventId: eventId
}
}).then(function (response) {
if(response.status==200){
alert(response.data.result.message);
if(response.data.status=='OK'){
//刷新本页面
$("#refresh_form").submit();
}
}
}).catch(function (error) {
console.log(error);
});
},
}
})
</script>
\ No newline at end of file
......@@ -18,6 +18,12 @@
视频列表
</div>
<br/>
<form id="refresh_form" action="media_list.php" method="post" style="padding-left: 43px;font-size: 14px;">
<input type="hidden" name="page_num" value="<?=$page_num?>"/>
<input type="hidden" name="media_type" value="<?=$media_type?>"/>
<input type="hidden" name="media_kind" value="<?=$media_kind?>"/>
<input type="hidden" name="title" value="<?=$title?>"/>
</form>
<form id="search_form" action="media_list.php" method="post" style="padding-left: 43px;font-size: 14px;">
<input type="hidden" name="media_type" value="<?=$media_type?>"/>
<input type="hidden" name="media_kind" value="<?=$media_kind?>"/>
......@@ -43,17 +49,20 @@
<br />
<div class="result_list">
<el-table :data="tableData" border>
<el-table-column prop="title" label="视频名称" width=""></el-table-column>
<el-table-column prop="tags" label="视频标签" width=""></el-table-column>
<el-table-column prop="media_type" label="视频类型" width=""></el-table-column>
<el-table-column prop="title" label="视频名称" width="320"></el-table-column>
<el-table-column prop="media_type" label="视频类型" width="80"></el-table-column>
<el-table-column prop="media_kind" label="视频种类" width=""></el-table-column>
<el-table-column prop="size" label="视频大小" width=""></el-table-column>
<el-table-column prop="upload_time" label="上传时间" width=""></el-table-column>
<el-table-column prop="view_count" label="观看人数" width=""></el-table-column>
<el-table-column label="操作" width="100">
<el-table-column prop="view_count" label="观看人数" width="80"></el-table-column>
<el-table-column prop="is_recommend" label="推荐" width="50"></el-table-column>
<el-table-column prop="is_top" label="置顶" width="50"></el-table-column>
<el-table-column label="操作" width="240">
<template slot-scope="scope">
<el-button @click="handleChange(scope.row)" type="text" size="small">编辑</el-button>
<el-button type="text" size="small" @click.native.prevent="deleteRow(scope.row)">删除</el-button>
<el-button type="text" size="small" @click.native.prevent="setRecommend(scope.row)">[推荐]切换</el-button>
<el-button type="text" size="small" @click.native.prevent="setTop(scope.row)">[置顶]切换</el-button>
</template>
</el-table-column>
</el-table>
......@@ -74,6 +83,14 @@ require_once("page_common.inc");
var list=[];
<?
foreach ($course_list as $tmp) {
$is_top = "x";
if($tmp->is_top) {
$is_top = "o";
}
$is_recommend = "x";
if($tmp->is_recommend) {
$is_recommend = "o";
}
?>
var data={
id:<?=$tmp->id ?>,
......@@ -83,14 +100,16 @@ require_once("page_common.inc");
tags:'<?=$tmp->tags?>',
size:'<?=round($tmp->size /1024 /1024,2)?>M',
upload_time:'<?=$tmp->registration_date?>',
view_count:<?=$tmp->view_count?>
view_count:'<?=$tmp->view_count?>',
is_top:'<?=$is_top?>',
is_recommend:'<?=$is_recommend?>'
};
list.push(data);
<?
}
?>
new Vue({
var vue = new Vue({
el:'#classSetting',
data:{
tableData: list,
......@@ -102,27 +121,63 @@ require_once("page_common.inc");
methods:{
handleChange(row) {
window.location.href='media_edit_input.php?id='+row.id;
},
deleteRow(rows) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
},
deleteRow(rows) {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
window.location.href='media_delete_result.php?id='+rows.id;
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
search(){
$("input[name='media_type']").val(this.media_type);
setTop(row) {
var mediaId = row.id;
axios.get('./if/ajax_settop_media.php', {
params:{
mediaId: mediaId
}
}).then(function (response) {
if(response.status==200){
alert(response.data.result.message);
if(response.data.status=='OK'){
//刷新本页面
$("#refresh_form").submit();
}
}
}).catch(function (error) {
console.log(error);
});
},
setRecommend(row) {
var mediaId = row.id;
axios.get('./if/ajax_setrecommend_media.php', {
params:{
mediaId: mediaId
}
}).then(function (response) {
if(response.status==200){
alert(response.data.result.message);
if(response.data.status=='OK'){
//刷新本页面
$("#refresh_form").submit();
}
}
}).catch(function (error) {
console.log(error);
});
},
search(){
$("input[name='media_type']").val(this.media_type);
$("input[name='media_kind']").val(this.media_kind);
$("#search_form").submit();
}
......
......@@ -72,7 +72,6 @@
return;
}
//获取编辑器中的文本内容
alert(editor.txt.html());
$('#content').val(editor.txt.html());
$('#form').submit();
},
......
......@@ -8,12 +8,12 @@ ErrorLogger::doOutput("Compass...ajax_attend_volunteer_event_circle.php....Start
//获取参数
$unionId = ParamUtil::getRequestString("unionId");
$eventId = ParamUtil::getRequestNumber("eventId", 0);
$circleIds = ParamUtil::getRequestString("circleIds");
$circleIds = ParamUtil::getRequestString("circleIds", 0);
$result = array();
//参数检查
if(empty($unionId) || empty($eventId)|| empty($circleIds)) {
if(empty($unionId) || empty($eventId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
......@@ -27,7 +27,6 @@ if(empty($userList)) {
$result["message"] = "用户不存在!";
responseNG($result);
}
$userMst = $userList[0];
//查询志愿者活动
......@@ -36,20 +35,8 @@ if(empty($volunteerDat)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//是否已经报名
$param = array();
$param['volunteer_event_id'] = $eventId;
$param['user_id'] = $userMst->id;
$param['delete_flg'] = false;
$tmpList = VolunteerEventMemberDat::getList($param, "id", "desc", 0, 1);
if(!empty($tmpList)) {
$result["message"] = "不能重复报名!";
responseNG($result);
}
//分解获取圈子id参数
$tmpArray = explode("|",$circleIds);
$tmpArray = explode("|", $circleIds);
$circleIdArray = array_filter($tmpArray);
if(empty($circleIdArray)) {
$result["message"] = "参数错误!";
......@@ -58,45 +45,72 @@ if(empty($circleIdArray)) {
//循环处理圈子报名
foreach($circleIdArray as $circleId) {
$tmpObj = explode("_",$circleId);
$circleId = $tmpObj[0];
$itemClass = $tmpObj[1];
if(empty($circleId) || empty($itemClass)) {
continue;
}
$circleDat = CircleDat::getById($circleId);
if(empty($circleDat)) {
continue;
}
//报名顺序
$param = array();
$param['volunteer_event_id'] = $eventId;
$param['delete_flg'] = false;
$tmpCount = VolunteerEventMemberDat::getListCount($param);
$indexNo = sprintf("%05d", $tmpCount+1);
//报名表插入数据
$volunteerEventMemberDat = new VolunteerEventMemberDat();
$volunteerEventMemberDat->volunteer_event_id = $eventId;
$volunteerEventMemberDat->user_id = $userMst->id;
$volunteerEventMemberDat->circle_id = $circleId;
$volunteerEventMemberDat->is_owner = true;
$volunteerEventMemberDat->index_no = $indexNo;
$volunteerEventMemberDat->mobile = $userMst->mobile;
$volunteerEventMemberDat->save();
//查找圈子成员,给圈子成员发送邀请消息
//判断该圈子是否已经报名
$param = array();
$param['volunteer_event_id'] = $eventId;
$param['circle_id'] = $circleId;
$param['user_id_NOT'] = $userMst->id;//不包含自己
$param['delete_flg'] = false;
$tmpCircleMemberList = CircleMemberDat::getList($param);
if(!empty($tmpCircleMemberList)) {
foreach($tmpCircleMemberList as $tmpCircleMember) {
$userMessageDat = new UserMessageDat();
$userMessageDat->user_id = $tmpCircleMember->user_id;
$userMessageDat->title = "活动参加邀请通知";
$userMessageDat->comment = "嘀嘀嘀!圈主邀请您参加活动,快点击参加报名吧!";
$tmpList = VolunteerEventMemberDat::getList($param, "id", "desc", 0, 1);
//根据状态判断
if($itemClass == "circleItem") {
//未选中,已经报名的情况下 取消报名
if(!empty($tmpList)) {
$tmpList[0]->delete_flg = true;
$tmpList[0]->save();
//对应成员删除??
}
} else {
//已经选中。未报名,报名处理
if(empty($tmpList)) {
//报名顺序【选中的时候】
$param = array();
$param['volunteer_event_id'] = $eventId;
$param['delete_flg'] = false;
$tmpCount = VolunteerEventMemberDat::getListCount($param);
$indexNo = sprintf("%05d", $tmpCount+1);
//报名表插入数据
$volunteerEventMemberDat = new VolunteerEventMemberDat();
$volunteerEventMemberDat->volunteer_event_id = $eventId;
$volunteerEventMemberDat->user_id = $userMst->id;
$volunteerEventMemberDat->circle_id = $circleId;
$volunteerEventMemberDat->is_owner = true;
$volunteerEventMemberDat->index_no = $indexNo;
$volunteerEventMemberDat->mobile = $userMst->mobile;
$volunteerEventMemberDat->save();
//添加附件附件
$userMessageDat->attach_dat_type = "VOLUNTEER";
$userMessageDat->attach_dat_id = $circleDat->id;
$userMessageDat->attach_dat_path = "/pages/volunteersEventDetail/volunteersEventDetail?eventId={$eventId}&circleId={$circleId}";
$userMessageDat->save();
//查找圈子成员,给圈子成员发送邀请消息
$param = array();
$param['circle_id'] = $circleId;
$param['user_id_NOT'] = $userMst->id;//不包含自己
$param['delete_flg'] = false;
$tmpCircleMemberList = CircleMemberDat::getList($param);
if(!empty($tmpCircleMemberList)) {
foreach($tmpCircleMemberList as $tmpCircleMember) {
$userMessageDat = new UserMessageDat();
$userMessageDat->user_id = $tmpCircleMember->user_id;
$userMessageDat->title = "活动参加邀请通知";
$userMessageDat->comment = "嘀嘀嘀!圈主邀请您参加活动,快点击参加报名吧!";
//添加附件附件
$userMessageDat->attach_dat_type = "VOLUNTEER";
$userMessageDat->attach_dat_id = $circleDat->id;
$userMessageDat->attach_dat_path = "/pages/volunteersEventDetail/volunteersEventDetail?eventId={$eventId}&circleId={$circleId}";
$userMessageDat->save();
}
}
}
}
......@@ -105,7 +119,7 @@ foreach($circleIdArray as $circleId) {
ErrorLogger::doOutput("Compass...ajax_attend_volunteer_event_circle.php....End.", 0);
//返回结果
$result["message"] = "报名成功!";
$result["message"] = "操作成功!";
responseOK($result);
function responseNG($result) {
......
......@@ -5,13 +5,14 @@ require_once ("../user_include.inc");
$unionId = ParamUtil::getRequestString("unionId", 0);
$openId = ParamUtil::getRequestString("openId", 0);
$mediaId = ParamUtil::getRequestString("mediaId", 0);
$courseId = ParamUtil::getRequestNumber("courseId", 0);
$mediaId = ParamUtil::getRequestNumber("mediaId", 0);
ErrorLogger::doOutput("Compass...ajax_buy_course_media.php....Start.", 0);
ErrorLogger::doOutput("Compass...ajax_buy_course_media.php....unionId=" . $unionId, 0);
//参数验证
if(empty($unionId) || empty($openId)) {
if(empty($unionId) || empty($openId) || empty($mediaId)) {
responseNG("参数错误!");
}
......@@ -32,7 +33,16 @@ if(empty($courseMediaDat)) {
$result["message"] = "视频不存在!";
responseNG($result);
}
//单个视频
$money = $courseMediaDat->price;
$title = $courseMediaDat->title;
if($courseId > 0) {
//合集购买
$courseMst = CourseMst::getById($courseMediaDat->course_id);
$money = $courseMst->price;
$title = $courseMst->title;
}
//调用支付
//生成临时订单
$orderNo = "C" . date("YmdHis") . "_" . $userMst->id;
......@@ -40,8 +50,8 @@ $userMediaDat = new UserMediaDat();
$userMediaDat->user_id = $userMst->id;
$userMediaDat->course_id = $courseMediaDat->course_id;
$userMediaDat->media_id = $courseMediaDat->id;
$userMediaDat->is_free = $courseMediaDat->is_free;
$userMediaDat->money = $courseMediaDat->price;
$userMediaDat->is_free = false;
$userMediaDat->money = $money;
$userMediaDat->order_no = $orderNo;
$userMediaDat->status = "NEW";
$userMediaDat->save();
......@@ -51,13 +61,13 @@ ErrorLogger::doOutput("Compass...ajax_buy_course_media.php....SetNotify_url=" .
//调用微信支付接口
$tools = new JsApiPay();
$input = new WxPayUnifiedOrder();
$input->SetBody("购买" . $courseMediaDat->title);
$input->SetAttach("购买" . $courseMediaDat->title);
$input->SetBody("购买" . $title);
$input->SetAttach("购买" . $title);
$input->SetOut_trade_no($orderNo);
$input->SetTotal_fee($courseMediaDat->price * 100);//折算到分
$input->SetTotal_fee($money * 100);//折算到分
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 800));
$input->SetGoods_tag("购买" . $courseMediaDat->title);
$input->SetGoods_tag("购买" . $title);
$input->SetNotify_url("https://" . SSL_PATH . "/api/api_wx_pay_notify.php");
$input->SetTrade_type("JSAPI");
$input->SetOpenid($userMst->openid);
......
......@@ -73,7 +73,7 @@ $circleDat->save();
//组装返回数据
$result["message"] = "删除成功!";
ErrorLogger::doOutput("Compass...ajax_delete_circle.php....End.", 0);
ErrorLogger::doOutput("Compass...ajax_delete_circle.php.php....End.", 0);
//返回结果
responseOK($result);
......
......@@ -37,6 +37,7 @@ if(empty($courseMediaDat)) {
}
//如果为合集视频获取对应的媒体列表
$courseId = "0";
$courseTitle = "";
$teacherName = "";
$teacherProfile = "";
......@@ -44,10 +45,14 @@ $frontImage = "";
$courseComment = "";
$updateTime = "";
$viewCount = "0";
$price = "0";
$haveBuy = false;
$courseMediaList = array();
//单个视频
if($courseMediaDat->course_id == 0) {
if($courseMediaDat->course_id == "0") {
$courseMediaList[] = $courseMediaDat;
$courseId = $courseMediaDat->course_id;
$courseTitle = $courseMediaDat->title;
$teacherName = $courseMediaDat->teacher;
$teacherProfile = $courseMediaDat->teacher_profile;
......@@ -58,26 +63,26 @@ if($courseMediaDat->course_id == 0) {
//是否购买本视频
$courseMediaDat->haveBuy = false;
//付费会员、教育局领导、学校负责人、班级负责人可以免费观看
if($userMst->is_member || $userMst->role == 4 || $userMst->school_owner || $userMst->class_owner) {
$courseMediaDat->haveBuy = true;
if($courseMediaDat->is_free || $userMst->is_member || $userMst->role == 4 || $userMst->school_owner || $userMst->class_owner) {
$haveBuy = true;
} else {
if($courseMediaDat->is_free==false) {
//收费课程的情况下,判断用户是否已经购买本课程
$param = array();
$param['user_id'] = $userMst->id;
$param['media_id'] = $courseMediaDat->id;
$param['is_free'] = false;
$param['status'] = 'SUCCESS';
$param['delete_flg'] = false;
$userMstBuyList = UserMediaDat::getList($param, "id", "desc", 0, 1);
if(!empty($userMstBuyList)) {
$courseMediaDat->haveBuy = true;
$haveBuy = true;
}
}
}
} else {
//合集视频
$courseMst = CourseMst::getById($courseMediaDat->course_id);
$courseId = $courseMediaDat->course_id;
$courseTitle = $courseMst->title;
$teacherName = $courseMst->teacher_name;
$teacherProfile = $courseMst->teacher_profile;
......@@ -85,37 +90,32 @@ if($courseMediaDat->course_id == 0) {
$courseComment = $courseMst->comment;
$updateTime = $courseMst->registration_date;
$viewCount = $courseMediaDat->view_count;
$price = $courseMst->price;
//是否已经购买判断
$param = array();
$param['course_id'] = $courseMediaDat->course_id;
$param['delete_flg'] = false;
$tmpList = CourseMediaDat::getList($param,'id','asc');
if(!empty($tmpList)) {
foreach($tmpList as $tmp) {
$tmp->haveBuy = false;
if($userMst->is_member || $userMst->role == 4 || $userMst->school_owner || $userMst->class_owner) {
$tmp->haveBuy = true;
} else {
if($tmp->is_free==false) {
//收费课程的情况下,判断用户是否已经购买本课程
$param = array();
$param['user_id'] = $userMst->id;
$param['media_id'] = $tmp->id;
$param['is_free'] = false;
$param['status'] = 'SUCCESS';
$param['delete_flg'] = false;
$userBuyList = UserMediaDat::getList($param, "id", "desc", 0, 1);
if(!empty($userBuyList)) {
$tmp->haveBuy = true;
}
}
}
$courseMediaList[] = $tmp;
$courseMediaList = CourseMediaDat::getList($param,'id','asc');
//是否已经购买判断
$param = array();
$param['user_id'] = $userMst->id;
$param['course_id'] = $courseMediaDat->course_id;
$param['status'] = 'SUCCESS';
$param['delete_flg'] = false;
$userMstBuyList = UserMediaDat::getList($param,'id','asc');
if($courseMst->price <= 0 || $userMst->is_member || $userMst->role == 4 || $userMst->school_owner || $userMst->class_owner) {
$haveBuy = true;
} else {
if(!empty($userMstBuyList)) {
$haveBuy = true;
}
}
}
//接口返回数据
$result["courseId"] = $courseId;
$result["courseTitle"] = $courseTitle;
$result["teacherName"] = $teacherName;
$result["teacherProfile"] = $teacherProfile;
......@@ -124,6 +124,8 @@ $result["courseComment"] = $courseComment;
$result["mediaCount"] = count($courseMediaList);
$result["updateTime"] = $updateTime;
$result["viewCount"] = $viewCount;
$result["price"] = $price;//合集价格
$result["haveBuy"] = $haveBuy;//是否已经购买(单个或者合集)
$result["mediaList"] = $courseMediaList;
ErrorLogger::doOutput("Compass...ajax_get_course_detail.php....End.", 0);
......
......@@ -39,49 +39,80 @@ if(empty($courseMediaDat)) {
$courseMediaDat->haveBuy = false;
//付费会员、教育局领导、学校负责人、班级负责人可以免费观看
if($userMst->is_member || $userMst->role == 4 || $userMst->school_owner || $userMst->class_owner) {
ErrorLogger::doOutput("Compass...ajax_get_play_media_detail.php.....1111111", 0);
$courseMediaDat->haveBuy = true;
} else {
//收费课程判断用户是否已经购买
if($courseMediaDat->is_free==false) {
//收费课程的情况下,判断用户是否已经购买本课程
$param = array();
$param['user_id'] = $userMst->id;
$param['media_id'] = $courseMediaDat->id;
$param['is_free'] = false;
$param['status'] = 'SUCCESS';
$param['delete_flg'] = false;
$userMstBuyList = UserMediaDat::getList($param, "id", "desc", 0, 1);
if(!empty($userMstBuyList)) {
if($courseMediaDat->course_id == 0) {
ErrorLogger::doOutput("Compass...ajax_get_play_media_detail.php.....22222222", 0);
//单个视频的情况
if($courseMediaDat->is_free==true) {
ErrorLogger::doOutput("Compass...ajax_get_play_media_detail.php.....22222222111111", 0);
$courseMediaDat->haveBuy = true;
} else {
ErrorLogger::doOutput("Compass...ajax_get_play_media_detail.php.....22222222_2222222", 0);
//是否有购买记录
$param = array();
$param['user_id'] = $userMst->id;
$param['media_id'] = $courseMediaDat->id;
$param['status'] = 'SUCCESS';
$param['delete_flg'] = false;
$userMstBuyList = UserMediaDat::getList($param, "id", "desc", 0, 1);
if(!empty($userMstBuyList)) {
$courseMediaDat->haveBuy = true;
}
}
} else {
ErrorLogger::doOutput("Compass...ajax_get_play_media_detail.php.....333333333", 0);
$courseMst = CourseMst::getById($courseMediaDat->course_id);
//此时的价格为 合集的价格!!
$courseMediaDat->price = $courseMst->price;
if(empty($courseMst)) {
$result["message"] = "数据错误!";
responseNG($result);
}
if($courseMst->price <= 0) {
$courseMediaDat->haveBuy = true;
} else {
//是否本合集的购买记录
$param = array();
$param['user_id'] = $userMst->id;
$param['course_id'] = $courseMediaDat->course_id;
$param['status'] = 'SUCCESS';
$param['delete_flg'] = false;
$userMstBuyList = UserMediaDat::getList($param, "id", "desc", 0, 1);
if(!empty($userMstBuyList)) {
$courseMediaDat->haveBuy = true;
}
}
}
}
//添加播放次数[观看次数+1]
$courseMediaDat->view_count++;
$courseMediaDat->save();
//添加用户播放记录
//添加用户观看记录(已经观看过则更新时间变成最后观看)
$param = array();
$param['user_id'] = $userMst->id;
$param['course_id'] = $courseMediaDat->course_id;
$param['media_id'] = $mediaId;
$param['delete_flg'] = false;
$tmpUserMediaDatList = UserMediaDat::getList($param,'id','desc', 0, 1);
if(empty($tmpUserMediaDatList)) {
//第一次观看则添加记录
$userMstMediaDat = new UserMediaDat();
$userMstMediaDat->user_id = $userMst->id;
$userMstMediaDat->course_id = $courseMediaDat->course_id;
$userMstMediaDat->media_id = $mediaId;
$userMstMediaDat->is_free = $courseMediaDat->is_free;
$userMstMediaDat->money = 0;
$userMstMediaDat->save();
} else {
//以前有观看记录则修改观看时间
$tmpUserMediaDatList[0]->registration_date = date("Y-m-d H:i:s");
$tmpUserMediaDatList[0]->save();
if($courseMediaDat->haveBuy) {
$courseMediaDat->view_count++;
$courseMediaDat->save();
//添加用户播放记录
//添加用户观看记录(已经观看过则更新时间变成最后观看)
$param = array();
$param['user_id'] = $userMst->id;
$param['media_id'] = $mediaId;
$param['delete_flg'] = false;
$tmpUserMediaDatList = UserMediaDat::getList($param,'id','desc', 0, 1);
if(empty($tmpUserMediaDatList)) {
//第一次观看则添加记录
$userMstMediaDat = new UserMediaDat();
$userMstMediaDat->user_id = $userMst->id;
$userMstMediaDat->course_id = $courseMediaDat->course_id;
$userMstMediaDat->media_id = $mediaId;
$userMstMediaDat->is_free = $courseMediaDat->is_free;
$userMstMediaDat->money = 0;
$userMstMediaDat->save();
} else {
//以前有观看记录则修改观看时间
$tmpUserMediaDatList[0]->registration_date = date("Y-m-d H:i:s");
$tmpUserMediaDatList[0]->save();
}
}
//接口返回数据
......
......@@ -42,11 +42,12 @@ $familyEventList = array();
$socialEventList = array();
$mediaList = array();
//志愿者活动[当前所在区域的第一条志愿者活动]
//志愿者活动[后端推荐的最新一条]
$param = array();
$param['province'] = $province;
$param['city'] = $city;
$param['district'] = $district;
//$param['province'] = $province;
//$param['city'] = $city;
//$param['district'] = $district;
$param['is_recommend'] = true;
$param['status'] = "OK";
$param['delete_flg'] = false;
//社会用户和机构用户的时候,添加【是否允许社会人士参加】
......@@ -64,7 +65,35 @@ foreach($tmpVolunteerEventList as $tmp) {
$volunteerEventList[] = $tmp;
}
//获取首页的志愿要闻
$newsList = array();
//大图数据1条
$param = array();
$param['is_top'] = true;
$param['front_image_big_NOT'] = true;
$param['delete_flg'] = false;
$newsList = NewsDat::getList($param,'id','desc', 0, 1);
$bigId = 0;
$smallCount = 3;
if(!empty($newsList)) {
$bigId = $newsList[0]->id;
$smallCount = 2;
}
$param = array();
$param['is_top'] = true;
$param['id_NOT'] = $bigId;
$param['front_image_small_NOT'] = true;
$param['delete_flg'] = false;
$newsList2 = NewsDat::getList($param,'id','desc', 0, $smallCount);
if(!empty($newsList2)) {
foreach($newsList2 as $newsObj) {
$newsObj->front_image_big = "";
$newsList[] = $newsObj;
}
}
/** 注释掉 社会实践和亲子活动
//家园用户只显示本校的亲子活动
if($userMst->role == 1) {
//本校亲子活动
......@@ -107,23 +136,32 @@ if(!empty($tmpFamilyEventList)) {
}
}
**/
//公益课堂
$mediaList = array();
$param = array();
$param['delete_flg'] = false;
$mediaList = CourseMediaDat::getList($param,'id','desc', 0, 3);
$tmpMediaList = CourseMediaDat::getList($param,'id','desc', 0, 3);
//循环获取分类
foreach($tmpMediaList as $mediaDat) {
$categoryTitle = CourseParentCategory::getTitleById($mediaDat->parent_category_id);
$mediaDat->parent_category_id = $categoryTitle;
$mediaList[] = $mediaDat;
}
/**
//未读消息数量
$param = array();
$param['user_id'] = $userMst->id;
$param['is_read'] = false;
$param['delete_flg'] = false;
$unreadMessageCount = UserMessageDat::getListCount($param);
*/
//组装返回数据
$result["unreadMessageCount"] = $unreadMessageCount;
$result["volunteerEventList"] = $volunteerEventList;
$result["familyEventList"] = $familyEventList;
$result["socialEventList"] = $socialEventList;
$result["newsList"] = $newsList;
$result["mediaList"] = $mediaList;
ErrorLogger::doOutput("Compass...ajax_get_top_dat.php....End.", 0);
......
<?php
// 发送短信验证码
require_once ("../user_include.inc");
//设置一个随机验证码
$verificationCode = PasswordMaker::numbers(4,4);
$_SESSION['verificationCode'] = $verificationCode;
//发送验证码给用户
responseOK($verificationCode);
function responseOK($verificationCode) {
$result = array("status"=>"OK", "code"=>$verificationCode);
print json_encode($result);
exit;
}
\ No newline at end of file
......@@ -61,9 +61,26 @@ $ownerCircleList = array();
$param = array();
$param['owner_id'] = $userMst->id;
$param['delete_flg'] = false;
$ownerCircleList = CircleDat::getList($param, "id", "desc");
if(!empty($ownerCircleList)) {
$tmpOwnerCircleList = CircleDat::getList($param, "id", "desc");
if(!empty($tmpOwnerCircleList)) {
$isCircleOwner = true;
foreach($tmpOwnerCircleList as $tmpCircle) {
$tmp = array();
$defaultClass = "circleItem";
//判断该圈子是否已经报名
$param = array();
$param['volunteer_event_id'] = $eventId;
$param['circle_id'] = $tmpCircle->id;
$param['delete_flg'] = false;
$tmpCount = VolunteerEventMemberDat::getListCount($param);
if($tmpCount > 0) {
$defaultClass = "circleItemSelected";
}
$tmp["id"] = $tmpCircle->id;
$tmp["title"] = $tmpCircle->title;
$tmp["itemClass"] = $defaultClass;
$ownerCircleList[] = $tmp;
}
}
//报名是否已经结束
......@@ -85,8 +102,10 @@ $tmpMemberList1 = VolunteerEventMemberDat::getList($param, "id", "desc");
if(!empty($tmpMemberList1)) {
foreach($tmpMemberList1 as $tmpMember) {
$tmpUser = UserMst::getById($tmpMember->user_id);
$tmpArray= array("name"=>$tmpUser->name, "header_img"=>$tmpUser->header_img );
$personalMemberList[] = $tmpArray;
if(!empty($tmpUser)) {
$tmpArray= array("name"=>$tmpUser->name, "header_img"=>$tmpUser->header_img);
$personalMemberList[] = $tmpArray;
}
}
}
......
......@@ -8,6 +8,7 @@ ErrorLogger::doOutput("Compass...ajax_get_volunteer_event_list.php....Start.", 0
//获取参数
$unionId = ParamUtil::getRequestString("unionId");
$page = ParamUtil::getRequestNumber("page", 0);//翻页
$type = ParamUtil::getRequestString("type", "nearby");//类型 nearby other
//用户所在【省市区】
$province = ParamUtil::getRequestString("province");
......@@ -81,6 +82,11 @@ foreach($tmpVolunteerEventList as $tmp) {
if($tmp->include_social_user) {
$tmp->scope = "校内.社会人士";
}
if($tmp->max_member==0) {
$tmp->max_member = "不限";
} else {
$tmp->max_member = $tmp->max_member . "人";
}
$volunteerEventList[] = $tmp;
}
......
<?php
// 获取志愿者活动列表
require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...ajax_get_volunteer_event_list.php....Start.", 0);
//获取参数
$unionId = ParamUtil::getRequestString("unionId");
$page = ParamUtil::getRequestNumber("page", 0);//翻页
//用户所在【省市区】
$province = ParamUtil::getRequestString("province");
$city = ParamUtil::getRequestString("city");
$district = ParamUtil::getRequestString("district");
$result = array();
//参数检查
if(empty($unionId)) {
$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];
//志愿者活动【顶部轮播】
$volunteerEventList1 = array();
$param = array();
if(DEBUG_MODE==false) {
$param['province'] = $province;
$param['city'] = $city;
$param['district'] = $district;
}
$param['status'] = "OK";
$param['is_recommend'] = true;
$param['delete_flg'] = false;
//社会用户和机构用户的时候,添加【是否允许社会人士参加】
if($userMst->role == 5 || $userMst->role == 6) {
$param['include_social_user'] = true;
}
$tmpVolunteerEventList1 = VolunteerEventDat::getList($param,'id','desc', 0, 2);
//志愿者活动【最新活动】
$volunteerEventList2 = array();
$param = array();
if(DEBUG_MODE==false) {
$param['province'] = $province;
$param['city'] = $city;
$param['district'] = $district;
}
$param['status'] = "OK";
$param['delete_flg'] = false;
//社会用户和机构用户的时候,添加【是否允许社会人士参加】
if($userMst->role == 5 || $userMst->role == 6) {
$param['include_social_user'] = true;
}
$tmpVolunteerEventList2 = VolunteerEventDat::getList($param,'id','desc', 0, 1);
//志愿者活动【附近活动】
$volunteerEventList3 = array();
$param = array();
if(DEBUG_MODE==false) {
$param['province'] = $province;
$param['city'] = $city;
$param['district'] = $district;
}
$param['status'] = "OK";
$param['delete_flg'] = false;
//社会用户和机构用户的时候,添加【是否允许社会人士参加】
if($userMst->role == 5 || $userMst->role == 6) {
$param['include_social_user'] = true;
}
$tmpVolunteerEventList3 = VolunteerEventDat::getList($param,'id','desc', 0, 2);
//志愿者活动【其他活动】
$volunteerEventList4 = array();
$param = array();
if(DEBUG_MODE==false) {
$param['province'] = $province;
$param['city'] = $city;
$param['district'] = $district;
}
$param['status'] = "OK";
$param['delete_flg'] = false;
//社会用户和机构用户的时候,添加【是否允许社会人士参加】
if($userMst->role == 5 || $userMst->role == 6) {
$param['include_social_user'] = true;
}
$tmpVolunteerEventList4 = VolunteerEventDat::getList($param,'id','desc', 0, 2);
//查询所在区域能力分汇总
//能力分汇总
$abilityPoint = 0;
$sql = "select sum(ability_point) as ability_point from user_mst where delete_flg = false and school_no is not null and province='{$province}'";
if(!empty($city)) {
$sql .= " and city='{$city}'";
}
if(!empty($district)) {
$sql .= " and district='{$district}'";
}
$db = &CompassDBManager::getInstance();
$tmp = $db->executeQuery($sql);
if(!empty($tmp)) {
$abilityPoint = $tmp[0]['ability_point'];
}
$result["abilityPoint"] = $abilityPoint;
//设置状态和招募范围
foreach($tmpVolunteerEventList1 as $tmp) {
$tmp->status_title = EventStatus::getTitleByName($tmp->status);
$tmp->scope = "校内";
if($tmp->include_social_user) {
$tmp->scope = "校内.社会人士";
}
if($tmp->max_member==0) {
$tmp->max_member = "不限";
} else {
$tmp->max_member = $tmp->max_member . "人";
}
$volunteerEventList1[] = $tmp;
}
foreach($tmpVolunteerEventList2 as $tmp) {
$tmp->status_title = EventStatus::getTitleByName($tmp->status);
$tmp->scope = "校内";
if($tmp->include_social_user) {
$tmp->scope = "校内.社会人士";
}
if($tmp->max_member==0) {
$tmp->max_member = "不限";
} else {
$tmp->max_member = $tmp->max_member . "人";
}
$volunteerEventList2[] = $tmp;
}
foreach($tmpVolunteerEventList3 as $tmp) {
$tmp->status_title = EventStatus::getTitleByName($tmp->status);
$tmp->scope = "校内";
if($tmp->include_social_user) {
$tmp->scope = "校内.社会人士";
}
if($tmp->max_member==0) {
$tmp->max_member = "不限";
} else {
$tmp->max_member = $tmp->max_member . "人";
}
$volunteerEventList3[] = $tmp;
}
foreach($tmpVolunteerEventList4 as $tmp) {
$tmp->status_title = EventStatus::getTitleByName($tmp->status);
$tmp->scope = "校内";
if($tmp->include_social_user) {
$tmp->scope = "校内.社会人士";
}
if($tmp->max_member==0) {
$tmp->max_member = "不限";
} else {
$tmp->max_member = $tmp->max_member . "人";
}
$volunteerEventList4[] = $tmp;
}
//组装返回数据
$result["volunteerEventList1"] = $volunteerEventList1;
$result["volunteerEventList2"] = $volunteerEventList2;
$result["volunteerEventList3"] = $volunteerEventList3;
$result["volunteerEventList4"] = $volunteerEventList4;
ErrorLogger::doOutput("Compass...ajax_get_volunteer_event_list.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
<?
// クラス、設定読み込み
//添加或者删除用户的收藏记录
require_once ("../user_include.inc");
ErrorLogger::doOutput("Koala...ajax_operate_favorite.php....Start.", 0);
$action_type = ParamUtil::getRequestString("action_type");//delete/add
$data_type = ParamUtil::getRequestString("data_type");//word/article
$data_id = ParamUtil::getRequestNumber("data_id", 0);
ErrorLogger::doOutput("Koala...ajax_operate_favorite.php....action_type=" . $action_type, 0);
ErrorLogger::doOutput("Koala...ajax_operate_favorite.php....data_type=" . $data_type, 0);
ErrorLogger::doOutput("Koala...ajax_operate_favorite.php....data_id=" . $data_id, 0);
//参数错误
if(empty($action_type) || ($action_type!="delete" && $action_type!="add")) {
responseNG("NG_PARAM", "参数错误!");
}
if(empty($data_type) || ($data_type!="word" && $data_type!="article")) {
responseNG("NG_PARAM", "参数错误!");
}
if(empty($data_id) || $data_id==0) {
responseNG("NG_PARAM", "参数错误!");
}
//判断用户登陆状态
$ta = new TemplateAction();
if(!$ta->isLogin()) {
responseNG("NG_LOGIN", "未登录!");
}
//检查数据是否存在
if($action_type == "add" && $data_type == "word") {
$word_dat = WordDat::getById($data_id);
if(empty($word_dat)) {
responseNG("NG_PARAM", "参数错误!");
}
}
if($action_type == "add" && $data_type == "article") {
$article_dat = ArticleDat::getById($data_id);
if(empty($article_dat)) {
responseNG("NG_PARAM", "参数错误!");
}
}
$user_id = $ta->user->id;
//是否重复登陆
if($action_type == "add") {
$param = array();
$param["user_id"] = $user_id;
$param["data_type"] = $data_type;
$param["data_id"] = $data_id;
$param["delete_flg"] = false;
$tmp_favorite_count = UserFavoriteDat::getListCount($param);
if ($tmp_favorite_count > 0) {
responseNG("NG_REPEAT", "重复添加!");
}
}
//数据操作
$sql = "";
if($action_type == "add") {
$sql = "INSERT INTO user_favorite_dat(user_id, data_type, data_id) values('{$user_id}', '{$data_type}', '{$data_id}')";
}
if($action_type == "delete") {
$sql = "DELETE FROM user_favorite_dat WHERE delete_flg=false and user_id='{$user_id}' and data_type='{$data_type}' and data_id='{$data_id}'";
}
ErrorLogger::doOutput("Koala...ajax_operate_favorite.php....sql=" . $sql, 0);
$db = &KoalaDBManager::getInstance();
$db->executeQuery($sql);
responseOK("操作成功!");
function responseNG($status, $message) {
$result = array("status"=>$status, "message"=>$message);
print json_encode($result);
exit;
}
function responseOK($message) {
$result = array("status"=>"OK", "message"=>$message);
print json_encode($result);
exit;
}
?>
\ No newline at end of file
<?
// クラス、設定読み込み
//判断当前客户端是否在登陆状态
require_once ("../user_include.inc");
ErrorLogger::doOutput("Koala...ajax_user_check_login.php....Start.", 0);
$ta = new TemplateAction();
if($ta->isLogin()) {
ErrorLogger::doOutput("Koala...ajax_user_check_login.php..LOGIN_IN..End.", 0);
responseStatus("LOGIN_IN");
} else {
ErrorLogger::doOutput("Koala...ajax_user_check_login.php..LOGIN_OUT..End.", 0);
responseStatus("LOGIN_OUT");
}
function responseStatus($status) {
$result = array("status"=>$status);
print json_encode($result);
exit;
}
?>
\ No newline at end of file
<?php
// 提交用户签到结果
require_once ("../user_include.inc");
ErrorLogger::doOutput("Koala...ajax_user_exchange_coupon.php....Start.", 0);
//代金券ID
$coupon_id = ParamUtil::getRequestNumber("coupon_id", 0);
$ta = new TemplateAction();
if(!$ta->isLogin()) {
responseNG("请先登录!");
}
//代金券是否存在
$coupon_dat = Coupon::getById($coupon_id);
if(empty($coupon_dat)) {
responseNG("数据错误!");
}
//积分整合性判断
//获取用户数据
$point_left = 0;
$param = array();
$param["user_id"] = $ta->user->id;
$param["status"] = "SUCCESS";
$param["delete_flg"] = false;
$user_point_list = UserPointLog::getList($param, "id", "desc", 0, 1);
if(!empty($user_point_list)) {
$point_left = $user_point_list[0]->point_left;
}
ErrorLogger::doOutput("Koala...ajax_user_exchange_coupon.php....point1=" . $ta->user->point, 0);
ErrorLogger::doOutput("Koala...ajax_user_exchange_coupon.php....point2=" . $point_left, 0);
if($ta->user->point != $point_left) {
responseNG("数据错误2!");
}
if($point_left < $coupon_dat->point) {
responseNG("积分不足!");
}
//开始兑换
//添加一条新的积分记录记录
$minus_point = $coupon_dat->point;
$user_point_log = new UserPointLog();
$user_point_log->user_id = $ta->user->id;
$user_point_log->action_type = 5;//兑换代金券
$user_point_log->point = (-1)*$minus_point;
$user_point_log->point_left = $point_left - $minus_point;
$user_point_log->status = "SUCCESS";
$user_point_log->save();
//添加代金券
$dead_time = time() + ($coupon_dat->valid_days)*24*3600;
$user_coupon_dat = new UserCouponDat();
$user_coupon_dat->user_id = $ta->user->id;
$user_coupon_dat->coupon_id = $coupon_id;
$user_coupon_dat->coupon_count = 1;
$user_coupon_dat->dead_time = date('y-m-d',$dead_time) . " 23:59:59";
$user_coupon_dat->transfer_count = 0;
$user_coupon_dat->save();
//更新用户表的point字段值
$ta->user->point = $user_point_log->point_left;
$ta->user->save();
ErrorLogger::doOutput("Koala...ajax_user_exchange_coupon.php....point_left=" . $point_left, 0);
ErrorLogger::doOutput("Koala...ajax_user_exchange_coupon.php....minus_point=" . $minus_point, 0);
//更新用户表的point字段值
$ta->user->point = $user_point_log->point_left;
$ta->user->save();
ErrorLogger::doOutput("Koala...ajax_user_exchange_coupon.php....End.", 0);
responseOK("兑换成功!");
function responseNG($message) {
$result = array("status"=>"NG", "message"=>$message);
header("Access-Control-Allow-Origin: *");
print json_encode($result);
exit;
}
function responseOK($message) {
$result = array("status"=>"OK", "message"=>$message);
header("Access-Control-Allow-Origin: *");
print json_encode($result);
exit;
}
?>
\ No newline at end of file
<?
// クラス、設定読み込み
require_once ("../user_include.inc");
ErrorLogger::doOutput("Koala...ajax_user_login.php....Start.", 0);
$mobile = ParamUtil::getRequestString("mobile");
$verifycode = ParamUtil::getRequestString("verifycode");
ErrorLogger::doOutput("Koala...ajax_user_login.php....mobile=" . $mobile, 0);
ErrorLogger::doOutput("Koala...ajax_user_login.php....verifycode=" . $verifycode, 0);
//获取不到手机号码
if(empty($mobile)) {
responseNG("手机号码错误!");
}
//获取不到验证码
if(empty($verifycode)) {
responseNG("验证码错误!");
}
//检测验证码
$verification_code = @$_SESSION['verificationCode'];
if(empty($verification_code) || $verification_code != $verifycode) {
responseNG("验证码错误!");
}
//检测用户是否已经注册
$param = array();
$param["delete_flg"] = false;
$param["mobile"] = $mobile;
$user_list = UserMst::getList($param);
//存在的情况下,注册一条数据
if(empty($user_list)) {
responseNG("手机号码不存在!");
}
//清除验证码
if(isset($_SESSION['verificationCode'])) {
unset($_SESSION['verificationCode']);
}
//设定到session中保持
$_SESSION['_user_'] = $user_list[0];
ErrorLogger::doOutput("Koala...ajax_user_login.php....End.", 0);
responseOK("登陆成功!");
function responseNG($message) {
$result = array("status"=>"NG", "message"=>$message);
print json_encode($result);
exit;
}
function responseOK($message) {
$result = array("status"=>"OK", "message"=>$message);
print json_encode($result);
exit;
}
?>
\ No newline at end of file
<?php
// 提交用户签到结果
require_once ("../user_include.inc");
ErrorLogger::doOutput("Koala...ajax_user_sign.php....Start.", 0);
//文章ID
$article_id = ParamUtil::getRequestNumber("article_id", 0);
$ta = new TemplateAction();
if(!$ta->isLogin()) {
responseNG("请先登录!");
}
//判断当天是否已经签到
$param = array();
$param["object_date"] = date("Y-m-d");
$param["user_id"] = $ta->user->id;
$param["delete_flg"] = false;
$sign_count = UserSignDat::getListCount($param);
if($sign_count >= 1) {
responseNG("今天已经签到,请明天再来!");
}
//用户加点
$point_left = 0;
$add_point = rand(1, 10);
ErrorLogger::doOutput("Koala...ajax_user_sign.php....point_left=" . $point_left, 0);
ErrorLogger::doOutput("Koala...ajax_user_sign.php....add_point=" . $add_point, 0);
//签到操作
$user_sign_dat = new UserSignDat();
$user_sign_dat->object_date = date("Y-m-d");
$user_sign_dat->user_id = $ta->user->id;
$user_sign_dat->point = $add_point;
$user_sign_dat->article_id = $article_id;
$user_sign_dat->save();
//查找最后一条记录
$param = array();
$param["user_id"] = $ta->user->id;
$last_log_list = UserPointLog::getList($param, "id", "desc", 0, 1);
if(!empty($last_log_list)) {
$point_left = $last_log_list[0]->point_left;
}
//添加一条新的记录
$user_point_log = new UserPointLog();
$user_point_log->user_id = $ta->user->id;
$user_point_log->action_type = 2;//签到
$user_point_log->point = $add_point;
$user_point_log->point_left = $point_left + $add_point;
$user_point_log->status = "SUCCESS";
$user_point_log->save();
//更新用户表的point字段值
$ta->user->point = $user_point_log->point_left;
$ta->user->save();
ErrorLogger::doOutput("Koala...ajax_user_sign.php....End.", 0);
responseOK("签到成功!获得" . $add_point . "积分!");
function responseNG($message) {
$result = array("status"=>"NG", "message"=>$message);
header("Access-Control-Allow-Origin: *");
print json_encode($result);
exit;
}
function responseOK($message) {
$result = array("status"=>"OK", "message"=>$message);
header("Access-Control-Allow-Origin: *");
print json_encode($result);
exit;
}
?>
\ No newline at end of file
<?php
// 使用代金券
require_once ("../user_include.inc");
$user_coupon_dat_id = ParamUtil::getRequestNumber("user_coupon_dat_id", 0);
$coupon_id = ParamUtil::getRequestNumber("coupon_id", 0);
ErrorLogger::doOutput("Koala...ajax_user_use_coupon.php....Start.", 0);
$ta = new TemplateAction();
if(!$ta->isLogin()) {
responseNG("请先登录!");
}
//优惠券是否存在
$coupon_dat = Coupon::getById($coupon_id);
if(empty($coupon_dat)) {
responseNG("参数错误!");
}
$user_coupon_dat = UserCouponDat::getById($user_coupon_dat_id);
if(empty($user_coupon_dat)) {
responseNG("参数错误!");
}
if($user_coupon_dat->user_id != $ta->user->id || $user_coupon_dat->coupon_id != $coupon_id){
responseNG("参数错误!");
}
if($user_coupon_dat->coupon_count <= 0) {
responseNG("代金券数量不足!");
}
//有效期
$dead_time = $user_coupon_dat->dead_time;
if(date("Y-m-d H:i:s") > $dead_time) {
responseNG("已过有效期!");
}
//一个代金券只能使用一次
$param = array();
$param["user_id"] = $ta->user->id;
$param["coupon_id"] = $coupon_id;
$param["status_NOT"] = "BACK";
$param["delete_flg"] = false;
$user_use_coupon_list = UserUseCouponDat::getList($param);
if(!empty($user_use_coupon_list)) {
responseNG("每次只能使用一张代金券!");
}
//使用代金券
$user_coupon_dat->coupon_count = 0;
$user_coupon_dat->save();
$user_use_coupon_dat = new UserUseCouponDat();
$user_use_coupon_dat->user_id = $ta->user->id;
$user_use_coupon_dat->coupon_id = $coupon_id;
$user_use_coupon_dat->status = "APPLY";
$user_use_coupon_dat->save();
ErrorLogger::doOutput("Koala...ajax_user_use_coupon.php....End.", 0);
responseOK("申请成功!请等待课程顾问老师联系您!");
function responseNG($message) {
$result = array("status"=>"NG", "message"=>$message);
header("Access-Control-Allow-Origin: *");
print json_encode($result);
exit;
}
function responseOK($message) {
$result = array("status"=>"OK", "message"=>$message);
header("Access-Control-Allow-Origin: *");
print json_encode($result);
exit;
}
?>
\ No newline at end of file
......@@ -5,6 +5,7 @@ require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...test.php....Start.", 0);
/**
$startTime = "20200401 12:00:00";
$finishTime = "20200401 18:20:00";
ErrorLogger::doOutput("Compass...ajax_set_circle_event_new.php....startTime=" . $startTime, 0);
......@@ -13,7 +14,7 @@ $minutes=floor((strtotime($finishTime)-strtotime($startTime))%86400/60);
ErrorLogger::doOutput("Compass...ajax_set_circle_event_new.php....minutes=" . $minutes, 0);
echo ceil($minutes/60) . "小时" . $minutes%60 . "分钟";
/**
$tmpMemberList = array();
//圈主
$circleMemberDat = new CircleMemberDat();
......@@ -186,6 +187,14 @@ foreach($tmpMemberList as $tmp) {
}
*/
$userMst = UserMst::getById(79);
//管辖区域
$userMst->province="吉林省";
$userMst->city="哈尔滨市";
$userMst->save();
ErrorLogger::doOutput("Compass...test.php....End.", 0);
......
......@@ -182,26 +182,12 @@ Page({
},
//合集点击明细处理
videoplay() {
if (this.data.show1) {
this.setData({
showPay: 1
})
this.fufeilook()
} else {
this.setData({
showPlay: 1
})
this.classDerails();
var query = wx.createSelectorQuery();
var that = this;
query.select('.video').boundingClientRect(function (rect) {
var videoHeight = (rect.width * 9) / 16;
that.setData({
videoHeight: videoHeight
})
}).exec();
}
learnCollection(e) {
wx.showToast({
title: '请点击目录观看。',
icon: 'success',
duration: 2000
});
},
//播放返回
......@@ -270,7 +256,8 @@ Page({
success(res) {
that.setData({
showPay: 0,
showPlay: 1
showPlay: 1,
haveBuy:true
})
},
fail(res) {
......
......@@ -47,8 +47,8 @@
<view class="sub_detail" wx:if="{{subTab2}}">
<block wx:for="{{mediaList}}">
<view class="catalog">
<text bindtap='videoplay'>{{item.title}}</text>
<image src='/img/suo1.png' class='suo' wx:if="{{!haveBuy&&price>0}}"></image>
<text>{{item.title}}</text>
<image src='/img/suo1.png' class='suo' wx:if="{{!haveBuy&&price>0}}" bindtap="learn" data-id="{{item.id}}"></image>
<image src='/img/sanjiao.png' class='suo' wx:if="{{haveBuy||price==0}}" bindtap="learn" data-id="{{item.id}}"></image>
</view>
</block>
......@@ -63,11 +63,13 @@
</view>
<!-- 单个课程 -->
<view class="buyBtn" wx:if="{{courseId==0 && haveBuy==false && price > 0}}" bindtap="learn" data-id="{{mediaId}}">课程金额:{{price}}</view>
<view class="buyBtn" wx:elif="{{courseId==0}}" bindtap="learn" data-id="{{mediaId}}">学习</view>
<view class="buyBtn" wx:elif="{{courseId==0}}" bindtap="learn" data-id="{{mediaId}}">
<view class="PlayTriangle"></view>
</view>
<!-- 合集课程 -->
<view class="buyBtn" wx:if="{{courseId>0 && haveBuy==false && price > 0}}" bindtap="learn" data-id="{{mediaId}}">课程金额:{{price}}</view>
<view class="buyBtn" wx:elif="{{courseId>0}}">请点击目录学习</view>
<view class="buyBtn" wx:elif="{{courseId>0}}" bindtap="learnCollection" data-id="{{mediaId}}"><view class="PlayTriangle"></view></view>
</view>
</view>
<view class='fufeilook' wx:if="{{showPay==1}}">
......
......@@ -260,4 +260,14 @@ page {
text-align: center;
font-size: 14px;
margin-bottom: 10px;
}
\ No newline at end of file
}
.PlayTriangle {
width:0;
height:0;
border-left:10px solid #FFFFFF;
border-top: 7px solid transparent;
border-bottom: 7px solid transparent;
margin-left: 50%;
margin-top: 8px;
}
\ No newline at end of file
......@@ -6,21 +6,25 @@
<view class="titleArea">
<text>亲爱的志愿者\n欢迎来到志愿者服务大厅</text>
</view>
<view class="searchArea">
<text>关键词索引</text>
<input class="input" name="keyword" placeholder="搜索从这里开始" bindinput="keywordInput" placeholder-class="input_center" />
<view bindtap="searchFaq">搜索</view>
</view>
<view class='topTitle'>
<view class='leftTitle'>
<view class='leftLine'></view>
<text class="hot_title">热门咨询</text>
<view class="topArea">
<view class="searchArea">
<text>关键词索引</text>
<input class="input" name="keyword" placeholder="搜索从这里开始" bindinput="keywordInput" placeholder-class="input_center" />
<view bindtap="searchFaq">搜索</view>
</view>
<view class='rightTitle' bindtap='myFaq'>
<text>我的咨询</text>
<view></view>
<view class='topTitle'>
<view class='leftTitle'>
<view class='leftLine'></view>
<text class="hot_title">热门咨询</text>
</view>
<view class='rightTitle' bindtap='myFaq'>
<text>我的咨询</text>
<view></view>
</view>
</view>
</view>
<view class="content">
<view class="hotFaqs">
<view bindtap='faqDetail' wx:for="{{faqList}}" class="faqItem" data-index="{{item.id}}" wx:key="{{index}}">
......
......@@ -4,7 +4,6 @@
width: 100%;
left: 0;
top: 0;
background: #fff;
z-index: 200;
}
......@@ -21,7 +20,8 @@
.titleArea {
position: fixed;
top: 12%;
top: 75px;
height: 55px;
width: 100%;
display: flex;
align-items: center;
......@@ -36,13 +36,21 @@
color: #fff;
}
.searchArea {
.topArea {
position: fixed;
top: 30%;
width: 100%;
height: 100px;
top: 0;
background-color: #fff;
z-index: 199;
padding-top: 200px;
}
.searchArea {
margin-top: 5px;
width: 100%;
height: 60px;
background-color: #fff;
z-index: 190;
display: flex;
flex-direction: row;
align-items: center;
......@@ -79,8 +87,7 @@
}
.topTitle {
position: fixed;
top: 38%;
margin-top: 5px;
width: 100%;
height: 35px;
display: flex;
......@@ -88,7 +95,6 @@
align-items: center;
justify-content: space-between;
background-color: #fff;
z-index: 200;
}
.topTitle .leftTitle {
......@@ -139,7 +145,7 @@
width: 100%;
height: 100%;
position: absolute;
top: 47%;
top: 305px;
}
.hotFaqs {
......
......@@ -9,8 +9,17 @@
"postcss": true,
"minified": true,
"newFeature": true,
"coverView": true,
"autoAudits": false,
"checkInvalidKey": true
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useCompilerModule": true
},
"compileType": "miniprogram",
"libVersion": "2.10.0",
......
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