Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
pingan-promise
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
437528eb
authored
Mar 10, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
245f2c25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
+39
-3
Public/static/js/common.js
+39
-3
No files found.
Public/static/js/common.js
View file @
437528eb
...
...
@@ -47,8 +47,8 @@ if ($('div').length > 0) {
$
(
'.page1'
).
show
();
$
(
'input[name=name]'
).
attr
(
'placeholder'
,
'姓名'
);
$
(
'input[name=business]'
).
attr
(
'placeholder'
,
'业务号'
);
$
(
'input[name=name]'
).
attr
(
'placeholder'
,
'姓名'
)
.
attr
(
'id'
,
'name'
);
;
$
(
'input[name=business]'
).
attr
(
'placeholder'
,
'业务号'
)
.
attr
(
'type'
,
'number'
).
attr
(
'maxlength'
,
10
)
;
$
(
'.page1 .num'
).
html
(
'已有 <span class="numbig">'
+
window
.
num
+
'</span> 人发起承诺'
);
//上传canvas定义
...
...
@@ -95,9 +95,15 @@ $(document).ready(function () {
});
$
(
'.btn-retry'
).
on
(
'click'
,
()
=>
{
$
(
'input[name=btn-upload]'
).
click
()
})
});
//署名输入框限制长度事件
$
(
'.page1 input[name=name]'
).
on
(
'input propertychange'
,
inputLength
);
});
function
inputLength
()
{
checkIt
(
'name'
,
4
);
}
function
bindMc
(
mc
,
ctx
,
myCanvas
,
img
,
imgInfo
)
{
mc
.
get
(
'pan'
).
set
({
direction
:
Hammer
.
DIRECTION_ALL
...
...
@@ -253,4 +259,33 @@ function RandomNumBoth(Min, Max) {
var
Rand
=
Math
.
random
();
var
num
=
Min
+
Math
.
round
(
Rand
*
Range
);
//四舍五入
return
num
;
}
function
checkIt
(
bind
,
maxNum
)
{
if
(
agreeSuggestion
)
{
var
v
=
document
.
getElementById
(
bind
).
value
;
if
(
v
==
""
)
{
return
[];
}
var
len
=
0
;
//中英字符长度计数
//计算
for
(
i
=
0
;
i
<
v
.
length
;
i
++
)
{
var
c
=
v
.
charCodeAt
(
i
);
if
((
c
>=
0x0001
&&
c
<=
0x007e
)
||
(
0xff60
<=
c
&&
c
<=
0xff9f
))
//英文字母状态
{
len
++
;
}
else
//中文状态
{
len
+=
2
;
}
if
(
len
>=
maxNum
)
{
if
(
i
!=
v
.
length
-
1
)
{
$
(
"#"
+
bind
).
val
(
v
.
substr
(
0
,
i
+
1
))
break
;
}
}
}
}
else
{
$
(
"#"
+
bind
).
val
(
''
);
}
}
\ No newline at end of file
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