Commit 9f9d6df6 authored by agping's avatar agping

恢复

parent f3185a44
{layout name="global/frame_baidu_tpl" /}
<input type="hidden" class="page-load" id="opensquareListbaidu" />
<style>
.modal-body{
padding: 0px!important;
}
.detail-content img{
max-width: 200px;
}
.table-responsive{
overflow-x: none!important;
}
.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: 200px;
height: 130px;
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: 200px;
height: 168px;
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>
<!--新增开盘 编辑开盘-->
<div style="height: 800px;">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody id="" class="text-center">
<tr>
<td>
<form class="form-horizontal" action="" 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_add" 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="add_city_id" title=" ">
<option value="">请选择城市</option>
<option value="10001">上海市</option>
<option value="10002">杭州市</option>
<option value="10003">深圳市</option>
</select>
</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="add_district_id" title=" ">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">封面图:</label>
<div class="col-xs-9">
<ul class="list-group">
<li class="list-group-item">
<div class="file-upload-area p-a-0 ">
<ul class="img-pre-ul" id="fujian_ul_add"></ul>
<div class="btn-area">
<input class="btn btn-default" type="file" id="upload-image-btn" data-limittop="1" /> <!--修改上传文件的最大数字-->
<button class="btn btn-default">选择图片</button>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">内容:</label>
<div class="col-sm-9">
<div>
<!-- 加载编辑器的容器 -->
<script type="text/plain" id="myEditor" style="width:716px;height:300px;">
</script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
var ue = UE.getEditor('myEditor');
</script>
</div>
</div>
</div>
</form>
<button type="button" class="btn btn-primary" id="add_news">保存 </button>
</td>
</tr>
</tbody>
</table>
</div>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script language="javascript" type="text/javascript"
src="http://pre2.tonglianjituan.com/resource/lib/ueditor/ueditor.config.js"></script>
<script language="javascript" type="text/javascript"
src="http://pre2.tonglianjituan.com/resource/lib/ueditor/ueditor.all.min.js"></script>
111
<script type="text/plain" id="myEditor" style="width:880px;height:240px;">
</script>
<script type = "text/javascript" >
var ue = UE.getEditor('myEditor');
</script>
</body>
</html>
\ No newline at end of file
......@@ -342,14 +342,7 @@
</div>
<div class="modal-body">
<div class="modal-body">
<br />
<br />
<div style="font-size: 16px;margin-left: 20px;font-weight: 600;">确认删除吗?</div>
<br />
<br />
<br />
<input type="hidden" value="" id="delete_id" /> 确认删除吗?
</div>
</div>
<div class="modal-footer">
......@@ -407,7 +400,78 @@
</h4>
</div>
<div class="modal-body">
<iframe class="iframe-shop-detail" style="height: 800px;"></iframe>
<div class="">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody id="" class="text-center">
<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_add" 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="add_city_id" title=" ">
<option value="">请选择城市</option>
<option value="10001">上海市</option>
<option value="10002">杭州市</option>
<option value="10003">深圳市</option>
</select>
</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="add_district_id" title=" ">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">封面图:</label>
<div class="col-xs-9">
<ul class="list-group">
<li class="list-group-item">
<div class="file-upload-area p-a-0 ">
<ul class="img-pre-ul" id="fujian_ul_add"></ul>
<div class="btn-area">
<input class="btn btn-default" type="file" id="upload-image-btn" data-limittop="1" /> <!--修改上传文件的最大数字-->
<button class="btn btn-default">选择图片</button>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">内容:</label>
<div class="col-sm-9">
<div>
<!-- 加载编辑器的容器 -->
<script type="text/plain" id="myEditor" style="width:716px;height:300px;">
</script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
var ue = UE.getEditor('myEditor');
</script>
</div>
</div>
</div>
</form>
<button type="button" class="btn btn-primary" id="add_news">保存 </button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--<div class="modal-footer text-center">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
......
......@@ -18,6 +18,7 @@ define (['doT', 'text!temp/opensquareList_template_tpl.html','ckfinder','ckfinde
modal_btn_id : '' ,
announcementdel_id:'',//文章id
is_add:1,//是否新增
switchUrl:'',
init: function () {
//初始化dot
$ ("body").append (template);
......@@ -29,15 +30,38 @@ define (['doT', 'text!temp/opensquareList_template_tpl.html','ckfinder','ckfinde
var _doc = $(document);
var _imgMaskObj = $('#img_mask_area'); //预览大图的mask
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
//搜索获取 开盘标签
user.getDistrict();
//获取学院标签
user.getDistrict(function(){
_doc.on('input', '#district_id', 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', '.new-pan', function(){
//置空内容
$('#announcement_title_add').val('');
$('#add_city_id').val('');
$('#add_city_id').val('');
$('#fujian_ul_add').html('');
var ue = UE.getEditor('myEditor');
ue.ready(function() {//编辑器初始化完成再赋值
ue.setContent(''); //赋值给UEditor
});
user.is_add = 1;
$('.is-add').html('发布开盘')
$('.iframe-shop-detail').attr('src', ServerHostImageLiu + '/index/test?is_add=1');
user.getDistrict();
user.switchUrl = '/index/addSquare';
});
_doc.on('click', '.pdf-pre-a', function() {
var file_id = $(this).parent('li').attr('id') - 0 ;
......@@ -51,11 +75,22 @@ define (['doT', 'text!temp/opensquareList_template_tpl.html','ckfinder','ckfinde
$("#reset").click(function () {
document.getElementById("form_search").reset();
});
$("#confirm_delete").click(function(){
var params = {};
params.id = 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");
});
$ (document).delegate ("#add_news", "click", function () {//新增文章
user.user_id = $ (this).attr ("data-id");
user.add_news();
});
_doc.on('click', '.jian_class>ul>li', function(){
var _this = $(this);
_this.parent().prev().val(_this.html()).attr('data-id',_this.attr('data-id'));
......@@ -143,15 +178,48 @@ define (['doT', 'text!temp/opensquareList_template_tpl.html','ckfinder','ckfinde
user.text_details_view();
});
_doc.on('click','.edit_modal_btn' ,function(e){//点击编辑
$('.is-add').html('编辑开盘')
user.announcementdel_id = $ (this).attr ("data-id");
$('.iframe-shop-detail').attr('src', ServerHostImageLiu + '/index/test?is_add=0&id='+user.announcementdel_id);
user.is_add = 0;
user.text_details();
});
},
//点击编辑 调用的接口
text_details: function() {
$('.is-add').html('编辑开盘')
user.switchUrl = '/index/editSquare';
user.getDistrict();
$.ajax({
'type': 'GET',
'url': '/index/getSquareInfo',
data: {
'id': user.announcementdel_id,
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
$('#announcement_title_add').val(data.data.title);
$("#add_city_id").val(data.data.site_id);
$("#add_district_id").val(data.data.district_lable_id);
var ue = UE.getEditor('myEditor');
ue.ready(function() {//编辑器初始化完成再赋值
ue.setContent(data.data.content); //赋值给UEditor
});
var _data = data['data'];
if(_data['cover_img']) {
$('#fujian_ul_add').html('<li><img title="点击查看大图" src="{0}" data-name="{1}" class="titleImg"/></li>'.stringFormatObj({
'0': ServerHostImageLiu + "/resource/lib/Attachments/images/" + _data['cover_img'],
'1': _data['cover_img']
}));
};
} else {}
}
});
},
//点击查看 调用的接口
text_details_view: function() {
$.ajax({
......@@ -164,9 +232,9 @@ define (['doT', 'text!temp/opensquareList_template_tpl.html','ckfinder','ckfinde
success: function(data) {
if(data.code == 200) {
console.log(555)
$(".detail-title").html(data.data.title);
$(".detail-time").html(data.data.create_time);
$(".detail-content").html(data.data.content);
$(".detail-title").html(data.data.data.title);
$(".detail-time").html(data.data.data.create_time);
$(".detail-content").html(data.data.data.content);
} else {}
}
});
......@@ -238,6 +306,36 @@ define (['doT', 'text!temp/opensquareList_template_tpl.html','ckfinder','ckfinde
}
});
},
add_news: function() { //新增开盘 编辑开盘
if ($('.titleImg')) {
var pic = $('.titleImg').attr("data-name");
}
var _data = {};
if(user.is_add*1 == 0){//编辑 传id
_data.id = user.announcementdel_id;
}
_data.title = $("#announcement_title_add").val();
_data.site_id = $("#add_city_id").val(); //商学院标签id
_data.district_id = $("#add_district_id").val(); //商学院标签id
_data.cover_img = pic; //封面图 剪切后的字符串
_data.content = UE.getEditor('myEditor').getContent();
$.ajax({
url: user.switchUrl,
type: 'POST',
async: true,
data: _data,
dataType: 'json',
success: function(data) {
if(data.code == 200) {
$("#add_modal").modal('hide'); //提交成功 关闭模态框
alert('提交成功')
user.getList(user.pageNo);
} else {
alert(data.msg);
}
}
});
},
};
return user;
......
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