Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
51a24553
Commit
51a24553
authored
May 29, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify: 取参
parent
60fa3237
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
45 deletions
+48
-45
app.json
src/app.json
+2
-3
authorization-modal.js
src/component/authorization-modal/authorization-modal.js
+26
-29
Http.js
src/utils/Http.js
+4
-4
wxService.js
src/utils/wxService.js
+16
-9
No files found.
src/app.json
View file @
51a24553
...
...
@@ -21,8 +21,6 @@
"navigationBarTextStyle"
:
"black"
},
"navigateToMiniProgramAppIdList"
:
[
"wxeb490c6f9b154ef9"
,
"wx8e84d264b42cae80"
,
"wx3661dec4a09553f1"
"wxeb490c6f9b154ef9"
]
}
\ No newline at end of file
src/component/authorization-modal/authorization-modal.js
View file @
51a24553
...
...
@@ -41,34 +41,31 @@ Component({
})
const
userInfo
=
res
.
detail
||
{}
if
(
res
.
detail
.
userInfo
)
{
console
.
log
(
'点击
了同意
'
)
this
.
setUserInfo
()
// let token = buyer-token;
utils
.
getUserInfoByBtn
(
userInfo
).
then
(({
token
=
''
,
data
=
{}
})
=>
{
console
.
log
(
'点击
授权
'
)
utils
.
getUserInfoByBtn
(
userInfo
).
then
(
(
data
=
{}
)
=>
{
const
{
token
}
=
data
wx
.
setStorageSync
(
'_accreditUserInfo'
,
userInfo
)
wx
.
hideNavigationBarLoading
()
if
(
token
)
{
// app.globalData.userNo = token.split('###')[0]
wx
.
setStorageSync
(
'token'
,
token
)
}
else
{
wx
.
setStorageSync
(
'token'
,
''
)
}
if
(
data
&&
data
.
isMember
===
'1'
)
{
app
.
globalData
.
openCard
=
true
app
.
globalData
.
userInfo
=
wx
.
getStorageSync
(
'_userInfo'
)
cEvent
.
notify
(
'openCardSuccess'
,
data
)
}
wx
.
setStorageSync
(
'_baseUserInfo'
,
data
)
this
.
setUserInfo
()
}).
catch
(
err
=>
{
if
(
err
&&
err
.
rspCode
===
-
1
)
{
}).
catch
(
err
=>
{
if
(
err
)
{
wx
.
showToast
({
title
:
`会员系统异常请稍后重试!`
,
icon
:
'none'
})
}
})
}
else
{
console
.
log
(
'点击了取消'
)
this
.
setData
({
...
...
@@ -86,23 +83,23 @@ Component({
return
false
}
const
urls
=
getCurrentPages
()
setTimeout
(()
=>
{
const
item
=
urls
[
0
].
options
if
(
item
.
route
)
{
try
{
const
options
=
JSON
.
parse
(
item
.
options
)
wxService
.
router
(
`/
${
item
.
route
}
`
).
search
(
options
).
replace
()
}
catch
(
e
)
{
wx
.
switchTab
({
url
:
'/pages/userCenter/userCenter'
})
}
}
else
{
wx
.
switchTab
({
url
:
'/pages/userCenter/userCenter'
})
}
},
200
)
//
setTimeout(() => {
//
const item = urls[0].options
//
if (item.route) {
//
try {
//
const options = JSON.parse(item.options)
//
wxService.router(`/${item.route}`).search(options).replace()
//
} catch (e) {
//
wx.switchTab({
//
url: '/pages/userCenter/userCenter'
//
})
//
}
//
} else {
//
wx.switchTab({
//
url: '/pages/userCenter/userCenter'
//
})
//
}
//
}, 200)
}
}
...
...
src/utils/Http.js
View file @
51a24553
...
...
@@ -84,8 +84,8 @@ class Http {
url
,
method
:
'GET'
,
header
:
{
//
'buyer-token': this.getToken()
'buyer-token'
:
'3e15b819c551713ae210adc525da028b'
'buyer-token'
:
this
.
getToken
()
//
'buyer-token': '3e15b819c551713ae210adc525da028b'
// 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
},
data
:
parmas
...
...
@@ -97,8 +97,8 @@ class Http {
url
,
method
:
'POST'
,
header
:
{
//
'buyer-token': this.getToken()
'buyer-token'
:
'3e15b819c551713ae210adc525da028b'
'buyer-token'
:
this
.
getToken
()
//
'buyer-token':'3e15b819c551713ae210adc525da028b'
// 'seller-token': 'f80d09122733517ea4a0c2628c4eb0e9'
},
data
:
parmas
,
...
...
src/utils/wxService.js
View file @
51a24553
...
...
@@ -436,7 +436,8 @@ class WXService extends Http {
}
})
}
else
{
this
.
router
(
'/pages/page/page'
)
this
.
router
(
'/pages/index/index'
)
console
.
log
(
'开卡成功跳转'
)
}
},
complete
:
()
=>
{
...
...
@@ -449,17 +450,23 @@ class WXService extends Http {
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
return
new
Promise
((
resolve
,
reject
)
=>
{
// const app = this.getApp()
if
(
baseUserInfo
&&
baseUserInfo
.
isMember
===
'1'
)
{
resolve
(
baseUserInfo
)
}
else
if
(
!
baseUserInfo
||
baseUserInfo
.
isMember
===
'0'
)
{
return
this
.
navigateToMiniProgram
({
biz
:
baseUserInfo
.
biz
,
encrypt_card_id
:
baseUserInfo
.
encrypt_card_i
d
,
outer_str
:
baseUserInfo
.
outer_s
tr
encrypt_card_id
:
baseUserInfo
.
encryptCardI
d
,
outer_str
:
baseUserInfo
.
outerS
tr
})
}
else
{
reject
({
state
:
0
})
}
// if (baseUserInfo && baseUserInfo.isMember === '1') {
// resolve(baseUserInfo)
// } else if (!baseUserInfo || baseUserInfo.isMember === '0') {
// return this.navigateToMiniProgram({
// biz: baseUserInfo.biz,
// encrypt_card_id: baseUserInfo.encryptCardId,
// outer_str: baseUserInfo.outerStr
// })
// } else {
// reject({ state: 0 })
// }
})
}
...
...
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