Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
e7f59143
Commit
e7f59143
authored
Dec 21, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
注册积分
parent
db419887
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
registeInfos.ts
v2.0/src/decorator/common/registeInfos.ts
+18
-3
index.d.ts
v2.0/src/typings/index.d.ts
+2
-0
item.d.ts
v2.0/src/typings/item.d.ts
+11
-0
No files found.
v2.0/src/decorator/common/registeInfos.ts
View file @
e7f59143
/** @format */
/** @format */
import
{
CommonUserService
,
CommonBaseService
}
from
'../../service/common'
import
{
CommonUserService
,
CommonBaseService
}
from
'../../service/common'
import
{
getSellerSession
}
from
'../../utils'
import
{
getSellerSession
,
getUserOrderlist
}
from
'../../utils'
import
{
formatVipCbUrl
,
getShopVip
}
from
'../../utils/common/vip'
import
{
formatVipCbUrl
,
getShopVip
}
from
'../../utils/common/vip'
import
{
CODE_TYPES
}
from
'../../errorCode'
import
{
CODE_TYPES
}
from
'../../errorCode'
import
{
resultsModel
}
from
'../../sdk'
import
{
resultsModel
,
TBAPIS
}
from
'../../sdk'
export
type
IInfo
=
'session'
|
'vipInfo'
export
type
IInfo
=
'session'
|
'vipInfo'
|
'taobaoOrderist'
|
'credits'
async
function
initBaseInfo
(
context
:
IContext
<
IParams
>
,
baseInfos
:
ICheckControllerInfos
,
needInfos
:
IInfo
[])
{
async
function
initBaseInfo
(
context
:
IContext
<
IParams
>
,
baseInfos
:
ICheckControllerInfos
,
needInfos
:
IInfo
[])
{
const
handler
=
context
?.
cloud
?.
dataspace
?.
context
?.
handler
const
handler
=
context
?.
cloud
?.
dataspace
?.
context
?.
handler
...
@@ -39,6 +39,21 @@ async function initBaseInfo(context: IContext<IParams>, baseInfos: ICheckControl
...
@@ -39,6 +39,21 @@ async function initBaseInfo(context: IContext<IParams>, baseInfos: ICheckControl
const
vipInfo
=
await
getShopVip
(
context
,
baseInfos
.
activityInfo
,
formatVipCbUrl
(
context
))
const
vipInfo
=
await
getShopVip
(
context
,
baseInfos
.
activityInfo
,
formatVipCbUrl
(
context
))
baseInfos
.
vipInfo
=
vipInfo
baseInfos
.
vipInfo
=
vipInfo
}
}
if
(
needInfos
.
includes
(
'taobaoOrderist'
)
&&
!
baseInfos
.
taobaoOrderist
)
{
const
taobaoOrderist
=
await
getUserOrderlist
(
context
,
baseInfos
?.
userInfo
?.
createTime
||
baseInfos
?.
activityInfo
?.
startTime
||
Date
.
now
(),
Date
.
now
()
)
baseInfos
.
taobaoOrderist
=
taobaoOrderist
}
if
(
needInfos
.
includes
(
'credits'
)
&&
!
baseInfos
.
credits
)
{
const
credits
=
await
TBAPIS
.
queryCredits
(
this
.
context
)
baseInfos
.
credits
=
credits
}
return
baseInfos
return
baseInfos
}
}
...
...
v2.0/src/typings/index.d.ts
View file @
e7f59143
...
@@ -28,6 +28,8 @@ interface IControllerInfos {
...
@@ -28,6 +28,8 @@ interface IControllerInfos {
vipInfo
?:
IVipInfo
vipInfo
?:
IVipInfo
activityInfo
:
IActivityInfo
activityInfo
:
IActivityInfo
session
?:
string
session
?:
string
credits
?:
number
taobaoOrderist
?:
ITaoBaoOrders
[]
}
}
interface
ICheckControllerInfos
extends
IControllerInfos
{
interface
ICheckControllerInfos
extends
IControllerInfos
{
...
...
v2.0/src/typings/item.d.ts
View file @
e7f59143
...
@@ -8,3 +8,14 @@ interface ITaoBaoItems {
...
@@ -8,3 +8,14 @@ interface ITaoBaoItems {
image
:
string
image
:
string
desc
:
string
desc
:
string
}
}
interface
ITaoBaoOrders
{
payTime
:
string
itemId
:
string
time
:
string
price
:
string
orderId
:
string
img
:
string
title
:
string
tId
:
string
}
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