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
0d074ef4
Commit
0d074ef4
authored
Sep 08, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor:
💡
B C端任务字段统一
parent
2c9db784
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
37 additions
and
37 deletions
+37
-37
awards.controller.d.ts
v2.0/dist/controller/awards.controller.d.ts
+2
-2
share.controller.js
v2.0/dist/controller/share.controller.js
+1
-1
share.controller.js.map
v2.0/dist/controller/share.controller.js.map
+1
-1
stat.controller.d.ts
v2.0/dist/controller/stat.controller.d.ts
+1
-1
index.d.ts
v2.0/dist/index.d.ts
+2
-2
task.service.js
v2.0/dist/service/task.service.js
+5
-5
task.service.js.map
v2.0/dist/service/task.service.js.map
+1
-1
user.service.js
v2.0/dist/service/user.service.js
+8
-8
user.service.js.map
v2.0/dist/service/user.service.js.map
+1
-1
share.controller.ts
v2.0/src/controller/share.controller.ts
+1
-1
task.service.ts
v2.0/src/service/task.service.ts
+5
-5
user.service.ts
v2.0/src/service/user.service.ts
+6
-6
activity.d.ts
v2.0/src/typings/activity.d.ts
+3
-3
No files found.
v2.0/dist/controller/awards.controller.d.ts
View file @
0d074ef4
...
...
@@ -30,11 +30,11 @@ export default class AwardsController {
/**
* 权益重新领取
*/
receiveEnamePrize
(
context
:
IContext
<
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
AwardsService
]):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
CodeType
|
IAwards
,
true
>>
;
receiveEnamePrize
(
context
:
IContext
<
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
AwardsService
]):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
CodeType
|
IAwards
,
true
>>
;
/**
* 概率抽奖
*/
drawLotteryPrize
(
context
:
IContext
<
IParams
>
,
{
userInfo
}:
IControllerInfos
,
[
awardSer
]:
[
AwardsService
]):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
{
drawLotteryPrize
(
context
:
IContext
<
IParams
>
,
{
userInfo
}:
IControllerInfos
,
[
awardSer
]:
[
AwardsService
]):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
{
data
:
{
type
:
number
;
name
:
string
;
...
...
v2.0/dist/controller/share.controller.js
View file @
0d074ef4
...
...
@@ -83,7 +83,7 @@ var Share = /** @class */ (function () {
return
[
2
/*return*/
,
sdk_1
.
resultsModel
.
error
(
constants_1
.
CODE_TYPES
.
ERROR_AREADY_INVITE_SUCCESS
)];
}
tasks
=
activityInfo
.
tasks
;
value
=
(
tasks
||
{}).
invite
Friend
s
.
value
;
value
=
(
tasks
||
{}).
invites
.
value
;
isNewVip
=
userService
.
checkNewVip
(
userInfo
,
vipInfo
);
isValidShare
=
[
isNewVip
].
every
(
function
(
v
)
{
return
!!
v
;
});
today
=
utils_1
.
getToday
();
...
...
v2.0/dist/controller/share.controller.js.map
View file @
0d074ef4
{"version":3,"file":"share.controller.js","sourceRoot":"","sources":["../../src/controller/share.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2C;AAC3C,4CAA8E;AAC9E,kDAAgD;AAEhD,8BAAqC;AACrC,kCAAmC;AACnC,sCAAoE;AAEpE;IAAA;IAyDA,CAAC;IAxDC;;OAEG;IAIG,sBAAM,GAAZ,UACE,OAA0B,EAC1B,EAAqD,EACrD,EAAoF;YADlF,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;YAChC,WAAW,QAAA,EAAE,WAAW,QAAA,EAAE,aAAa,QAAA;;;;;;;wBAEhC,QAAQ,GAAK,OAAO,CAAC,IAAI,SAAjB,CAAiB;wBACzB,MAAM,GAAK,OAAO,OAAZ,CAAY;wBAEQ,qBAAM,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC;4BACjF,iCAAiC;0BADgD;;wBAA3E,cAAc,GAAc,SAA+C;wBACjF,iCAAiC;wBACjC,IAAI,CAAC,cAAc;4BAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,uBAAuB,CAAC,EAAA;wBAE5E,kBAAkB,GAAG,WAAW,CAAC,6BAA6B,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;wBAE/F,eAAe;wBACf,IAAI,kBAAkB,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,KAAK,MAAM,EAAnB,CAAmB,CAAC,EAAE;4BACrD,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,2BAA2B,CAAC,EAAA;yBAClE;wBAKO,KAAK,GAAK,YAAY,MAAjB,CAAiB;wBAGX,KAAK,GACZ,CAAA,KAAK,IAAI,EAAE,CAAA,oBADC,CACD;wBAGjB,QAAQ,GAAG,WAAW,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;wBAGrD,YAAY,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAC,CAAA;wBAEzC,KAAK,GAAG,gBAAQ,EAAE,CAAA;6BACpB,YAAY,EAAZ,wBAAY;wBACD,YAAY,GAAK,cAAc,IAAnB,CAAmB;wBAC5C,mBAAmB;wBACnB,qBAAM,WAAW,CAAC,UAAU,CAAC,YAAY,EAAE;gCACzC,IAAI,EAAE;oCACJ,qBAAqB,EAAE,KAAK;iCAC7B;gCACD,KAAK;oCACH,GAAC,cAAY,KAAK,aAAU,IAAG,EAAE,MAAM,QAAA,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;uCAClE;6BACF,CAAC,EAAA;;wBARF,mBAAmB;wBACnB,SAOE,CAAA;;4BAGJ,sBAAO,kBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;;;KAClC;IAjDD;QAHC,mBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvC,yBAAiB;QACjB,mBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;uCAkDnD;IACH,YAAC;CAAA,AAzDD,IAyDC;kBAzDoB,KAAK"}
\ No newline at end of file
{"version":3,"file":"share.controller.js","sourceRoot":"","sources":["../../src/controller/share.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2C;AAC3C,4CAA8E;AAC9E,kDAAgD;AAEhD,8BAAqC;AACrC,kCAAmC;AACnC,sCAAoE;AAEpE;IAAA;IAyDA,CAAC;IAxDC;;OAEG;IAIG,sBAAM,GAAZ,UACE,OAA0B,EAC1B,EAAqD,EACrD,EAAoF;YADlF,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;YAChC,WAAW,QAAA,EAAE,WAAW,QAAA,EAAE,aAAa,QAAA;;;;;;;wBAEhC,QAAQ,GAAK,OAAO,CAAC,IAAI,SAAjB,CAAiB;wBACzB,MAAM,GAAK,OAAO,OAAZ,CAAY;wBAEQ,qBAAM,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC;4BACjF,iCAAiC;0BADgD;;wBAA3E,cAAc,GAAc,SAA+C;wBACjF,iCAAiC;wBACjC,IAAI,CAAC,cAAc;4BAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,uBAAuB,CAAC,EAAA;wBAE5E,kBAAkB,GAAG,WAAW,CAAC,6BAA6B,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;wBAE/F,eAAe;wBACf,IAAI,kBAAkB,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,MAAM,KAAK,MAAM,EAAnB,CAAmB,CAAC,EAAE;4BACrD,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,2BAA2B,CAAC,EAAA;yBAClE;wBAKO,KAAK,GAAK,YAAY,MAAjB,CAAiB;wBAGjB,KAAK,GACN,CAAA,KAAK,IAAI,EAAE,CAAA,cADL,CACK;wBAGjB,QAAQ,GAAG,WAAW,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;wBAGrD,YAAY,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAC,CAAA;wBAEzC,KAAK,GAAG,gBAAQ,EAAE,CAAA;6BACpB,YAAY,EAAZ,wBAAY;wBACD,YAAY,GAAK,cAAc,IAAnB,CAAmB;wBAC5C,mBAAmB;wBACnB,qBAAM,WAAW,CAAC,UAAU,CAAC,YAAY,EAAE;gCACzC,IAAI,EAAE;oCACJ,qBAAqB,EAAE,KAAK;iCAC7B;gCACD,KAAK;oCACH,GAAC,cAAY,KAAK,aAAU,IAAG,EAAE,MAAM,QAAA,EAAE,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;uCAClE;6BACF,CAAC,EAAA;;wBARF,mBAAmB;wBACnB,SAOE,CAAA;;4BAGJ,sBAAO,kBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;;;KAClC;IAjDD;QAHC,mBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvC,yBAAiB;QACjB,mBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;uCAkDnD;IACH,YAAC;CAAA,AAzDD,IAyDC;kBAzDoB,KAAK"}
\ No newline at end of file
v2.0/dist/controller/stat.controller.d.ts
View file @
0d074ef4
...
...
@@ -18,5 +18,5 @@ export default class StatController {
/**
* 统计数据
*/
getStats
(
context
:
IContext
<
IGetStatsParams
>
):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
[],
true
>>
;
getStats
(
context
:
IContext
<
IGetStatsParams
>
):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
[],
true
>>
;
}
v2.0/dist/index.d.ts
View file @
0d074ef4
...
...
@@ -13,8 +13,8 @@ declare const _default: {
}
>
,
{}:
{},
[
baseService
]:
[
import
(
"./service"
).
BaseService
])
=>
Promise
<
IResult
<
IActivityInfo
>>
;
getMyPrizeList
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IPrizeListParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
IResult
<
IAwards
[]
>>
;
receiveObjectPrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveOjectParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
IResult
<
boolean
>>
;
receiveEnamePrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
import
(
"taobao-mini-sdk/lib/utils/codetypes"
).
CodeType
|
IAwards
,
true
>>
;
receiveEnamePrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
import
(
"taobao-mini-sdk/lib/utils/codetypes"
).
CodeType
|
IAwards
,
true
>>
;
doHelp
:
(
context
:
IContext
<
IParams
>
,
{
userInfo
,
vipInfo
,
activityInfo
}:
IControllerInfos
,
[
userService
,
taskService
,
accessService
]:
[
import
(
"./service/user.service"
).
default
,
import
(
"./service"
).
TaskService
,
import
(
"./service"
).
AccessService
])
=>
Promise
<
IResult
<
boolean
>>
;
getStats
:
(
context
:
IContext
<
import
(
"./controller/stat.controller"
).
IGetStatsParams
>
)
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
[],
true
>>
;
getStats
:
(
context
:
IContext
<
import
(
"./controller/stat.controller"
).
IGetStatsParams
>
)
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
[],
true
>>
;
};
export
default
_default
;
v2.0/dist/service/task.service.js
View file @
0d074ef4
...
...
@@ -84,7 +84,7 @@ var TaskService = /** @class */ (function (_super) {
TaskService
.
prototype
.
initVipTask
=
function
(
userInfo
,
vipInfo
,
tasks
)
{
var
remainTimes
=
userInfo
.
remainTimes
;
// 后台配置奖励
var
value
=
tasks
.
beMembership
.
value
;
var
value
=
tasks
.
member
.
value
;
return
{
taskType
:
"member"
,
title
:
"
\
u52A0
\
u5165
\
u4F1A
\
u5458"
,
...
...
@@ -177,7 +177,7 @@ var TaskService = /** @class */ (function (_super) {
};
// 初始化邀请任务
TaskService
.
prototype
.
initInvitesTask
=
function
(
userInfo
,
tasks
)
{
var
_a
=
tasks
.
invite
Friend
s
,
value
=
_a
.
value
,
taskRateType
=
_a
.
taskRateType
,
times
=
_a
.
times
;
var
_a
=
tasks
.
invites
,
value
=
_a
.
value
,
taskRateType
=
_a
.
taskRateType
,
times
=
_a
.
times
;
var
remainTimes
=
userInfo
.
remainTimes
;
var
todayCompleteTimes
=
this
.
getTodayCompleteTask
(
'invites'
,
userInfo
).
todayCompleteTimes
;
var
invitesCompleteList
=
this
.
getCompleteTaskByUserTaskInfo
(
'invites'
,
userInfo
);
...
...
@@ -196,7 +196,7 @@ var TaskService = /** @class */ (function (_super) {
};
// 关注店铺
TaskService
.
prototype
.
initFollowTask
=
function
(
userInfo
,
tasks
)
{
var
value
=
tasks
.
attentionStore
.
value
;
var
value
=
tasks
.
follow
.
value
;
var
remainTimes
=
userInfo
.
remainTimes
;
var
followCompleteList
=
this
.
getCompleteTaskByUserTaskInfo
(
'follow'
,
userInfo
);
return
{
...
...
@@ -249,7 +249,7 @@ var TaskService = /** @class */ (function (_super) {
var
newMember
=
member
.
newMember
;
var
today
=
utils_1
.
getToday
();
var
isNewVip
=
this
.
checkNewVip
(
userInfo
,
vipInfo
);
var
value
=
tasks
.
beMembership
.
value
;
var
value
=
tasks
.
member
.
value
;
var
projection
=
{
$set
:
{},
$inc
:
{},
...
...
@@ -356,7 +356,7 @@ var TaskService = /** @class */ (function (_super) {
today
=
utils_1
.
getToday
();
_id
=
userInfo
.
_id
,
_a
=
userInfo
.
taskInfo
,
taskInfo
=
_a
===
void
0
?
{}
:
_a
,
follow
=
userInfo
.
follow
;
tasks
=
activityInfo
.
tasks
;
value
=
(
tasks
||
{}).
attentionStore
.
value
;
value
=
(
tasks
||
{}).
follow
.
value
;
followInfo
=
this
.
setNewFollowUserData
(
follow
);
return
[
4
/*yield*/
,
this
.
updateUser
(
_id
,
{
$set
:
{
...
...
v2.0/dist/service/task.service.js.map
View file @
0d074ef4
This diff is collapsed.
Click to expand it.
v2.0/dist/service/user.service.js
View file @
0d074ef4
...
...
@@ -184,7 +184,7 @@ var UserService = /** @class */ (function (_super) {
*/
UserService
.
prototype
.
initUserData
=
function
(
vipInfo
,
activityInfo
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
_a
,
openId
,
data
,
activityId
,
isFollow
,
avatar
,
inviteId
,
userNick
,
today
,
tasks
,
attentionStore
,
beMembership
,
user
;
var
_a
,
openId
,
data
,
activityId
,
isFollow
,
avatar
,
inviteId
,
userNick
,
today
,
tasks
,
follow
,
member
,
user
;
var
_b
,
_c
;
return
__generator
(
this
,
function
(
_d
)
{
switch
(
_d
.
label
)
{
...
...
@@ -194,7 +194,7 @@ var UserService = /** @class */ (function (_super) {
today
=
utils_1
.
getToday
();
console
.
log
(
"----------"
+
today
+
"----------"
,
today
);
tasks
=
activityInfo
.
tasks
;
attentionStore
=
tasks
.
attentionStore
,
beMembership
=
tasks
.
beMembership
;
follow
=
tasks
.
follow
,
member
=
tasks
.
member
;
user
=
{
activityId
:
activityId
,
avatar
:
avatar
,
...
...
@@ -203,8 +203,8 @@ var UserService = /** @class */ (function (_super) {
openId
:
openId
,
// 待领取次数初始化, 根据需自定义添加
remainTimes
:
{
follow
:
isFollow
?
attentionStore
.
value
:
0
,
member
:
vipInfo
.
isVip
?
beMembership
.
value
:
0
follow
:
isFollow
?
follow
.
value
:
0
,
member
:
vipInfo
.
isVip
?
member
.
value
:
0
},
member
:
{
flag
:
!!
vipInfo
.
isVip
...
...
@@ -230,7 +230,7 @@ var UserService = /** @class */ (function (_super) {
};
UserService
.
prototype
.
updateUserData
=
function
(
vipInfo
,
userInfo
,
activityInfo
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
data
,
isFollow
,
today
,
projection
,
tasks
,
attentionStore
,
beMembership
,
followBefore
,
followNow
,
isNewVip
;
var
data
,
isFollow
,
today
,
projection
,
tasks
,
follow
,
member
,
followBefore
,
followNow
,
isNewVip
;
var
_a
;
return
__generator
(
this
,
function
(
_b
)
{
switch
(
_b
.
label
)
{
...
...
@@ -248,21 +248,21 @@ var UserService = /** @class */ (function (_super) {
_a
)
};
tasks
=
activityInfo
.
tasks
;
attentionStore
=
tasks
.
attentionStore
,
beMembership
=
tasks
.
beMembership
;
follow
=
tasks
.
follow
,
member
=
tasks
.
member
;
followBefore
=
userInfo
.
follow
.
flag
;
followNow
=
isFollow
;
if
(
!
followBefore
&&
followNow
&&
!
userInfo
.
follow
.
newFollow
)
{
// @ts-ignore
projection
.
$set
.
follow
=
this
.
setNewFollowUserData
(
userInfo
.
follow
);
projection
.
$push
[
"taskInfo."
+
today
+
".follow"
]
=
{
createTime
:
Date
.
now
()
};
projection
.
$inc
[
"remainTimes.follow"
]
=
attentionStore
.
value
;
projection
.
$inc
[
"remainTimes.follow"
]
=
follow
.
value
;
}
isNewVip
=
this
.
checkNewVip
(
userInfo
,
vipInfo
);
if
(
isNewVip
&&
!
userInfo
.
member
.
newMember
)
{
// @ts-ignore
projection
.
$set
.
member
=
this
.
setNewVipUserData
(
userInfo
.
member
);
projection
.
$push
[
"taskInfo."
+
today
+
".member"
]
=
{
createTime
:
Date
.
now
()
};
projection
.
$inc
[
"remainTimes.member"
]
=
beMembership
.
value
;
projection
.
$inc
[
"remainTimes.member"
]
=
member
.
value
;
}
return
[
4
/*yield*/
,
this
.
updateUser
(
userInfo
.
_id
,
projection
)];
case
1
:
...
...
v2.0/dist/service/user.service.js.map
View file @
0d074ef4
This diff is collapsed.
Click to expand it.
v2.0/src/controller/share.controller.ts
View file @
0d074ef4
...
...
@@ -40,7 +40,7 @@ export default class Share {
const
{
tasks
}
=
activityInfo
// 获取分享奖励
const
{
invite
Friend
s
:
{
value
}
invites
:
{
value
}
}:
ITasks
=
tasks
||
{}
// 新会员
...
...
v2.0/src/service/task.service.ts
View file @
0d074ef4
...
...
@@ -32,7 +32,7 @@ export default class TaskService extends UserService {
// 后台配置奖励
const
{
beMembership
:
{
value
}
member
:
{
value
}
}
=
tasks
return
{
...
...
@@ -146,7 +146,7 @@ export default class TaskService extends UserService {
// 初始化邀请任务
initInvitesTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
{
const
{
invite
Friend
s
:
{
value
,
taskRateType
,
times
}
invites
:
{
value
,
taskRateType
,
times
}
}
=
tasks
const
{
remainTimes
}
=
userInfo
...
...
@@ -171,7 +171,7 @@ export default class TaskService extends UserService {
// 关注店铺
initFollowTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
{
const
{
attentionStore
:
{
value
}
follow
:
{
value
}
}
=
tasks
const
{
remainTimes
}
=
userInfo
...
...
@@ -241,7 +241,7 @@ export default class TaskService extends UserService {
const
isNewVip
=
this
.
checkNewVip
(
userInfo
,
vipInfo
)
const
{
beMembership
:
{
value
}
member
:
{
value
}
}
=
tasks
let
projection
=
{
...
...
@@ -359,7 +359,7 @@ export default class TaskService extends UserService {
const
{
tasks
}
=
activityInfo
// 获取关注店铺奖励
const
{
attentionStore
:
{
value
}
follow
:
{
value
}
}
=
tasks
||
{}
// 更新follow信息
...
...
v2.0/src/service/user.service.ts
View file @
0d074ef4
...
...
@@ -97,7 +97,7 @@ class UserService extends BaseService {
const
today
=
getToday
()
console
.
log
(
`----------
${
today
}
----------`
,
today
)
const
{
tasks
}
=
activityInfo
const
{
attentionStore
,
beMembership
}
=
tasks
const
{
follow
,
member
}
=
tasks
const
user
:
IUserInfo
=
{
activityId
,
avatar
,
...
...
@@ -106,8 +106,8 @@ class UserService extends BaseService {
openId
,
// 待领取次数初始化, 根据需自定义添加
remainTimes
:
{
follow
:
isFollow
?
attentionStore
.
value
:
0
,
member
:
vipInfo
.
isVip
?
beMembership
.
value
:
0
follow
:
isFollow
?
follow
.
value
:
0
,
member
:
vipInfo
.
isVip
?
member
.
value
:
0
},
member
:
{
flag
:
!!
vipInfo
.
isVip
...
...
@@ -145,7 +145,7 @@ class UserService extends BaseService {
}
const
{
tasks
}
=
activityInfo
const
{
attentionStore
,
beMembership
}
=
tasks
const
{
follow
,
member
}
=
tasks
// 老用户
// 之前进入活动未关注,现在进入关注,则视为新关注店铺用户
...
...
@@ -155,7 +155,7 @@ class UserService extends BaseService {
// @ts-ignore
projection
.
$set
.
follow
=
this
.
setNewFollowUserData
(
userInfo
.
follow
)
projection
.
$push
[
`taskInfo.
${
today
}
.follow`
]
=
{
createTime
:
Date
.
now
()
}
projection
.
$inc
[
`remainTimes.follow`
]
=
attentionStore
.
value
projection
.
$inc
[
`remainTimes.follow`
]
=
follow
.
value
}
// 之前进入活动非会员,现在进入会员,则视为新会员用户
...
...
@@ -164,7 +164,7 @@ class UserService extends BaseService {
// @ts-ignore
projection
.
$set
.
member
=
this
.
setNewVipUserData
(
userInfo
.
member
)
projection
.
$push
[
`taskInfo.
${
today
}
.member`
]
=
{
createTime
:
Date
.
now
()
}
projection
.
$inc
[
`remainTimes.member`
]
=
beMembership
.
value
projection
.
$inc
[
`remainTimes.member`
]
=
member
.
value
}
await
this
.
updateUser
(
userInfo
.
_id
,
projection
)
...
...
v2.0/src/typings/activity.d.ts
View file @
0d074ef4
...
...
@@ -16,15 +16,15 @@ interface IActivityInfo {
}
interface
ITasks
{
attentionStore
?:
ITaskConfig
beMembership
?:
ITaskConfig
follow
?:
ITaskConfig
member
?:
ITaskConfig
sign
?:
ITaskConfig
exchangeCredits
?:
ITaskConfig
browseGoods
?:
ITaskConfig
orderGoods
?:
ITaskConfig
collectGoods
?:
ITaskConfig
jumpLink
?:
ITaskConfig
invite
Friend
s
?:
ITaskConfig
invites
?:
ITaskConfig
}
interface
ITaskConfig
{
...
...
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