Commit fce1e7d3 authored by agping's avatar agping

开盘广场

parent aa8d88d9
<?php
namespace app\index\controller;
/**
* Created by PhpStorm.
* User: liu yin ping
* Date: 2018/3/13
* Time: 15:48
*/
use app\index\extend\Basic;
class OpenSquareLog extends Basic
{
public function opensquarelogList()
{
if (!$this->request->isAjax()) {
return view('opensquare/opensquareLogList');
}
}
}
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="opensquareList" />
<style>
.modal-body1 {
height: 600px;
overflow-y: auto;
padding-bottom: 60px;
}
.modal-body2 {
padding: 35px;
height: 380px;
}
.user-ul {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
position: relative;
left: -40px;
}
.user-ul li {
list-style: none;
line-height: 30px;
}
.user-ul2 {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
position: relative;
left: -40px;
}
.user-ul2 li {
list-style: none;
line-height: 30px;
}
.input {
width: 16%!important;
}
.text-left {
float: left;
display: inline-block;
height: 26px;
line-height: 26px;
font-size: 14px;
}
.text-right {
float: right;
display: inline-block;
}
#batch {
float: left;
height: 34px;
line-height: 34px;
}
.ld-Marheight {
margin-top: 15px;
}
.phone_list {
margin-top: 32px;
width: 182px;
margin-left: -182px;
}
.phone_jia {
width: 182px;
}
.phone_list li {
height: 22px;
line-height: 22px;
}
.phone_list li:nth-of-type(even) {
display: none;
}
.modal-dialog-one {
width: 668px;
}
.clear {
clear: both;
}
.left {
float: left;
font-size: 12px;
}
.bottom {
margin-top: 30px;
}
.btn6_1 {
width: 80% !important;
float: left;
}
.notice-title {
font-size: 20px;
}
.notice-time {
font-size: 13px;
margin-top: 20px;
}
.notice-text {
font-size: 16px;
margin-top: 30px;
text-indent: 2em;
}
.col-sm-9 .btn5 {
width: 30%!important;
}
.img-pre-ul {
padding-left: 0;
overflow: hidden;
/*width: 100%;*/
}
/*图片上传相关样式*/
.img-pre-ul>li {
list-style: no;
float: left;
width: 210px;
height: 170px;
overflow: hidden;
margin-right: 10px;
margin-top: 10px;
}
.img-pre-ul>li.pdf-pre-li {
height: 70px;
}
.img-pre-ul>li>img {
float: left;
width: 210px;
height: 140px;
object-fit: contain;
cursor: pointer;
}
.img-pre-ul>li>a {
float: left;
width: 210px;
text-align: center;
line-height: 30px;
}
.img-pre-ul>li>a.pdf-pre-a {
line-height: 20px;
word-break: break-all;
}
/*图片点击放大预览区域的样式*/
#img_mask_area {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 1999;
background-color: rgba(0, 0, 0, .3);
display: none;
}
#img_mask_area>img {
width: 900px;
height: 700px;
object-fit: contain;
position: absolute;
left: 50%;
top: 50%;
margin-left: -450px;
margin-top: -350px;
}
/*上传图片列表 样式*/
.form-group {
margin: 10px;
}
.input-100-width {
width: 100px!important;
}
.input-360-width {
width: 360px!important;
}
.textarea-500-width {
width: 500px!important;
}
.list-group-item>.full-width-100+.full-width-100 {
padding-top: 10px;
}
.list-group-item>.full-width-100>label {
width: 60px;
}
.list-group-item>.full-pic-area>label {
width: 120px;
}
.delet-pic-btn {
color: red;
}
#modal_content_add {
width: 900px;
}
.cke_skin_kama .cke_wrapper{
background-color:#fff;
}
#modal_detail_value{
height: 200px;
overflow-y: scroll;
border: 1px solid #ccc;
background: #fff;
}
</style>
<!--导航star-->
<!-- Sidebar -->
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li>
<a href="#">商学院</a>
</li>
<li class="active">商学院列表</li>
<div class="pull-right">
<ul class="bread_btn">
<li>
<a href="new_text.html" class="btn btn-default add_alert" target="_self"><i class="icon-plus"></i> 新增文章
</a>
</li>
</ul>
</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="11">
<form action="" method="get" id="form_search">
<span class="fore-span ld-Marheight">发布时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<!--下拉列表-->
<select class="form-control btn2 margin-top-ld input" name="" id="district_id" title=" ">
<option value="">请选择标签</option>
</select>
<input class="form-control btn2 margin-top-ld" data-rule-phoneus="false" data-rule-required="false" id="release_title" placeholder="文章标题" type="text" value="">
<span class="btn btn-info btn3 margin-top-ld" id="search">搜索</span>
<span class="btn btn-info btn3 margin-top-ld" id="reset">重置</span>
</form>
</td>
</tr>
<tr>
<th class="text-center">发布时间</th>
<th class="text-center">发布人</th>
<th class="text-center">标题</th>
<th class="text-center">标签</th>
<th class="text-center">评论数</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody id="users_list" class="text-center">
</tbody>
</table>
</div>
<!-- /#page-content-wrapper -->
<!-- <div class="text-left">
每页显示<span id="page">15</span>条 | 共<span id="total_page"></span>条
</div> -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /#wrapper -->
<!-- /#删除模态框 -->
<div class="modal fade" id="modal-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title">
删除
</h4>
</div>
<div class="modal-body">
<div class="modal-body">
<input type="hidden" value="" id="delete_id" /> 确认删除吗?
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="confirm_delete">
删除
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!-- 查看-->
<div class="modal fade" id="show_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
<div class="modal-dialog button-center-bargain" style="width:70%!important">
<div class="modal-content" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
查看
</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody id="" class="">
<tr>
<td>
<form class="form-horizontal" action="/agents/add_user" id="">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">标题:</label>
<div class="col-sm-9">
<input type="text" class="form-control btn6" name="user_name" id="announcement_title" placeholder="请输入标题">
<span class="use-span text-danger"><!--(20字以内,显示在首页列表)--></span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">标签:</label>
<div class="col-sm-9">
<select class="form-control btn5 input" name="" id="district_id2" title=" ">
<option value="">请选择标签</option>s
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">封面图:</label>
<div class="col-sm-9">
<!--选择图片-->
<ul class="list-group">
<li class="list-group-item">
<!--封面图 一张-->
<div class="form-group full-width-100 full-pic-area">
<span class="tip"></span>
</div>
<ul class="img-pre-ul" id="liebiao_pic_ul"></ul>
</li>
</ul>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">内容:</label>
<div class="col-sm-9">
<div class="" style="width: 818px;">
<div style="width : 100%" id="modal_detail_value" ></div>
</div>
</div>
</div>
<!--附件-->
<div class="form-group">
<label class="col-sm-2 control-label">附件<!--(格式为pdf/doc,选填,上限为10个)--></label>
<div class="col-sm-9">
<div class="file-upload-area" style="padding-left:15px!important">
<ul class="img-pre-ul" id="fujian_ul"></ul>
<p class="text-center"><strong>点击文件名称即可下载</strong></p>
</div>
</div>
</div>
</form>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer text-center">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
\ No newline at end of file
......@@ -335,6 +335,7 @@ Route::group('index', [
'inspectionRecordList' => [ 'index/InspectionRecord/inspectionRecordList', [ 'method' => 'GET' ] ],//约带看记录liu
'realtimePerformance' => [ 'index/RealTimePerformance/realtimePerformanceList', [ 'method' => 'GET' ] ],//实时业绩liu
'shopinspectionLog' => [ 'index/ShopInspectionLog/shopinspectionLogList', [ 'method' => 'POST|GET' ] ],//商铺查看日志liu
'opensquareLog' => [ 'index/OpenSquareLog/opensquarelogList', [ 'method' => 'POST|GET' ] ],//开盘广场liu
'redEnvelope' => [ 'index/RedEnvelope/redEnvelopeList', [ 'method' => 'POST|GET' ] ],//活动列表liu
'CashBack' => [ 'index/CashBack/cashBackList', [ 'method' => 'POST|GET' ] ],//返现红包liu
'CashAccount' => [ 'index/CashAccount/cashAccountList', [ 'method' => 'POST|GET' ] ],//现金账户liu
......
define (['doT', 'text!temp/opensquareList_template_tpl.html','ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker",'pagination','bootstrapJs'], function (doT, template) {
//处理文件名,长度过长时处理
function dealFileName(str) {
//如果文件超过30的长度,则用*代替
if(str.length > 26) {
return str.slice(0, 23) + '***' + str.slice(-4);
} else {
return str;
};
};
var user = {
pageNo: 1, /*第几页*/
pageSize: 15, /*每页显示多少条*/
user_id : 0,
urls: '',
agent_id_two:'',
agent_id2 : 0,
modal_btn_id : '' ,
init: function () {
//初始化dot
$ ("body").append (template);
user.event ();
user.getList ();
//时间控件初始化
},
event: function () {
var _doc = $(document);
var _imgMaskObj = $('#img_mask_area'); //预览大图的mask
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
//获取学院标签
user.getDistrict(function(){
_doc.on('input', '#district_id, #district_id2', function(){
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
}else{
};
});
});
$ (".Bannertu").click (function () {
BrowseServer ('cover_image');
});
_doc.on('click', '.add-pic', function(){
follow.getaddPicList();
});
_doc.on('click', '.pdf-pre-a', function() {
var file_id = $(this).parent('li').attr('id') - 0 ;
var _url = ServerHostImageLiu+'/index/downloadFile';
window.open(_url + '?file_id=' + file_id);
});
$("#search").click(function(){
user.getList(1);
});
$("#reset").click(function () {
document.getElementById("form_search").reset();
});
$("#confirm_delete").click(function(){
var params = {};
params.id = user.announcementdel_id;
console.log(user.announcementdel_id);
if(!params.id || params.id == null){
alert ("要删除的id不能为空");
return false;
}
user.delete_text(params);
});
$ (document).delegate (".announcement-del", "click", function () {
user.announcementdel_id = $ (this).attr ("data-id");
console.log(user.announcementdel_id);
});
$ (document).delegate (".add_alert", "click", function () {//新增客户
// document.getElementById("add_user_form").reset();
});
$ (document).delegate ("#add_news", "click", function () {//新增文章
user.user_id = $ (this).attr ("data-id");
user.add_news();
});
$ (document).delegate (".announcement-details", "click", function () {//点击公告详情
$('.notice-title').html($ (this).attr ("data-title"));
$('.notice-time').html($ (this).attr ("data-createTime"));
$('.notice-text').html($ (this).attr ("data-content"));
user.news_id = $ (this).attr ("data-id");
console.log(user.news_id);
user.announcement_details();
});
_doc.on('click', '.jian_class>ul>li', function(){
var _this = $(this);
_this.parent().prev().val(_this.html()).attr('data-id',_this.attr('data-id'));
_this.parent().html('').hide();
});
//图片上传,附件上传处理事件
$(".upload-image-btn").click(function() {
var _this = $(this),
_spFile = _this.data('spfile'),
_limitTop = _this.data('limittop'),
_fileNum = _this.parent().next().find('.delet-pic-btn').length; //根据删除按钮的个数,确定文件的个数
if(_limitTop && (_fileNum < _limitTop)) {
BrowseServer(_this.prev().attr('id'), function(url) {
console.log(url);
if(_spFile == 'pdf') {
if(/(\.pdf)$/i.test(url)) {
_this.parent().next().prepend('<li class="pdf-pre-li"><a class="pdf-pre-a" download="{1}" href="{0}" title="点击查看">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': url,
'1': dealFileName(decodeURI(url.slice(url.lastIndexOf('/') + 1)))
}));
} else {
alert('所选择的格式不是pdf,请重新选择');
return false;
}
} else {
if(/(\.jpg|\.jpeg|\.png|\.gif|\.bmp)$/i.test(url)) {
_this.parent().next().prepend('<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': url
}));
} else {
alert('所选择的格式不正确,请重新选择');
return false;
}
};
});
} else {
alert('上传上限为 ' + _limitTop);
return false;
};
});
//图片预览点击放大事件
_doc.on('click', '.img-pre-ul>li>img', function(e) {
_imgMaskObj.show().find('img').attr('src', this.src);
});
_imgMaskObj.click(function(e) {
this.style.display = 'none';
});
_doc.on('click','.show_modal_btn' ,function(e){
user.modal_btn_id = e.target.dataset.id;
$('#fujian_ul').html('');
});
$("#show_modal").on("shown.bs.modal",function(){
$('.cke_toolbox').hide();
user.text_details();
});
},
//点击编辑 调用的接口
text_details: function() {
var news_id = user.modal_btn_id;
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
var _imgUploadLiebiao = $('#liebiao_pic_ul'); //列表页封面图ul
var _urlCut = location.origin + '/resource/lib/Attachments/images/'; //要截取的部分url
var _dajiangtangObj = $('#dajiangtang'); //大讲堂
$.ajax({
'type': 'GET',
'url': '/index/getNewsInfo',
data: {
'id': news_id,
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
$('#modal_detail_value').html(data.data.content);
$("#announcement_title").val(data.data.title);
$("#district_id2").val(data.data.s_label_id * 1); //商学院标签id
var _data = data['data'];
if(_data['cover_plan']) {
_imgUploadLiebiao.html('<li><img title="点击查看大图" src="{0}" /></li>'.stringFormatObj({
'0': _data['cover_plan']
}));
};
//获取编辑器里的内容
// setCKeditorValue(id,content)
//setCKeditorValue("goods_sup_id", _data['content']);
//附件
var file_paths = _data['file'];
if ( file_paths ) {
for ( var i = 0 ; i < file_paths.length ; i++ ){
console.log(file_paths[i]['file_name'])
var _tempArr = file_paths[i]['file_name'].split('/');
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['file_id'] +'><a class="pdf-pre-a" download="{1}" href="javascript:;" title="点击可下载">{2}</a></li>'.stringFormatObj({
'0': '/' + file_paths[i]['show_file'],
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1])),
'2': file_paths[i]['file_former_name']?file_paths[i]['file_former_name']:dealFileName(decodeURI(_tempArr[_tempArr.length-1]))
}));
}
}
$('#announcement_title').attr('readonly','readonly');
$('#district_id2').attr('disabled','disabled');
} else {}
}
});
},
//筛选 获取文章列表
getList: function (pageNo) {
user.pageNo = pageNo;
var params = {};
params.start_time = $("#start_date").val();
params.end_time = $("#end_date").val();
params.title = $("#release_title").val();
params.label_id = $("#district_id").val();
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
$.ajax ({
url: '/index/business_school',
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
console.log('公告');
var temp = document.getElementById ('schoolBusiness_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#users_list").html (doTtmpl (data.data.list));
/*分页代码*/
add_page(data.data.total,pageNo,user.pageSize,user.getList);
$("#total_page").html(data.data.total);
}
});
},
getDistrict : function (fn) {
$.ajax ({
url: '/index/getNewsLabel',
type: 'GET',
async: true,
data: {},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.label_name+'</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
delete_text : function(params) {//删除文章
$.ajax ({
url: '/index/delNews',
type: 'POST',
async: true,
data: params,
dataType: 'json',
success: function (data) {
$ ("#modal-delete").modal ('hide');
if (data.code == "101") {
alert (data.msg);
return false;
}
user.getList (user.pageNo);
}
});
},
};
return user;
});
<script id="opensquare_list_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]['create_time'] %]</td>
<!--<td>[%= hideTel(it[item]["name"]) %]</td>-->
<td>[% if(it[item]["name"] != null) { %]
[%= it[item]["name"] %]
[% } %]
</td>
<td>[%= it[item]["title"] %]</td>
<td>[% if(it[item]["label_name"] != null) { %]
[%= it[item]["label_name"] %]
[% } %]
</td>
<!--<td>[%= it[item]["label_name"] %]</td>-->
<!--没有评论数字段-->
<td>[%= it[item]["comment_number"] %]</td>
<td>
<a href="#show_modal" class="btn1 btn-success show_modal_btn" data-toggle="modal" data-id="[%= it[item]['id'] %]"> 查看</a>
<!--<a class="btn1 btn-success" href="new_text.html?id=[%= it[item]['id'] %]" data-createTime='[%= it[item]["create_time"] %]' data-title='[%= it[item]["title"] %]' data-id='[%= it[item]["id"] %]' data-content='[%= it[item]["content"] %]' target="_self">-->
<a class="btn1 btn-success" href="new_text.html?id=[%= it[item]['id'] %]" data-id="[%= it[item]['id'] %]">
编辑
</a>
[% if(check_auth('index/delNews')) { %]
<!--删除权限-->
<a class="btn1 btn-danger announcement-del" href="#modal-delete" data-toggle="modal" data-id='[%= it[item]["id"] %]'>删除</a>
[% } %]
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="7" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
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