Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2bc9f226
authored
Jun 27, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
特殊字符编码
parent
ba5f288d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
2 deletions
public/js/order.js
public/js/order.js
View file @
2bc9f226
...
...
@@ -14,6 +14,58 @@
return
true
;
});
// 特殊字符编码
function
specialCode
(
chr
)
{
switch
(
chr
)
{
case
'!'
:
return
'%21'
;
break
;
case
'"'
:
return
'%22'
;
break
;
case
'#'
:
return
'%23'
;
break
;
case
'$'
:
return
'%24'
;
break
;
case
'%'
:
return
'%25'
;
break
;
case
'&'
:
return
'%26'
;
break
;
case
'\''
:
return
'%27'
;
break
;
case
'('
:
return
'%28'
;
break
;
case
')'
:
return
'%29'
;
break
;
case
'*'
:
return
'%2A'
;
break
;
case
'+'
:
return
'%2B'
;
break
;
case
','
:
return
'%2C'
;
break
;
case
'/'
:
return
'%2F'
;
break
;
case
':'
:
return
'%3A'
;
break
;
case
';'
:
return
'%3B'
;
break
;
case
'<'
:
return
'%3C'
;
break
;
case
'='
:
return
'%3D'
;
break
;
case
'>'
:
return
'%3E'
;
break
;
case
'?'
:
return
'%3F'
;
break
;
case
'@'
:
return
'%40'
;
break
;
case
'['
:
return
'%5B'
;
break
;
case
']'
:
return
'%5D'
;
break
;
case
'\\'
:
return
'%5C'
;
break
;
case
'|'
:
return
'%7C'
;
break
;
default
:
return
''
;
break
;
}
}
// 查找特殊字符
function
specialStr
(
str
)
{
var
reg
=
new
RegExp
(
"[!\"#$%&'()*+,/:;<=>?@\\[\\]\\|]"
);
var
len
=
str
.
length
;
var
rs
=
''
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
var
val
=
str
.
substr
(
i
,
1
);
if
(
reg
.
test
(
val
))
{
rs
=
rs
+
specialCode
(
val
);;
}
else
{
rs
=
rs
+
val
;
}
}
return
rs
;
}
$
(
'.searchOrder'
).
click
(
function
(){
var
order_type
=
$
(
'#order_type'
).
data
(
'default'
),
order_contain
=
$
(
'input[name=order_contain]'
).
val
(),
...
...
@@ -33,7 +85,7 @@
listUrl
+=
'?order_type='
+
order_type
;
if
(
order_contain
)
{
listUrl
+=
'&order_contain='
+
escape
(
order_contain
);
listUrl
+=
'&order_contain='
+
specialStr
(
order_contain
);
}
if
(
time_start
){
...
...
@@ -245,7 +297,7 @@
listUrl
+=
'?order_type='
+
order_type
;
if
(
order_contain
)
{
listUrl
+=
'&order_contain='
+
order_contain
;
listUrl
+=
'&order_contain='
+
specialStr
(
order_contain
)
;
}
if
(
time_start
){
...
...
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