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
1766eb3a
Commit
1766eb3a
authored
Jul 05, 2018
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收款记录修改
parent
ce9449d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
58 deletions
+30
-58
getCollection.html
application/index/view/collection/getCollection.html
+3
-5
getCollection.js
public/resource/js/getCollection.js
+27
-53
No files found.
application/index/view/collection/getCollection.html
View file @
1766eb3a
...
...
@@ -168,11 +168,6 @@
.hide
{
display
:
none
!important
;
}
.result
,
.result2
{
width
:
600px
;
}
.result
>
img
,
.result2
>
img
{
width
:
200px
;
height
:
200px
;
...
...
@@ -196,6 +191,9 @@
left
:
60px
;
}
.span-del2
,
.span-del
{
color
:
red
;
}
/*css样式*/
</style>
<div
id=
"page-content-wrapper"
>
...
...
public/resource/js/getCollection.js
View file @
1766eb3a
...
...
@@ -6,7 +6,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
/*每页显示多少条*/
id
:
''
,
house_id
:
''
,
house_fatherid
:
''
,
house_fatherid
:
''
,
type
:
''
,
valueCurrent
:
''
,
ajaxObj
:
''
,
...
...
@@ -23,36 +23,6 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
},
event
:
function
()
{
var
_doc
=
$
(
document
);
// 收款图片上传多张图片
// window.onload = function(){
// var input = document.getElementById("file_input");
// var result,div;
//
// if(typeof FileReader==='undefined'){
// result.innerHTML = "抱歉,你的浏览器不支持 FileReader";
// input.setAttribute('disabled','disabled');
// }else{
// input.addEventListener('change',readFile,false);
// }
// function readFile(){
// for(var i=0;i<this.files.length;i++){
// if (!input['value'].match(/.jpg|.gif|.png|.bmp/i)){ //判断上传文件格式
// return alert("上传的图片格式不正确,请重新选择")
// }
// var reader = new FileReader();
// reader.readAsDataURL(this.files[i]);
// reader.onload = function(e){
// result = '<div id="result"><img src="'+this.result+'" alt=""/></div>';
// div = document.createElement('div');
// div.innerHTML = result;
// document.getElementById('body').appendChild(div); //插入dom树 <br> }
// }
// }
// };
// $('.span-del').click(function(){
// console.log(55);
// $(this).parent().remove();
// });
_doc
.
on
(
'click'
,
'.span-del'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
...
...
@@ -126,23 +96,28 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
e
.
preventDefault
();
e
.
stopPropagation
();
var
imgname
=
[];
for
(
var
i
=
0
;
i
<
$
(
'.result'
).
length
;
i
++
)
{
imgname
[
i
]
=
$
(
'.result>img'
).
get
(
i
).
getAttribute
(
"class"
);
var
imgname
=
[];
for
(
var
i
=
0
;
i
<
$
(
'.result'
).
length
;
i
++
)
{
imgname
[
i
]
=
$
(
'.result>img'
).
get
(
i
).
getAttribute
(
"class"
);
}
console
.
log
(
imgname
.
join
(
','
));
var
id_pic
;
if
(
follow
.
house_fatherid
>
0
)
{
id_pic
=
follow
.
house_fatherid
;
}
else
{
id_pic
=
follow
.
house_id
;
if
(
follow
.
house_fatherid
>
0
)
{
id_pic
=
follow
.
house_fatherid
;
}
else
{
id_pic
=
follow
.
house_id
;
}
var
_data
=
{
img_id
:
id_pic
,
img_name
:
imgname
.
join
(
','
)
};
//无新的图片上传 不调用接口
if
(
imgname
.
join
(
','
))
{
_data
[
'img_name'
]
=
imgname
.
join
(
','
);
}
else
{
return
}
$
.
ajax
({
type
:
'GET'
,
url
:
'/index/addReceiptImg'
,
...
...
@@ -159,7 +134,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
error
:
function
()
{
alert
(
'enter error'
);
},
complete
:
function
(
xhr
,
textStatus
)
{
complete
:
function
(
xhr
,
textStatus
)
{
if
(
textStatus
===
'timeout'
)
{
//处理超时的逻辑
alert
(
'请求超时,请重试'
);
...
...
@@ -224,7 +199,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
'type'
:
'POST'
,
'url'
:
'/index/deleteReceiptImg'
,
data
:
{
id
:
n
id
:
n
},
dataType
:
"json"
,
success
:
function
(
data
)
{
...
...
@@ -235,13 +210,13 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
});
},
getaddPicList
:
function
()
{
//获取收款图片
// container_body
getaddPicList
:
function
()
{
//获取收款图片
// container_body
var
id_pic
;
if
(
follow
.
house_fatherid
>
0
)
{
id_pic
=
follow
.
house_fatherid
;
}
else
{
id_pic
=
follow
.
house_id
;
if
(
follow
.
house_fatherid
>
0
)
{
id_pic
=
follow
.
house_fatherid
;
}
else
{
id_pic
=
follow
.
house_id
;
}
$
(
'.result2,.result'
).
remove
();
...
...
@@ -256,13 +231,12 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
//渲染已经有的列表
for
(
i
=
0
;
i
<
data
.
data
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
data
.
data
.
length
;
i
++
)
{
var
result
=
'<div class="result2"><img class="'
+
data
.
data
[
i
].
id
+
'" src="'
+
data
.
data
[
i
].
img_name
+
'" alt=""/> <span class="span-del2">删除</span></div>'
;
div
=
document
.
createElement
(
'div'
);
div
.
innerHTML
=
result
;
document
.
getElementById
(
'container_body'
).
appendChild
(
div
);
}
}
}
else
{}
}
...
...
@@ -278,6 +252,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
}
else
{
input
.
addEventListener
(
'change'
,
readFile
,
false
);
};
function
readFile
()
{
console
.
log
(
this
.
files
);
for
(
var
i
=
0
;
i
<
this
.
files
.
length
;
i
++
)
{
...
...
@@ -322,8 +297,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
alert
(
'请求超时,请重试'
);
};
}
});
});
}
};
};
...
...
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