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
51e6ce0d
Commit
51e6ce0d
authored
Aug 28, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
增加任务状态
parent
a19ef951
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
274 additions
and
157 deletions
+274
-157
constants.d.ts
v2.0/dist/constants.d.ts
+5
-0
constants.js
v2.0/dist/constants.js
+7
-1
constants.js.map
v2.0/dist/constants.js.map
+1
-1
task.controller.js
v2.0/dist/controller/task.controller.js
+5
-8
task.controller.js.map
v2.0/dist/controller/task.controller.js.map
+1
-1
task.service.d.ts
v2.0/dist/service/task.service.d.ts
+28
-1
task.service.js
v2.0/dist/service/task.service.js
+92
-53
task.service.js.map
v2.0/dist/service/task.service.js.map
+1
-1
logger.d.ts
v2.0/dist/utils/package/logger.d.ts
+1
-1
logger.js
v2.0/dist/utils/package/logger.js
+1
-5
logger.js.map
v2.0/dist/utils/package/logger.js.map
+1
-1
constants.ts
v2.0/src/constants.ts
+7
-0
task.controller.ts
v2.0/src/controller/task.controller.ts
+7
-7
task.service.ts
v2.0/src/service/task.service.ts
+115
-76
user.d.ts
v2.0/src/typings/user.d.ts
+1
-0
logger.ts
v2.0/src/utils/package/logger.ts
+1
-1
No files found.
v2.0/dist/constants.d.ts
View file @
51e6ce0d
...
@@ -191,6 +191,11 @@ export declare const TASK_RATE_TYPE: {
...
@@ -191,6 +191,11 @@ export declare const TASK_RATE_TYPE: {
EVERYDAY
:
number
;
EVERYDAY
:
number
;
NOLIMIT
:
number
;
NOLIMIT
:
number
;
};
};
export
declare
const
TASK_STATUS
:
{
WAIT_DO
:
number
;
WAIT_RECEIVE
:
number
;
DONE
:
number
;
};
export
declare
const
PRIZE_TYPE
:
{
export
declare
const
PRIZE_TYPE
:
{
ENAME
:
number
;
ENAME
:
number
;
CREDITS
:
number
;
CREDITS
:
number
;
...
...
v2.0/dist/constants.js
View file @
51e6ce0d
"use strict"
;
"use strict"
;
/** @format */
/** @format */
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
Object
.
defineProperty
(
exports
,
"__esModule"
,
{
value
:
true
});
exports
.
SWICH_TOCK
=
exports
.
PRIZE_DATA_TYPE
=
exports
.
PRIZE_TYPE
=
exports
.
TASK_RATE_TYPE
=
exports
.
TAOBAO_SUCCESS_ORDER_STATUS
=
exports
.
C_APP_NAME
=
exports
.
DRAW_STATUS
=
exports
.
TBERROR
=
exports
.
CODE_TYPES
=
exports
.
BusinessError
=
void
0
;
exports
.
SWICH_TOCK
=
exports
.
PRIZE_DATA_TYPE
=
exports
.
PRIZE_TYPE
=
exports
.
TASK_
STATUS
=
exports
.
TASK_
RATE_TYPE
=
exports
.
TAOBAO_SUCCESS_ORDER_STATUS
=
exports
.
C_APP_NAME
=
exports
.
DRAW_STATUS
=
exports
.
TBERROR
=
exports
.
CODE_TYPES
=
exports
.
BusinessError
=
void
0
;
var
sdk_1
=
require
(
"./sdk"
);
var
sdk_1
=
require
(
"./sdk"
);
exports
.
BusinessError
=
{
exports
.
BusinessError
=
{
// 更新重试失败(用于并发更新)
// 更新重试失败(用于并发更新)
...
@@ -133,6 +133,12 @@ exports.TASK_RATE_TYPE = {
...
@@ -133,6 +133,12 @@ exports.TASK_RATE_TYPE = {
EVERYDAY
:
2
,
EVERYDAY
:
2
,
NOLIMIT
:
3
NOLIMIT
:
3
};
};
//任务状态
exports
.
TASK_STATUS
=
{
WAIT_DO
:
1
,
WAIT_RECEIVE
:
2
,
DONE
:
3
// 已完成
};
// 奖品类型
// 奖品类型
exports
.
PRIZE_TYPE
=
{
exports
.
PRIZE_TYPE
=
{
ENAME
:
1
,
ENAME
:
1
,
...
...
v2.0/dist/constants.js.map
View file @
51e6ce0d
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,6BAA0C;AAE7B,QAAA,aAAa,GAAG;IAC3B,iBAAiB;IACjB,kBAAkB,EAAE;QAClB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,0BAAM;KACnB;IACD,QAAQ;IACR,iBAAiB,EAAE;QACjB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,sBAAsB,EAAE;QACtB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,mBAAmB,EAAE;QACnB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;KACpB;IACD,UAAU;IACV,oBAAoB,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,wDAAW;KACxB;IACD,UAAU;IACV,yBAAyB,EAAE;QACzB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,4CAAS;KACtB;IACD,QAAQ;IACR,mBAAmB,EAAE;QACnB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,UAA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,QAGrB"}
\ No newline at end of file
\ No newline at end of file
v2.0/dist/controller/task.controller.js
View file @
51e6ce0d
...
@@ -61,12 +61,6 @@ var constants_1 = require("./../constants");
...
@@ -61,12 +61,6 @@ var constants_1 = require("./../constants");
var
decorator_1
=
require
(
"../decorator"
);
var
decorator_1
=
require
(
"../decorator"
);
var
sdk_1
=
require
(
"../sdk"
);
var
sdk_1
=
require
(
"../sdk"
);
var
service_1
=
require
(
"../service"
);
var
service_1
=
require
(
"../service"
);
// {
// "handler": "getTaskList",
// "data": {
// "activityId": "5f213791964f9706aa59b192"
// }
// }
var
Task
=
/** @class */
(
function
()
{
var
Task
=
/** @class */
(
function
()
{
function
Task
()
{
function
Task
()
{
}
}
...
@@ -77,14 +71,15 @@ var Task = /** @class */ (function () {
...
@@ -77,14 +71,15 @@ var Task = /** @class */ (function () {
var
userInfo
=
_a
.
userInfo
,
vipInfo
=
_a
.
vipInfo
,
activityInfo
=
_a
.
activityInfo
,
session
=
_a
.
session
;
var
userInfo
=
_a
.
userInfo
,
vipInfo
=
_a
.
vipInfo
,
activityInfo
=
_a
.
activityInfo
,
session
=
_a
.
session
;
var
taskService
=
_b
[
0
];
var
taskService
=
_b
[
0
];
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
tasks
,
startTime
,
updatedUserInfo
,
_c
,
_d
,
_e
,
_f
,
vipTask
,
followTask
,
orderGoodsTask
,
browseGoodsTask
,
collectGoodsTask
,
jumpLinkTask
,
invitesTask
;
var
tasks
,
startTime
,
updatedUserInfo
,
_c
,
_d
,
_e
,
_f
,
vipTask
,
followTask
,
signTask
,
orderGoodsTask
,
browseGoodsTask
,
collectGoodsTask
,
jumpLinkTask
,
invitesTask
;
return
__generator
(
this
,
function
(
_g
)
{
return
__generator
(
this
,
function
(
_g
)
{
switch
(
_g
.
label
)
{
switch
(
_g
.
label
)
{
case
0
:
case
0
:
tasks
=
activityInfo
.
tasks
,
startTime
=
activityInfo
.
startTime
;
tasks
=
activityInfo
.
tasks
,
startTime
=
activityInfo
.
startTime
;
_d
=
(
_c
=
taskService
).
updateTasks
;
_d
=
(
_c
=
taskService
).
updateTasks
;
_e
=
[
userInfo
.
_id
];
_e
=
[
userInfo
.
_id
];
_f
=
[
taskService
.
updateVipTaskStatus
(
userInfo
,
vipInfo
,
tasks
)];
_f
=
[
taskService
.
updateVipTask
(
userInfo
,
vipInfo
,
tasks
),
taskService
.
updateSignTask
(
userInfo
,
tasks
)];
return
[
4
/*yield*/
,
taskService
.
updateOrderGoodsTask
(
userInfo
,
tasks
,
startTime
,
session
)];
return
[
4
/*yield*/
,
taskService
.
updateOrderGoodsTask
(
userInfo
,
tasks
,
startTime
,
session
)];
case
1
:
return
[
4
/*yield*/
,
_d
.
apply
(
_c
,
_e
.
concat
([
_f
.
concat
([
case
1
:
return
[
4
/*yield*/
,
_d
.
apply
(
_c
,
_e
.
concat
([
_f
.
concat
([
_g
.
sent
()
_g
.
sent
()
...
@@ -97,6 +92,7 @@ var Task = /** @class */ (function () {
...
@@ -97,6 +92,7 @@ var Task = /** @class */ (function () {
];
];
vipTask
=
taskService
.
initVipTask
(
updatedUserInfo
,
vipInfo
,
tasks
);
vipTask
=
taskService
.
initVipTask
(
updatedUserInfo
,
vipInfo
,
tasks
);
followTask
=
taskService
.
initFollowTask
(
updatedUserInfo
,
tasks
);
followTask
=
taskService
.
initFollowTask
(
updatedUserInfo
,
tasks
);
signTask
=
taskService
.
initSignTask
(
updatedUserInfo
,
tasks
);
orderGoodsTask
=
taskService
.
initOrderGoodsTask
(
updatedUserInfo
,
tasks
);
orderGoodsTask
=
taskService
.
initOrderGoodsTask
(
updatedUserInfo
,
tasks
);
browseGoodsTask
=
taskService
.
initBrowseGoodsTask
(
updatedUserInfo
,
tasks
);
browseGoodsTask
=
taskService
.
initBrowseGoodsTask
(
updatedUserInfo
,
tasks
);
collectGoodsTask
=
taskService
.
initCollectGoodsTask
(
updatedUserInfo
,
tasks
);
collectGoodsTask
=
taskService
.
initCollectGoodsTask
(
updatedUserInfo
,
tasks
);
...
@@ -105,6 +101,7 @@ var Task = /** @class */ (function () {
...
@@ -105,6 +101,7 @@ var Task = /** @class */ (function () {
// 积分兑换
// 积分兑换
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
return
[
2
/*return*/
,
sdk_1
.
resultsModel
.
success
([
return
[
2
/*return*/
,
sdk_1
.
resultsModel
.
success
([
signTask
,
vipTask
,
vipTask
,
followTask
,
followTask
,
orderGoodsTask
,
orderGoodsTask
,
...
...
v2.0/dist/controller/task.controller.js.map
View file @
51e6ce0d
This diff is collapsed.
Click to expand it.
v2.0/dist/service/task.service.d.ts
View file @
51e6ce0d
...
@@ -15,6 +15,7 @@ interface ITaskInfo {
...
@@ -15,6 +15,7 @@ interface ITaskInfo {
times
?:
number
;
times
?:
number
;
waitReceive
?:
number
;
waitReceive
?:
number
;
title
:
string
;
title
:
string
;
status
:
number
;
}
}
export
default
class
TaskService
extends
UserService
{
export
default
class
TaskService
extends
UserService
{
constructor
(
context
:
Context
);
constructor
(
context
:
Context
);
...
@@ -25,13 +26,27 @@ export default class TaskService extends UserService {
...
@@ -25,13 +26,27 @@ export default class TaskService extends UserService {
initJumpLinkTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
initJumpLinkTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
initInvitesTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
initInvitesTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
initFollowTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
initFollowTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
initSignTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
initExchangeCreditsTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
initExchangeCreditsTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
ITaskInfo
;
updateVipTask
Status
(
userInfo
:
IUserInfo
,
vipInfo
:
IVipInfo
,
tasks
:
ITasks
):
{
updateVipTask
(
userInfo
:
IUserInfo
,
vipInfo
:
IVipInfo
,
tasks
:
ITasks
):
{
$set
:
{};
$set
:
{};
$inc
:
{};
$inc
:
{};
$push
:
{};
$push
:
{};
};
};
updateOrderGoodsTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
,
activityStartTime
:
number
,
session
?:
string
):
Promise
<
{}
>
;
updateOrderGoodsTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
,
activityStartTime
:
number
,
session
?:
string
):
Promise
<
{}
>
;
updateSignTask
(
userInfo
:
IUserInfo
,
tasks
:
ITasks
):
{
$inc
:
{
'remainTimes.sign'
:
number
;
};
$push
:
{
[
x
:
string
]:
{
createTime
:
number
;
};
};
}
|
{
$inc
?:
undefined
;
$push
?:
undefined
;
};
/**
/**
*更新关注店铺任务状态
*更新关注店铺任务状态
*
*
...
@@ -41,6 +56,18 @@ export default class TaskService extends UserService {
...
@@ -41,6 +56,18 @@ export default class TaskService extends UserService {
* @memberof TaskService
* @memberof TaskService
*/
*/
updateFollowTask
(
userInfo
:
IUserInfo
,
activityInfo
:
IActivityInfo
):
Promise
<
any
>
;
updateFollowTask
(
userInfo
:
IUserInfo
,
activityInfo
:
IActivityInfo
):
Promise
<
any
>
;
/**
*
* 根据用户和任务完成情况,设置任务状态
*
* @param {IUserInfo} useInfo
* @param {string} taskType
* @param {number} taskRateType
* @param {number} [limitTimesEverday] 每天限制次数 任务频率为每天的时候必填
* @return {taskTatus} 1未完成 2 待领取 3 已完成
* @memberof TaskService
*/
setTaskStatus
(
useInfo
:
IUserInfo
,
taskType
:
string
,
taskRateType
:
number
,
limitTimesEveryday
?:
number
):
number
;
/**
/**
*
*
* 获取任务今天完成的次数
* 获取任务今天完成的次数
...
...
v2.0/dist/service/task.service.js
View file @
51e6ce0d
This diff is collapsed.
Click to expand it.
v2.0/dist/service/task.service.js.map
View file @
51e6ce0d
This diff is collapsed.
Click to expand it.
v2.0/dist/utils/package/logger.d.ts
View file @
51e6ce0d
export
declare
const
logFn
:
(
context
:
Context
)
=>
void
;
export
declare
const
logFn
:
(
context
:
Context
)
=>
void
;
export
declare
const
recordErrorLog
:
(
context
:
Context
,
baseInfos
:
IControllerInfos
,
errorMsg
:
string
,
stack
:
string
)
=>
Promise
<
any
>
;
export
declare
const
recordErrorLog
:
(
context
:
Context
,
baseInfos
:
IControllerInfos
,
errorMsg
:
string
,
stack
:
string
)
=>
Promise
<
any
>
;
export
declare
const
logger
:
(
...
message
:
any
)
=>
void
;
export
declare
const
logger
:
(
message
:
any
)
=>
void
;
v2.0/dist/utils/package/logger.js
View file @
51e6ce0d
...
@@ -79,11 +79,7 @@ exports.recordErrorLog = function (context, baseInfos, errorMsg, stack) { return
...
@@ -79,11 +79,7 @@ exports.recordErrorLog = function (context, baseInfos, errorMsg, stack) { return
});
});
});
};
});
};
// 本地mock 增加颜色辨识度
// 本地mock 增加颜色辨识度
exports
.
logger
=
function
()
{
exports
.
logger
=
function
(
message
)
{
var
message
=
[];
for
(
var
_i
=
0
;
_i
<
arguments
.
length
;
_i
++
)
{
message
[
_i
]
=
arguments
[
_i
];
}
console
.
log
(
'
\
x1b[36m%s
\
x1b[0m'
,
"-------------------
\
u65E5
\
u5FD7----------------------------"
);
console
.
log
(
'
\
x1b[36m%s
\
x1b[0m'
,
"-------------------
\
u65E5
\
u5FD7----------------------------"
);
console
.
log
(
'
\
x1b[36m%s
\
x1b[0m'
,
JSON
.
stringify
(
message
,
null
,
2
));
console
.
log
(
'
\
x1b[36m%s
\
x1b[0m'
,
JSON
.
stringify
(
message
,
null
,
2
));
console
.
log
(
'
\
x1b[36m%s
\
x1b[0m'
,
"-------------------
\
u65E5
\
u5FD7----------------------------"
);
console
.
log
(
'
\
x1b[36m%s
\
x1b[0m'
,
"-------------------
\
u65E5
\
u5FD7----------------------------"
);
...
...
v2.0/dist/utils/package/logger.js.map
View file @
51e6ce0d
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/utils/package/logger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,iCAAmC;AACnC,+BAA4C;AAC5C,qCAAsC;AAEzB,QAAA,KAAK,GAAG,UAAC,OAAgB;;IACpC,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACpB,OAAO,CAAC,GAAG,CACT,6BAAgB,OAAO,CAAC,MAAM,IAAI,EAAE,WAClC,mBAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,SAAS,0CAAE,OAAO,0CAAE,OAAO,KAAI,OAAO,CAAC,OAAO,kBAClD,CACf,CAAA;IACD,OAAO,CAAC,GAAG,CAAC,wCAAkB,IAAI,iBAAc,CAAC,CAAA;AACnD,CAAC,CAAA;AAED,SAAS;AACI,QAAA,cAAc,GAAG,UAC5B,OAAgB,EAChB,SAA2B,EAC3B,QAAgB,EAChB,KAAa;;;;;;gBAEL,MAAM,GAAK,OAAO,OAAZ,CAAY;gBAClB,UAAU,GAAK,CAAA,OAAO,CAAC,IAAI,IAAI,EAAE,CAAA,WAAvB,CAAuB;gBACjC,QAAQ,GAAK,SAAS,SAAd,CAAc;gBACtB,QAAQ,GAAK,CAAA,QAAQ,IAAI,EAAE,CAAA,SAAnB,CAAmB;gBAC7B,MAAM,GAAa,IAAI,aAAO,CAAC,OAAO,EAAE,sBAAiB,CAAC,CAAA;gBAC1D,YAAY,GAAW,CAAG,OAAO,CAAC,MAAM,IAAI,EAAE,WAClD,mBAAA,OAAO,aAAP,OA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,CAAA;AAED,iBAAiB;AACJ,QAAA,MAAM,GAAG,UAAC,OAAY;IACjC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,6DAAmD,CAAC,CAAA;IACrF,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;IAClE,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,6DAAmD,CAAC,CAAA;IAErF,+DAA+D;AACjE,CAAC,CAAA"}
\ No newline at end of file
\ No newline at end of file
v2.0/src/constants.ts
View file @
51e6ce0d
...
@@ -151,6 +151,13 @@ export const TASK_RATE_TYPE = {
...
@@ -151,6 +151,13 @@ export const TASK_RATE_TYPE = {
NOLIMIT
:
3
NOLIMIT
:
3
}
}
//任务状态
export
const
TASK_STATUS
=
{
WAIT_DO
:
1
,
// 未完成
WAIT_RECEIVE
:
2
,
// 待领取
DONE
:
3
// 已完成
}
// 奖品类型
// 奖品类型
export
const
PRIZE_TYPE
=
{
export
const
PRIZE_TYPE
=
{
ENAME
:
1
,
ENAME
:
1
,
...
...
v2.0/src/controller/task.controller.ts
View file @
51e6ce0d
...
@@ -8,12 +8,6 @@ import { TaskService, BaseService } from '../service'
...
@@ -8,12 +8,6 @@ import { TaskService, BaseService } from '../service'
import
{
logger
}
from
'../utils'
import
{
logger
}
from
'../utils'
import
{
time
}
from
'console'
import
{
time
}
from
'console'
// {
// "handler": "getTaskList",
// "data": {
// "activityId": "5f213791964f9706aa59b192"
// }
// }
export
default
class
Task
{
export
default
class
Task
{
/**
/**
* 任务列表
* 任务列表
...
@@ -32,8 +26,10 @@ export default class Task {
...
@@ -32,8 +26,10 @@ export default class Task {
// 更新user状态
// 更新user状态
let
updatedUserInfo
=
await
taskService
.
updateTasks
(
let
updatedUserInfo
=
await
taskService
.
updateTasks
(
userInfo
.
_id
,
userInfo
.
_id
,
// 需要查询更新的任务
[
[
taskService
.
updateVipTaskStatus
(
userInfo
,
vipInfo
,
tasks
),
taskService
.
updateVipTask
(
userInfo
,
vipInfo
,
tasks
),
taskService
.
updateSignTask
(
userInfo
,
tasks
),
await
taskService
.
updateOrderGoodsTask
(
userInfo
,
tasks
,
startTime
,
session
)
await
taskService
.
updateOrderGoodsTask
(
userInfo
,
tasks
,
startTime
,
session
)
],
],
userInfo
userInfo
...
@@ -45,6 +41,9 @@ export default class Task {
...
@@ -45,6 +41,9 @@ export default class Task {
const
vipTask
=
taskService
.
initVipTask
(
updatedUserInfo
,
vipInfo
,
tasks
)
const
vipTask
=
taskService
.
initVipTask
(
updatedUserInfo
,
vipInfo
,
tasks
)
// 关注店铺
// 关注店铺
const
followTask
=
taskService
.
initFollowTask
(
updatedUserInfo
,
tasks
)
const
followTask
=
taskService
.
initFollowTask
(
updatedUserInfo
,
tasks
)
// 签到任务
const
signTask
=
taskService
.
initSignTask
(
updatedUserInfo
,
tasks
)
// 下单任务
// 下单任务
const
orderGoodsTask
=
taskService
.
initOrderGoodsTask
(
updatedUserInfo
,
tasks
)
const
orderGoodsTask
=
taskService
.
initOrderGoodsTask
(
updatedUserInfo
,
tasks
)
// 浏览商品任务
// 浏览商品任务
...
@@ -60,6 +59,7 @@ export default class Task {
...
@@ -60,6 +59,7 @@ export default class Task {
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
return
resultsModel
.
success
([
return
resultsModel
.
success
([
signTask
,
vipTask
,
vipTask
,
followTask
,
followTask
,
orderGoodsTask
,
orderGoodsTask
,
...
...
v2.0/src/service/task.service.ts
View file @
51e6ce0d
This diff is collapsed.
Click to expand it.
v2.0/src/typings/user.d.ts
View file @
51e6ce0d
...
@@ -27,6 +27,7 @@ interface IRemainTimesInfo {
...
@@ -27,6 +27,7 @@ interface IRemainTimesInfo {
collectGoods
?:
number
collectGoods
?:
number
exchangeCredits
?:
number
exchangeCredits
?:
number
jumpLink
?:
number
jumpLink
?:
number
sign
?:
number
}
}
interface
IMemberInfo
{
interface
IMemberInfo
{
...
...
v2.0/src/utils/package/logger.ts
View file @
51e6ce0d
...
@@ -45,7 +45,7 @@ export const recordErrorLog = async (
...
@@ -45,7 +45,7 @@ export const recordErrorLog = async (
}
}
// 本地mock 增加颜色辨识度
// 本地mock 增加颜色辨识度
export const logger = (
...
message: any) => {
export const logger = (message: any) => {
console.log('\x1b[36m%s\x1b[0m', `
-------------------
日志
----------------------------
`)
console.log('\x1b[36m%s\x1b[0m', `
-------------------
日志
----------------------------
`)
console.log('\x1b[36m%s\x1b[0m', JSON.stringify(message, null, 2))
console.log('\x1b[36m%s\x1b[0m', JSON.stringify(message, null, 2))
console.log('\x1b[36m%s\x1b[0m', `
-------------------
日志
----------------------------
`)
console.log('\x1b[36m%s\x1b[0m', `
-------------------
日志
----------------------------
`)
...
...
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