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
c69d0250
Commit
c69d0250
authored
Aug 03, 2018
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
附件相关
parent
99f20741
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
141 additions
and
63 deletions
+141
-63
customerinfo_details_new.html
...ation/app_broker/view/index/customerinfo_details_new.html
+2
-2
new_text.html
application/index/view/news/new_text.html
+8
-13
add_notice_view.html
application/index/view/notice/add_notice_view.html
+8
-13
public.css
public/resource/css/public.css
+27
-0
addNoticeView.js
public/resource/js/addNoticeView.js
+35
-24
schoolBusinessNew.js
public/resource/js/schoolBusinessNew.js
+61
-11
No files found.
application/app_broker/view/index/customerinfo_details_new.html
View file @
c69d0250
...
...
@@ -122,9 +122,9 @@
<div
class=
"genjin-mark-area-zhuangtai"
>
<div
class=
"genjin-mark-area-title"
>
状态标签:(必选)
</div>
<div
class=
"genjin-mark-area-alink"
>
<a
data-markid=
"0"
>
求租
</a>
<a
data-markid=
"1"
>
已租
</a>
<a
data-markid=
"-1"
>
无效
</a>
<a
data-markid=
"1"
>
已租
</a>
<a
data-markid=
"0"
>
求租
</a>
</div>
</div>
</div>
...
...
application/index/view/news/new_text.html
View file @
c69d0250
...
...
@@ -307,22 +307,17 @@
</div>
<!--附件-->
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
附件(格式为pdf/doc,选填,上限为1个):
</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"
>
<!--<label for="">列表页封面图(1张)</label>-->
<input
readonly=
"readonly"
type=
"text"
name=
"fujian_input"
class=
"form-control"
style=
"width: 150px !important;display:none"
id=
"fujian_input"
placeholder=
"请选择图片"
>
<button
class=
"btn btn-default upload-image-btn"
id=
"fujian_btn"
data-spfile=
"pdf"
type=
"button"
data-limittop=
"1"
>
选择附件
</button>
<span
class=
"tip"
></span>
</div>
<ul
class=
"img-pre-ul"
id=
"fujian_ul"
></ul>
</li>
</ul>
<div
class=
"file-upload-area"
>
<div
class=
"btn-area"
>
<input
type=
"file"
id=
"file_input"
class=
""
data-limittop=
"1"
/>
<button
class=
"btn btn-default"
>
选择附件
</button>
</div>
<ul
class=
"img-pre-ul"
id=
"fujian_ul"
></ul>
</div>
</div>
</div>
...
...
application/index/view/notice/add_notice_view.html
View file @
c69d0250
...
...
@@ -278,22 +278,17 @@
</div>
<!--附件-->
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
附件(格式为pdf/doc,选填,上限为1个):
</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"
>
<!--<label for="">列表页封面图(1张)</label>-->
<input
readonly=
"readonly"
type=
"text"
name=
"fujian_input"
class=
"form-control"
style=
"width: 150px !important;display:none"
id=
"fujian_input"
placeholder=
"请选择图片"
>
<button
class=
"btn btn-default upload-image-btn"
id=
"fujian_btn"
data-spfile=
"pdf"
type=
"button"
data-limittop=
"1"
>
选择附件
</button>
<span
class=
"tip"
></span>
</div>
<ul
class=
"img-pre-ul"
id=
"fujian_ul"
></ul>
</li>
</ul>
<div
class=
"file-upload-area"
>
<div
class=
"btn-area"
>
<input
type=
"file"
id=
"file_input"
class=
""
data-limittop=
"1"
/>
<button
class=
"btn btn-default"
>
选择附件
</button>
</div>
<ul
class=
"img-pre-ul"
id=
"fujian_ul"
></ul>
</div>
</div>
</div>
...
...
public/resource/css/public.css
View file @
c69d0250
...
...
@@ -346,3 +346,29 @@ a:hover{
display
:
block
;
margin
:
0
auto
;
}
/*商学院文章,公告文章,附件相关样式*/
.file-upload-area
{
min-height
:
76px
;
padding
:
18px
0
;
background-color
:
white
;
}
.file-upload-area
>
.btn-area
{
position
:
relative
;
width
:
100px
;
height
:
40px
;
}
.file-upload-area
>
.btn-area
>
input
,
.file-upload-area
>
.btn-area
>
button
{
position
:
absolute
;
left
:
0
;
top
:
0
;
width
:
100%
;
height
:
100%
;
}
.file-upload-area
>
.btn-area
>
input
{
z-index
:
3
;
opacity
:
0
;
}
.file-upload-area
>
.btn-area
>
button
{
z-index
:
2
;
}
\ No newline at end of file
public/resource/js/addNoticeView.js
View file @
c69d0250
...
...
@@ -28,37 +28,49 @@ define (['doT', 'text!temp/notice_template_tpl.html','ckfinder','ckfinderStart',
return
str
;
};
};
//图片上传,附件上传处理事件
$
(
"
.upload-image-btn"
).
click
(
function
()
{
$
(
"
#file_input"
).
change
(
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|
\.
doc|
\.
xls
)
$/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
)))
//dealFileName不要忘记
}));
}
else
{
alert
(
'所选择的格式不是pdf/doc/xls,请重新选择'
);
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
var
formData
=
new
FormData
();
formData
.
append
(
'type'
,
'business_school_file'
);
formData
.
append
(
'image'
,
_this
[
0
].
files
[
0
]);
$
.
ajax
({
type
:
'post'
,
url
:
'/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
;
_this
.
parent
().
next
().
prepend
(
'<li class="pdf-pre-li"><a data-filename="{3}" class="pdf-pre-a" href="javascript:;" title="保存之后才可以点击下载">{2}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
_url
,
'1'
:
decodeURI
(
_url
.
slice
(
_url
.
lastIndexOf
(
'/'
)
+
1
)),
'2'
:
dealFileName
(
decodeURI
(
_url
.
slice
(
_url
.
lastIndexOf
(
'/'
)
+
1
))),
//dealFileName不要忘记
'3'
:
_data
.
data
.
img_path
}));
}
else
{
alert
(
'所选择的格式不正确,请重新选择'
);
return
false
;
}
};
alert
(
_data
.
msg
);
};
},
error
:
function
()
{
alert
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
alert
(
'请求超时,请重试'
);
};
}
});
}
else
{
alert
(
'上传上限为 '
+
_limitTop
);
...
...
@@ -109,9 +121,8 @@ define (['doT', 'text!temp/notice_template_tpl.html','ckfinder','ckfinderStart',
//附件相关
var
_fujianObj
=
$
(
'#fujian_ul'
).
find
(
'li>a.pdf-pre-a'
);
//附件看的是删除按钮的个数
var
_tempArr
=
_fujianObj
[
0
].
href
.
split
(
'/'
);
if
(
_fujianObj
.
length
===
1
)
{
params
[
'annex_file_name'
]
=
_
tempArr
[
_tempArr
.
length
-
1
];
//附件取得是href值
params
[
'annex_file_name'
]
=
_
fujianObj
[
0
].
getAttribute
(
'data-filename'
);
//附件取得是data-filename
};
$
.
ajax
({
...
...
public/resource/js/schoolBusinessNew.js
View file @
c69d0250
define
([
'doT'
,
'text!temp/schoolBusiness_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
,
/*第几页*/
...
...
@@ -72,15 +82,7 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
_this
.
parent
().
html
(
''
).
hide
();
});
//处理文件名,长度过长时处理
function
dealFileName
(
str
)
{
//如果文件超过30的长度,则用*代替
if
(
str
.
length
>
26
)
{
return
str
.
slice
(
0
,
23
)
+
'***'
+
str
.
slice
(
-
4
);
}
else
{
return
str
;
};
};
//图片上传,附件上传处理事件
$
(
".upload-image-btn"
).
click
(
function
()
{
...
...
@@ -118,6 +120,55 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
return
false
;
};
});
//附件上传处理事件
$
(
"#file_input"
).
change
(
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
))
{
var
formData
=
new
FormData
();
formData
.
append
(
'type'
,
'business_school_file'
);
formData
.
append
(
'image'
,
_this
[
0
].
files
[
0
]);
$
.
ajax
({
type
:
'post'
,
url
:
'/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
;
_this
.
parent
().
next
().
prepend
(
'<li class="pdf-pre-li"><a data-filename="{3}" class="pdf-pre-a" href="javascript:;" title="保存之后才可以点击下载">{2}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
_url
,
'1'
:
decodeURI
(
_url
.
slice
(
_url
.
lastIndexOf
(
'/'
)
+
1
)),
'2'
:
dealFileName
(
decodeURI
(
_url
.
slice
(
_url
.
lastIndexOf
(
'/'
)
+
1
))),
//dealFileName不要忘记
'3'
:
_data
.
data
.
img_path
}));
}
else
{
alert
(
_data
.
msg
);
};
},
error
:
function
()
{
alert
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
alert
(
'请求超时,请重试'
);
};
}
});
}
else
{
alert
(
'上传上限为 '
+
_limitTop
);
return
false
;
};
});
//图片,附件上传删除键事件
_doc
.
on
(
'click'
,
'.delet-pic-btn'
,
function
(
e
)
{
...
...
@@ -254,9 +305,8 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
//附件相关
var
_fujianObj
=
$
(
'#fujian_ul'
).
find
(
'li>a.pdf-pre-a'
);
//附件看的是删除按钮的个数
var
_tempArr
=
_fujianObj
[
0
].
href
.
split
(
'/'
);
if
(
_fujianObj
.
length
===
1
)
{
_data
[
'annex_file_name'
]
=
_
tempArr
[
_tempArr
.
length
-
1
];
//附件取得是href值
_data
[
'annex_file_name'
]
=
_
fujianObj
[
0
].
getAttribute
(
'data-filename'
);
//附件取得是data-filename
};
$
.
ajax
({
url
:
'/index/addNews'
,
...
...
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