Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
biao
9 years ago
Commit
3683a4dc8faec8e84fcad0d607f44dfe23ab5b56
1 parent
4fd35c03
update for delete img
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
2 deletions
public/js/me/exchange.page.js
public/scss/me/return/_change.css
public/tpl/me/thumbnail.hbs
public/js/me/exchange.page.js
View file @
3683a4d
...
...
@@ -14,6 +14,8 @@ var phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
var
validate
=
require
(
'./order/validation'
);
var
imgBoxTpl
=
require
(
'../../tpl/me/thumbnail.hbs'
);
var
validateMap
=
{
user
:
{
sl
:
'#user'
,
...
...
@@ -400,6 +402,17 @@ function initAddr(areaCode) {
}
}
function
bindImgDeleteEvent
()
{
$
(
'.operation-box .delete'
).
off
(
'click'
).
on
(
'click'
,
function
()
{
var
$thumb
=
$
(
this
).
closest
(
'.thumb-box'
);
var
$t
=
$thumb
.
siblings
(
'.img-up-tip'
);
var
number
=
$
(
'.thumb-box'
).
length
-
1
;
$t
.
text
(
number
+
'/4'
);
$thumb
.
remove
();
});
}
function
bindUploadEvent
()
{
var
$tip
=
$
(
'.img-up-tip'
);
...
...
@@ -419,12 +432,13 @@ function bindUploadEvent() {
var
$t
;
if
(
result
.
code
===
200
)
{
img
=
'<img class="envidence" src="'
+
result
.
data
+
'" alt="凭证图片">'
;
img
=
imgBoxTpl
({
src
:
result
.
data
})
;
$t
=
$
(
that
).
next
(
'.img-up-tip'
);
$
(
that
).
before
(
img
);
number
+=
1
;
$t
.
text
(
number
+
'/4'
);
bindImgDeleteEvent
();
}
else
{
new
_alert
(
result
.
message
).
show
();
}
...
...
public/scss/me/return/_change.css
View file @
3683a4d
...
...
@@ -21,6 +21,36 @@
}
}
.thumb-box
{
position
:
relative
;
float
:
left
;
.operation-box
{
display
:
none
;
width
:
60px
;
padding
:
5px
0
;
position
:
absolute
;
top
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,
0.6
);
text-align
:
center
;
font-size
:
12px
;
.delete
{
cursor
:
pointer
;
}
*
{
color
:
#fff
!important
;
}
}
&
:hover
{
.operation-box
{
display
:
block
;
}
}
}
.iconfont
{
&.checkbox
{
position
:
relative
;
...
...
@@ -178,6 +208,5 @@
width
:
60px
;
height
:
60px
;
margin-right
:
10px
;
float
:
left
;
}
}
...
...
public/tpl/me/thumbnail.hbs
0 → 100644
View file @
3683a4d
<div
class=
"thumb-box"
>
<img
class=
"envidence"
src=
"
{{
src
}}
"
alt=
"凭证图片"
>
<div
class=
"operation-box"
>
<a
href=
"
{{
src
}}
"
target=
"_blank"
>
查看
</a>
<span
class=
"delete"
>
删除
</span>
</div>
</div>
...
...
Please
register
or
login
to post a comment