Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uc_card
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhoujun
uc_card
Commits
514a378f
Commit
514a378f
authored
Jun 07, 2021
by
zhoujun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of
http://gitlab.cccwangluo.com/zhoujun/uc_card
into test
parents
b2cc8745
0762ec65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
src/resources/views/card/card.blade.php
src/resources/views/card/card.blade.php
+5
-2
No files found.
src/resources/views/card/card.blade.php
View file @
514a378f
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
@if($userImgStatus == -1)
<img
src=
"{{ asset('postcard/images/img_add.jpg') }}"
class=
"img img-add"
alt=
""
>
@if($userImgStatus == -1)
<img
src=
"{{ asset('postcard/images/img_add.jpg') }}"
class=
"img img-add"
alt=
""
>
<input
type=
"file"
id=
"file"
>
@endif
<input
type=
"file"
id=
"file"
>
@endif
@if($userImgStatus == 0)
<img
src=
"{{ asset('postcard/images/img_sh.jpg') }}"
class=
"img img-sh"
alt=
""
>
@endif
@if($userImgStatus == 0)
<img
src=
"{{ asset('postcard/images/img_sh.jpg') }}"
class=
"img img-sh"
alt=
""
>
@endif
@if($userImgStatus == 1)
<img
src=
"{{ $userImg }}"
class=
"img img-sh"
alt=
""
>
@endif
@if($userImgStatus == 1)
<img
src=
"{{ $userImg }}
?t=129094392478
"
class=
"img img-sh"
alt=
""
>
@endif
@if($userImgStatus == 2)
<img
src=
"{{ asset('postcard/images/sh_fail.jpg') }}"
class=
"img img-sh"
alt=
""
>
@if($userImgStatus == 2)
<img
src=
"{{ asset('postcard/images/sh_fail.jpg') }}"
class=
"img img-sh"
alt=
""
>
<input
type=
"file"
id=
"file"
>
@endif
<input
type=
"file"
id=
"file"
>
@endif
</div>
</div>
...
@@ -182,6 +182,7 @@
...
@@ -182,6 +182,7 @@
var
file
=
$
(
"
#file
"
)[
0
].
files
[
0
];
var
file
=
$
(
"
#file
"
)[
0
].
files
[
0
];
var
acceptFileTypes
=
/^image
\/(
gif|jpe
?
g|png
)
$/i
;
var
acceptFileTypes
=
/^image
\/(
gif|jpe
?
g|png
)
$/i
;
var
roleId
=
getQueryString
(
'
roleId
'
);
var
roleId
=
getQueryString
(
'
roleId
'
);
var
serverId
=
getQueryString
(
'
serverId
'
);
//文件类型判断
//文件类型判断
if
(
file
.
type
.
length
&&
!
acceptFileTypes
.
test
(
file
.
type
))
{
if
(
file
.
type
.
length
&&
!
acceptFileTypes
.
test
(
file
.
type
))
{
alert
(
'
请上传gif、jpg、jpeg或png格式的文件
'
);
alert
(
'
请上传gif、jpg、jpeg或png格式的文件
'
);
...
@@ -194,6 +195,7 @@
...
@@ -194,6 +195,7 @@
}
}
formData
.
append
(
"
imgFile
"
,
file
);
formData
.
append
(
"
imgFile
"
,
file
);
formData
.
append
(
"
roleId
"
,
roleId
);
formData
.
append
(
"
roleId
"
,
roleId
);
formData
.
append
(
"
serverId
"
,
serverId
);
formData
.
append
(
"
_token
"
,
"
{{ csrf_token() }}
"
)
formData
.
append
(
"
_token
"
,
"
{{ csrf_token() }}
"
)
$
.
ajax
({
$
.
ajax
({
url
:
"
/upload/img
"
,
url
:
"
/upload/img
"
,
...
@@ -216,13 +218,14 @@
...
@@ -216,13 +218,14 @@
function
baseImageUrl
()
{
function
baseImageUrl
()
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
html2canvas
(
document
.
querySelector
(
"
#test
"
),
{
//关键在于new
html2canvas
(
document
.
querySelector
(
"
#test
"
),
{
//关键在于new
useCORS
:
true
,
removeContainer
:
true
,
removeContainer
:
true
,
allowTaint
:
false
,
allowTaint
:
false
,
width
:
window
.
screen
.
availWidth
,
width
:
window
.
screen
.
availWidth
,
windowWidth
:
document
.
body
.
scrollWidth
,
windowWidth
:
document
.
body
.
scrollWidth
,
x
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
useCORS
:
true
,
logging
:
true
}).
then
(
canvas
=>
{
}).
then
(
canvas
=>
{
var
image
=
canvas
.
toDataURL
(
'
image/jpeg
'
,
1.0
);
var
image
=
canvas
.
toDataURL
(
'
image/jpeg
'
,
1.0
);
var
img
=
'
<img src="
'
+
image
+
'
">
'
;
var
img
=
'
<img src="
'
+
image
+
'
">
'
;
...
...
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