Commit 586b0c0d authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/0702-v.2.2.0' into 0702-v.2.2.0

parents 1df1092c b39702db
......@@ -6,7 +6,8 @@
overflow-y: auto;
padding-bottom: 60px;
}
.modal-body2{
.modal-body2 {
padding: 35px;
height: 380px;
}
......@@ -92,33 +93,40 @@
.clear {
clear: both;
}
.left{
.left {
float: left;
font-size: 12px;
}
.bottom{
.bottom {
margin-top: 30px;
}
.btn6_1{
.btn6_1 {
width: 80% !important;
float: left;
}
.notice-title{
.notice-title {
font-size: 20px;
}
.notice-time{
.notice-time {
font-size: 13px;
margin-top: 20px;
}
.notice-text{
.notice-text {
font-size: 16px;
margin-top: 30px;
text-indent: 2em;
}
.col-sm-9 .btn5{
width: 30%!important;
.col-sm-9 .btn5 {
width: 30%!important;
}
.img-pre-ul {
padding-left: 0;
overflow: hidden;
......@@ -184,39 +192,42 @@
margin-top: -350px;
}
/*上传图片列表 样式*/
.form-group {
margin: 10px;
}
}
.input-100-width {
.input-100-width {
width: 100px!important;
}
}
.input-360-width {
.input-360-width {
width: 360px!important;
}
}
.textarea-500-width {
.textarea-500-width {
width: 500px!important;
}
}
.list-group-item>.full-width-100+.full-width-100 {
.list-group-item>.full-width-100+.full-width-100 {
padding-top: 10px;
}
}
.list-group-item>.full-width-100>label {
.list-group-item>.full-width-100>label {
width: 60px;
}
}
.list-group-item>.full-pic-area>label {
.list-group-item>.full-pic-area>label {
width: 120px;
}
.delet-pic-btn{
color:red;
}
#modal_content_add{
}
.delet-pic-btn {
color: red;
}
#modal_content_add {
width: 900px;
}
}
</style>
<!--导航star-->
......@@ -307,7 +318,7 @@
&times;
</button>
<h4 class="modal-title">
新增公告
新增文章
</h4>
</div>
......@@ -321,7 +332,6 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">标签:</label>
<div class="col-sm-9">
......@@ -338,14 +348,22 @@
<ul class="list-group">
<li class="list-group-item">
<div class="form-group full-width-100 full-pic-area">
<!--<label for="">详情页轮播图(至少4张)</label>-->
<!--详情图 多张-->
<!--<div class="form-group full-width-100 full-pic-area">
<input readonly="readonly" type="text" name="xiangqing_pic_input" class="form-control" style="display: none" id="xiangqing_pic_input" placeholder="请选择图片">
<button class="btn btn-default upload-image-btn" id="xiangqing_pic_btn" type="button" data-limittop="20">上传图片</button>
<span class="tip"></span>
</div>
<ul class="img-pre-ul" id="xiangqing_pic_ul">
</ul>
</ul>-->
<!--封面图 一张-->
<div class="form-group full-width-100 full-pic-area">
<!--<label for="">列表页封面图(1张)</label>-->
<input readonly="readonly" type="text" name="liebiao_pic_input" class="form-control" style="width: 150px !important;display:none" id="liebiao_pic_input" placeholder="请选择图片">
<button class="btn btn-default upload-image-btn" id="liebiao_pic_btn" type="button" data-limittop="1">选择图片</button>
<span class="tip"></span>
</div>
<ul class="img-pre-ul" id="liebiao_pic_ul"></ul>
</li>
</ul>
......@@ -375,12 +393,11 @@
</div>
</div>-->
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="add_announcement">
<button type="button" class="btn btn-primary" id="add_news">
保存
</button>
</div>
......
......@@ -31,14 +31,6 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
user.getDistrictStoreList(_id, function(_data){
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
});
}else{
};
});
......@@ -87,10 +79,10 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
document.getElementById("add_user_form").reset();
});
// ===========================新增公告====================
$ (document).delegate ("#add_announcement", "click", function () {//新增客户
// ===========================新增文章====================
$ (document).delegate ("#add_news", "click", function () {//新增文章
user.user_id = $ (this).attr ("data-id");
user.add_announcement();
user.add_news();
});
$ (document).delegate (".announcement-details", "click", function () {//点击公告详情
......@@ -274,7 +266,7 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
_imgMaskObj.click(function(e) {
this.style.display = 'none';
});
//保存上传的图片
//保存上传的图片 详情页多张
_doc.on('click', '#saveBtn', function(e) {
var _this = $(this);
var _data={
......@@ -463,6 +455,43 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
}
});
},
//点击收款图片 调用的接口
getaddPicList: function() { //提交
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul
var _imgUploadLiebiao = $('#liebiao_pic_ul');//列表页封面图ul
var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url
_imgUploadLunbo.empty();
$.ajax({
'type': 'GET',
'url': '/index/houseEdit',
data: {
"id": 3104,
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
// 封面图一张
if(_data['cover']){
_imgUploadLiebiao.html('<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _urlCut + _data['cover']
}));
};
// 封面图一张
var _data = data['data'];
for(var i in _data['slide_show']) {
_imgUploadLunbo.append('<li data-imgid="{id}"><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': _urlCut + _data['slide_show'][i]['img_name'],
'id': _data['slide_show'][i]['id']
}));
};
// follow.getList(0);
} else {
}
}
});
},
......@@ -486,35 +515,61 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
}
});
},
add_announcement : function () {
var params = {};
params.title = $("#announcement_title").val();
params.content = $("#announcement_content").val();
if (params.title == '') {
alert('标题不能为空');
$("#announcement_title").focus();
return ;
}
if (params.title.length > 20) {
alert('标题字数20以内');
$("#announcement_title").focus();
return ;
}
if (params.content == '') {
alert('内容不能为空');
$("#announcement_content").focus();
return ;
}
if (params.content.length > 250) {
alert('公告内容字数250以内');
$("#announcement_content").focus();
return ;
}
add_news : function () {//新增文章
var _imgUploadLiebiao = $('#liebiao_pic_ul');//列表页封面图ul
var _liebiaoPicObj = _imgUploadLiebiao.find('li>img');
var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url
var _dajiangtangObj = $('#dajiangtang'); //大讲堂
var _dajiangtangVal = _dajiangtangObj.find('iframe').contents().find('body').html();
if(_liebiaoPicObj.length < 1) {
alert('列表页封面图需要上传');
return false;
};
var _data = {};
//字符串形式 传过去
// $.each(_liebiaoPicObj, function(i, item) {
//// _data['cover[' + i + ']'] = item.src.replace(_urlCut, '');
// _data['file_img[' + i + ']'] = item.src;
//
// });
_data.title = $("#announcement_title").val();
_data.title2 = $("#district_id2").val();//商学院标签id
_data.file_img = _liebiaoPicObj[0].src;//封面图
_data.content = _dajiangtangVal;
// if (params.title == '') {
// alert('标题不能为空');
// $("#announcement_title").focus();
// return ;
// }
// if (params.title.length > 20) {
// alert('标题字数20以内');
// $("#announcement_title").focus();
// return ;
// }
// if (params.content == '') {
// alert('内容不能为空');
// $("#announcement_content").focus();
// return ;
// }
// if (params.content.length > 250) {
// alert('公告内容字数250以内');
// $("#announcement_content").focus();
// return ;
// }
//判断有没有图片
// if(_liebiaoPicObj.length < 1) {
// alert('列表页封面图需要上传');
// return false;
// };
$.ajax ({
url: '/index/addNotice',
url: '/index/addNews',
type: 'POST',
async: true,
data: params,
data: _data,
dataType: 'json',
success: function (data) {
if (data.code == 200) {
......@@ -548,8 +603,6 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
};
return user;
});
function edit(obj) {
var params = {}
params.id = $(obj).attr ("data-id")
......
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