作者 v_bairong06

前台双创项目提交功能、后台管理制作

<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">双创项目提交列表</a></li>
</ul>
<form class="well form-search" method="post" action="{:U('WillProduceApply/index')}">
时间:
<input type="text" name="start_time" class="js-datetime" value="{$formget.start_time|default=''}" style="width: 120px;" autocomplete="off">-
<input type="text" class="js-datetime" name="end_time" value="{$formget.end_time|default=''}" style="width: 120px;" autocomplete="off"> &nbsp; &nbsp;
关键字:
<input type="text" name="keyword" style="width: 200px;" value="{$keyword|default=''}" placeholder="请输入关键字...">
<input type="submit" class="btn btn-primary" value="搜索" />
<a class="btn btn-danger" href="{:U('WillProduceApply/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<div class="table-actions">
<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('WillProduceApply/delete')}" data-subcheck="true" data-msg="您确定删除吗?">{:L('DELETE')}</button>
</div>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
<th width="50">ID</th>
<th>用户id</th>
<th width="50">投稿人姓名</th>
<th>所在省市</th>
<th>出生年份</th>
<th>性别</th>
<th>高校</th>
<th>专业</th>
<th>手机号码</th>
<th>年级</th>
<th>邮箱</th>
<th width="100">提交时间</th>
<th>状态</th>
<th width="70">操作</th>
</tr>
</thead>
<foreach name="list" item="vo">
<tr>
<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}" title="ID:{$vo.id}"></td>
<td><b>{$vo.id}</b></td>
<td>{$vo.user_id}</td>
<td>{$vo.name}</td>
<td>{$vo.province}{$vo.city}</td>
<td>{$vo.birth}</td>
<td><eq name="vo.sex" value="1"></eq><eq name="vo.sex" value="2"></eq></td>
<td>{$vo.school}</td>
<td>{$vo.major}</td>
<td>{$vo.mobile}</td>
<td>{$vo.classes}</td>
<td>{$vo.email}</td>
<td>{:date('Y-m-d H:i',$vo['ctime'])}</td>
<td><eq name="vo.is_issue" value="0">未发布</eq><eq name="vo.is_issue" value="1">已发布</eq></td>
<td>
<a href="{:U('WillProduceApply/view',array('id'=>$vo['id']))}">查看</a> |
<eq name="vo.is_issue" value="0"><a href="{:U('WillProduceApply/send',array('id'=>$vo['id']))}">发布</a> |</eq>
<a href="{:U('WillProduceApply/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">删除</a>
</td>
</tr>
</foreach>
<tfoot>
<tr>
<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
<th width="50">ID</th>
<th>用户id</th>
<th width="50">投稿人姓名</th>
<th>所在省市</th>
<th>出生年份</th>
<th>性别</th>
<th>高校</th>
<th>专业</th>
<th>手机号码</th>
<th>年级</th>
<th>邮箱</th>
<th width="50">提交时间</th>
<th>状态</th>
<th width="70">操作</th>
</tr>
</tfoot>
</table>
<div class="table-actions">
<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('WillProduceApply/delete')}" data-subcheck="true" data-msg="你确定删除吗?">{:L('DELETE')}</button>
</div>
<div class="pagination">{$page}</div>
</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
\ No newline at end of file
... ...
<admintpl file="header" />
<style type="text/css">
.pic-list li {
margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:U('WillProduceApply/index')}">双创项目列表</a></li>
<li class="active"><a target="_self">编辑双创项目</a></li>
</ul>
<form action="{:U('WillProduceApply/edit_post')}" method="post" class="form-horizontal js-ajax-forms" enctype="multipart/form-data">
<div class="row-fluid">
<div class="span9">
<table class="table table-bordered">
<tr>
<th width="150">项目名称</th>
<td>
<input type="text" style="width:400px;" name="post[name]" id="name" value="{$post.name}" required placeholder="请输入项目名称"/>
<span class="form-required">*</span>
</td>
</tr>
<tr>
<th>简介</th>
<td>
<textarea name="post[description]" placeholder="请输入项目简介">{$post.description}</textarea>
</td>
</tr>
<tr>
<th>详情</th>
<td>
<script type="text/plain" id="content" name="post[content]">{$post.content}</script>
</td>
</tr>
</table>
</div>
<div class="span3">
<table class="table table-bordered">
<tr>
<th><b>缩略图</b></th>
</tr>
<tr>
<td>
<div style="text-align: center;">
<input type="hidden" name="post[thumb]" id="thumb" value="{$post.thumb|default=''}">
<a href="javascript:upload_one_image('图片上传','#thumb');">
<if condition="empty($post['thumb'])">
<img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb-preview" width="135" style="cursor: hand" />
<else />
<img src="{:sp_get_image_preview_url($post['thumb'])}" id="thumb-preview" width="135" style="cursor: hand"/>
</if>
</a>
<input type="button" class="btn btn-small" onclick="$('#thumb-preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;" value="取消图片">
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="form-actions">
<button class="btn btn-primary js-ajax-submit" type="submit">提交</button>
<a class="btn" href="{:U('WillProduceApply/index')}">返回</a>
</div>
</form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function() {
$('.yes').on('click', function () {
$('.price').show();
})
$('.no').on('click', function () {
$('.price').hide();
})
$(".js-ajax-close-btn").on('click', function(e) {
e.preventDefault();
Wind.use("artDialog", function() {
art.dialog({
id : "question",
icon : "question",
fixed : true,
lock : true,
background : "#CCCCCC",
opacity : 0,
content : "您确定需要关闭当前页面嘛?",
ok : function() {
setCookie("refersh_time", 1);
window.close();
return true;
}
});
});
});
/////---------------------
Wind.use('validate', 'ajaxForm', 'artDialog', function() {
//javascript
//编辑器
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
//增加编辑器验证规则
jQuery.validator.addMethod('editorcontent', function() {
try {
editorcontent.sync();
} catch (err) {
}
return editorcontent.hasContents();
});
var form = $('form.js-ajax-forms');
//ie处理placeholder提交问题
if ($.browser && $.browser.msie) {
form.find('[placeholder]').each(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
}
});
}
var formloading = false;
//表单验证开始
form.validate({
//是否在获取焦点时验证
onfocusout : false,
//是否在敲击键盘时验证
onkeyup : false,
//当鼠标掉级时验证
onclick : false,
//验证错误
showErrors : function(errorMap, errorArr) {
//errorMap {'name':'错误信息'}
//errorArr [{'message':'错误信息',element:({})}]
try {
$(errorArr[0].element).focus();
art.dialog({
id : 'error',
icon : 'error',
lock : true,
fixed : true,
background : "#CCCCCC",
opacity : 0,
content : errorArr[0].message,
cancelVal : '确定',
cancel : function() {
$(errorArr[0].element).focus();
}
});
} catch (err) {
}
},
//验证规则
rules : {
'post[name]' : {
required : 1
}
},
//验证未通过提示消息
messages : {
'post[name]' : {
required : '请输入活动名称'
}
},
//给未通过验证的元素加效果,闪烁等
highlight : false,
//是否在获取焦点时验证
onfocusout : false,
//验证通过,提交表单
submitHandler : function(forms) {
if (formloading)
return;
$(forms).ajaxSubmit({
url : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
dataType : 'json',
beforeSubmit : function(arr, $form, options) {
formloading = true;
},
success : function(data, statusText, xhr, $form) {
formloading = false;
if (data.status) {
setCookie("refersh_time", 1);
//添加成功
Wind.use("artDialog", function() {
art.dialog({
id : "succeed",
icon : "succeed",
fixed : true,
lock : true,
background : "#CCCCCC",
opacity : 0,
content : data.info,
button : [ {
name : '发布成功',
callback : function() {
location = "{:U('WillProduceApply/index')}";
return true;
},
focus : true
} ]
});
});
} else {
artdialog_alert(data.info);
}
}
});
}
});
});
////-------------------------
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:U('WillProduceApply/index')}">双创项目提交列表</a></li>
<li class="active"><a href="">双创项目提交详情</a></li>
</ul>
<form action="" method="post" class="form-horizontal js-ajax-forms">
<div class="row-fluid">
<div class="span9">
<table class="table table-bordered">
<tr>
<th width="80">用户ID</th>
<td>{$user_id}</td>
</tr>
<tr>
<th>姓名</th>
<td>{$name}</td>
</tr>
<tr>
<th>所在省市</th>
<td>{$province}{$city}</td>
</tr>
<tr>
<th>出生年份</th>
<td>{$birth}</td>
</tr>
<tr>
<th>性别</th>
<td>
<eq name="sex" value="1"></eq>
<eq name="sex" value="2"></eq>
</td>
</tr>
<tr>
<th>高校</th>
<td>{$school}</td>
</tr>
<tr>
<th>专业</th>
<td>{$major}</td>
</tr>
<tr>
<th>手机号码</th>
<td>{$mobile}</td>
</tr>
<tr>
<th>年级</th>
<td>{$classes}</td>
</tr>
<tr>
<th>邮箱</th>
<td>{$email}</td>
</tr>
<tr>
<th>团队成员或个人相关经验</th>
<td>{$experience}</td>
</tr>
<tr>
<th>团队成员或个人描述</th>
<td>{$product}</td>
</tr>
<tr>
<th>双创项目创意概述</th>
<td>{$product_description}</td>
</tr>
<tr>
<th>提交时间</th>
<td>{:date('Y-m-d H:i',$ctime)}</td>
</tr>
</table>
</div>
</div>
<div class="form-actions">
<a class="btn" href="{:U('WillProduceApply/index')}">返回</a>
</div>
</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -25,7 +25,7 @@
<tr>
<th>简介</th>
<td>
<textarea name="post[description]" placeholder="请输入项目简介"></textarea>>
<textarea name="post[description]" placeholder="请输入项目简介"></textarea>
</td>
</tr>
<tr>
... ...
... ... @@ -26,7 +26,7 @@
<tr>
<th>简介</th>
<td>
<textarea name="post[description]" placeholder="请输入项目简介">{$post.description}</textarea>>
<textarea name="post[description]" placeholder="请输入项目简介">{$post.description}</textarea>
</td>
</tr>
<tr>
... ...
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/4/25
* Time: 20:55
*/
namespace Admin\Controller;
use Common\Controller\AdminbaseController;
class WillProduceApplyController extends AdminbaseController {
function _initialize() {
parent::_initialize(); // TODO: Change the autogenerated stub
$this->will_produce_apply_model = D('Common/WillProduceApply');
}
// 双创项目提交列表
public function index() {
$this->assign('list', $this->will_produce_apply_model->getList(I('get.p'), I('post.keyword'), strtotime(I('post.start_time')), strtotime(I('post.end_time'))));
$count = $this->will_produce_apply_model->getCount(I('post.keyword'), strtotime(I('post.start_time')), strtotime(I('post.end_time')));
$page = $this->page($count, C('MAX_PAGE_NUM'));
$this->assign('page', $page->show('Admin'));
$this->assign('formget', I('post.'));
$this->assign('keyword', I('post.keyword'));
$this->display();
}
// 查看
public function view(){
$id= I("get.id",0,'intval');
$this->assign($this->will_produce_apply_model->where(array('id'=>$id, 'is_del'=>0))->find());
$this->display();
}
// 删除
public function delete(){
if(I('get.id')){
$id = I("get.id",0,'intval');
if ($this->will_produce_apply_model->where(array('id'=>$id))->save(array('is_del'=>1,'dtime'=>time())) !==false) {
$this->success("删除成功!");
} else {
$this->error("删除失败!");
}
}
if(I('post.ids')){
$ids = I('post.ids/a');
if (!$this->will_produce_apply_model->where(array('id'=>array('in',$ids)))->save(array('is_del'=>1,'dtime'=>time()))) {
$this->error("删除失败!");
}
$this->success("删除成功!");
}
}
}
\ No newline at end of file
... ...
... ... @@ -6,86 +6,10 @@ class AppframeController extends Controller {
function _initialize() {
$this->assign("waitSecond", 3);
$time=time();
$time=time();
$this->assign("js_debug",APP_DEBUG?"?v=$time":"");
}
/**
* 使用微信客服发送消息
*/
protected function customSend($openid, $sort, $content, $access_token) {
$url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" . $access_token;
$data = array('touser'=>$openid, 'msgtype'=>$sort, $sort=>$content);
return $this->https_request($url, $this->decodeUnicode(json_encode($data)));
}
// 测试发送客服消息
// protected function customSends() {
// $access_token = $this->access_token();
// $url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" . $access_token;
//// $data = array('touser'=>$openid, 'msgtype'=>$sort, $sort=>$content);
//// $data = array('touser'=>'oiW1q0d1thiCMixF-n1ID6HTILWM', 'msgtype'=>'image', 'image'=>array('media_id'=>'G5of-rd4XWlM2QO3tGhC0j9b1nI7uN8hqELjgOcabYJkP5Jkjue6S3xoojUerReu'));
// $data = array('touser'=>'oiW1q0d1thiCMixF-n1ID6HTILWM', 'msgtype'=>'image', 'image'=>array('media_id'=>'G5of-rd4XWlM2QO3tGhC0j9b1nI7uN8hqELjgOcabYJkP5Jkjue6S3xoojUerReu'));
// $this->https_request($url, json_encode($data));
// }
function https_request($url, $data = null)
{
$curl = curl_init();
//curl_setopt ( $curl, CURLOPT_SAFE_UPLOAD, false);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
if (!empty ($data)) {
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($curl);
curl_close($curl);
return $output;
}
// 对unicode码进行解码
function decodeUnicode($str){
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i',
create_function(
'$matches',
'return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE");'
),
$str);
}
/**
* 微信access_token调用
*/
protected function access_token() {
require VENDOR_PATH.'jssdk/jssdk.php';
$jssdk = new \jssdk(C('WX_APPID'),C('WX_APPSECRET'));
return $jssdk->getAccessToken();
}
/**
* 时间格式化
*/
public function formateData($time){
$now_time = date("Y-m-d H:i:s");
$now_time = strtotime($now_time);
$dur = $now_time - $time;
if($dur < 60){
return $dur.'秒前';
}else{
if($dur < 3600){
return floor($dur/60).'分钟前';
}else{
if($dur < 86400){
return floor($dur/3600).'小时前';
}else{
return floor($dur/86400).'天前';
}
}
}
}
/*
* TP上传操作
... ... @@ -193,7 +117,7 @@ class AppframeController extends Controller {
$attachmentId = $this->attachmentModel->addFileUpload($attachmentData);
if (!$returnJson) {
return array(true, $savePath, C('UPLOADS_PATH') . $savePath, $attachmentId);
return array(true, $savePath, C('UPLOADS_PATH') . $savePath, $attachmentId);exit;
}
//返回文件地址和名给JS作回调用
$this->ajaxReturn(array('code' => 0, 'msg' => '上传成功', 'data' => array('path' => $savePath, 'link' => C('UPLOADS_PATH') . $savePath, 'attachment_id' => $attachmentId), 'info'=>$info));
... ... @@ -219,42 +143,42 @@ class AppframeController extends Controller {
* @return void
*/
protected function ajaxReturn($data, $type = '',$json_option=0) {
$data['referer'] = $data['url'] ? $data['url'] : "";
$data['state'] = !empty($data['status']) ? "success" : "fail";
if(empty($type)) $type = C('DEFAULT_AJAX_RETURN');
switch (strtoupper($type)){
case 'JSON' :
// 返回JSON数据格式到客户端 包含状态信息
header('Content-Type:application/json; charset=utf-8');
exit(json_encode($data,$json_option));
case 'XML' :
// 返回xml格式数据
header('Content-Type:text/xml; charset=utf-8');
exit(xml_encode($data));
case 'JSONP':
// 返回JSON数据格式到客户端 包含状态信息
header('Content-Type:application/json; charset=utf-8');
$handler = isset($_GET[C('VAR_JSONP_HANDLER')]) ? $_GET[C('VAR_JSONP_HANDLER')] : C('DEFAULT_JSONP_HANDLER');
exit($handler.'('.json_encode($data,$json_option).');');
case 'EVAL' :
// 返回可执行的js脚本
header('Content-Type:text/html; charset=utf-8');
exit($data);
case 'AJAX_UPLOAD':
// 返回JSON数据格式到客户端 包含状态信息
header('Content-Type:text/html; charset=utf-8');
exit(json_encode($data,$json_option));
default :
// 用于扩展其他返回格式数据
Hook::listen('ajax_return',$data);
case 'JSON' :
// 返回JSON数据格式到客户端 包含状态信息
header('Content-Type:application/json; charset=utf-8');
exit(json_encode($data,$json_option));
case 'XML' :
// 返回xml格式数据
header('Content-Type:text/xml; charset=utf-8');
exit(xml_encode($data));
case 'JSONP':
// 返回JSON数据格式到客户端 包含状态信息
header('Content-Type:application/json; charset=utf-8');
$handler = isset($_GET[C('VAR_JSONP_HANDLER')]) ? $_GET[C('VAR_JSONP_HANDLER')] : C('DEFAULT_JSONP_HANDLER');
exit($handler.'('.json_encode($data,$json_option).');');
case 'EVAL' :
// 返回可执行的js脚本
header('Content-Type:text/html; charset=utf-8');
exit($data);
case 'AJAX_UPLOAD':
// 返回JSON数据格式到客户端 包含状态信息
header('Content-Type:text/html; charset=utf-8');
exit(json_encode($data,$json_option));
default :
// 用于扩展其他返回格式数据
Hook::listen('ajax_return',$data);
}
}
/**
*
*
* @param number $totalSize 总数
* @param number $pageSize 总页数
* @param number $currentPage 当前页
... ... @@ -264,53 +188,53 @@ class AppframeController extends Controller {
* @param string $static 是否为静态链接
*/
protected function page($totalSize = 1, $pageSize = 0, $currentPage = 1, $listRows = 6, $pageParam = '', $pageLink = '', $static = FALSE) {
if ($pageSize == 0) {
$pageSize = C("PAGE_LISTROWS");
}
if (empty($pageParam)) {
$pageParam = C("VAR_PAGE");
}
$page = new \Page($totalSize, $pageSize, $currentPage, $listRows, $pageParam, $pageLink, $static);
$page->setLinkWraper("li");
if(sp_is_mobile()){
$page->SetPager('default', '{prev}&nbsp;{list}&nbsp;{next}', array("listlong" => "4", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
}else{
$page->SetPager('default', '{first}{prev}&nbsp;{liststart}{list}{listend}&nbsp;{next}{last}', array("listlong" => "4", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
}
return $page;
if ($pageSize == 0) {
$pageSize = C("PAGE_LISTROWS");
}
if (empty($pageParam)) {
$pageParam = C("VAR_PAGE");
}
$page = new \Page($totalSize, $pageSize, $currentPage, $listRows, $pageParam, $pageLink, $static);
$page->setLinkWraper("li");
if(sp_is_mobile()){
$page->SetPager('default', '{prev}&nbsp;{list}&nbsp;{next}', array("listlong" => "4", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
}else{
$page->SetPager('default', '{first}{prev}&nbsp;{liststart}{list}{listend}&nbsp;{next}{last}', array("listlong" => "4", "first" => "首页", "last" => "尾页", "prev" => "上一页", "next" => "下一页", "list" => "*", "disabledclass" => ""));
}
return $page;
}
//空操作
public function _empty() {
$this->error('该页面不存在!');
}
/**
* 检查操作频率
* @param int $duration 距离最后一次操作的时长
*/
protected function check_last_action($duration){
$action=MODULE_NAME."-".CONTROLLER_NAME."-".ACTION_NAME;
$time=time();
$session_last_action=session('last_action');
if(!empty($session_last_action['action']) && $action==$session_last_action['action']){
$mduration=$time-$session_last_action['time'];
if($duration>$mduration){
$this->error("您的操作太过频繁,请稍后再试~~~");
}else{
session('last_action.time',$time);
}
}else{
session('last_action.action',$action);
session('last_action.time',$time);
}
$action=MODULE_NAME."-".CONTROLLER_NAME."-".ACTION_NAME;
$time=time();
$session_last_action=session('last_action');
if(!empty($session_last_action['action']) && $action==$session_last_action['action']){
$mduration=$time-$session_last_action['time'];
if($duration>$mduration){
$this->error("您的操作太过频繁,请稍后再试~~~");
}else{
session('last_action.time',$time);
}
}else{
session('last_action.action',$action);
session('last_action.time',$time);
}
}
/**
* 模板主题设置
* @access protected
... ...
... ... @@ -16,30 +16,38 @@ class WillProduceApplyModel extends CommonModel {
protected $_validate = array(
//array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
array('user_id', 'number', '用户ID不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('mid', 'number', '任务ID不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('name', 'require', '姓名不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('name', 'require', '团队联系人(或主持人)不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('province', 'require', '所在省不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('city', 'require', '城市不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('age', 'number', '年龄格式错误', 1, 'regex', CommonModel::MODEL_BOTH),
array('sex', array(0,1,2), '性别格式错误', 1, 'regex', CommonModel::MODEL_BOTH),
array('school', 'require', '高校不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('birth', 'require', '出生年份不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('school', 'require', '所在公司或高校不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('sex', array(0,1,2), '性别格式错误', 1, 'in', CommonModel::MODEL_BOTH),
array('major', 'require', '专业不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('mobile', 'require', '手机号码不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('mobile', 'mobile', '手机号码格式错误', 1, 'regex', CommonModel::MODEL_BOTH),
array('classes', 'require', '年级不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('email', 'require', '邮箱不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('email', 'email', '邮箱格式错误', 1, 'regex', CommonModel::MODEL_BOTH),
array('classes', 'require', '年级不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('experience', 'require', '相关经验不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('product', 'require', '创作描述不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('product_description', 'require', '作品描述不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('experience', 'require', '团队成员或个人相关经验不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('product', 'require', '团队成员或个人描述不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('product_description', 'require', '双创项目创意概述不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('att', 'require', '详细附件不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
array('images', 'require', '双创项目图片不能为空', 1, 'regex', CommonModel::MODEL_BOTH),
);
// 获取双创项目申请列表
public function getList($keyword = null) {
public function getList($page_num, $keyword = null, $start_time = null, $end_time = null) {
$perPage = 25;
$where['is_del'] = 0;
if($keyword) {
$where['name'] = array('like', '%'.$keyword.'%');
}
return $this->where($where)->select();
if($start_time && $end_time) {
$where['ctime'] = array('between', array($start_time,$end_time));
}
return $this->where($where)
->page($page_num, $perPage)
->select();
}
// 获取双创项目申请详情
... ... @@ -48,4 +56,22 @@ class WillProduceApplyModel extends CommonModel {
$where['id'] = $id;
return $this->where($where)->find();
}
/**
* 获取数据总数
* @author Liuzhen
*/
public function getCount($keyword = null, $start_time = null, $end_time = null) {
$where = array();
if($keyword) {
$where['name'] = array('like', '%'.$keyword.'%');
}
if($start_time && $end_time) {
$where['ctime'] = array('between', array($start_time,$end_time));
}
$where['is_del'] = 0;
$count = $this->where($where)
->count();
return $count;
}
}
\ No newline at end of file
... ...
... ... @@ -72,4 +72,60 @@ class WillController extends HomebaseController {
$this->assign($this->will_produce_model->getInfo($id));
$this->display();
}
// 入会申请提交
public function submit() {
if(IS_AJAX) {
$post =I('post.');
$user_id = $post['user_id'] = 1;
// $user_id = $post['user_id'] = sp_get_current_userid();
// if(!$user_id) {
// $this->ajaxReturn(array('status'=>false,'msg'=>'用户未登录'));
// }
$post['images'] = implode(',',I('post.images'));
$post['ctime'] = $post['utime'] = time();
$will_produce_apply_model = D('Common/WillProduceApply');
if(!$will_produce_apply_model->create($post)) {
$this->ajaxReturn(array('status'=>false,'msg'=>$will_produce_apply_model->getError()));
}
if(count(I('post.images'))<3 || count(I('post.images'))>5) {
$this->ajaxReturn(array('status'=>false,'msg'=>'图片数量不符'));
}
$will_id = $will_produce_apply_model->add($post);
if(!$will_id) {
$this->ajaxReturn(array('status'=>false,'msg'=>'提交失败'));
}
$this->ajaxReturn(array('status'=>true,'msg'=>'提交成功','data'=>$will_id));
} else {
$this->error('非法操作');
}
}
//上传图片
public function personalUpload() {
if(IS_POST){
list($status, $info, $link, $attachmentId) = $this->uploadCommon('image', C('UPLOAD_MATERIAL_IMAGE_MAX_SIZE'), 'personal', false);
if ($status) {
echo json_encode(array('status' => true, 'data' => $info, 'file'=>sp_get_image_preview_url($info)));exit;
} else {
echo json_encode(array('status' => false, 'msg'=>$info));exit;
}
} else {
$this->error('非法操作');
}
}
//上传附件
public function personalUploadAtt() {
if(IS_POST){
list($status, $info, $link, $attachmentId) = $this->uploadCommon('file', C('UPLOAD_MAX_SIZE'), 'file', false);
if ($status) {
echo json_encode(array('status' => true, 'data' => $info, 'file'=>sp_get_image_preview_url($info)));exit;
} else {
echo json_encode(array('status' => false, 'msg'=>$info));exit;
}
} else {
$this->error('非法操作');
}
}
}
\ No newline at end of file
... ...
... ... @@ -12,4 +12,57 @@
'UPLOADS_PATH' => '/data/upload/',
'WX_APPID' => 'wx2160bffae9db71df',
'WX_APPSECRET' => 'f2f4170fdbdc4c46be7f6012e76a05c9',
'UPLOAD_MAX_SIZE' => 20971520,
'UPLOAD_MATERIAL_IMAGE_MAX_SIZE' => 2097152,
'UPLOAD_MATERIAL_VOICE_MAX_SIZE' => 2097152,
'UPLOAD_MATERIAL_VIDEO_MAX_SIZE' => 10485760,
'UPLOAD_MATERIAL_FILE_MAX_SIZE' => 20971520,
'UPLOAD_IMAGE_EXT' =>
array (
0 => 'jpg',
1 => 'gif',
2 => 'png',
3 => 'jpeg',
),
'UPLOAD_AUDIO_EXT' =>
array (
0 => 'mp3',
1 => 'midi',
2 => 'mid',
3 => 'wma',
4 => 'm4a',
5 => 'wav',
6 => 'amr',
),
'UPLOAD_VIDEO_EXT' =>
array (
0 => 'swf',
1 => 'flv',
2 => 'rmvb',
3 => 'rm',
4 => 'wmv',
5 => 'mp4',
6 => 'mpg',
7 => 'mpeg',
8 => 'avi',
),
'UPLOAD_FILE_EXT' =>
array (
0 => 'doc',
1 => 'docx',
2 => 'xls',
3 => 'xlsx',
4 => 'ppt',
5 => 'pptx',
6 => 'pdf',
7 => 'rar',
8 => 'zip',
9 => 'gz',
10 => 'tgz',
11 => 'tbz',
12 => 'bz2',
13 => 'tar',
14 => '7z',
15 => 'txt',
),
);
\ No newline at end of file
... ...
jQuery.extend({
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error ) {
s.error.call( s.context || s, xhr, status, e );
}
// Fire the global callback
if ( s.global ) {
(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
}
},
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error ) {
s.error.call( s.context || s, xhr, status, e );
}
// Fire the global callback
if ( s.global ) {
(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
}
},
createUploadIframe: function(id, uri)
{
//create frame
var frameId = 'jUploadFrame' + id;
var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
if(window.ActiveXObject)
{
if(typeof uri== 'boolean'){
iframeHtml += ' src="' + 'javascript:false' + '"';
{
//create frame
var frameId = 'jUploadFrame' + id;
var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
if(window.ActiveXObject)
{
if(typeof uri== 'boolean'){
iframeHtml += ' src="' + 'javascript:false' + '"';
}
else if(typeof uri== 'string'){
iframeHtml += ' src="' + uri + '"';
}
else if(typeof uri== 'string'){
iframeHtml += ' src="' + uri + '"';
}
}
iframeHtml += ' />';
jQuery(iframeHtml).appendTo(document.body);
}
}
iframeHtml += ' />';
jQuery(iframeHtml).appendTo(document.body);
return jQuery('#' + frameId).get(0);
return jQuery('#' + frameId).get(0);
},
createUploadForm: function(id, fileElementId, data)
{
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
if(data)
{
for(var i in data)
{
jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
}
}
var oldElement = jQuery('#' + fileElementId);
var newElement = jQuery(oldElement).clone();
jQuery(oldElement).attr('id', fileId);
jQuery(oldElement).before(newElement);
jQuery(oldElement).appendTo(form);
//set attributes
jQuery(form).css('position', 'absolute');
jQuery(form).css('top', '-1200px');
jQuery(form).css('left', '-1200px');
jQuery(form).appendTo('body');
return form;
{
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
if(data)
{
for(var i in data)
{
jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
}
}
var oldElement = jQuery('#' + fileElementId);
var newElement = jQuery(oldElement).clone();
jQuery(oldElement).attr('id', fileId);
jQuery(oldElement).before(newElement);
jQuery(oldElement).appendTo(form);
//set attributes
jQuery(form).css('position', 'absolute');
jQuery(form).css('top', '-1200px');
jQuery(form).css('left', '-1200px');
jQuery(form).appendTo('body');
return form;
},
ajaxFileUpload: function(s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = new Date().getTime()
var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
var id = new Date().getTime()
var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
// Watch for a new set of requests
if ( s.global && ! jQuery.active++ )
{
jQuery.event.trigger( "ajaxStart" );
}
{
jQuery.event.trigger( "ajaxStart" );
}
var requestDone = false;
// Create the request object
var xml = {}
var xml = {}
if ( s.global )
jQuery.event.trigger("ajaxSend", [xml, s]);
// Wait for a response to come back
var uploadCallback = function(isTimeout)
{
var io = document.getElementById(frameId);
try
{
if(io.contentWindow)
{
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument)
{
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
}
{
var io = document.getElementById(frameId);
try
{
if(io.contentWindow)
{
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument)
{
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
}
}catch(e)
{
jQuery.handleError(s, xml, null, e);
}
if ( xml || isTimeout == "timeout")
{
{
jQuery.handleError(s, xml, null, e);
}
if ( xml || isTimeout == "timeout")
{
requestDone = true;
var status;
try {
status = isTimeout != "timeout" ? "success" : "error";
// Make sure that the request was successful or notmodified
if ( status != "error" )
{
{
// process the data (runs the xml through httpData regardless of callback)
var data = jQuery.uploadHttpData( xml, s.dataType );
var data = jQuery.uploadHttpData( xml, s.dataType );
// If a local callback was specified, fire it and pass it the data
if ( s.success )
s.success( data, status );
// Fire the global callback
if( s.global )
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
} else
jQuery.handleError(s, xml, status);
} catch(e)
{
} catch(e)
{
status = "error";
jQuery.handleError(s, xml, status, e);
}
... ... @@ -141,54 +141,54 @@ jQuery.extend({
jQuery(io).unbind()
setTimeout(function()
{ try
{
jQuery(io).remove();
jQuery(form).remove();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
}, 100)
{ try
{
jQuery(io).remove();
jQuery(form).remove();
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
}, 100)
xml = null
}
}
// Timeout checker
if ( s.timeout > 0 )
{
if ( s.timeout > 0 )
{
setTimeout(function(){
// Check to see if the request is still happening
if( !requestDone ) uploadCallback( "timeout" );
}, s.timeout);
}
try
{
try
{
var form = jQuery('#' + formId);
jQuery(form).attr('action', s.url);
jQuery(form).attr('method', 'POST');
jQuery(form).attr('target', frameId);
var form = jQuery('#' + formId);
jQuery(form).attr('action', s.url);
jQuery(form).attr('method', 'POST');
jQuery(form).attr('target', frameId);
if(form.encoding)
{
jQuery(form).attr('encoding', 'multipart/form-data');
{
jQuery(form).attr('encoding', 'multipart/form-data');
}
else
{
jQuery(form).attr('enctype', 'multipart/form-data');
}
{
jQuery(form).attr('enctype', 'multipart/form-data');
}
jQuery(form).submit();
} catch(e)
{
} catch(e)
{
jQuery.handleError(s, xml, null, e);
}
jQuery('#' + frameId).load(uploadCallback );
return {abort: function () {}};
jQuery('#' + frameId).load(uploadCallback );
return {abort: function () {}};
},
... ...
... ... @@ -1110,6 +1110,7 @@ class Model {
'integer' => '/^[-\+]?\d+$/',
'double' => '/^[-\+]?\d+(\.\d+)?$/',
'english' => '/^[A-Za-z]+$/',
'mobile' => '/^[1][3,4,5,7,8][0-9]{9}$/',
);
// 检查是否有内置的正则表达式
if(isset($validate[strtolower($rule)]))
... ...
<div id="myModal" class="modal fade" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4>入会申请</h4>
</div>
<div class="modal-body">
<form name="form" action="" method="post">
<div class="row">
<div class="row-title">
<h5>个人信息</h5>
</div>
<div class="row-con">
<div class="inner-row cf">
<div class="ipt-container lf">
<input type="text" name="name" placeholder="申请人姓名">
</div>
<div class="radio-container lf">
<label>性别:</label>
<input type="radio" name="sex" value="1" checked>
<input type="radio" name="sex" value="2">
</div>
<div class="ipt-container lf">
<input type="text" name="age" placeholder="年龄">
</div>
<div class="ipt-container lf">
<input type="text" name="mobile" placeholder="手机号">
</div>
<div class="ipt-container lf">
<input type="text" name="email" placeholder="邮箱">
</div>
</div>
<div class="inner-row cf">
<div class="subtitle-container lf">
<h3>在校学生</h3>
</div>
<div class="subtitle-container lf">
<h3>已工作</h3>
</div>
<div class="ipt-container lf">
<input type="text" name="school" placeholder="所在公司或高校">
</div>
<div class="slt-list lf" id="city">
<div class="slt-container lf">
<select class="mm-select prov">
<option value=""></option>
</select>
</div>
<div class="slt-container lf">
<select class="mm-select city" disabled="disabled"><option value=""></option></select>
</div>
</div>
<div class="ipt-container lf">
<input type="text" name="major" placeholder="专业">
</div>
<div class="ipt-container lf">
<input type="text" name="company" placeholder="公司">
</div>
<div class="slt-container lf">
<select name="classes" id="slt_0">
<option selected>年级</option>
<option>一年级</option>
<option>二年级</option>
<option>三年级</option>
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="row-title">
<h5>专业经验</h5>
</div>
<div class="row-con">
<div class="textarea-container">
<textarea name="experience" maxlength="500" placeholder="相关专业经验(绘画、设计、广告、文创、营销等)简要描述"></textarea>
</div>
</div>
</div>
<div class="row">
<div class="row-title">
<h5>创意兴趣描述</h5>
</div>
<div class="row-con">
<div class="textarea-container">
<textarea id="txt" name="skill" maxlength="500" placeholder="个人创意特长与兴趣领域描述(文100-500字)"></textarea>
<p>
<span id="txt_num">0</span>/500字
</p>
</div>
</div>
</div>
<div class="row">
<div class="sub-container">
<input type="button" name="submit" value="确认提交">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
$('input[name=submit]').click(function(){
var form = $('form').serialize();
$.ajax({
url:"{:U('Will/submit')}",
type:"POST",
data:form,
dateType:"json",
success:function (data) {
console.log(data);
}
})
console.log(form);
})
$('#txt').keyup(function() {
var len=$(this).val().length;
$('#txt_num').html(len);
});
</script>
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@
<link href="__TMPL__Public/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/common.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/style.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/modal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<tc_include file="Public:header"/>
... ... @@ -56,9 +57,26 @@
</div>
</div>
</div>
<tc_include file="Portal/Will:apply"/>
<tc_include file="Public:footer"/>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/common.js"></script>
<script src="__TMPL__Public/assets/js/modal.js"></script>
<script>
// $('#myModal').modal({
// })
$('#myModal').on('shown.bs.modal', function () {
document.documentElement.style.overflow='hidden';
})
$('#myModal').on('hidden.bs.modal', function () {
document.documentElement.style.overflow='auto';
})
</script>
<!--城市-->
<script type="text/javascript">
$("#city").citySelect({nodata:"none",required:false});
</script>
</body>
</html>
... ...
... ... @@ -7,6 +7,7 @@
<link href="__TMPL__Public/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/common.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/style.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/modal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<tc_include file="Public:header"/>
... ... @@ -53,9 +54,26 @@
</ul>
</div>
</div>
<tc_include file="Portal/Will:apply"/>
<tc_include file="Public:footer"/>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/common.js"></script>
<script src="__TMPL__Public/assets/js/modal.js"></script>
<script>
// $('#myModal').modal({
// })
$('#myModal').on('shown.bs.modal', function () {
document.documentElement.style.overflow='hidden';
})
$('#myModal').on('hidden.bs.modal', function () {
document.documentElement.style.overflow='auto';
})
</script>
<!--城市-->
<script type="text/javascript">
$("#city").citySelect({nodata:"none",required:false});
</script>
</body>
</html>
... ...
... ... @@ -50,109 +50,6 @@
</div>
</div>
</div>
<div id="myModal" class="modal fade" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4>入会申请</h4>
</div>
<div class="modal-body">
<form action="" method="post">
<div class="row">
<div class="row-title">
<h5>个人信息</h5>
</div>
<div class="row-con">
<div class="inner-row cf">
<div class="ipt-container lf">
<input type="text" name="" placeholder="申请人姓名">
</div>
<div class="radio-container lf">
<label>性别:</label>
<input type="radio" name="sex" checked>
<input type="radio" name="sex">
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="年龄">
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="手机号">
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="邮箱">
</div>
</div>
<div class="inner-row cf">
<div class="subtitle-container lf">
<h3>在校学生</h3>
</div>
<div class="subtitle-container lf">
<h3>已工作</h3>
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="所在公司或高校">
</div>
<div class="slt-list lf" id="city">
<div class="slt-container lf">
<select class="mm-select prov">
<option value=""></option>
</select>
</div>
<div class="slt-container lf">
<select class="mm-select city" disabled="disabled"><option value=""></option></select>
</div>
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="专业">
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="公司">
</div>
<div class="slt-container lf">
<span>年级</span>
<select id="slt_0">
<option selected>年级</option>
<option>一年级</option>
<option>二年级</option>
<option>三年级</option>
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="row-title">
<h5>专业经验</h5>
</div>
<div class="row-con">
<div class="textarea-container">
<textarea name="" placeholder="相关专业经验(绘画、设计、广告、文创、营销等)简要描述"></textarea>
</div>
</div>
</div>
<div class="row">
<div class="row-title">
<h5>创意兴趣描述</h5>
</div>
<div class="row-con">
<div class="textarea-container">
<textarea id="txt" name="" placeholder="个人创意特长与兴趣领域描述(文100-500字)"></textarea>
<p>
<span id="txt_num">0</span>/500字
</p>
</div>
</div>
</div>
<div class="row">
<div class="sub-container">
<input type="submit" name="" value="确认提交">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<tc_include file="Public:footer"/>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
... ... @@ -175,5 +72,6 @@
<script type="text/javascript">
$("#city").citySelect({nodata:"none",required:false});
</script>
<tc_include file="Portal/Will:apply"/>
</body>
</html>
... ...
... ... @@ -7,6 +7,7 @@
<link href="__TMPL__Public/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/common.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/style.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/modal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<tc_include file="Public:header"/>
... ... @@ -111,9 +112,26 @@
</div>
</div>
</div>
<tc_include file="Portal/Will:apply"/>
<tc_include file="Public:footer"/>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/common.js"></script>
<script src="__TMPL__Public/assets/js/modal.js"></script>
<script>
// $('#myModal').modal({
// })
$('#myModal').on('shown.bs.modal', function () {
document.documentElement.style.overflow='hidden';
})
$('#myModal').on('hidden.bs.modal', function () {
document.documentElement.style.overflow='auto';
})
</script>
<!--城市-->
<script type="text/javascript">
$("#city").citySelect({nodata:"none",required:false});
</script>
</body>
</html>
... ...
... ... @@ -7,6 +7,7 @@
<link href="__TMPL__Public/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/common.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/style.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/modal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<tc_include file="Public:header"/>
... ... @@ -95,9 +96,26 @@
</ul>
</div>
</div>
<tc_include file="Portal/Will:apply"/>
<tc_include file="Public:footer"/>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/common.js"></script>
<script src="__TMPL__Public/assets/js/modal.js"></script>
<script>
// $('#myModal').modal({
// })
$('#myModal').on('shown.bs.modal', function () {
document.documentElement.style.overflow='hidden';
})
$('#myModal').on('hidden.bs.modal', function () {
document.documentElement.style.overflow='auto';
})
</script>
<!--城市-->
<script type="text/javascript">
$("#city").citySelect({nodata:"none",required:false});
</script>
</body>
</html>
... ...
... ... @@ -3,10 +3,11 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>9鹿鸣社_4近期活动详情</title>
<title>鹿鸣社_近期活动详情</title>
<link href="__TMPL__Public/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/common.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/style.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/modal.css" rel="stylesheet" type="text/css" />
</head>
<body>
<tc_include file="Public:header"/>
... ... @@ -20,8 +21,8 @@
<li><a href="{:U('Will/explain')}">入会说明</a></li>
<li><a href="#myModal" data-toggle="modal">入会申请</a></li>
<li><a href="{:U('Will/mission_list')}">任务发布</a></li>
<li class="active"><a href="{:U('Will/events_list')}">近期活动</a></li>
<li><a href="{:U('Will/produce_list')}">双创项目</a></li>
<li><a href="{:U('Will/events_list')}">近期活动</a></li>
<li class="active"><a href="{:U('Will/produce_list')}">双创项目</a></li>
</ul>
</div>
</div>
... ... @@ -49,9 +50,26 @@
</div>
</div>
</div>
<tc_include file="Portal/Will:apply"/>
<tc_include file="Public:footer"/>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/common.js"></script>
<script src="__TMPL__Public/assets/js/modal.js"></script>
<script>
// $('#myModal').modal({
// })
$('#myModal').on('shown.bs.modal', function () {
document.documentElement.style.overflow='hidden';
})
$('#myModal').on('hidden.bs.modal', function () {
document.documentElement.style.overflow='auto';
})
</script>
<!--城市-->
<script type="text/javascript">
$("#city").citySelect({nodata:"none",required:false});
</script>
</body>
</html>
... ...
... ... @@ -3,12 +3,32 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>9鹿鸣社_5双创项目</title>
<title>鹿鸣社_双创项目</title>
<link href="__TMPL__Public/assets/css/reset.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/common.css" rel="stylesheet" type="text/css" />
<link href="__TMPL__Public/assets/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="__TMPL__Public/assets/css/modal.css">
<style>
.img_box{
width:100%;
position: absolute;
top: 0;
left: 0;
z-index:1;
background-color: #FFF;
overflow: hidden;
max-height: 100%;
}
.img_box img{
width: auto;
}
.upload{
z-index: 2;
}
</style>
</head>
<body>
<tc_include file="Public:header"/>
<tc_include file="Public:nav"/>
... ... @@ -67,46 +87,44 @@
</div>
<div class="row-con cf">
<div class="ipt-container lf">
<input type="text" name="" placeholder="团队联系人(或主持人)">
<input type="text" name="name" placeholder="团队联系人(或主持人)">
</div>
<div class="slt-list lf" id="city">
<div class="slt-container lf">
<select class="mm-select prov">
<option value=""></option>
<select name="province" class="mm-select prov">
<option value="天津"></option>
</select>
</div>
<div class="slt-container lf">
<select class="mm-select city" disabled="disabled"><option value=""></option></select>
<select name="city" class="mm-select city"><option value="天津"></option></select>
</div>
</div>
<div class="ipt-container lf">
<input id="d11" type="text" placeholder="出生年月" onClick="WdatePicker({skin:'twoer'})"/>
<input id="d11" type="text" name="birth" placeholder="出生年月" onClick="WdatePicker({skin:'twoer'})"/>
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="所在公司或高校">
<input type="text" name="school" placeholder="所在公司或高校">
</div>
<div class="radio-container lf">
<label>性别:</label>
<input type="radio" name="sex" checked>
<input type="radio" name="sex">
<input type="radio" name="sex" value="1" checked>
<input type="radio" name="sex" value="2">
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="专业">
<input type="text" name="major" placeholder="专业">
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="手机号">
<input type="text" name="mobile" placeholder="手机号">
</div>
<div class="slt-container lf">
<span>年级</span>
<select id="slt_0">
<option selected>年级</option>
<option>一年级</option>
<select name="classes" id="slt_0">
<option selected>一年级</option>
<option>二年级</option>
<option>三年级</option>
</select>
</div>
<div class="ipt-container lf">
<input type="text" name="" placeholder="邮箱">
<input type="text" name="email" placeholder="邮箱">
</div>
</div>
</div>
... ... @@ -116,10 +134,10 @@
</div>
<div class="row-con">
<div class="textarea-container">
<textarea name="" placeholder="团队成员或个人相关专业经验(绘画、设计、广告、文创、营销等)简要描述"></textarea>
<textarea name="experience" placeholder="团队成员或个人相关专业经验(绘画、设计、广告、文创、营销等)简要描述"></textarea>
</div>
<div class="textarea-container">
<textarea name="" placeholder="团队成员或个人相关双创经验简要描述"></textarea>
<textarea name="product" placeholder="团队成员或个人相关双创经验简要描述"></textarea>
</div>
</div>
</div>
... ... @@ -130,10 +148,11 @@
<div class="row-con">
<div class="file-container">
上传详细附件
<input type="file" name="">
<input type="file" name="att" id="att">
</div>
<div class="file-container" style="display:none;border:none;" id="att_file"></div>
<div class="textarea-container">
<textarea id="txt" name="" placeholder="双创项目创意概述"></textarea>
<textarea id="txt" name="product_description" placeholder="双创项目创意概述"></textarea>
<p>
<span id="txt_num">0</span>/500字
</p>
... ... @@ -144,19 +163,39 @@
</div>
<div class="btn-list cf">
<div class="btn-item lf">
<div class="img_box">
</div>
<i class="icon"></i>
<p>上传双创项目图片</p>
<input type="file" name="" class="upload">
<input type="file" name="images[]" class="upload" id="id_photos">
</div>
<div class="btn-item lf">
<div class="img_box">
</div>
<i class="icon"></i>
<p>上传双创项目图片</p>
<input type="file" name="" class="upload">
<input type="file" name="images[]" class="upload" id="id_photos1">
</div>
<div class="btn-item lf">
<div class="img_box">
</div>
<i class="icon"></i>
<p>上传双创项目图片</p>
<input type="file" name="" class="upload">
<input type="file" name="images[]" class="upload" id="id_photos2">
</div>
<div class="btn-item lf">
<div class="img_box">
</div>
<i class="icon"></i>
<p>上传双创项目图片</p>
<input type="file" name="images[]" class="upload" id="id_photos3">
</div>
<div class="btn-item lf">
<div class="img_box">
</div>
<i class="icon"></i>
<p>上传双创项目图片</p>
<input type="file" name="images[]" class="upload" id="id_photos4">
</div>
</div>
</div>
... ... @@ -164,7 +203,7 @@
</div>
<div class="row">
<div class="sub-container">
<input type="submit" name="" value="确认提交">
<input type="button" name="submit" value="确认提交">
</div>
</div>
</form>
... ... @@ -173,12 +212,14 @@
</div>
</div>
<!-- js -->
<script src="__TMPL__Public/assets/js/jquery.min.js"></script>
<!--<script src="__TMPL__Public/assets/js/jquery.min.js"></script>-->
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="__TMPL__Public/assets/js/common.js"></script>
<script src="__TMPL__Public/assets/js/modal.js"></script>
<script src="__TMPL__Public/assets/js/pop.js"></script>
<script type="text/javascript" src="__TMPL__Public/assets/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__TMPL__Public/assets/js/jquery.cityselect1.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ajaxfileupload.js"></script>
<script>
// $('#myModal').modal({
... ... @@ -197,16 +238,87 @@
<script>
showOptionInfo('#slt_0');
countWrodNum('#txt','#txt_num',500);
// 附件上传
$('#att').on('change',function(){
var fileId = $(this).attr('id');
$.ajaxFileUpload({
url: "{:U('personalUploadAtt')}", //处理图片的脚本路径
type: 'post', //提交的方式
secureuri: false, //是否启用安全提交
fileElementId: fileId, //file控件ID
dataType: 'json', //服务器返回的数据类型
success: function (data) { //提交成功后自动执行的处理函数
if(data.status) {
$('#att_file').show();
$('#att_file').append('<a target="_blank" href="'+data.file+'">我上传的附件</a><input type="hidden" name="att" value="'+data.data+'"/>');
} else {
alert(data.msg);
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数
alert(e);
}
})
});
// 图片上传
$('.upload').on('change',function(){
var objUrl = getObjectURL(this.files[0]);
if (objUrl) {
var str="url('"+objUrl+"') center no-repeat";
$(this).parent().css({
"background":str,
"-webkit-background-size":" cover",
"background-size": "cover"
});
}
var imgHidden = $(this).parent();
var imgWarp = $(this).parent().find('.img_box');
var fileId = $(this).attr('id');
$.ajaxFileUpload({
url: "{:U('personalUpload')}", //处理图片的脚本路径
type: 'post', //提交的方式
secureuri: false, //是否启用安全提交
fileElementId: fileId, //file控件ID
dataType: 'json', //服务器返回的数据类型
success: function (data) { //提交成功后自动执行的处理函数
if(data.status) {
imgWarp.append('<img src="'+ data.file +'" height="100%" />');
imgHidden.append('<input type="hidden" name="images[]" value="'+data.data+'"/>');
} else {
alert(data.msg);
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数
alert(e);
}
})
});
</script>
<script>
$('input[name=submit]').click(function(){
var btn = $(this);
var text = btn.val();
var form = $('form').serialize();
$.ajax({
url:"{:U('Will/submit')}",
type:"POST",
data:form,
dateType:"json",
beforeSend: function () {
// Handle the beforeSend event
btn.val('提交中...').attr('disabled', true);
},
success:function (data) {
if(data.status) {
alert(data.msg);
location.reload();
} else {
alert(data.msg);
}
},
error: function (data, status, e) { //提交失败自动执行的处理函数
alert(e);
},
complete: function () {
// Handle the complete event
btn.val(text).attr('disabled', false);
}
})
})
$('#txt').keyup(function() {
var len=$(this).val().length;
$('#txt_num').html(len);
});
</script>
</body>
... ...
... ... @@ -216,7 +216,7 @@ input[type="submit"],input[type="radio"],input[type="file"]{cursor: pointer;}
width: 10px;
height: 5px;
margin-top: -2.5px;
background-image: url('../images/pop/arrow-b.png');
/*background-image: url('../images/arrow-b.png');*/
}
.modal-body .textarea-container{
... ...