Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
allCampaign
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
allCampaign
Commits
7bee0d9c
Commit
7bee0d9c
authored
Nov 22, 2019
by
Chao Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购买獴哥添加渠道
parent
bb9e5847
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
34 deletions
+51
-34
consulting/js/base.js
+51
-34
No files found.
consulting/js/base.js
View file @
7bee0d9c
...
@@ -26,6 +26,27 @@ $(function () {
...
@@ -26,6 +26,27 @@ $(function () {
$
(
"#phone,#name,#code"
).
blur
(
function
()
{
$
(
"#phone,#name,#code"
).
blur
(
function
()
{
window
.
scrollTo
(
0
,
0
);
window
.
scrollTo
(
0
,
0
);
})
})
$
(
".right"
).
click
(
function
()
{
if
(
getQueryString
(
'source'
))
{
$
(
'.modalBox'
).
hide
();
goTopay
()
}
else
{
$
(
"#phone"
).
val
(
''
)
$
(
"#code"
).
val
(
''
)
$
(
"#name"
).
val
(
''
)
$
(
'.modalBox'
).
show
();
}
})
$
(
'.closeModal'
).
click
(
function
()
{
$
(
'.modalBox'
).
hide
();
})
if
(
getQueryString
(
'hmsr'
)
||
getQueryString
(
'hmpl'
)
||
getQueryString
(
'hmkw'
)
||
getQueryString
(
'hmci'
))
{
window
.
localStorage
.
setItem
(
'hmsr'
,
getQueryString
(
'hmsr'
))
window
.
localStorage
.
setItem
(
'hmpl'
,
getQueryString
(
'hmpl'
))
window
.
localStorage
.
setItem
(
'hmkw'
,
getQueryString
(
'hmkw'
))
window
.
localStorage
.
setItem
(
'hmci'
,
getQueryString
(
'hmci'
))
}
function
getToken
()
{
function
getToken
()
{
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
...
@@ -43,6 +64,33 @@ $(function () {
...
@@ -43,6 +64,33 @@ $(function () {
}
}
var
token
=
getToken
();
var
token
=
getToken
();
//解密来源
getChannel
()
function
getChannel
()
{
if
(
getQueryString
(
'source'
))
{
$
.
ajax
({
type
:
"POST"
,
url
:
api
+
'/api/activity/getActivityOrderInfo'
,
contentType
:
"application/json"
,
data
:
JSON
.
stringify
({
encryptData
:
getQueryString
(
'source'
)
}),
async
:
false
,
headers
:
{
"X-Authorization"
:
token
},
success
:
function
(
res
)
{
if
(
res
[
'success'
])
{
res
=
res
[
'data'
];
window
.
localStorage
.
setItem
(
'hmsr'
,
res
[
'channelLaunchAD'
][
'hmsr'
])
window
.
localStorage
.
setItem
(
'hmpl'
,
res
[
'channelLaunchAD'
][
'hmpl'
])
window
.
localStorage
.
setItem
(
'hmkw'
,
res
[
'channelLaunchAD'
][
'hmkw'
])
window
.
localStorage
.
setItem
(
'hmci'
,
res
[
'channelLaunchAD'
][
'hmci'
])
param
.
name
=
res
[
'name'
];
param
.
phone
=
res
[
'mobileNo'
];
param
.
customerId
=
res
[
'customerId'
];
}
}
})
}
}
function
checkDeviceType
()
{
function
checkDeviceType
()
{
if
(
/Android|webOS|iPhone|iPod|BlackBerry/i
.
test
(
navigator
.
userAgent
))
{
if
(
/Android|webOS|iPhone|iPod|BlackBerry/i
.
test
(
navigator
.
userAgent
))
{
if
(
navigator
.
userAgent
.
toLowerCase
().
indexOf
(
'micromessenger'
)
!==
-
1
)
{
if
(
navigator
.
userAgent
.
toLowerCase
().
indexOf
(
'micromessenger'
)
!==
-
1
)
{
...
@@ -55,7 +103,6 @@ $(function () {
...
@@ -55,7 +103,6 @@ $(function () {
}
}
return
deviceType
;
return
deviceType
;
}
}
var
deviceType
=
checkDeviceType
();
var
deviceType
=
checkDeviceType
();
param
.
deviceType
=
deviceType
;
param
.
deviceType
=
deviceType
;
//获取产品价格
//获取产品价格
...
@@ -65,13 +112,9 @@ $(function () {
...
@@ -65,13 +112,9 @@ $(function () {
type
:
"POST"
,
type
:
"POST"
,
url
:
api
+
'/api/voucherInfoQuery'
,
url
:
api
+
'/api/voucherInfoQuery'
,
contentType
:
"application/json"
,
contentType
:
"application/json"
,
data
:
JSON
.
stringify
({
data
:
JSON
.
stringify
({
planId
:
424
}),
planId
:
424
}),
async
:
false
,
async
:
false
,
headers
:
{
headers
:
{
"X-Authorization"
:
token
},
"X-Authorization"
:
token
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
[
'data'
])
{
if
(
res
[
'data'
])
{
$
(
".nowPrice"
).
html
(
res
[
'data'
][
'voucherSalePrice'
])
$
(
".nowPrice"
).
html
(
res
[
'data'
][
'voucherSalePrice'
])
...
@@ -82,29 +125,6 @@ $(function () {
...
@@ -82,29 +125,6 @@ $(function () {
})
})
return
nowPrice
return
nowPrice
}
}
$
(
".right"
).
click
(
function
()
{
if
(
getQueryString
(
'name'
)
&&
getQueryString
(
'customerId'
)
&&
getQueryString
(
'mobileNo'
))
{
$
(
'.modalBox'
).
hide
();
goTopay
()
}
else
{
$
(
"#phone"
).
val
(
''
)
$
(
"#code"
).
val
(
''
)
$
(
"#name"
).
val
(
''
)
$
(
'.modalBox'
).
show
();
}
})
$
(
'.closeModal'
).
click
(
function
()
{
$
(
'.modalBox'
).
hide
();
})
if
(
getQueryString
(
'hmsr'
)
||
getQueryString
(
'hmpl'
)
||
getQueryString
(
'hmkw'
)
||
getQueryString
(
'hmci'
))
{
window
.
localStorage
.
setItem
(
'hmsr'
,
getQueryString
(
'hmsr'
))
window
.
localStorage
.
setItem
(
'hmpl'
,
getQueryString
(
'hmpl'
))
window
.
localStorage
.
setItem
(
'hmkw'
,
getQueryString
(
'hmkw'
))
window
.
localStorage
.
setItem
(
'hmci'
,
getQueryString
(
'hmci'
))
}
function
getQueryString
(
name
)
{
function
getQueryString
(
name
)
{
const
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
);
const
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
);
const
r
=
decodeURIComponent
(
gitUrlParam
).
substr
(
1
).
match
(
reg
);
const
r
=
decodeURIComponent
(
gitUrlParam
).
substr
(
1
).
match
(
reg
);
...
@@ -298,10 +318,7 @@ $(function () {
...
@@ -298,10 +318,7 @@ $(function () {
}
}
function
goTopay
()
{
function
goTopay
()
{
if
(
getQueryString
(
'name'
)
&&
getQueryString
(
'customerId'
)
&&
getQueryString
(
'mobileNo'
))
{
if
(
getQueryString
(
'source'
))
{
param
.
customerId
=
getQueryString
(
'customerId'
);
param
.
name
=
getQueryString
(
'name'
);
param
.
phone
=
getQueryString
(
'mobileNo'
);
param
.
verificationCodeValider
=
true
;
param
.
verificationCodeValider
=
true
;
}
else
{
}
else
{
param
.
name
=
$
(
"#name"
).
val
();
param
.
name
=
$
(
"#name"
).
val
();
...
...
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