Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
jd-vx-app
Commits
37156ead
Commit
37156ead
authored
May 21, 2022
by
肖健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定京东账号
parent
599ff6e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
23 deletions
+70
-23
home.vue
pages/home.vue
+34
-11
config.js
pages/login/config.js
+1
-1
main.vue
pages/main.vue
+35
-11
No files found.
pages/home.vue
View file @
37156ead
...
@@ -69,7 +69,14 @@
...
@@ -69,7 +69,14 @@
};
};
},
},
methods
:
{
methods
:
{
goJdLogin
(){
let
returnPage
=
'/pages/main'
;
uni
.
navigateTo
({
url
:
"/pages/login/index/index"
})
},
getPrice
()
{
getPrice
()
{
let
that
=
this
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
)
{
if
(
!
token
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
...
@@ -81,20 +88,36 @@
...
@@ -81,20 +88,36 @@
url
:
'/app/user/info'
,
url
:
'/app/user/info'
,
method
:
'get'
method
:
'get'
}
}
th
is
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
th
at
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
let
freeMoveFlag
=
res
.
data
.
data
.
freeMoveFlag
let
freeMoveFlag
=
res
.
data
.
data
.
freeMoveFlag
if
(
freeMoveFlag
)
{
let
bindPin
=
res
.
data
.
data
.
bindPin
uni
.
showToast
({
title
:
"您的免费领取次数已用完"
,
if
(
!
bindPin
)
{
icon
:
'none'
,
uni
.
showModal
({
duration
:
2000
,
title
:
"未绑定账号"
,
});
content
:
"您没有绑定京东账号,请绑定后再领取"
,
}
else
{
success
:
function
(
res
){
//跳转到领取优惠卷页面
if
(
res
.
confirm
)
{
uni
.
navigateTo
({
that
.
goJdLogin
()
url
:
'/pagesA/pages/index/getPrice?orderId='
+
this
.
freeCode
.
id
}
}
});
});
// if (freeMoveFlag) {
// uni.showToast({
// title: "您的免费领取次数已用完",
// icon: 'none',
// duration: 2000,
// success:function(){
// }
// });
// } else {
// //跳转到领取优惠卷页面
// uni.navigateTo({
// url: '/pagesA/pages/index/getPrice?orderId=' + this.freeCode.id
// });
// }
}
}
}
}
})
})
...
...
pages/login/config.js
View file @
37156ead
export
let
config
=
{
export
let
config
=
{
appid
:
1814
,
appid
:
1814
,
returnPage
:
undefined
,
returnPage
:
'/pages/main'
,
pageType
:
undefined
,
pageType
:
undefined
,
isLogout
:
1
,
isLogout
:
1
,
noWXinfo
:
1
,
noWXinfo
:
1
,
...
...
pages/main.vue
View file @
37156ead
...
@@ -44,7 +44,6 @@ export default {
...
@@ -44,7 +44,6 @@ export default {
})
})
},
},
onShow
:
function
()
{
onShow
:
function
()
{
console
.
log
(
plugin
.
getPtKey
(),
1111111
)
uni
.
hideHomeButton
()
uni
.
hideHomeButton
()
if
(
this
.
tab
==
'personal'
){
if
(
this
.
tab
==
'personal'
){
this
.
$refs
.
personal
.
getUserInfo
();
this
.
$refs
.
personal
.
getUserInfo
();
...
@@ -59,18 +58,11 @@ export default {
...
@@ -59,18 +58,11 @@ export default {
}
}
},
},
methods
:
{
methods
:
{
goLogin
(){
let
returnPage
=
'/pages/main'
;
uni
.
navigateTo
({
url
:
"/pages/login/index/index?returnPage="
+
returnPage
})
},
tabChange
(
index
)
{
tabChange
(
index
)
{
let
that
=
this
let
that
=
this
switch
(
index
)
{
switch
(
index
)
{
case
0
:
case
0
:
this
.
tab
=
'index'
this
.
tab
=
'index'
this
.
goLogin
()
break
;
break
;
case
1
:
case
1
:
this
.
tab
=
'moveCar'
this
.
tab
=
'moveCar'
...
@@ -153,17 +145,49 @@ export default {
...
@@ -153,17 +145,49 @@ export default {
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
let
that
=
this
if
(
option
&&
option
.
index
){
if
(
option
&&
option
.
index
){
th
is
.
$nextTick
(()
=>
{
th
at
.
$nextTick
(()
=>
{
let
i
=
parseInt
(
option
.
index
);
let
i
=
parseInt
(
option
.
index
);
if
(
!
i
){
if
(
!
i
){
i
=
0
;
i
=
0
;
}
}
th
is
.
tabChange
(
i
)
th
at
.
tabChange
(
i
)
th
is
.
$refs
.
myTab
.
current
=
i
;
th
at
.
$refs
.
myTab
.
current
=
i
;
});
});
}
}
let
ptKey
=
plugin
.
getPtKey
();
if
(
ptKey
)
{
plugin
.
isvObfuscator
({
url
:
'https://wxapplogin2.m.jd.com/cgi-bin/login/isv/isvObfuscator'
}).
then
(
res
=>
{
let
{
token
,
message
}
=
res
;
if
(
!
token
)
{
uni
.
showToast
({
title
:
`京东登录失败:
${
message
}
`
,
icon
:
'none'
,
duration
:
2000
});
}
else
{
let
opts
=
{
url
:
'/app/user/bind/jd'
,
method
:
'post'
}
that
.
http
.
httpTokenRequest
(
opts
,
{
'token'
:
token
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
uni
.
showToast
({
title
:
"京东账号绑定成功"
,
icon
:
'none'
,
duration
:
1000
});
}
})
}
}).
catch
(
err
=>
{
console
.
log
(
'err'
,
err
)
})
}
},
},
}
}
</
script
>
</
script
>
...
...
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