Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
citic-mdrt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c3fcd7d8
authored
Apr 21, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
76c05635
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
Public/static/js/common.js
+21
-15
No files found.
Public/static/js/common.js
View file @
c3fcd7d8
...
@@ -67,6 +67,13 @@ let noInfo = {
...
@@ -67,6 +67,13 @@ let noInfo = {
let
createPosterLock
=
false
;
let
createPosterLock
=
false
;
let
level
=
0
;
preloadimages
(
preloadImageList
,
function
()
{
preloadimages
(
preloadImageList
,
function
()
{
initPage
();
initPage
();
$
(
'.page1'
).
show
();
$
(
'.page1'
).
show
();
...
@@ -75,9 +82,9 @@ preloadimages(preloadImageList, function () {
...
@@ -75,9 +82,9 @@ preloadimages(preloadImageList, function () {
$
(
'input[name=job-number]'
).
attr
(
'placeholder'
,
'请输入工号'
).
attr
(
'type'
,
'tel'
);
$
(
'input[name=job-number]'
).
attr
(
'placeholder'
,
'请输入工号'
).
attr
(
'type'
,
'tel'
);
// blackUrl = $('.black').css('background-image').replace(/^url\((['"]?)(.*)\1\)$/, '$2');
// blackUrl = $('.black').css('background-image').replace(/^url\((['"]?)(.*)\1\)$/, '$2');
// $('.black').css('background-image', 'none');
// $('.black').css('background-image', 'none');
// let canvasinfo = initCanvas('.black', 'uploadCanvas', 259, 259
);
let
canvasinfo
=
initCanvas
(
'.upload-canvas-block'
,
'uploadCanvas'
,
640
,
1238
);
//
uploadCanvas = canvasinfo[0];
uploadCanvas
=
canvasinfo
[
0
];
//
uploadCtx = canvasinfo[1];
uploadCtx
=
canvasinfo
[
1
];
},
function
(
progress
)
{});
},
function
(
progress
)
{});
...
@@ -93,17 +100,16 @@ $(document).ready(function () {
...
@@ -93,17 +100,16 @@ $(document).ready(function () {
//提交信息
//提交信息
$
(
'.page1 .btn-next'
).
on
(
'click'
,
checkInfo
);
$
(
'.page1 .btn-next'
).
on
(
'click'
,
checkInfo
);
// $('input[name=btn-upload]').change(function () {
$
(
'input[name=btn-upload]'
).
change
(
function
()
{
// $('.regulate-block').show();
imgInfo
=
{};
// imgInfo = {};
img
=
''
;
// img = '';
bindUpload
(
this
,
uploadCtx
,
uploadCanvas
,
1
,
function
(
img
)
{
// bindUpload(this, uploadCtx, uploadCanvas, 1, function (img) {
avatar
=
img
;
// avatar = img;
var
mc
=
new
Hammer
(
$
(
'#uploadCanvas'
).
get
(
0
));
// var mc = new Hammer($('#uploadCanvas').get(0));
bindMc
(
mc
,
uploadCtx
,
uploadCanvas
,
img
,
imgInfo
);
// bindMc(mc, uploadCtx, uploadCanvas, img, imgInfo);
},
imgInfo
);
// }, imgInfo);
return
false
;
// return false;
});
// });
// $('.btn-retry').on('click', () => {
// $('.btn-retry').on('click', () => {
// $('input[name=btn-upload]').click()
// $('input[name=btn-upload]').click()
// });
// });
...
@@ -143,6 +149,7 @@ function checkInfo() {
...
@@ -143,6 +149,7 @@ function checkInfo() {
},
},
success
:
function
(
resp
)
{
success
:
function
(
resp
)
{
if
(
resp
.
status
==
1
)
{
if
(
resp
.
status
==
1
)
{
level
=
resp
.
poster
;
toUploadPage
();
toUploadPage
();
}
else
{
}
else
{
$
(
'#notification_area'
).
remove
();
$
(
'#notification_area'
).
remove
();
...
@@ -531,7 +538,6 @@ function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) {
...
@@ -531,7 +538,6 @@ function initCanvas(target, id, canvasWidth, canvasHeight, useRem = false) {
canvasWidth
=
pxToRem
(
canvasWidth
);
canvasWidth
=
pxToRem
(
canvasWidth
);
canvasHeight
=
pxToRem
(
canvasHeight
);
canvasHeight
=
pxToRem
(
canvasHeight
);
}
}
black
=
loadedImages
[
blackUrl
];
$
(
target
).
append
(
$
(
'<canvas id="'
+
id
+
'" width="'
+
canvasWidth
+
'" height="'
+
canvasHeight
+
'"></canvas>'
));
$
(
target
).
append
(
$
(
'<canvas id="'
+
id
+
'" width="'
+
canvasWidth
+
'" height="'
+
canvasHeight
+
'"></canvas>'
));
canvas
=
$
(
'#'
+
id
)[
0
];
canvas
=
$
(
'#'
+
id
)[
0
];
ctx
=
canvas
.
getContext
(
"2d"
);
ctx
=
canvas
.
getContext
(
"2d"
);
...
...
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