Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
9baabe08
Commit
9baabe08
authored
Apr 08, 2019
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
143ce1bb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
595 additions
and
208 deletions
+595
-208
frame_two_tpl.html
application/index/view/global/frame_two_tpl.html
+1
-1
test.html
application/index/view/news/test.html
+351
-23
opensquareLogList.html
application/index/view/opensquare/opensquareLogList.html
+9
-73
opensquareList.js
public/resource/js/opensquareList.js
+13
-111
opensquareListbaidu.js
public/resource/js/opensquareListbaidu.js
+221
-0
No files found.
application/index/view/global/frame_two_tpl.html
View file @
9baabe08
...
...
@@ -11,7 +11,7 @@
<link
rel=
"stylesheet"
href=
"/resource/css/bootstrap-datetimepicker.min.css"
>
<link
rel=
"stylesheet"
href=
"/resource/css/b-liu.tabs.css"
>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"/resource/lib/ueditor/ueditor.config.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"/resource/lib/ueditor/ueditor.all.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"/resource/lib/ueditor/ueditor.all.
min.
js"
></script>
<script
type=
"text/javascript"
src=
"/resource/lib/ueditor/lang/zh-cn/zh-cn.js"
></script>
<title>
同联商业
</title>
...
...
application/index/view/news/test.html
View file @
9baabe08
<!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
{layout name="global/frame_two_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
:
130px
;
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
application/index/view/opensquare/opensquareLogList.html
View file @
9baabe08
...
...
@@ -342,7 +342,14 @@
</div>
<div
class=
"modal-body"
>
<div
class=
"modal-body"
>
<input
type=
"hidden"
value=
""
id=
"delete_id"
/>
确认删除吗?
<br
/>
<br
/>
<div
style=
"font-size: 16px;margin-left: 20px;font-weight: 600;"
>
确认删除吗?
</div>
<br
/>
<br
/>
<br
/>
</div>
</div>
<div
class=
"modal-footer"
>
...
...
@@ -400,78 +407,7 @@
</h4>
</div>
<div
class=
"modal-body"
>
<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>
<iframe
class=
"iframe-shop-detail"
style=
"height: 800px;"
></iframe>
</div>
<!--<div class="modal-footer text-center">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
...
...
public/resource/js/opensquareList.js
View file @
9baabe08
...
...
@@ -18,7 +18,6 @@ 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
);
...
...
@@ -30,38 +29,15 @@ 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
(
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'
);
});
//搜索获取 开盘标签
user
.
getDistrict
();
_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
(
'发布开盘'
)
user
.
getDistrict
();
user
.
switchUrl
=
'/index/addSquare'
;
$
(
'.iframe-shop-detail'
).
attr
(
'src'
,
ServerHostImageLiu
+
'/index/test?is_add=1'
);
});
_doc
.
on
(
'click'
,
'.pdf-pre-a'
,
function
()
{
var
file_id
=
$
(
this
).
parent
(
'li'
).
attr
(
'id'
)
-
0
;
...
...
@@ -75,22 +51,11 @@ 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'
));
...
...
@@ -178,48 +143,15 @@ 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"
);
user
.
is_add
=
0
;
user
.
text_details
();
$
(
'.iframe-shop-detail'
).
attr
(
'src'
,
ServerHostImageLiu
+
'/index/test?is_add=0&id='
+
user
.
announcementdel_id
)
;
});
},
//点击编辑 调用的接口
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
({
...
...
@@ -232,9 +164,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
.
data
.
title
);
$
(
".detail-time"
).
html
(
data
.
data
.
data
.
create_time
);
$
(
".detail-content"
).
html
(
data
.
data
.
data
.
content
);
$
(
".detail-title"
).
html
(
data
.
data
.
title
);
$
(
".detail-time"
).
html
(
data
.
data
.
create_time
);
$
(
".detail-content"
).
html
(
data
.
data
.
content
);
}
else
{}
}
});
...
...
@@ -306,36 +238,6 @@ 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
;
...
...
public/resource/js/opensquareListbaidu.js
0 → 100644
View file @
9baabe08
define
([
'doT'
,
'css!style/home.css'
,
'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
:
''
,
announcementdel_id
:
''
,
//文章id
is_add
:
1
,
//是否新增
switchUrl
:
''
,
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
user
.
event
();
user
.
getDistrict
();
if
(
getUrlParam
(
'is_add'
)
==
1
){
//置空内容
$
(
'#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
});
}
else
{
user
.
text_details
();
};
//时间控件初始化
},
event
:
function
()
{
var
_doc
=
$
(
document
);
var
_imgMaskObj
=
$
(
'#img_mask_area'
);
//预览大图的mask
var
_imgUploadLunbo
=
$
(
'#xiangqing_pic_ul'
);
//详情页轮播图ul
_doc
.
on
(
'click'
,
'.add-pic'
,
function
(){
follow
.
getaddPicList
();
});
$
(
document
).
delegate
(
"#add_news"
,
"click"
,
function
()
{
//新增文章
user
.
user_id
=
$
(
this
).
attr
(
"data-id"
);
user
.
add_news
();
});
//图片上传,附件上传处理事件(发布开盘 新增图片)
$
(
"#upload-image-btn"
).
change
(
function
()
{
var
_this
=
$
(
this
),
_spFile
=
_this
.
data
(
'spfile'
),
_limitTop
=
1
,
_fileNum
=
$
(
'#fujian_ul'
).
find
(
'.delet-pic-btn'
).
length
;
//根据删除按钮的个数,确定文件的个数
if
(
_limitTop
&&
(
_fileNum
<
_limitTop
))
{
var
formData
=
new
FormData
();
formData
.
append
(
'type'
,
'house_img'
);
formData
.
append
(
'image'
,
_this
[
0
].
files
[
0
]);
$
.
ajax
({
type
:
'post'
,
url
:
ServerHostImageLiu
+
'/index/uploadImg'
,
data
:
formData
,
dataType
:
'json'
,
contentType
:
false
,
cache
:
false
,
processData
:
false
,
beforeSend
:
function
()
{},
success
:
function
(
_data
)
{
if
(
_data
.
code
==
200
)
{
var
_url
=
_data
.
data
.
internet_img_name
;
var
tag
=
''
;
user
.
titlePic
=
_data
.
data
.
img_path
;
var
url
=
ServerHostImageLiu
+
"/resource/lib/Attachments/images/"
+
_url
;
if
(
_spFile
==
'pdf'
)
{
if
(
/
(\.
pdf|
\.
doc|
\.
xls
)
$/i
.
test
(
url
))
{
$
(
'#fujian_ul'
).
append
(
'<li class="pdf-pre-li"><a class="pdf-pre-a" download="{1}" href="javascript:;" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
url
,
'1'
:
dealFileName
(
decodeURI
(
url
.
slice
(
url
.
lastIndexOf
(
'/'
)
+
1
)))
//dealFileName不要忘记
}));
}
else
{
alert
(
'所选择的格式不是pdf/doc/xls,请重新选择'
);
return
false
;
}
}
else
{
if
(
/
(\.
jpg|
\.
jpeg|
\.
png|
\.
gif|
\.
bmp
)
$/i
.
test
(
url
))
{
$
(
'#fujian_ul_add'
).
append
(
'<li><img class="titleImg" title="点击查看大图" src="{0}" data-name="{1}"/><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
url
,
'1'
:
_data
.
data
.
img_path
}));
}
else
{
alert
(
'所选择的格式不正确,请重新选择'
);
return
false
;
}
};
}
else
{
alert
(
_data
.
msg
);
};
},
error
:
function
()
{
alert
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
alert
(
'请求超时,请重试'
);
};
}
});
}
else
{
alert
(
'上传上限为 '
+
_limitTop
);
return
false
;
};
});
},
//点击编辑 调用的接口
text_details
:
function
()
{
user
.
getDistrict
();
$
.
ajax
({
'type'
:
'GET'
,
'url'
:
'/index/getSquareInfo'
,
data
:
{
'id'
:
getUrlParam
(
'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
{}
}
});
},
getDistrict
:
function
()
{
$
(
"#district_id"
).
html
(
''
);
$
(
"#add_district_id"
).
html
(
''
);
$
.
ajax
({
url
:
'/index/getDistrictLable'
,
type
:
'GET'
,
async
:
true
,
data
:
{},
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
&&
data
.
data
!=
null
)
{
var
str
=
'<option value="">部门标签</option>'
;
$
.
each
(
data
.
data
,
function
(
i
,
item
)
{
str
+=
'<option value="'
+
item
.
id
+
'">'
+
item
.
name
+
'</option>'
;
});
$
(
"#district_id"
).
append
(
str
);
$
(
"#add_district_id"
).
append
(
str
);
}
}
});
},
add_news
:
function
()
{
//新增开盘 编辑开盘
if
(
$
(
'.titleImg'
))
{
var
pic
=
$
(
'.titleImg'
).
attr
(
"data-name"
);
}
var
_data
=
{};
if
(
getUrlParam
(
'is_add'
)
*
1
==
0
){
//编辑 传id
_data
.
id
=
getUrlParam
(
'id'
);
user
.
switchUrl
=
'/index/editSquare'
}
else
{
user
.
switchUrl
=
'/index/addSquare'
;
}
_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
;
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment