Commit 51e6ce0d authored by qinhaitao's avatar qinhaitao

feat: 🎸 增加任务状态

parent a19ef951
......@@ -191,6 +191,11 @@ export declare const TASK_RATE_TYPE: {
EVERYDAY: number;
NOLIMIT: number;
};
export declare const TASK_STATUS: {
WAIT_DO: number;
WAIT_RECEIVE: number;
DONE: number;
};
export declare const PRIZE_TYPE: {
ENAME: number;
CREDITS: number;
......
"use strict";
/** @format */
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");
exports.BusinessError = {
// 更新重试失败(用于并发更新)
......@@ -133,6 +133,12 @@ exports.TASK_RATE_TYPE = {
EVERYDAY: 2,
NOLIMIT: 3
};
//任务状态
exports.TASK_STATUS = {
WAIT_DO: 1,
WAIT_RECEIVE: 2,
DONE: 3 // 已完成
};
// 奖品类型
exports.PRIZE_TYPE = {
ENAME: 1,
......
{"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,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;AAHD,WAAY,UAAU;IACpB,6CAAS,CAAA;IACT,mDAAY,CAAA;AACd,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB"}
\ No newline at end of file
{"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,UAAU,EAAE,kDAAU;KACvB;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,wDAAW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uB;IACvB,0BAA0B;IAC1B,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;CACtB,CAAA;AAcD,UAAU;AACG,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;CACX,CAAA;AAED,MAAM;AACO,QAAA,WAAW,GAAG;IACzB,OAAO,EAAE,CAAC;IACV,YAAY,EAAE,CAAC;IACf,IAAI,EAAE,CAAC,CAAC,MAAM;CACf,CAAA;AAED,OAAO;AACM,QAAA,UAAU,GAAG;IACxB,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;CACV,CAAA;AAED,OAAO;AACM,QAAA,eAAe,GAAG;IAC7B,OAAO,EAAE,CAAC;IACV,WAAW,EAAE,CAAC,CAAC,KAAK;CACrB,CAAA;AAED,WAAW;AACX,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,6CAAS,CAAA;IACT,mDAAY,CAAA;AACd,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB"}
\ No newline at end of file
......@@ -61,12 +61,6 @@ var constants_1 = require("./../constants");
var decorator_1 = require("../decorator");
var sdk_1 = require("../sdk");
var service_1 = require("../service");
// {
// "handler": "getTaskList",
// "data": {
// "activityId": "5f213791964f9706aa59b192"
// }
// }
var Task = /** @class */ (function () {
function Task() {
}
......@@ -77,14 +71,15 @@ var Task = /** @class */ (function () {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo, session = _a.session;
var taskService = _b[0];
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) {
switch (_g.label) {
case 0:
tasks = activityInfo.tasks, startTime = activityInfo.startTime;
_d = (_c = taskService).updateTasks;
_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)];
case 1: return [4 /*yield*/, _d.apply(_c, _e.concat([_f.concat([
_g.sent()
......@@ -97,6 +92,7 @@ var Task = /** @class */ (function () {
];
vipTask = taskService.initVipTask(updatedUserInfo, vipInfo, tasks);
followTask = taskService.initFollowTask(updatedUserInfo, tasks);
signTask = taskService.initSignTask(updatedUserInfo, tasks);
orderGoodsTask = taskService.initOrderGoodsTask(updatedUserInfo, tasks);
browseGoodsTask = taskService.initBrowseGoodsTask(updatedUserInfo, tasks);
collectGoodsTask = taskService.initCollectGoodsTask(updatedUserInfo, tasks);
......@@ -105,6 +101,7 @@ var Task = /** @class */ (function () {
// 积分兑换
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
return [2 /*return*/, sdk_1.resultsModel.success([
signTask,
vipTask,
followTask,
orderGoodsTask,
......
This diff is collapsed.
......@@ -15,6 +15,7 @@ interface ITaskInfo {
times?: number;
waitReceive?: number;
title: string;
status: number;
}
export default class TaskService extends UserService {
constructor(context: Context);
......@@ -25,13 +26,27 @@ export default class TaskService extends UserService {
initJumpLinkTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initInvitesTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initFollowTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initSignTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initExchangeCreditsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
updateVipTaskStatus(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): {
updateVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): {
$set: {};
$inc: {};
$push: {};
};
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 {
* @memberof TaskService
*/
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;
/**
*
* 获取任务今天完成的次数
......
This diff is collapsed.
This diff is collapsed.
export declare const logFn: (context: Context) => void;
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;
......@@ -79,11 +79,7 @@ exports.recordErrorLog = function (context, baseInfos, errorMsg, stack) { return
});
}); };
// 本地mock 增加颜色辨识度
exports.logger = function () {
var message = [];
for (var _i = 0; _i < arguments.length; _i++) {
message[_i] = arguments[_i];
}
exports.logger = function (message) {
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', "-------------------\u65E5\u5FD7----------------------------");
......
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/utils/package/logger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,i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U,EAAE,OAAO,CAAC,UAAU;wBAC9B,MAAM,EAAE,OAAO,CAAC,IAAI;wBACpB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;wBACtB,SAAS,EAAE,gBAAQ,EAAE;wBACrB,SAAS,EAAE,CAAC;qBACb,CAAC,EAAA;oBAZF,sBAAO,SAYL,EAAA;;;KACH,CAAA;AAED,iBAAiB;AACJ,QAAA,MAAM,GAAG;IAAC,iBAAe;SAAf,UAAe,EAAf,qBAAe,EAAf,IAAe;QAAf,4BAAe;;IACpC,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
{"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,CA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CAAC,mBAAmB,EAAE,6DAAmD,CAAC,CAAA;IAErF,+DAA+D;AACjE,CAAC,CAAA"}
\ No newline at end of file
......@@ -151,6 +151,13 @@ export const TASK_RATE_TYPE = {
NOLIMIT: 3
}
//任务状态
export const TASK_STATUS = {
WAIT_DO: 1, // 未完成
WAIT_RECEIVE: 2, // 待领取
DONE: 3 // 已完成
}
// 奖品类型
export const PRIZE_TYPE = {
ENAME: 1,
......
......@@ -8,12 +8,6 @@ import { TaskService, BaseService } from '../service'
import { logger } from '../utils'
import { time } from 'console'
// {
// "handler": "getTaskList",
// "data": {
// "activityId": "5f213791964f9706aa59b192"
// }
// }
export default class Task {
/**
* 任务列表
......@@ -32,8 +26,10 @@ export default class Task {
// 更新user状态
let updatedUserInfo = await taskService.updateTasks(
userInfo._id,
// 需要查询更新的任务
[
taskService.updateVipTaskStatus(userInfo, vipInfo, tasks),
taskService.updateVipTask(userInfo, vipInfo, tasks),
taskService.updateSignTask(userInfo, tasks),
await taskService.updateOrderGoodsTask(userInfo, tasks, startTime, session)
],
userInfo
......@@ -45,6 +41,9 @@ export default class Task {
const vipTask = taskService.initVipTask(updatedUserInfo, vipInfo, tasks)
// 关注店铺
const followTask = taskService.initFollowTask(updatedUserInfo, tasks)
// 签到任务
const signTask = taskService.initSignTask(updatedUserInfo, tasks)
// 下单任务
const orderGoodsTask = taskService.initOrderGoodsTask(updatedUserInfo, tasks)
// 浏览商品任务
......@@ -60,6 +59,7 @@ export default class Task {
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
return resultsModel.success([
signTask,
vipTask,
followTask,
orderGoodsTask,
......
This diff is collapsed.
......@@ -27,6 +27,7 @@ interface IRemainTimesInfo {
collectGoods?: number
exchangeCredits?: number
jumpLink?: number
sign?: number
}
interface IMemberInfo {
......
......@@ -45,7 +45,7 @@ export const recordErrorLog = async (
}
// 本地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', JSON.stringify(message, null, 2))
console.log('\x1b[36m%s\x1b[0m', `-------------------日志----------------------------`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment