Commit 6b9ac21a authored by qinhaitao's avatar qinhaitao

feat: 🎸 任务优化

parent ea4236d9
/** @format */
export declare const BusinessError: {
ERROR_UPDATE_RETRY: {
code: string;
defaultMsg: string;
};
ERROR_NO_ACTIVITY: {
code: string;
defaultMsg: string;
};
ERROR_ACTIVITY_NOSTART: {
code: string;
defaultMsg: string;
};
ERROR_ACTIVITY_OVER: {
code: string;
defaultMsg: string;
};
ERROR_NO_USER: {
code: string;
defaultMsg: string;
};
ERROR_NO_VIP: {
code: string;
defaultMsg: string;
};
ERROR_TASK_NORECEIVE: {
code: string;
defaultMsg: string;
};
ERROR_TASK_ALREADYRECEIVE: {
code: string;
defaultMsg: string;
};
ERROR_TASK_COMPLETE: {
code: string;
defaultMsg: string;
};
ERROR_INVALID_INVITE_ID: {
code: string;
defaultMsg: string;
};
ERROR_NO_CREDITS: {
code: string;
defaultMsg: string;
};
ERROR_TASK_LIMIT: {
code: string;
defaultMsg: string;
};
ERROR_AREADY_INVITE_SUCCESS: {
code: string;
defaultMsg: string;
};
ERROR_NO_INVITE_SELF: {
code: string;
defaultMsg: string;
};
ERROR_FORBIDDEN_OPE: {
code: string;
defaultMsg: string;
};
ERROR_RECEIVE_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_SEND_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_NO_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_NO_STOCK: {
code: string;
defaultMsg: string;
};
ERROR_PRIZE_EXPIRED: {
code: string;
defaultMsg: string;
};
};
export declare const CODE_TYPES: {
PARAMS_ERROR: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
SYSTEM_ERROR: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
SUCCESS: import("taobao-mini-sdk/lib/utils/codetypes").CodeType;
} & {
ERROR_UPDATE_RETRY: {
code: string;
defaultMsg: string;
};
ERROR_NO_ACTIVITY: {
code: string;
defaultMsg: string;
};
ERROR_ACTIVITY_NOSTART: {
code: string;
defaultMsg: string;
};
ERROR_ACTIVITY_OVER: {
code: string;
defaultMsg: string;
};
ERROR_NO_USER: {
code: string;
defaultMsg: string;
};
ERROR_NO_VIP: {
code: string;
defaultMsg: string;
};
ERROR_TASK_NORECEIVE: {
code: string;
defaultMsg: string;
};
ERROR_TASK_ALREADYRECEIVE: {
code: string;
defaultMsg: string;
};
ERROR_TASK_COMPLETE: {
code: string;
defaultMsg: string;
};
ERROR_INVALID_INVITE_ID: {
code: string;
defaultMsg: string;
};
ERROR_NO_CREDITS: {
code: string;
defaultMsg: string;
};
ERROR_TASK_LIMIT: {
code: string;
defaultMsg: string;
};
ERROR_AREADY_INVITE_SUCCESS: {
code: string;
defaultMsg: string;
};
ERROR_NO_INVITE_SELF: {
code: string;
defaultMsg: string;
};
ERROR_FORBIDDEN_OPE: {
code: string;
defaultMsg: string;
};
ERROR_RECEIVE_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_SEND_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_NO_PRIZE: {
code: string;
defaultMsg: string;
};
ERROR_NO_STOCK: {
code: string;
defaultMsg: string;
};
ERROR_PRIZE_EXPIRED: {
code: string;
defaultMsg: string;
};
};
export * from './errorCode';
export declare const TBERROR: {
USER_PERMISSION_EXCEED_MAX_RIGHT_COUNT_IN_DAY: string;
COUPON_INVALID_OR_DELETED: string;
......@@ -184,9 +17,6 @@ export declare const DRAW_STATUS: {
EXPIRED: number;
RETRY: number;
};
export declare const appId = "${\u9700\u8981\u8865\u5145}";
export declare const sellerId = "${\u5546\u94FAid}";
export declare const C_APP_NAME: string;
export declare const TAOBAO_SUCCESS_ORDER_STATUS: string[];
export declare const enum ACTIVITY_STATUS {
NORMAL = 1,
......@@ -229,3 +59,6 @@ export declare enum STAT_TYPE {
CLICK_INVITE = 1,
CLICK_FOLLOW_TASK = 2
}
export declare const appId = "${\u9700\u8981\u8865\u5145}";
export declare const sellerId = "${\u5546\u94FAid}";
export declare const C_APP_NAME: string;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.STAT_TYPE = exports.SHIP_STATUS = 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.sellerId = exports.appId = exports.DRAW_STATUS = exports.TBERROR = exports.CODE_TYPES = exports.BusinessError = void 0;
var sdk_1 = require("./sdk");
exports.BusinessError = {
// 更新重试失败(用于并发更新)
ERROR_UPDATE_RETRY: {
code: "210001",
defaultMsg: "\u7CFB\u7EDF\u9519\u8BEF"
},
// 活动不存在
ERROR_NO_ACTIVITY: {
code: "220001",
defaultMsg: "\u6D3B\u52A8\u4E0D\u5B58\u5728"
},
// 活动未开始
ERROR_ACTIVITY_NOSTART: {
code: "220002",
defaultMsg: "\u6D3B\u52A8\u672A\u5F00\u59CB"
},
// 活动已结束
ERROR_ACTIVITY_OVER: {
code: "220003",
defaultMsg: "\u6D3B\u52A8\u5DF2\u7ED3\u675F"
},
// 用户不存在
ERROR_NO_USER: {
code: "310002",
defaultMsg: "\u7528\u6237\u4E0D\u5B58\u5728"
},
// 非店铺会员
ERROR_NO_VIP: {
code: "310003",
defaultMsg: '非店铺会员'
},
// 暂无次数可领取
ERROR_TASK_NORECEIVE: {
code: "430001",
defaultMsg: "\u8BE5\u4EFB\u52A1\u6682\u65E0\u9886\u53D6\u6B21\u6570"
},
// 任务奖励已领取
ERROR_TASK_ALREADYRECEIVE: {
code: "430002",
defaultMsg: "\u4EFB\u52A1\u5956\u52B1\u5DF2\u9886\u53D6"
},
// 任务已完成
ERROR_TASK_COMPLETE: {
code: "430003",
defaultMsg: "\u4EFB\u52A1\u5DF2\u5B8C\u6210"
},
ERROR_INVALID_INVITE_ID: {
code: "430004",
defaultMsg: "\u9080\u8BF7\u7801\u65E0\u6548"
},
ERROR_NO_CREDITS: {
code: "430005",
defaultMsg: "\u4EFB\u52A1\u6240\u9700\u79EF\u5206\u4E0D\u8DB3"
},
ERROR_TASK_LIMIT: {
code: "430006",
defaultMsg: "\u4ECA\u65E5\u8BE5\u4EFB\u52A1\u6B21\u6570\u8D85\u9650"
},
ERROR_AREADY_INVITE_SUCCESS: {
code: "430007",
defaultMsg: "\u5DF2\u7ECF\u6210\u529F\u9080\u8BF7\u8FC7"
},
ERROR_NO_INVITE_SELF: {
code: "430008",
defaultMsg: "\u81EA\u5DF1\u4E0D\u80FD\u7ED9\u81EA\u5DF1\u52A9\u529B"
},
ERROR_FORBIDDEN_OPE: {
code: "530001",
defaultMsg: "\u975E\u6CD5\u64CD\u4F5C"
},
ERROR_RECEIVE_PRIZE: {
code: "630002",
defaultMsg: "\u5956\u52B1\u5DF2\u9886\u53D6"
},
ERROR_SEND_PRIZE: {
code: "730001",
defaultMsg: "\u53D1\u5956\u5931\u8D25"
},
ERROR_NO_PRIZE: {
code: "730002",
defaultMsg: "\u5956\u54C1\u4E0D\u5B58\u5728"
},
ERROR_NO_STOCK: {
code: "730003",
defaultMsg: "\u5E93\u5B58\u4E0D\u8DB3"
},
ERROR_PRIZE_EXPIRED: {
code: "740001",
defaultMsg: "\u5956\u54C1\u5DF2\u8D85\u8FC7\u9886\u53D6\u65F6\u95F4"
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
exports.CODE_TYPES = Object.assign({}, sdk_1.DEFAULT_CODE_TYPES, exports.BusinessError);
Object.defineProperty(exports, "__esModule", { value: true });
exports.C_APP_NAME = exports.sellerId = exports.appId = exports.STAT_TYPE = exports.SHIP_STATUS = exports.SWICH_TOCK = exports.PRIZE_DATA_TYPE = exports.PRIZE_TYPE = exports.TASK_STATUS = exports.TASK_RATE_TYPE = exports.TAOBAO_SUCCESS_ORDER_STATUS = exports.DRAW_STATUS = exports.TBERROR = void 0;
__exportStar(require("./errorCode"), exports);
// tb 接口返回部分错误
exports.TBERROR = {
USER_PERMISSION_EXCEED_MAX_RIGHT_COUNT_IN_DAY: '今日领取达到上限,明日再来领取哦',
......@@ -120,11 +38,6 @@ exports.DRAW_STATUS = {
// 重新领取
RETRY: 6
};
exports.appId = '${需要补充}';
// 商铺id 拼接vip链接用
exports.sellerId = '${商铺id}';
// C端的APP NAME
exports.C_APP_NAME = "promotioncenter-" + exports.appId;
// 订单状态
exports.TAOBAO_SUCCESS_ORDER_STATUS = [
'WAIT_SELLER_SEND_GOODS',
......@@ -176,4 +89,9 @@ var STAT_TYPE;
STAT_TYPE[STAT_TYPE["CLICK_INVITE"] = 1] = "CLICK_INVITE";
STAT_TYPE[STAT_TYPE["CLICK_FOLLOW_TASK"] = 2] = "CLICK_FOLLOW_TASK";
})(STAT_TYPE = exports.STAT_TYPE || (exports.STAT_TYPE = {}));
exports.appId = '${需要补充}';
// 商铺id 拼接vip链接用
exports.sellerId = '${商铺id}';
// C端的APP NAME
exports.C_APP_NAME = "promotioncenter-" + exports.appId;
//# sourceMappingURL=constants.js.map
\ 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,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ACR,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;AAED,MAAM;AACO,QAAA,WAAW,GAAG;IACzB,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;CACZ,CAAA;AAED,OAAO;AACP,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,yDAAgB,CAAA;IAChB,mEAAiB,CAAA;AACnB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
\ No newline at end of file
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;AAEd,8CAA2B;AAE3B,cAAc;AACD,QAAA,OAAO,GAAG;IACrB,6CAA6C,EAAE,kBAAkB;IACjE,yBAAyB,EAAE,iBAAiB;IAC5C,oBAAoB,EAAE,aAAa;IACnC,sCAAsC,EAAE,gBAAgB;IACxD,iBAAiB,EAAE,cAAc;IACjC,YAAY,EAAE,YAAY;IAC1B,iBAAiB,EAAE,iBAAiB;CACrC,CAAA;AAED,SAAS;AACI,QAAA,WAAW,GAAG;IACzB,MAAM;IACN,SAAS,EAAE,CAAC;IACZ,MAAM;IACN,UAAU,EAAE,CAAC;IACb,OAAO;IACP,OAAO,EAAE,CAAC;IACV,OAAO;IACP,IAAI,EAAE,CAAC;IACP,MAAM;IACN,OAAO,EAAE,CAAC;IACV,OAAO;IACP,KAAK,EAAE,CAAC;CACT,CAAA;AAED,OAAO;AACM,QAAA,2BAA2B,GAAa;IACnD,wBAAwB;IACxB,uBAAuB;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;AAED,MAAM;AACO,QAAA,WAAW,GAAG;IACzB,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;CACZ,CAAA;AAED,OAAO;AACP,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,yDAAgB,CAAA;IAChB,mEAAiB,CAAA;AACnB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB;AAEY,QAAA,KAAK,GAAG,SAAS,CAAA;AAE9B,gBAAgB;AACH,QAAA,QAAQ,GAAG,SAAS,CAAA;AAEjC,cAAc;AACD,QAAA,UAAU,GAAW,qBAAmB,aAAO,CAAA"}
\ No newline at end of file
......@@ -33,12 +33,12 @@ 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 | string[] | number[] | object[], 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<{
id: number | CodeType;
id: string | CodeType;
type: number;
name: string;
image: string;
......
......@@ -139,7 +139,7 @@ var AwardsController = /** @class */ (function () {
var userInfo = _a.userInfo;
var awardSer = _b[0];
return __awaiter(this, void 0, void 0, function () {
var openId, _d, activityId, prizeDataType, prizesPool, thanksPrize, prize, reduceResult, type, _id, ename, image, name, userNick, record, result;
var openId, _d, activityId, prizeDataType, prizesPool, thanksPrize, prize, reduceResult, type, _id, ename, image, name, useUrl, userNick, record, result;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
......@@ -177,7 +177,7 @@ var AwardsController = /** @class */ (function () {
if (((_c = reduceResult) === null || _c === void 0 ? void 0 : _c.code) || !reduceResult) {
prize = thanksPrize;
}
type = prize.type, _id = prize._id, ename = prize.ename, image = prize.image, name = prize.name;
type = prize.type, _id = prize._id, ename = prize.ename, image = prize.image, name = prize.name, useUrl = prize.useUrl;
userNick = userInfo.userNick;
record = {
openId: openId,
......@@ -186,6 +186,7 @@ var AwardsController = /** @class */ (function () {
drawStatus: constants_1.DRAW_STATUS.WAITAWARD,
prizeDataType: prizeDataType,
remark: '',
useUrl: useUrl,
type: type,
ename: ename,
name: name,
......
{"version":3,"file":"awards.controller.js","sourceRoot":"","sources":["../../src/controller/awards.controller.ts"],"names":[],"mappings":";AAAA,c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EAAE,MAAM;gCACV,IAAI,MAAA;gCACJ,IAAI,MAAA;gCACJ,KAAK,OAAA;6BACN,CAAC,EAAA;;;;KACH;IAtID;QAHC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;0DAczB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;QAC7G,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;8DAuBzB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QACjC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;6DAYzB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;QAC5C,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;4DAiEzB;IACH,uBAAC;CAAA,AA9ID,IA8IC;kBA9IoB,gBAAgB"}
\ No newline at end of file
{"version":3,"file":"awards.controller.js","sourceRoot":"","sources":["../../src/controller/awards.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,0CAAkF;AAClF,8BAAqC;AACrC,sCAA0C;AAC1C,0CAAkE;AAClE,kCAA2C;AAwB3C;IAAA;IA+IA,CAAC;IA9IC;;OAEG;IAIG,yCAAc,GAApB,UACE,OAAmC,EACnC,EAAE,EACF,EAA2B;YAA1B,QAAQ,QAAA;;;;;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B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;0DAczB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;QAC7G,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;8DAuBzB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QACjC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;6DAYzB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;QAC5C,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,uBAAa,CAAC,CAAC;;;;4DAkEzB;IACH,uBAAC;CAAA,AA/ID,IA+IC;kBA/IoB,gBAAgB"}
\ No newline at end of file
/** @format */
import { UserService, AccessService, TaskService } from '../service';
import { UserService, TaskService } from '../service';
export default class Share {
/**
* 获取邀请信息
*/
getShareInfo(context: IContext<{
activityId: string;
}>, { userInfo }: IControllerInfos): Promise<IResult<{
rewards: number;
}>>;
/**
* 完成分享
*/
doHelp(context: IContext<IParams>, { userInfo, vipInfo, activityInfo }: IControllerInfos, [userService, taskService, accessService]: [UserService, TaskService, AccessService]): Promise<IResult<boolean>>;
doHelp(context: IContext<{
activityId: string;
inviteId: string;
}>, { userInfo, vipInfo, activityInfo }: IControllerInfos, [userService, taskService]: [UserService, TaskService]): Promise<IResult<boolean>>;
}
......@@ -56,14 +56,29 @@ var registeInfos_1 = require("../decorator/registeInfos");
var Share = /** @class */ (function () {
function Share() {
}
/**
* 获取邀请信息
*/
Share.prototype.getShareInfo = function (context, _a) {
var userInfo = _a.userInfo;
return __awaiter(this, void 0, void 0, function () {
var invites;
return __generator(this, function (_b) {
invites = userInfo.remainTimes.invites;
return [2 /*return*/, sdk_1.resultsModel.success({
rewards: invites
})];
});
});
};
/**
* 完成分享
*/
Share.prototype.doHelp = function (context, _a, _b) {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo;
var userService = _b[0], taskService = _b[1], accessService = _b[2];
var userService = _b[0], taskService = _b[1];
return __awaiter(this, void 0, void 0, function () {
var inviteId, openId, inviteUserInfo, inviteCompleteList, tasks, value, isNewVip, isValidShare, today, inviteUserId;
var inviteId, openId, inviteUserInfo, taskInfo, tasks, value, isNewVip, isValidShare, today, inviteUserId;
var _c;
return __generator(this, function (_d) {
switch (_d.label) {
......@@ -80,13 +95,13 @@ var Share = /** @class */ (function () {
// inviteId的用户信息查询不到, 则inviteId无效
if (!inviteUserInfo)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.ERROR_INVALID_INVITE_ID)];
inviteCompleteList = taskService.getCompleteTaskByUserTaskInfo('invites', inviteUserInfo);
taskInfo = taskService.getCompleteTaskByUserTaskInfo('invites', inviteUserInfo).taskInfo;
// 邀请成功列表有该用户信息
if (inviteCompleteList.some(function (v) { return v.openId === openId; })) {
if (taskInfo.some(function (v) { return v.openId === openId; })) {
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.ERROR_AREADY_INVITE_SUCCESS)];
}
tasks = activityInfo.tasks;
value = (tasks || {}).invites.value;
value = tasks.invites.value;
isNewVip = userService.checkNewVip(userInfo, vipInfo);
if (!(isNewVip && !userInfo.member.newMember)) return [3 /*break*/, 3];
return [4 /*yield*/, userService.updateUser(userInfo._id, {
......@@ -120,6 +135,14 @@ var Share = /** @class */ (function () {
});
});
};
__decorate([
check_1.paramsCheck(['activityId']),
registeInfos_1.registeInfos(['userInfo', 'activityInfo']),
services_1.services([service_1.UserService]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object]),
__metadata("design:returntype", Promise)
], Share.prototype, "getShareInfo", null);
__decorate([
check_1.paramsCheck(['activityId', 'inviteId']),
check_1.activityTimeCheck,
......
{"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;AACpE,0DAAwD;AAExD;IAAA;IAqEA,CAAC;IApEC;;OAEG;IAKG,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;wBAE1B,IAAI,MAAM,KAAK,QAAQ;4BAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,oBAAoB,CAAC,EAAA;wBAEjD,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,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;QACrD,mBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;uCA6DnD;IACH,YAAC;CAAA,AArED,IAqEC;kBArEoB,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;AACpE,0DAAwD;AAExD;IAAA;IA8FA,CAAC;IA7FC;;OAEG;IAIG,4BAAY,GAAlB,UACE,OAEE,EACF,EAA8B;YAA5B,QAAQ,cAAA;;;;gBAOO,OAAO,GACpB,QAAQ,oBADY,CACZ;gBAEZ,sBAAO,kBAAY,CAAC,OAAO,CAAC;wBAC1B,OAAO,EAAE,OAAO;qBACjB,CAAC,EAAA;;;KACH;IACD;;OAEG;IAKG,sBAAM,GAAZ,UACE,OAGE,EACF,EAAqD,EACrD,EAAsD;YADpD,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;YAChC,WAAW,QAAA,EAAE,WAAW,QAAA;;;;;;;wBAEjB,QAAQ,GAAK,OAAO,CAAC,IAAI,SAAjB,CAAiB;wBACzB,MAAM,GAAK,OAAO,OAAZ,CAAY;wBAE1B,IAAI,MAAM,KAAK,QAAQ;4BAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,oBAAoB,CAAC,EAAA;wBAEjD,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;wBAE1E,QAAQ,GA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ACnB,SAOE,CAAA;;4BAGJ,sBAAO,kBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;;;KAClC;IAtFD;QAHC,mBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,2BAAY,CAAC,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QAC1C,mBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;6CAkBvB;IAQD;QAJC,mBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvC,yBAAiB;QACjB,2BAAY,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;QACrD,mBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;uCA8DnD;IACH,YAAC;CAAA,AA9FD,IA8FC;kBA9FoB,KAAK"}
\ No newline at end of file
......@@ -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 | string[] | number[] | object[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<any, true>>;
}
......@@ -81,93 +81,122 @@ var StatController = /** @class */ (function () {
* 统计数据
*/
StatController.prototype.getStats = function (context) {
var _a, _b, _c, _d;
return __awaiter(this, void 0, void 0, function () {
var _a, activityId, startDay, endDay, userDao, accessDao, oneDay, xlsxData, day, PV, UV, newUV, vipPV, noVipPV, vipUV, noVipUV, newVipUV, newFollowUV, keyValueMapper, tommorrow, buffer, result, e_1;
return __generator(this, function (_b) {
switch (_b.label) {
var _e, activityId, startDay, endDay, userDao, accessDao, oneDay, xlsxData, day, PV, UV, newUV, vipPV, vipUV, noVipPV, noVipUV, newVipUV, newFollowUV, getTaskCompleteUV, keyValueMapper, tommorrow, buffer, result, e_1;
var _this = this;
return __generator(this, function (_f) {
switch (_f.label) {
case 0:
_a = context.data, activityId = _a.activityId, startDay = _a.startDay, endDay = _a.endDay;
_e = context.data, activityId = _e.activityId, startDay = _e.startDay, endDay = _e.endDay;
userDao = new sdk_1.BaseDao(context, db_1.USER_DB_NAME);
accessDao = new sdk_1.BaseDao(context, db_1.ACCESS_DB_NAME);
oneDay = 24 * 3600 * 1000;
xlsxData = [];
_b.label = 1;
_f.label = 1;
case 1:
_b.trys.push([1, 14, , 15]);
_f.trys.push([1, 14, , 15]);
day = startDay;
_b.label = 2;
_f.label = 2;
case 2:
if (!(new Date(day).getTime() <= new Date(endDay).getTime())) return [3 /*break*/, 12];
return [4 /*yield*/, accessDao.count({ activityId: activityId, createDay: day })
// 访问UV
];
case 3:
PV = _b.sent();
PV = _f.sent();
return [4 /*yield*/, accessDao.aggregate([
{ $match: { activityId: activityId, createDay: day } },
{ $group: { _id: '$openId', count: { $sum: 1 } } }
{ $group: { _id: '$openId', count: { $sum: 1 } } },
{ $count: 'uv' }
])];
case 4:
UV = (_b.sent()).length;
UV = (_b = (_a = (_f.sent())) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.uv;
return [4 /*yield*/, userDao.count({
activityId: activityId,
createDay: day
})
// 已入会PV
// 已入会(老会员)PV
];
case 5:
newUV = _b.sent();
return [4 /*yield*/, accessDao.count({ activityId: activityId, createDay: day, isVip: true })
// 未入会PV
newUV = _f.sent();
return [4 /*yield*/, accessDao.count({
activityId: activityId,
createDay: day,
//@ts-ignore
$or: [{ 'member.flag': true }, { 'member.newMember': true }],
'member.bememberDay': {
$not: {
$eq: day
}
}
})
// 已入会(老会员)UV
];
case 6:
vipPV = _b.sent();
vipPV = _f.sent();
return [4 /*yield*/, accessDao.aggregate([
{
$match: {
activityId: activityId,
createDay: day,
$or: [{ 'member.flag': true }, { 'member.newMember': true }],
'member.bememberDay': {
$not: {
$eq: day
}
}
}
},
{ $project: { openId: true } },
{ $group: { _id: '$openId', count: { $sum: 1 } } },
{ $count: 'uv' }
], { allowDiskUse: true })];
case 7:
vipUV = (_d = (_c = (_f.sent())) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.uv;
return [4 /*yield*/, accessDao.count({ activityId: activityId, createDay: day, isVip: false })
// 入会UV
// 入会UV
];
case 7:
noVipPV = _b.sent();
return [4 /*yield*/, accessDao.aggregate([
{ $match: { activityId: activityId, createDay: day, isVip: true } },
{ $group: { _id: '$openId', count: { $sum: 1 } } }
])];
case 8:
vipUV = (_b.sent()).length;
noVipPV = _f.sent();
return [4 /*yield*/, accessDao.aggregate([
{ $match: { activityId: activityId, createDay: day, isVip: false } },
{ $group: { _id: '$openId', count: { $sum: 1 } } }
])];
case 9:
noVipUV = (_b.sent()).length;
noVipUV = (_f.sent()).length;
return [4 /*yield*/, userDao.count({
activityId: activityId,
'member.newMember': true,
'member.bememberDay': day
})];
case 10:
newVipUV = _b.sent();
newVipUV = _f.sent();
return [4 /*yield*/, userDao.count({
activityId: activityId,
'follow.newFollow': true,
'follow.followDay': day
})
// 签到任务
// const signTaskUV = await userDao.count({
// activityId,
// [`taskInfo.${day}.sign`]: {
// $exists: true
// }
// })
// 收藏商品
// const collectGoodsTaskUV = await userDao.count({
// activityId,
// [`taskInfo.${day}.collecctGoods`]: {
// $exists: true
// }
// })
// 根据任务类型获取完成任务的人数
// example: await getTaskCompleteUV('collectGoods', day)
];
case 11:
newFollowUV = _b.sent();
newFollowUV = _f.sent();
getTaskCompleteUV = function (task, day) { return __awaiter(_this, void 0, void 0, function () {
var _a;
return __generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, userDao.count((_a = {
activityId: activityId
},
_a["taskInfo." + day + "." + task] = {
$exists: true
},
_a))];
case 1: return [2 /*return*/, _b.sent()];
}
});
}); };
keyValueMapper = {
时间: day,
访问PV: PV,
......@@ -179,9 +208,9 @@ var StatController = /** @class */ (function () {
未入会UV: noVipUV,
新入会UV: newVipUV,
新增关注UV: newFollowUV
// 收藏商品UV: collectGoodsTaskUV
// 签到任务UV: signTaskUV
//收藏商品UV: await getTaskCompleteUV('collectGoods', day)
};
console.log(keyValueMapper, 'xlsxData');
if (day === startDay) {
xlsxData.push(Object.keys(keyValueMapper));
}
......@@ -197,21 +226,18 @@ var StatController = /** @class */ (function () {
data: xlsxData
}
]);
// let result = {}
console.log(xlsxData, 'xlsxData');
return [4 /*yield*/, context.cloud.file.uploadFile({
fileContent: buffer,
fileName: "\u6570\u636E\u7EDF\u8BA1" + startDay.replace(/\//g, '-') + "-" + endDay.replace(/\//g, '-') + ".xlsx"
})];
case 13:
result = _b.sent();
console.log(xlsxData, 'xlsxData');
result = _f.sent();
if (result.url) {
result.url = result.url.replace('http', 'https').replace('-internal', '');
}
return [2 /*return*/, sdk_1.resultsModel.success(result)];
case 14:
e_1 = _b.sent();
e_1 = _f.sent();
console.log('上传文件出错', e_1);
// 打印日志
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, "\u4E0A\u4F20\u6587\u4EF6\u9519\u8BEF")];
......
{"version":3,"file":"stat.controller.js","sourceRoot":"","sources":["../../src/controller/stat.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4BAAoE;AACpE,8BAAmF;AACnF,0CAAyC;AACzC,gCAAiC;AACjC,kDAAgD;AAChD,sCAAwC;AACxC,0CAA2C;AAa3C,cAAc;AACd;IAAA;IA2IA,CAAC;IA1IC;;OAEG;IAGG,gCAAO,GAAb,UAAc,OAAkC,EAAE,EAA8B,EAAE,EAA4B;YAA1D,QAAQ,cAAA;YAAuB,WAAW,QAAA;;;;;;wBACpF,IAAI,GAAK,OAAO,CAAC,IAAI,KAAjB,CAAiB;wBAC7B,qBAAM,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,C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CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;wBACpB,qBAAM,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;gCAC/C,WAAW,EAAE,MAAM;gCACnB,QAAQ,EAAE,6BAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,SAAI,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,UAAO;6BACnF,CAAC,EAAA;;wBAHE,MAAM,GAAG,SAGX;wBACF,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;wBACjC,IAAI,MAAM,CAAC,GAAG,EAAE;4BACd,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;yBAC1E;wBACD,sBAAO,kBAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;;wBAEnC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAC,CAAC,CAAA;wBACxB,OAAO;wBACP,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,sCAAQ,CAAC,EAAA;;;;;KAE/D;IApID;QAFC,wBAAY,CAAC,CAAC,UAAU,CAAC,CAAC;QAC1B,mBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;iDAKvB;IAiIH,qBAAC;CAAA,AA3ID,IA2IC;kBA3IoB,cAAc"}
\ No newline at end of file
{"version":3,"file":"stat.controller.js","sourceRoot":"","sources":["../../src/controller/stat.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4BAAoE;AACpE,8BAAmF;AACnF,0CAAyC;AACzC,gCAAiC;AACjC,kDAAgD;AAChD,sCAAwC;AACxC,0CAA2C;AAa3C,cAAc;AACd;IAAA;IA8JA,CA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AW,EAAE,EAAE,CAAC,CAAA;yBAC1E;wBACD,sBAAO,kBAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;;wBAEnC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAC,CAAC,CAAA;wBACxB,OAAO;wBACP,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,sCAAQ,CAAC,EAAA;;;;;KAE/D;IAvJD;QAFC,wBAAY,CAAC,CAAC,UAAU,CAAC,CAAC;QAC1B,mBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;iDAKvB;IAoJH,qBAAC;CAAA,AA9JD,IA8JC;kBA9JoB,cAAc"}
\ No newline at end of file
......@@ -33,7 +33,9 @@ export default class Task {
/**
* 领取任务奖励
*/
receiveTaskRewards(context: IContext<IParams>, { userInfo }: IControllerInfos, [taskService]: [TaskService]): Promise<IResult<boolean>>;
receiveTaskRewards(context: IContext<IParams>, { userInfo }: IControllerInfos, [taskService]: [TaskService]): Promise<IResult<{
rewards: number;
}>>;
/**
* 获取收藏商品列表
*/
......
......@@ -71,7 +71,7 @@ var Task = /** @class */ (function () {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo;
var taskService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var tasks, startTime, updatedUserInfo, vipTask, followTask;
var tasks, startTime, updatedUserInfo;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
......@@ -88,33 +88,18 @@ var Task = /** @class */ (function () {
if (!updatedUserInfo)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, '更新任务列表失败')
// 返回对应的任务时, B端b_activity_config tasks 需配置对应的任务
// 会员任务
];
vipTask = taskService.initVipTask(updatedUserInfo, vipInfo, tasks);
followTask = taskService.initFollowTask(updatedUserInfo, tasks);
// 签到任务
// const signTask = taskService.initSignTask(updatedUserInfo, tasks)
// // 下单任务
// const orderGoodsTask = taskService.initOrderGoodsTask(updatedUserInfo, tasks)
// // 浏览商品任务
// const browseGoodsTask = taskService.initBrowseGoodsTask(updatedUserInfo, tasks)
// // 收藏商品任务
// const collectGoodsTask = taskService.initCollectGoodsTask(updatedUserInfo, tasks)
// // 跳转链接任务
// const jumpLinkTask = taskService.initJumpLinkTask(updatedUserInfo, tasks)
// // 邀请任务
// const invitesTask = taskService.initInvitesTask(updatedUserInfo, tasks)
// 积分兑换
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
// 返回对应的任务时, B端b_activity_config tasks 需配置对应的任务
return [2 /*return*/, sdk_1.resultsModel.success([
//signTask,
vipTask,
followTask
// orderGoodsTask,
// browseGoodsTask,
// invitesTask,
// collectGoodsTask,
// jumpLinkTask
taskService.initTask('member', '加入会员', tasks, updatedUserInfo),
taskService.initTask('follow', '关注店铺', tasks, updatedUserInfo)
// taskService.initTask('sign', '签到', tasks, updatedUserInfo),
// taskService.initTask('orderGoods', '购买商品', tasks, updatedUserInfo),
// taskService.initTask('browseGoods', '浏览商品', tasks, updatedUserInfo),
// taskService.initTask('collectGoods', '收藏商品', tasks, updatedUserInfo),
// taskService.initTask('jumpLink', '浏览页面', tasks, updatedUserInfo),
// taskService.initTask('invites', '邀请好友', tasks, updatedUserInfo),
// taskService.initTask('exchangeCredits', '积分兑换', tasks, updatedUserInfo)
])];
}
});
......@@ -255,8 +240,7 @@ var Task = /** @class */ (function () {
if (!itemIdArray.includes(+itemId))
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '商品id不匹配')];
_d = taskService.getTodayCompleteTask(taskType, userInfo), todayTaskInfo = _d.todayTaskInfo, todayCompleteTimes = _d.todayCompleteTimes;
hasCompleteToday = todayTaskInfo.filter(function (v) { return v.itemId === itemId; }).length &&
taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY;
hasCompleteToday = todayTaskInfo.filter(function (v) { return v.itemId === itemId; }).length && taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY;
// 今日任务已经完成
if (hasCompleteToday) {
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '今日该收藏商品任务已完成')];
......@@ -317,18 +301,18 @@ var Task = /** @class */ (function () {
var userInfo = _a.userInfo;
var taskService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var taskType, remainTimes, _id, waitReceiveTimes, awardsTargetKey;
var awardsTargetKey, taskType, remainTimes, _id, waitReceiveTimes;
var _c, _d;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
awardsTargetKey = "gameTimes";
taskType = context.data.taskType;
remainTimes = userInfo.remainTimes, _id = userInfo._id;
// 暂无领取次数
if (!(remainTimes === null || remainTimes === void 0 ? void 0 : remainTimes[taskType]))
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.ERROR_TASK_NORECEIVE)];
waitReceiveTimes = remainTimes === null || remainTimes === void 0 ? void 0 : remainTimes[taskType];
awardsTargetKey = "gameTimes";
return [4 /*yield*/, taskService.updateUser(_id, {
$set: (_c = {},
_c["remainTimes." + taskType] = 0,
......@@ -339,7 +323,9 @@ var Task = /** @class */ (function () {
})];
case 1:
_e.sent();
return [2 /*return*/, sdk_1.resultsModel.success(true)];
return [2 /*return*/, sdk_1.resultsModel.success({
rewards: waitReceiveTimes
})];
}
});
});
......@@ -351,7 +337,7 @@ var Task = /** @class */ (function () {
var session = _a.session, userInfo = _a.userInfo;
var baseService = _b[0], taskService = _b[1];
return __awaiter(this, void 0, void 0, function () {
var itemIds, list, completeList, listWithCollectStatus;
var itemIds, list, taskInfo, listWithCollectStatus;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
......@@ -359,11 +345,11 @@ var Task = /** @class */ (function () {
return [4 /*yield*/, baseService.getItemListByIds(itemIds, session)];
case 1:
list = _c.sent();
completeList = taskService.getCompleteTaskByUserTaskInfo('collectGoods', userInfo);
taskInfo = taskService.getCompleteTaskByUserTaskInfo('collectGoods', userInfo).taskInfo;
listWithCollectStatus = list.map(function (v) {
return __assign(__assign({}, v), {
// 完成列表是否含有itemId
collected: completeList.some(function (completeItem) { return completeItem.itemId === v.itemId; }) });
collected: taskInfo.some(function (completeItem) { return completeItem.itemId === v.itemId; }) });
});
return [2 /*return*/, sdk_1.resultsModel.success(listWithCollectStatus)];
}
......
{"version":3,"file":"task.controller.js","sourceRoot":"","sources":["../../src/controller/task.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2D;AAC3D,0CAAyG;AAEzG,8BAA6C;AAC7C,sCAAqD;AAIrD;IAAA;IAoVA,CAAC;IAnVC;;OAEG;IAMG,0BAAW,GAAjB,UACE,OAAyC,EACzC,EAAqD,EACrD,EAA4B;YAD1B,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;YAChC,WAAW,QAAA;;;;;;wBAEJ,KAAK,GAAgB,YAAY,MAA5B,EAAE,SAAS,GAAK,YAAY,UAAjB,CAAiB;wBAGnB,qBAAM,WAAW,CAAC,WAAW,CACjD,QAAQ,CAAC,GAAG;4BACZ,YAAY;4BACZ;gCACE,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC;gCACnD,+CAA+C;gCAC/C,8EAA8E;6BAC/E,EACD,QAAQ,CACT,EAAA;;wBATG,eAAe,GAAG,SASrB;wBAED,IAAI,CAAC,eAAe;4BAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,UAAU,CAAC;gCAEpF,+CAA+C;gCAE/C,OAAO;8BAJ6E;wBAK9E,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,eAAe,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;wBAElE,UAAU,GAAG,WAAW,CAAC,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;wBACrE,OAAO;wBACP,oEAA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VD,IAoVC;kBApVoB,IAAI"}
\ No newline at end of file
{"version":3,"file":"task.controller.js","sourceRoot":"","sources":["../../src/controller/task.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2D;AAC3D,0CAAyG;AAEzG,8BAA6C;AAC7C,sCAAqD;AAIrD;IAAA;IAiUA,CAAC;IAhUC;;OAEG;IAMG,0BAAW,GAAjB,UACE,OAAyC,EACzC,EAAqD,EACrD,EAA4B;YAD1B,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;YAChC,WAAW,QAAA;;;;;;wBAEJ,KAAK,GAAgB,YAAY,MAA5B,EAAE,SAAS,GAAK,YAAY,UAAjB,CAAiB;wBAGnB,qBAAM,WAAW,CAAC,WAAW,CACjD,QAAQ,CAAC,GAAG;4BACZ,YAAY;4BACZ;gCACE,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC;gCACnD,+CAA+C;gCAC/C,8EAA8E;6BAC/E,EACD,QAAQ,CACT,EAAA;;wBATG,eAAe,GAAG,SASrB;wBAED,IAAI,CAAC,eAAe;4BAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,UAAU,CAAC;gCAEpF,+CAA+C;8BAFqC;wBAEpF,+CAA+C;wBAE/C,sBAAO,kBAAY,CAAC,OAAO,CAAC;gCAC1B,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC;gCAC9D,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC;gCAC9D,8DAA8D;gCAC9D,sEAAsE;gCACtE,uEAAuE;gCACvE,wEAAwE;gCACxE,oEAAoE;gCACpE,mEAAmE;gCACnE,0EAA0E;6BAC3E,CAAC,EAAA;;;;KACH;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AAW,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QACrC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,wBAAY,CAAC,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QAC1C,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;kDAuCvB;IAUD;QALC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,wBAAY,CAAC,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QAC1C,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;8CA+BvB;IAUD;QALC,uBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,wBAAY,CAAC,CAAC,UAAU,CAAC,CAAC;QAC1B,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;kDA8BvB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACtC,wBAAY,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACrC,oBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,CAAC,CAAC;;;;mDAoBpC;IACH,WAAC;CAAA,AAjUD,IAiUC;kBAjUoB,IAAI"}
\ No newline at end of file
......@@ -22,5 +22,5 @@ export default class User {
/**
* 获取会员信息
*/
getVipInfo(context: IContext<IVipParams>, { session, activityUserNick }: IControllerInfos, [userService]: [UserService]): Promise<IResult<IVipInfo>>;
getVipInfo(context: IContext<IVipParams>, { session, activityUserNick }: IControllerInfos): Promise<IResult<IVipInfo>>;
}
......@@ -60,12 +60,11 @@ var User = /** @class */ (function () {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo;
var userService = _b[0], accessService = _b[1];
return __awaiter(this, void 0, void 0, function () {
var openId, isFollow;
var openId;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
openId = context.openId;
isFollow = context.data.isFollow;
if (!!userInfo) return [3 /*break*/, 2];
return [4 /*yield*/, userService.initUserData(vipInfo, activityInfo)];
case 1:
......@@ -91,18 +90,17 @@ var User = /** @class */ (function () {
/**
* 获取会员信息
*/
User.prototype.getVipInfo = function (context, _a, _b) {
User.prototype.getVipInfo = function (context, _a) {
var session = _a.session, activityUserNick = _a.activityUserNick;
var userService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var callbackUrl, result;
return __generator(this, function (_c) {
switch (_c.label) {
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
callbackUrl = context.data.callbackUrl;
return [4 /*yield*/, userService.getShopVip(session, callbackUrl || vip_1.formatVipCbUrl(context), activityUserNick)];
return [4 /*yield*/, vip_1.getShopVip(context, session, callbackUrl || vip_1.formatVipCbUrl(context), activityUserNick)];
case 1:
result = _c.sent();
result = _b.sent();
return [2 /*return*/, sdk_1.resultsModel.success(result)];
}
});
......@@ -120,9 +118,9 @@ var User = /** @class */ (function () {
__decorate([
decorator_1.paramsCheck(['activityId']),
decorator_1.registeInfos(['session']),
decorator_1.services([service_1.UserService]),
decorator_1.services([]),
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]),
__metadata("design:paramtypes", [Object, Object]),
__metadata("design:returntype", Promise)
], User.prototype, "getVipInfo", null);
return User;
......
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../src/controller/user.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,0CAAqF;AAErF,8BAAqC;AACrC,sCAAuD;AAEvD,4CAAqD;AAcrD;IAAA;IA+CA,CAAC;IA9CC;;OAEG;IAKG,oBAAK,GAAX,UACE,OAA+B,EAC/B,EAAqD,EACrD,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oBAAQ,CAAC,CAAC,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;qCAsBtC;IAOD;QAHC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,wBAAY,CAAC,CAAC,SAAS,CAAC,CAAC;QACzB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;0CAWvB;IACH,WAAC;CAAA,AA/CD,IA+CC;kBA/CoB,IAAI"}
\ No newline at end of file
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../src/controller/user.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,0CAAqF;AACrF,8BAAqC;AACrC,sCAAuD;AACvD,4CAAiE;AAcjE;IAAA;IA4CA,CAAC;IA3CC;;OAEG;IAKG,oBAAK,GAAX,UACE,OAA+B,EAC/B,EAAqD,EACrD,EAA0D;YADxD,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;YAChC,WAAW,QAAA,EAAE,aAAa,QAAA;;;;;;wBAEnB,MAAM,GAAK,OAAO,OAAZ,CAAY;6BAEtB,CAAC,QAAQ,EAAT,wBAAS;wBACA,qBAAM,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,EAAA;;wBAAhE,QAAQ,GAAG,SAAqD,CAAA;;4BAErD,qBAAM,WAAW,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAA;;wBAA5E,QAAQ,GAAG,SAAiE,CAAA;;;oBAG9E,UAAU;oBACV,qBAAM,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAA;;wBADvC,UAAU;wBACV,SAAuC,CAAA;wBAEvC,sBAAO,kBAAY,CAAC,OAAO,CAAC;gCAC1B,MAAM,QAAA;6BACP,CAAC,EAAA;;;;KACH;IACD;;OAEG;IAIG,yBAAU,GAAhB,UACE,OAA6B,EAC7B,EAA+C;YAA7C,OAAO,aAAA,EAAE,gBAAgB,sBAAA;;;;;;wBAEnB,WAAW,GAAK,OAAO,CAAC,IAAI,YAAjB,CAAiB;wBAErB,qBAAM,gBAAU,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,IAAI,oBAAc,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC,EAAA;;wBAArG,MAAM,GAAG,SAA4F;wBAE3G,sBAAO,kBAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;;;KACpC;IAnCD;QAJC,uBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC7D,6BAAiB;QACjB,wBAAY,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;QACrD,oBAAQ,CAAC,CAAC,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;qCAoBtC;IAOD;QAHC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,wBAAY,CAAC,CAAC,SAAS,CAAC,CAAC;QACzB,oBAAQ,CAAC,EAAE,CAAC;;;;0CAUZ;IACH,WAAC;CAAA,AA5CD,IA4CC;kBA5CoB,IAAI"}
\ No newline at end of file
......@@ -68,8 +68,10 @@ exports.paramsCheck = function (params) {
var dataKeys = Object.keys(context.data);
for (var i = 0; i < params.length; i++) {
var param = params[i];
if (!dataKeys.includes(param) || ((_a = context.data) === null || _a === void 0 ? void 0 : _a[param]) === '')
if (!dataKeys.includes(param) || ((_a = context.data) === null || _a === void 0 ? void 0 : _a[param]) === '') {
utils_1.logFn(context);
return sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, "\u7F3A\u5C11" + param + "\u53C2\u6570");
}
}
return method.apply(target, [context, __assign({}, otherArgs)]);
};
......@@ -124,7 +126,7 @@ exports.vipCheck = function (_a) {
return [4 /*yield*/, utils_1.getSellerSession(context)];
case 1:
_b = _c.sent(), session = _b.session, userNick = _b.userNick;
return [4 /*yield*/, userService.getShopVip(session, vip_1.formatVipCbUrl(context), userNick)];
return [4 /*yield*/, vip_1.getShopVip(context, session, vip_1.formatVipCbUrl(context), userNick)];
case 2:
vipInfo = _c.sent();
if (!vipInfo.isVip && intercept)
......
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/decorator/check.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,8BAAqC;AACrC,0CAAyC;AACzC,sCAAqD;AACrD,kCAA2C;AAE3C,4CAAqD;AACrD,WAAW;AACE,QAAA,WAAW,GAAG,UAAC,MAAgB;IAC1C,OAAO,UAAU,MAAc,EAAE,IAAY,EAAE,UAA8B;QAC3E,IAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAA;QAE/B,UAAU,CAAC,KAAK,GAAG;;YAAU,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAClC,IAAA,OAAO,GAAoB,IAAI,GAAxB,EAAE,KAAkB,IAAI,GAAR,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAQ;YACtC,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACtC,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;gBACvB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAA,OAAO,CAAC,IAAI,0CAAG,KAAK,OAAM,EAAE;oBAC3D,OAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,EAAE,iBAAK,KAAK,iBAAI,CAAC,CAAA;aACrE;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,eAAO,SAAS,EAAG,CAAC,CAAA;QA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AAE,CAAC,OAAO,wBAAO,SAAS,KAAE,YAAY,cAAA,IAAG,CAAC,EAAA;;;;KACvE,CAAA;AACH,CAAC,CAAA"}
\ No newline at end of file
......@@ -84,7 +84,7 @@ function initBaseInfo(context, baseInfos, needInfos) {
baseInfos.session = session;
baseInfos.activityUserNick = userNick;
_f.label = 6;
case 6: return [4 /*yield*/, userService.getShopVip(baseInfos.session, vip_1.formatVipCbUrl(context), baseInfos.activityUserNick)];
case 6: return [4 /*yield*/, vip_1.getShopVip(context, baseInfos.session, vip_1.formatVipCbUrl(context), baseInfos.activityUserNick)];
case 7:
vipInfo = _f.sent();
baseInfos.vipInfo = vipInfo;
......
{"version":3,"file":"registeInfos.js","sourceRoot":"","sources":["../../src/decorator/registeInfos.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,sCAAwC;AACxC,kCAAkE;AAGlE,4CAAqD;AAIrD,SAAe,YAAY,CAAC,OAA0B,EAAE,SAA2B,EAAE,SAAkB;;;;;;;oBAC/F,OAAO,qBAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,SAAS,0CAAE,OAAO,0CAAE,OAAO,CAAA;oBACrD,WAAW,GAAG,IAAI,qBAAW,CAAC,OAAO,CAAC,CAAA;yBAExC,CAAA,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAA,EAArD,wBAAqD;oBACtC,qBAAM,WAAW,CAAC,WAAW,EAAE,EAAA;;oBAA1C,QAAQ,GAAG,SAA+B;oBAChD,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA;;;yBAG3B,CAAA,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAA,EAAnD,wBAAmD;oBACvB,qBAAM,wBAAgB,CAAC,OAAO,CAAC,EAAA;;oBAAvD,KAAwB,SAA+B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B;oBACU,qBAAM,wBAAgB,CAAC,OAAO,CAAC,EAAA;;oBAAvD,KAAwB,SAA+B,EAArD,OAAO,aAAA,EAAE,QAAQ,cAAA;oBACzB,SAAS,CAAC,OAAO,GAAG,OAAO,CAAA;oBAC3B,SAAS,CAAC,gBAAgB,GAAG,QAAQ,CAAA;;wBAEvB,qBAAM,gBAAU,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,oBAAc,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,EAAA;;oBAA3G,OAAO,GAAG,SAAiG;oBACjH,SAAS,CAAC,OAAO,GAAG,OAAO,CAAA;;wBAE7B,sBAAO,SAAS,EAAA;;;;CACjB;AAEY,QAAA,YAAY,GAAG,UAAC,SAAkB;IAC7C,OAAO,UAAU,MAAW,EAAE,IAAY,EAAE,UAA8B;QACxE,IAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAA;QAC/B,UAAU,CAAC,KAAK,GAAG;YAAgB,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;;;;;;4BACxC,OAAO,GAAoB,IAAI,GAAxB,EAAE,KAAkB,IAAI,GAAR,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAQ;4BAErB,qBAAM,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,EAAA;;4BAA5D,QAAQ,GAAG,SAAiD;4BAElE,sBAAO,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,eAAO,QAAQ,EAAG,CAAC,EAAA;;;;SACxD,CAAA;IACH,CAAC,CAAA;AACH,CAAC,CAAA"}
\ No newline at end of file
/** @format */
declare type Constructor = new (...args: any[]) => {};
export declare const services: (services: Constructor[]) => (target: Object, name: string, descriptor: PropertyDescriptor) => void;
export {};
"use strict";
/** @format */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
......@@ -56,7 +57,6 @@ exports.services = function (services) {
case 0:
context = args[0], _a = args[1], otherArgs = _a === void 0 ? {} : _a;
servicesInstance = services.map(function (v) { return new v(context); });
// const baseInfos: IControllerInfos = await initBaseInfo(context, otherArgs)
utils_1.logFn(context);
baseInfos = otherArgs;
// 默认全局try catch 如果有noCatch参数则直接执行
......
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/decorator/services.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kCAAkE;AAClE,8BAAqC;AACrC,0CAAyC;AA0BzC,OAAO;AACM,QAAA,QAAQ,GAAG,UAAC,QAAuB;IAC9C,OAAO,UAAC,MAAc,EAAE,IAAY,EAAE,UAA8B;QAClE,IAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAA;QAE/B,UAAU,CAAC,KAAK,GAAG;YAAgB,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;;;;;;4BAC1C,OAAO,GAAoB,IAAI,GAAxB,EAAE,KAAkB,IAAI,GAAR,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAQ;4BAC9B,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,IAAI,CAAC,CAAC,OAAO,CAAC,EAAd,CAAc,CAAC,CAAA;4BAE1D,6EAA6E;4BAE7E,aAAK,CAAC,OAAO,CAAC,CAAA;4BAER,SAAS,GAAG,SAAS,CAAA;4BAE3B,mCAAmC;4BACnC,IAAI,SAAS,CAAC,OAAO,EAAE;gCACrB,OAAO,SAAS,CAAC,OAAO,CAAA;gCACxB,sBAAO,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,EAAA;6BACpE;;;;4BAGO,qBAAM,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OA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AAS,CAAC,OAAO,CAAA;gCACxB,sBAAO,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,EAAA;6BACpE;;;;4BAGO,qBAAM,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC,EAAA;;4BAAxE,GAAG,GAAG,SAAkE,CAAA;;;;4BAExE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,OAAK,CAAC,CAAA;4BAC3B,qBAAM,sBAAc,CAAC,OAAO,EAAE,SAAS,EAAE,OAAK,CAAC,QAAQ,EAAE,EAAE,OAAK,CAAC,KAAK,CAAC,EAAA;;4BAAvE,SAAuE,CAAA;4BACvE,GAAG,GAAG,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,YAAY,CAAC,CAAA;;gCAEnD,sBAAO,GAAG,EAAA;;;;SACX,CAAA;IACH,CAAC,CAAA;AACH,CAAC,CAAA"}
\ No newline at end of file
......@@ -3,11 +3,13 @@ declare const _default: {
login: (context: IContext<import("./controller/user.controller").ILoginParams>, { userInfo, vipInfo, activityInfo }: IControllerInfos, [userService, accessService]: [import("./service/user.service").default, import("./service").AccessService]) => Promise<IResult<{
openId: string;
}>>;
getVipInfo: (context: IContext<import("./controller/user.controller").IVipParams>, { session, activityUserNick }: IControllerInfos, [userService]: [import("./service/user.service").default]) => Promise<IResult<IVipInfo>>;
getVipInfo: (context: IContext<import("./controller/user.controller").IVipParams>, { session, activityUserNick }: IControllerInfos) => Promise<IResult<IVipInfo>>;
getTaskList: (context: IContext<{
activityId: string;
}>, { userInfo, vipInfo, activityInfo }: IControllerInfos, [taskService]: [import("./service").TaskService]) => Promise<IResult<import("./service/task.service").ITaskInfo[]>>;
receiveTaskRewards: (context: IContext<IParams>, { userInfo }: IControllerInfos, [taskService]: [import("./service").TaskService]) => Promise<IResult<boolean>>;
receiveTaskRewards: (context: IContext<IParams>, { userInfo }: IControllerInfos, [taskService]: [import("./service").TaskService]) => Promise<IResult<{
rewards: number;
}>>;
getActivityBaseInfoById: (context: IContext<{
activityId: string;
}>, {}: {}, [baseService]: [import("./service").BaseService]) => Promise<IResult<IActivityInfo>>;
......@@ -16,7 +18,11 @@ declare const _default: {
}>>;
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>>;
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>>;
doHelp: (context: IContext<{
activityId: string;
inviteId: string;
}>, { userInfo, vipInfo, activityInfo }: IControllerInfos, [userService, taskService]: [import("./service/user.service").default, import("./service").TaskService]) => 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>>;
addStat: (context: IContext<import("./controller/stat.controller").IAddStatsParams>, { userInfo }: IControllerInfos, [statService]: [import("./service").StatService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<boolean, true>>;
};
export default _default;
......@@ -14,7 +14,7 @@ doFollowTask = _b.doFollowTask, doJumpLinkTask = _b.doJumpLinkTask, doBrowseGood
var _c = new base_controller_1.default(), getActivityBaseInfoById = _c.getActivityBaseInfoById, getItemListByItemIds = _c.getItemListByItemIds;
var _d = new awards_controller_1.default(), getMyPrizeList = _d.getMyPrizeList, receiveObjectPrize = _d.receiveObjectPrize, receiveEnamePrize = _d.receiveEnamePrize, drawLotteryPrize = _d.drawLotteryPrize;
var doHelp = new share_controller_1.default().doHelp;
var getStats = new stat_controller_1.default().getStats;
var _e = new stat_controller_1.default(), getStats = _e.getStats, addStat = _e.addStat;
exports.default = {
login: login,
getVipInfo: getVipInfo,
......@@ -25,6 +25,7 @@ exports.default = {
receiveObjectPrize: receiveObjectPrize,
receiveEnamePrize: receiveEnamePrize,
doHelp: doHelp,
getStats: getStats
getStats: getStats,
addStat: addStat
};
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;;AAEd,2CAA2C;AAC3C,gEAAyD;AACzD,gEAAyD;AACzD,gEAAyD;AACzD,oEAA6D;AAC7D,kEAA2D;AAC3D,gEAAyD;AAEnD,IAAA,KAAwB,IAAI,yBAAc,EAAE,EAA1C,KAAK,WAAA,EAAE,UAAU,gBAAyB,CAAA;AAC5C,IAAA,KASF,IAAI,yBAAc,EAAE,EARtB,WAAW,iBAAA,EACX,kBAAkB,wBAAA,EAClB,mBAAmB,yBAAA,EAAE,kBAAkB;AACvC,YAAY,kBAAA,EACZ,cAAc,oBAAA,EACd,iBAAiB,uBAAA,EACjB,kBAAkB,wBAAA,EAClB,qBAAqB,2BACC,CAAA;AAElB,IAAA,KAAoD,IAAI,yBAAc,EAAE,EAAtE,uBAAuB,6BAAA,EAAE,oBAAoB,0BAAyB,CAAA;AAExE,IAAA,KAA8E,IAAI,2BAAgB,EAAE,EAAlG,cAAc,oBAAA,EAAE,kBAAkB,wBAAA,EAAE,iBAAiB,uBAAA,EAAE,gBAAgB,sBAA2B,CAAA;AAElG,IAAA,MAAM,GAAK,IAAI,0BAAe,EAAE,OAA1B,CAA0B;AAEhC,IAAA,QAAQ,GAAK,IAAI,yBAAc,EAAE,SAAzB,CAAyB;AAEzC,kBAAe;IACb,KAAK,OAAA;IACL,UAAU,YAAA;IACV,WAAW,aAAA;IACX,kBAAkB,oBAAA;IAClB,uBAAuB,yBAAA;IACvB,cAAc,gBAAA;IACd,kBAAkB,oBAAA;IAClB,iBAAiB,mBAAA;IACjB,MAAM,QAAA;IACN,QAAQ,UAAA;CACT,CAAA"}
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;;AAEd,2CAA2C;AAC3C,gEAAyD;AACzD,gEAAyD;AACzD,gEAAyD;AACzD,oEAA6D;AAC7D,kEAA2D;AAC3D,gEAAyD;AAEnD,IAAA,KAAwB,IAAI,yBAAc,EAAE,EAA1C,KAAK,WAAA,EAAE,UAAU,gBAAyB,CAAA;AAC5C,IAAA,KASF,IAAI,yBAAc,EAAE,EARtB,WAAW,iBAAA,EACX,kBAAkB,wBAAA,EAClB,mBAAmB,yBAAA,EAAE,kBAAkB;AACvC,YAAY,kBAAA,EACZ,cAAc,oBAAA,EACd,iBAAiB,uBAAA,EACjB,kBAAkB,wBAAA,EAClB,qBAAqB,2BACC,CAAA;AAElB,IAAA,KAAoD,IAAI,yBAAc,EAAE,EAAtE,uBAAuB,6BAAA,EAAE,oBAAoB,0BAAyB,CAAA;AAExE,IAAA,KAA8E,IAAI,2BAAgB,EAAE,EAAlG,cAAc,oBAAA,EAAE,kBAAkB,wBAAA,EAAE,iBAAiB,uBAAA,EAAE,gBAAgB,sBAA2B,CAAA;AAElG,IAAA,MAAM,GAAK,IAAI,0BAAe,EAAE,OAA1B,CAA0B;AAElC,IAAA,KAAwB,IAAI,yBAAc,EAAE,EAA1C,QAAQ,cAAA,EAAE,OAAO,aAAyB,CAAA;AAElD,kBAAe;IACb,KAAK,OAAA;IACL,UAAU,YAAA;IACV,WAAW,aAAA;IACX,kBAAkB,oBAAA;IAClB,uBAAuB,yBAAA;IACvB,cAAc,gBAAA;IACd,kBAAkB,oBAAA;IAClB,iBAAiB,mBAAA;IACjB,MAAM,QAAA;IACN,QAAQ,UAAA;IACR,OAAO,SAAA;CACR,CAAA"}
\ No newline at end of file
......@@ -11,6 +11,6 @@ export default class UserAccessService {
* 增加访问记录
* @param {是否关注店铺} isFollow
*/
addAccess(userInfo: IUserInfo): Promise<number>;
addAccess(userInfo: IUserInfo): Promise<string>;
getAccessCount(): Promise<number>;
}
......@@ -69,7 +69,7 @@ var UserAccessService = /** @class */ (function () {
isReceiveShare: !!inviteId,
inviteId: inviteId,
isFollow: userInfo.follow.flag || userInfo.follow.newFollow,
isVip: userInfo.member.flag || userInfo.member.newMember,
isVip: !!(userInfo.member.flag || userInfo.member.newMember),
follow: userInfo.follow,
member: userInfo.member,
accessTime: Date.now(),
......
{"version":3,"file":"access.service.js","sourceRoot":"","sources":["../../src/service/access.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAgC;AAChC,kCAAmC;AACnC,4BAAsC;AAEtC;IAGE,2BAAY,OAA0B;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,mBAAc,CAAC,CAAA;IACvD,CAAC;IACD;;;OAGG;IACG,qCAAS,GAAf,UAAgB,QAAmB;;;;;;wBAC7B,KAAmB,IAAI,CAAC,OAAO,EAA7B,MAAM,YAAA,EAAE,IAAI,UAAA,CAAiB;wBAC7B,UAAU,GAAiC,IAAI,WAArC,EAAE,QAAQ,GAAuB,IAAI,SAA3B,EAAE,MAAM,GAAe,IAAI,OAAnB,EAAE,QAAQ,GAAK,IAAI,SAAT,CAAS;wBAE9C,qBAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;gCACpC,MAAM,QAAA;gCACN,UAAU,YAAA;gCACV,QAAQ,UAAA;gCACR,MAAM,QAAA;gCACN,cAAc,EAAE,CAAC,CAAC,QAAQ;gCAC1B,QAAQ,UAAA;gCACR,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,SAAS;gCAC3D,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,SAAS;gCACxD,MAAM,EAAE,QAAQ,CAAC,MAAM;gCACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;gCACvB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;gCACtB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;gCACtB,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;gCACtB,SAAS,EAAE,gBAAQ,EAAE;6BACtB,CAAC,EAAA;4BAfF,sBAAO,SAeL,EAAA;;;;KACH;IAEK,0CAAc,GAApB;;;;;;wBACM,KAAmB,IAAI,CAAC,OAAO,EAA7B,MAAM,YAAA,EAAE,IAAI,UAAA,CAAiB;wBAC7B,UAAU,GAAK,IAAI,WAAT,CAAS;wBAClB,qBAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;gCAChC,MAAM,QAAA;gCACN,UAAU,YAAA;6BACX,CAAC,EAAA;4BAHF,sBAAO,SAGL,EAAA;;;;KACH;IACH,wBAAC;AAAD,CAAC,AAzCD,IAyCC"}
\ No newline at end of file
{"version":3,"file":"access.service.js","sourceRoot":"","sources":["../../src/service/access.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAgC;AAChC,kCAAmC;AACnC,4BAAsC;AAEtC;IAGE,2BAAY,OAA0B;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,mBAAc,CAAC,CAAA;IACvD,CAAC;IACD;;;OAGG;IACG,qCAAS,GAAf,UAAgB,QAAmB;;;;;;wBAC7B,KAAmB,IAAI,CAAC,OAAO,EAA7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sdao: IBaseDao;
activityprizedao: IBaseDao;
constructor(context: IContext<IParams>);
reduceStock(_id: string): Promise<any>;
reduceStock(_id: string): Promise<number | CodeType>;
/**
* 插入奖品记录
* @param {*} award
*/
addAward(award: IAwards): Promise<number | CodeType>;
addAward(award: IAwards): Promise<string | CodeType>;
/**
* 发放奖品
* @param {*} document
......
......@@ -16,5 +16,5 @@ export default class StatService {
* @return {boolean}
* @memberof StatService
*/
addStat(type: number, userInfo?: IUserInfo, customStatData?: object): Promise<number>;
addStat(type: number, userInfo?: IUserInfo, customStatData?: object): Promise<string>;
}
......@@ -19,15 +19,17 @@ export interface ITaskInfo {
}
export default class TaskService extends UserService {
constructor(context: IContext<IParams>);
initVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): ITaskInfo;
initOrderGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initBrowseGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
initCollectGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo;
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;
/**
* 根据任务类型初始化 b端 tasks字段必须有相应的配置
*
* @param {ITaskType} taskType 任务类型
* @param {string} title 任务标题
* @param {ITasks} tasks 任务配置
* @param {IUserInfo} userInfo 用户信息
* @return {ITaskInfo} {ITaskInfo} 任务信息
* @memberof TaskService
*/
initTask(taskType: ITaskType, title: string, tasks: ITasks, userInfo: IUserInfo): ITaskInfo;
updateVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): {
$set: {};
$inc: {};
......@@ -55,7 +57,7 @@ export default class TaskService extends UserService {
* @returns
* @memberof TaskService
*/
updateFollowTask(userInfo: IUserInfo, activityInfo: IActivityInfo): Promise<any>;
updateFollowTask(userInfo: IUserInfo, activityInfo: IActivityInfo): Promise<number>;
/**
*
* 根据用户和任务完成情况,设置任务状态
......@@ -78,8 +80,8 @@ export default class TaskService extends UserService {
* @memberof TaskService
*/
getTodayCompleteTask(taskType: string, userInfo: IUserInfo): {
todayCompleteTimes: any;
todayTaskInfo: any;
todayCompleteTimes: number;
todayTaskInfo: ITaskDetail[];
};
/**
* 根据任务类型获取任务完成情况
......@@ -89,7 +91,10 @@ export default class TaskService extends UserService {
* @returns {array}
* @memberof TaskService
*/
getCompleteTaskByUserTaskInfo(taskType: string, userInfo: IUserInfo): any[];
getCompleteTaskByUserTaskInfo(taskType: string, userInfo: IUserInfo): {
completeTimes: number;
taskInfo: ITaskDetail[];
};
/**
*根据任务类型更新任务待领取次数和任务记录
*
......
......@@ -81,171 +81,38 @@ var TaskService = /** @class */ (function (_super) {
function TaskService(context) {
return _super.call(this, context) || this;
}
TaskService.prototype.initVipTask = function (userInfo, vipInfo, tasks) {
/**
* 根据任务类型初始化 b端 tasks字段必须有相应的配置
*
* @param {ITaskType} taskType 任务类型
* @param {string} title 任务标题
* @param {ITasks} tasks 任务配置
* @param {IUserInfo} userInfo 用户信息
* @return {ITaskInfo} {ITaskInfo} 任务信息
* @memberof TaskService
*/
TaskService.prototype.initTask = function (taskType, title, tasks, userInfo) {
var _a = tasks, _b = taskType, _c = _a[_b], value = _c.value, _d = _c.itemIds, itemIds = _d === void 0 ? '' : _d, taskRateType = _c.taskRateType, _e = _c.times, times = _e === void 0 ? 1 : _e, _f = _c.link, link = _f === void 0 ? '' : _f;
var remainTimes = userInfo.remainTimes;
// 后台配置奖励
var value = tasks.member.value;
var todayCompleteTimes = this.getTodayCompleteTask(taskType, userInfo).todayCompleteTimes;
var completeTimes = this.getCompleteTaskByUserTaskInfo(taskType, userInfo).completeTimes;
return {
taskType: "member",
title: "\u52A0\u5165\u4F1A\u5458",
url: vipInfo.url,
rewards: value,
taskRateType: constants_1.TASK_RATE_TYPE.FOREVER,
waitReceive: remainTimes.member,
status: this.setTaskStatus(userInfo, 'member', constants_1.TASK_RATE_TYPE.FOREVER, 1)
};
};
// 初始化下单任务
TaskService.prototype.initOrderGoodsTask = function (userInfo, tasks) {
var _a = tasks.orderGoods, value = _a.value, itemIds = _a.itemIds, taskRateType = _a.taskRateType, times = _a.times;
var remainTimes = userInfo.remainTimes;
var todayCompleteTimes = this.getTodayCompleteTask('orderGoods', userInfo).todayCompleteTimes;
var orderGoodsCompleteList = this.getCompleteTaskByUserTaskInfo('orderGoods', userInfo);
var orderTask = {
taskType: "orderGoods",
title: "\u4E0B\u5355\u5546\u54C1",
taskType: taskType,
title: title,
itemIds: itemIds,
rewards: value,
taskRateType: taskRateType,
times: times,
url: taskType === 'member' ? utils_1.generateVipUrl(utils_1.formatVipCbUrl(this.context)) : link,
todayCompleteTimes: todayCompleteTimes,
completeTimes: orderGoodsCompleteList.length,
status: this.setTaskStatus(userInfo, 'orderGoods', taskRateType, times),
waitReceive: remainTimes.orderGoods
};
return orderTask;
};
// 初始化浏览商品任务
TaskService.prototype.initBrowseGoodsTask = function (userInfo, tasks) {
var _a = tasks.browseGoods, value = _a.value, itemIds = _a.itemIds, taskRateType = _a.taskRateType, times = _a.times;
var remainTimes = userInfo.remainTimes;
var todayCompleteTimes = this.getTodayCompleteTask('browseGoods', userInfo).todayCompleteTimes;
var browseGoodsCompleteList = this.getCompleteTaskByUserTaskInfo('browseGoods', userInfo);
var orderTask = {
taskType: "browseGoods",
title: "\u6D4F\u89C8\u5546\u54C1",
itemIds: itemIds,
times: times,
rewards: value,
waitReceive: remainTimes.browseGoods,
todayCompleteTimes: todayCompleteTimes,
completeTimes: browseGoodsCompleteList.length,
status: this.setTaskStatus(userInfo, 'browseGoods', taskRateType, times),
taskRateType: taskRateType
};
return orderTask;
};
// 初始化收藏商品任务
TaskService.prototype.initCollectGoodsTask = function (userInfo, tasks) {
var _a = tasks.collectGoods, value = _a.value, itemIds = _a.itemIds, taskRateType = _a.taskRateType, times = _a.times;
var remainTimes = userInfo.remainTimes;
var todayCompleteTimes = this.getTodayCompleteTask('collectGoods', userInfo).todayCompleteTimes;
var completeList = this.getCompleteTaskByUserTaskInfo('collectGoods', userInfo);
var orderTask = {
taskType: "collectGoods",
title: "\u6536\u85CF\u5546\u54C1",
itemIds: itemIds,
times: times,
rewards: value,
waitReceive: remainTimes.collectGoods,
todayCompleteTimes: todayCompleteTimes,
completeTimes: completeList.length,
taskRateType: taskRateType,
status: this.setTaskStatus(userInfo, 'collectGoods', taskRateType, times)
};
return orderTask;
};
// 初始化跳转任务
TaskService.prototype.initJumpLinkTask = function (userInfo, tasks) {
var _a = tasks.jumpLink, value = _a.value, link = _a.link, taskRateType = _a.taskRateType, times = _a.times;
var remainTimes = userInfo.remainTimes;
var todayCompleteTimes = this.getTodayCompleteTask('jumpLink', userInfo).todayCompleteTimes;
var completeList = this.getCompleteTaskByUserTaskInfo('jumpLink', userInfo);
var orderTask = {
taskType: "jumpLink",
title: "\u8DF3\u8F6C\u94FE\u63A5",
url: link,
times: times,
rewards: value,
waitReceive: remainTimes.jumpLink,
todayCompleteTimes: todayCompleteTimes,
completeTimes: completeList.length,
taskRateType: taskRateType,
status: this.setTaskStatus(userInfo, 'jumpLink', taskRateType, times)
};
return orderTask;
};
// 初始化邀请任务
TaskService.prototype.initInvitesTask = function (userInfo, tasks) {
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);
var orderTask = {
taskType: "invites",
title: "\u9080\u8BF7",
rewards: value,
taskRateType: taskRateType,
times: times,
todayCompleteTimes: todayCompleteTimes,
completeTimes: invitesCompleteList.length,
waitReceive: remainTimes.invites,
status: this.setTaskStatus(userInfo, 'invites', taskRateType, times)
};
return orderTask;
};
// 关注店铺
TaskService.prototype.initFollowTask = function (userInfo, tasks) {
var value = tasks.follow.value;
var remainTimes = userInfo.remainTimes;
var followCompleteList = this.getCompleteTaskByUserTaskInfo('follow', userInfo);
return {
taskType: "follow",
title: "\u5173\u6CE8\u5E97\u94FA",
rewards: value,
taskRateType: constants_1.TASK_RATE_TYPE.FOREVER,
waitReceive: remainTimes.follow,
completeTimes: followCompleteList.length,
status: this.setTaskStatus(userInfo, 'follow', constants_1.TASK_RATE_TYPE.FOREVER, 1)
};
};
// 初始化签到任务
TaskService.prototype.initSignTask = function (userInfo, tasks) {
var _a = tasks.sign, value = _a.value, times = _a.times;
var remainTimes = userInfo.remainTimes;
var completeList = this.getCompleteTaskByUserTaskInfo('sign', userInfo);
var todayCompleteTimes = this.getTodayCompleteTask('sign', userInfo).todayCompleteTimes;
return {
taskType: "sign",
title: "\u6BCF\u65E5\u7B7E\u5230",
rewards: value,
times: times,
taskRateType: constants_1.TASK_RATE_TYPE.EVERYDAY,
waitReceive: remainTimes.sign,
completeTimes: completeList.length,
todayCompleteTimes: todayCompleteTimes,
status: this.setTaskStatus(userInfo, 'sign', constants_1.TASK_RATE_TYPE.EVERYDAY, times)
};
};
// 积分兑换 /固定为每日限制
TaskService.prototype.initExchangeCreditsTask = function (userInfo, tasks) {
var _a = tasks.exchangeCredits, value = _a.value, times = _a.times;
var remainTimes = userInfo.remainTimes, taskInfo = userInfo.taskInfo;
var todayCompleteTimes = this.getTodayCompleteTask('exchangeCredits', userInfo).todayCompleteTimes;
return {
taskType: "exchangeCredits",
title: "\u79EF\u5206\u5151\u6362",
rewards: value,
times: times,
taskRateType: constants_1.TASK_RATE_TYPE.EVERYDAY,
todayCompleteTimes: todayCompleteTimes,
waitReceive: remainTimes.exchangeCredits,
status: this.setTaskStatus(userInfo, 'exchangeCredits', constants_1.TASK_RATE_TYPE.EVERYDAY)
completeTimes: completeTimes,
status: this.setTaskStatus(userInfo, taskType, taskRateType, times),
waitReceive: remainTimes[taskType]
};
};
// 根据会员状态更新
TaskService.prototype.updateVipTask = function (userInfo, vipInfo, tasks) {
var member = userInfo.member, remainTimes = userInfo.remainTimes, taskInfo = userInfo.taskInfo;
var member = userInfo.member;
var newMember = member.newMember;
var today = utils_1.getToday();
var isNewVip = this.checkNewVip(userInfo, vipInfo);
......@@ -268,16 +135,19 @@ var TaskService = /** @class */ (function (_super) {
};
// 根据下单下单记录,更新状态
TaskService.prototype.updateOrderGoodsTask = function (userInfo, tasks, activityStartTime, session) {
var _a, _b;
return __awaiter(this, void 0, void 0, function () {
var _a, value, itemIds, taskRateType, times, orderGoodsCompleteList, todayCompleteTimes, today, orderResult, itemIdsArr, projection, targetOrders;
return __generator(this, function (_b) {
switch (_b.label) {
var taskType, _c, _d, _e, value, itemIds, taskRateType, times, _f, completeTimes, taskInfo, todayCompleteTimes, today, orderResult, itemIdsArr, projection, targetOrders;
var _g;
return __generator(this, function (_h) {
switch (_h.label) {
case 0:
_a = tasks.orderGoods, value = _a.value, itemIds = _a.itemIds, taskRateType = _a.taskRateType, times = _a.times;
orderGoodsCompleteList = this.getCompleteTaskByUserTaskInfo('orderGoods', userInfo);
todayCompleteTimes = this.getTodayCompleteTask('orderGoods', userInfo).todayCompleteTimes;
taskType = 'orderGoods';
_c = tasks, _d = taskType, _e = _c[_d], value = _e.value, itemIds = _e.itemIds, taskRateType = _e.taskRateType, times = _e.times;
_f = this.getCompleteTaskByUserTaskInfo(taskType, userInfo), completeTimes = _f.completeTimes, taskInfo = _f.taskInfo;
todayCompleteTimes = this.getTodayCompleteTask(taskType, userInfo).todayCompleteTimes;
// 永久任务且已完成
if (taskRateType === constants_1.TASK_RATE_TYPE.FOREVER && orderGoodsCompleteList.length) {
if (taskRateType === constants_1.TASK_RATE_TYPE.FOREVER && completeTimes) {
return [2 /*return*/, {}];
}
today = utils_1.getToday();
......@@ -288,20 +158,23 @@ var TaskService = /** @class */ (function (_super) {
//@ts-ignore
activityStartTime || Date.now(), Date.now(), session)];
case 1:
orderResult = _b.sent();
orderResult = _h.sent();
itemIdsArr = itemIds.split(',').map(function (v) { return +v; });
projection = {
$inc: {
'remainTimes.orderGoods': 0
},
$inc: (_g = {},
_g["remainTimes." + taskType] = 0,
_g),
$set: {}
};
targetOrders = [];
targetOrders = ((_b = (_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo.taskInfo) === null || _a === void 0 ? void 0 : _a[today]) === null || _b === void 0 ? void 0 : _b[taskType]) || [];
orderResult.forEach(function (v) {
// @ts-ignore
// 商品订单包含目标商品 且orderId为新订单
if (itemIdsArr.includes(v.itemId) && !orderGoodsCompleteList.some(function (order) { return order.orderId === v.orderId; })) {
projection.$inc['remainTimes.orderGoods'] += +value;
if (itemIdsArr.includes(v.itemId) && !taskInfo.some(function (order) { return order.orderId === v.orderId; })) {
if (taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY && targetOrders.length >= times) {
return;
}
projection.$inc["remainTimes." + taskType] += +value;
targetOrders.push({
itemId: v.itemId,
orderId: v.orderId,
......@@ -309,14 +182,8 @@ var TaskService = /** @class */ (function (_super) {
createTime: Date.now()
});
}
if (targetOrders.length) {
if (userInfo.taskInfo[today] && userInfo.taskInfo[today]['orderGoods']) {
var targetList = userInfo.taskInfo[today]['orderGoods'].concat(targetOrders);
projection.$set["taskInfo." + today + ".orderGoods"] = targetList;
}
else {
projection.$set["taskInfo." + today + ".orderGoods"] = targetOrders;
}
if (targetOrders === null || targetOrders === void 0 ? void 0 : targetOrders.length) {
projection.$set["taskInfo." + today + "." + taskType] = targetOrders;
}
});
return [2 /*return*/, projection];
......@@ -331,7 +198,6 @@ var TaskService = /** @class */ (function (_super) {
var value = (tasks || {}).sign.value;
var todayCompleteTimes = this.getTodayCompleteTask('sign', userInfo).todayCompleteTimes;
var today = utils_1.getToday();
utils_1.logger(todayCompleteTimes);
// 今天没有有完成记录
return todayCompleteTimes === 0
? {
......@@ -397,13 +263,14 @@ var TaskService = /** @class */ (function (_super) {
*/
TaskService.prototype.setTaskStatus = function (useInfo, taskType, taskRateType, limitTimesEveryday) {
var _a;
if (limitTimesEveryday === void 0) { limitTimesEveryday = 1; }
var waitReceive = ((_a = useInfo === null || useInfo === void 0 ? void 0 : useInfo.remainTimes) === null || _a === void 0 ? void 0 : _a[taskType]) || 0;
if (waitReceive)
return constants_1.TASK_STATUS.WAIT_RECEIVE;
// 当天的完成次数
var todayCompleteTimes = this.getTodayCompleteTask(taskType, useInfo).todayCompleteTimes;
// 总共的完成次数
var completeTimes = this.getCompleteTaskByUserTaskInfo(taskType, useInfo).length;
var completeTimes = this.getCompleteTaskByUserTaskInfo(taskType, useInfo).completeTimes;
switch (taskRateType) {
case constants_1.TASK_RATE_TYPE.FOREVER:
return completeTimes > 0 ? constants_1.TASK_STATUS.DONE : constants_1.TASK_STATUS.WAIT_DO;
......@@ -452,7 +319,10 @@ var TaskService = /** @class */ (function (_super) {
targetTaskList = __spreadArrays(targetTaskList, dayTaskInfo);
}
});
return targetTaskList;
return {
completeTimes: (targetTaskList === null || targetTaskList === void 0 ? void 0 : targetTaskList.length) || 0,
taskInfo: targetTaskList
};
};
/**
*根据任务类型更新任务待领取次数和任务记录
......@@ -523,11 +393,18 @@ var TaskService = /** @class */ (function (_super) {
if (!Object.keys(updateKeys).length) {
return [2 /*return*/, userInfo];
}
return [4 /*yield*/, this.updateUser(id, updateKeys)];
return [4 /*yield*/, this.updateUser(id, updateKeys)
// 更新数据库后 延迟10ms 执行
];
case 1:
_a.sent();
// 更新数据库后 延迟10ms 执行
return [4 /*yield*/, utils_1.sleep(10)];
case 2:
// 更新数据库后 延迟10ms 执行
_a.sent();
return [4 /*yield*/, this.getUserInfo()];
case 2: return [2 /*return*/, _a.sent()];
case 3: return [2 /*return*/, _a.sent()];
}
});
});
......
{"version":3,"file":"task.service.js","sourceRoot":"","sources":["../../src/service/task.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,UAAU,CAAC,IAAI,EAAE;4BACjD,OAAO,UAAU,CAAC,IAAI,CAAA;yBACvB;wBACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,UAAU,CAAC,IAAI,EAAE;4BACjD,OAAO,UAAU,CAAC,IAAI,CAAA;yBACvB;wBACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,IAAI,UAAU,CAAC,KAAK,EAAE;4BACnD,OAAO,UAAU,CAAC,KAAK,CAAA;yBACxB;wBAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,EAAE;4BACnC,sBAAO,QAAQ,EAAA;yBAChB;wBAED,qBAAM,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,EAAA;;wBAArC,SAAqC,CAAA;wBAC9B,qBAAM,IAAI,CAAC,WAAW,EAAE,EAAA;4BAA/B,sBAAO,SAAwB,EAAA;;;;KAChC;IACH,kBAAC;AAAD,CAAC,AAzfD,CAAyC,sBAAW,GAyfnD"}
\ No newline at end of file
{"version":3,"file":"task.service.js","sourceRoot":"","sources":["../../src/service/task.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iCAA8B;AAC9B,+CAAwC;AACxC,kCAAoG;AACpG,0CAA0D;AAe1D;IAAyC,+BAAW;IAClD,qBAAY,OAA0B;eACpC,kBAAM,OAAO,CAAC;IAChB,CAAC;IACD;;;;;;;;;OASG;IACH,8BAAQ,GAAR,UAAS,QAAmB,EAAE,KAAa,EAAE,KAAa,EAAE,QAAmB;QAE3E,IACE,KAAA,KAAK,EADP,KAAC,QAAS,EAAV,WAAuE,EAAzD,KAAK,WAAA,EA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;;wBAArC,SAAqC,CAAA;wBAErC,mBAAmB;wBACnB,qBAAM,aAAK,CAAC,EAAE,CAAC,EAAA;;wBADf,mBAAmB;wBACnB,SAAe,CAAA;wBAER,qBAAM,IAAI,CAAC,WAAW,EAAE,EAAA;4BAA/B,sBAAO,SAAwB,EAAA;;;;KAChC;IACH,kBAAC;AAAD,CAAC,AA9VD,CAAyC,sBAAW,GA8VnD"}
\ No newline at end of file
......@@ -19,12 +19,6 @@ declare class UserService extends BaseService {
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/
getUserInfoByOpenId(openId: string): Promise<IUserInfo>;
/**
* @desc 获取是否是会员
* @param {调用淘宝接口的session} session
* @returns {isVip: boolean(是否是会员), url: string(入会链接) }
*/
getShopVip(session: string, callbackUrl?: string, activityUserNick?: string): Promise<IVipInfo>;
/**
* 初始化用户数据
*
......@@ -41,7 +35,7 @@ declare class UserService extends BaseService {
* @param {更新的对象} document
* @returns 若更新成功,返回为1; 若更新失败,返回为 0 或系统直接报错
*/
updateUser(_id: string, projection: IUpdateQuery): Promise<any>;
updateUser(_id: string, projection: IUpdateQuery): Promise<number>;
/**
* @desc 排行榜
* @param {查询条件} match
......@@ -55,6 +49,10 @@ declare class UserService extends BaseService {
* @param {排序规则} sort
*/
getMyRank(match: Object, sort: Object): Promise<any>;
/**
* 获取用户排名
*/
getUserRank(hotValue: number): Promise<string | number>;
/**
* updateUser projection 格式化
*
......
......@@ -69,8 +69,6 @@ var sdk_1 = require("../sdk");
var base_service_1 = require("./base.service");
var db_1 = require("../db");
var utils_1 = require("../utils");
var vipMock_1 = require("../vipMock");
var constants_1 = require("../constants");
var UserService = /** @class */ (function (_super) {
__extends(UserService, _super);
function UserService(context) {
......@@ -119,40 +117,6 @@ var UserService = /** @class */ (function (_super) {
});
});
};
/**
* @desc 获取是否是会员
* @param {调用淘宝接口的session} session
* @returns {isVip: boolean(是否是会员), url: string(入会链接) }
*/
UserService.prototype.getShopVip = function (session, callbackUrl, activityUserNick) {
if (callbackUrl === void 0) { callbackUrl = ''; }
if (activityUserNick === void 0) { activityUserNick = ''; }
return __awaiter(this, void 0, void 0, function () {
var result, shopUrl;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (utils_1.isUseVipMock(this.context, activityUserNick)) {
return [2 /*return*/, vipMock_1.VIP_MOCK];
}
result = {
result: {
member_info: ''
}
};
shopUrl = "https://market.m.taobao.com/app/sj/member-center-rax/pages/pages_index_index?wh_weex=true&sellerId=" + constants_1.sellerId + "&extraInfo=" + encodeURIComponent(JSON.stringify({ source: 'isvapp', entrance: 'duiba' })) + "&callbackUrl=" + encodeURIComponent(callbackUrl);
return [4 /*yield*/, sdk_1.TBAPIS.queryVipinfo(this.context, session)];
case 1:
result = _a.sent();
console.log("result, shopUrl", result, shopUrl);
return [2 /*return*/, {
isVip: !!(result.result && result.result.member_info),
url: shopUrl
}];
}
});
});
};
/**
* 初始化用户数据
*
......@@ -352,6 +316,42 @@ var UserService = /** @class */ (function (_super) {
});
});
};
/**
* 获取用户排名
*/
UserService.prototype.getUserRank = function (hotValue) {
return __awaiter(this, void 0, void 0, function () {
var activityId, openId, sameScoreList, rank, gap, j;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
activityId = this.context.data.activityId;
openId = this.context.openId;
return [4 /*yield*/, this.userdao.find({ hotValue: hotValue, activityId: activityId }, {
sort: { updateTime: 1 }
})];
case 1:
sameScoreList = _a.sent();
rank = '未上榜';
gap = 0;
//说明有多个跟自己同分数的人
for (j = 0; j < sameScoreList.length; j++) {
if (sameScoreList[j].openId == openId) {
gap = j;
}
}
return [4 /*yield*/, this.userdao.count({ hotValue: { $gt: hotValue }, activityId: activityId })];
case 2:
rank = _a.sent();
rank = rank + 1 + gap;
if (rank > 1000) {
rank = '1000+';
}
return [2 /*return*/, rank];
}
});
});
};
/**
* updateUser projection 格式化
*
......
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../src/service/user.service.ts"],"names":[],"mappings":";AAAA;;;;GAI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C,AAtSD,CAA0B,sBAAW,GAsSpC;AAED,kBAAe,WAAW,CAAA"}
\ No newline at end of file
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../src/service/user.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAwC;AACxC,+CAAwC;AACxC,4BAAoC;AACpC,kCAAiF;AAGjF;IAA0B,+BAAW;IAEnC,qBAAY,OAA0B;QAAtC,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,OAAO,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,iBAAY,CAAC,CAAA;;IACnD,CAAC;IACD;;;OAGG;IACG,iCAAW,GAAjB;;;;;;wBACM,KAAmB,IAAI,CAAC,OAAO,EAA7B,MAAM,YAAA,EAAE,IAAI,UAAA,CAAiB;wBAC7B,UAAU,GAAK,IAAI,WAAT,CAAS;wBACZ,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAY,EAAE,MAAM,QAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAAA;;wBAAtE,MAAM,GAAG,SAA6D;wBAC1E,sBAAO,MAAM,EAAA;;;;KACd;IAED;;;;;OAKG;IACG,yCAAmB,GAAzB,UAA0B,MAAc;;;;;;wBAChC,UAAU,GAAK,IAAI,CAAC,OAAO,CAAC,IAAI,WAAtB,CAAsB;wBACzB,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAY,EAAE,MAAM,QAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAAA;;wBAAtE,MAAM,GAAG,SAA6D;wBAC1E,sBAAO,MAAM,EAAA;;;;KACd;IAED;;;;;;;OAOG;IACG,kCAAY,GAAlB,UAAmB,OAAiB,EAAE,YAA2B;;;;;;;wBACzD,KAAmB,IAAI,CAAC,OAAO,EAA7B,MAAM,YAAA,EAAE,IAAI,UAAA,CAAiB;wBAC7B,UAAU,GA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,CAAC;IAED,0CAAoB,GAApB,UAAqB,MAAmB;QACtC,IAAM,KAAK,GAAG,gBAAQ,EAAE,CAAA;QACxB,6BACK,MAAM,KACT,SAAS,EAAE,IAAI,EACf,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,EACtB,SAAS,EAAE,KAAK,IACjB;IACH,CAAC;IACH,kBAAC;AAAD,CAAC,AAzSD,CAA0B,sBAAW,GAySpC;AAED,kBAAe,WAAW,CAAA"}
\ No newline at end of file
......@@ -8,3 +8,4 @@ export * from './package/rand';
export * from './package/getUserOrderlist';
export * from './package/vip';
export * from './package/exportHandlers';
export * from './package/helper';
......@@ -24,4 +24,5 @@ __exportStar(require("./package/rand"), exports);
__exportStar(require("./package/getUserOrderlist"), exports);
__exportStar(require("./package/vip"), exports);
__exportStar(require("./package/exportHandlers"), exports);
__exportStar(require("./package/helper"), exports);
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;AAEd,cAAc;AACd,uDAAoC;AAEpC,iBAAiB;AACjB,qDAAkC;AAElC,gBAAgB;AAChB,wDAAqC;AAErC,SAAS;AACT,uDAAoC;AAEpC,mDAAgC;AAEhC,iDAA8B;AAE9B,6DAA0C;AAE1C,gDAA6B;AAE7B,2DAAwC"}
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;AAEd,cAAc;AACd,uDAAoC;AAEpC,iBAAiB;AACjB,qDAAkC;AAElC,gBAAgB;AAChB,wDAAqC;AAErC,SAAS;AACT,uDAAoC;AAEpC,mDAAgC;AAEhC,iDAA8B;AAE9B,6DAA0C;AAE1C,gDAA6B;AAE7B,2DAAwC;AAExC,mDAAgC"}
\ No newline at end of file
/**
* param 将要转为URL参数字符串的对象
* key URL参数字符串的前缀
* encode true/false 是否进行URL编码,默认为true
*
* return URL参数字符串
*
* @format
*/
export declare const urlEncode: (param: IParams | string | number | boolean, key: string, encode?: boolean) => string;
/** @format */
export declare function sleep(time: number): Promise<unknown>;
"use strict";
/**
* param 将要转为URL参数字符串的对象
* key URL参数字符串的前缀
* encode true/false 是否进行URL编码,默认为true
*
* return URL参数字符串
*
* @format
*/
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.urlEncode = void 0;
exports.urlEncode = function (param, key, encode) {
if (encode === void 0) { encode = true; }
if (param == null)
return '';
var paramStr = '';
var t = typeof param;
if (t == 'string' || t == 'number' || t == 'boolean') {
paramStr += '&' + key + '=' + (encode == null || encode ? encodeURIComponent(param) : param);
}
else {
for (var i in param) {
var k = key == null ? i : key + (param instanceof Array ? '[' + i + ']' : '.' + i);
paramStr += exports.urlEncode(param[i], k, encode);
}
}
return paramStr;
};
exports.sleep = void 0;
function sleep(time) {
return new Promise(function (resolve) { return setTimeout(resolve, time); });
}
exports.sleep = sleep;
//# sourceMappingURL=helper.js.map
\ No newline at end of file
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/utils/package/helper.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEU,QAAA,SAAS,GAAG,UAAU,KAA0C,EAAE,GAAW,EAAE,MAAsB;IAAtB,uBAAA,EAAA,aAAsB;IAChH,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,EAAE,CAAA;IAC5B,IAAI,QAAQ,GAAG,EAAE,CAAA;IACjB,IAAM,CAAC,GAAG,OAAO,KAAK,CAAA;IACtB,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,IAAI,SAAS,EAAE;QACpD,QAAQ,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;KACvG;SAAM;QACL,KAAK,IAAM,CAAC,IAAI,KAAgB,EAAE;YAChC,IAAM,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;YACpF,QAAQ,IAAI,iBAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;SAC3C;KACF;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
\ No newline at end of file
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/utils/package/helper.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,SAAgB,KAAK,CAAC,IAAY;IAChC,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO,IAAI,OAAA,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAzB,CAAyB,CAAC,CAAA;AAC1D,CAAC;AAFD,sBAEC"}
\ No newline at end of file
export declare const logFn: (context: IContext<IParams>) => void;
export declare const recordErrorLog: (context: IContext<IParams>, baseInfos: IControllerInfos, errorMsg: string, stack: string) => Promise<number>;
export declare const recordErrorLog: (context: IContext<IParams>, baseInfos: IControllerInfos, errorMsg: string, stack: string) => Promise<string>;
export declare const logger: (message: any) => void;
/** @format */
/** @format */
export declare const isUseVipMock: (context: IContext<IParams>, userNick: string) => boolean;
/**
* @desc 获取是否是会员
* @param {调用淘宝接口的session} session
* @returns {isVip: boolean(是否是会员), url: string(入会链接) }
*/
export declare const getShopVip: (context: IContext<any>, session: string, callbackUrl?: string, activityUserNick?: string) => Promise<IVipInfo>;
export declare const generateVipUrl: (callbackUrl: string) => string;
export declare const formatVipCbUrl: (context: IContext<IParams>) => string;
"use strict";
/** @format */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatVipCbUrl = exports.isUseVipMock = void 0;
exports.formatVipCbUrl = exports.generateVipUrl = exports.getShopVip = exports.isUseVipMock = void 0;
var index_1 = require("../../config/index");
var constants_1 = require("../../constants");
var vipMock_1 = require("../../vipMock");
var sdk_1 = require("../../sdk");
/** @format */
// 测试环境 duib2账户mock数据 或者本地
exports.isUseVipMock = function (context, userNick) {
......@@ -11,6 +50,43 @@ exports.isUseVipMock = function (context, userNick) {
var isDuibaAccount = userNick.startsWith('duiba2');
return (isTestEnv && isDuibaAccount) || isMockEnv;
};
/**
* @desc 获取是否是会员
* @param {调用淘宝接口的session} session
* @returns {isVip: boolean(是否是会员), url: string(入会链接) }
*/
exports.getShopVip = function (context, session, callbackUrl, activityUserNick) {
if (callbackUrl === void 0) { callbackUrl = ''; }
if (activityUserNick === void 0) { activityUserNick = ''; }
return __awaiter(void 0, void 0, void 0, function () {
var result, shopUrl;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (exports.isUseVipMock(context, activityUserNick)) {
return [2 /*return*/, vipMock_1.VIP_MOCK];
}
result = {
result: {
member_info: ''
}
};
return [4 /*yield*/, sdk_1.TBAPIS.queryVipinfo(context, session)];
case 1:
result = _a.sent();
shopUrl = exports.generateVipUrl(callbackUrl);
return [2 /*return*/, {
isVip: !!(result.result && result.result.member_info),
url: shopUrl
}];
}
});
});
};
// 生成会员链接
exports.generateVipUrl = function (callbackUrl) {
return "https://market.m.taobao.com/app/sj/member-center-rax/pages/pages_index_index?wh_weex=true&sellerId=" + constants_1.sellerId + "&extraInfo=" + encodeURIComponent(JSON.stringify({ source: 'isvapp', entrance: 'duiba' })) + "&callbackUrl=" + encodeURIComponent(callbackUrl);
};
// 格式化Vip回调地址
exports.formatVipCbUrl = function (context) {
var _a, _b, _c;
......
{"version":3,"file":"vip.js","sourceRoot":"","sources":["../../../src/utils/package/vip.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,4CAA8C;AAC9C,cAAc;AAEd,2BAA2B;AACd,QAAA,YAAY,GAAG,UAAC,OAA0B,EAAE,QAAgB;IACvE,IAAM,SAAS,GAAG,OAAO,CAAC,GAA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AAK,iBAAS,CAAC,OAAO,CAAC,eAAvB,CAAuB;IAE3C,IAAM,WAAW,qBAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,SAAS,0CAAE,OAAO,0CAAE,OAAO,CAAA;IAE/D,SAAS;IACT,IAAI,KAAK,GAAG,gBAAc,UAAY,CAAA;IACtC,IAAI,KAAK,GAAG,gCAA8B,QAAQ,sBAAgB,WAAW,IAAI,EAAE,CAAE,CAAA;IAErF,IAAI,WAAW,GAAc,cAAc,eAAU,kBAAkB,CAAC,KAAK,CAAC,cAAS,kBAAkB,CAAC,KAAK,CAAG,CAAA;IAClH,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA"}
\ No newline at end of file
......@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.VIP_MOCK = void 0;
// 测试环境下 duiba2及其子账号自动开启VIP_MOCK, 返回数据可在此设置
exports.VIP_MOCK = {
isVip: false,
isVip: true,
url: '//taobao.com'
};
//# sourceMappingURL=vipMock.js.map
\ No newline at end of file
{"version":3,"file":"vipMock.js","sourceRoot":"","sources":["../src/vipMock.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,2CAA2C;AAC9B,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,KAAK;IACZ,GAAG,EAAE,cAAc;CACpB,CAAA"}
\ No newline at end of file
{"version":3,"file":"vipMock.js","sourceRoot":"","sources":["../src/vipMock.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,2CAA2C;AAC9B,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,IAAI;IACX,GAAG,EAAE,cAAc;CACpB,CAAA"}
\ No newline at end of file
/** @format */
import { DEFAULT_CODE_TYPES } from './sdk'
export const BusinessError = {
// 更新重试失败(用于并发更新)
ERROR_UPDATE_RETRY: {
code: `210001`,
defaultMsg: `系统错误`
},
// 活动不存在
ERROR_NO_ACTIVITY: {
code: `220001`,
defaultMsg: `活动不存在`
},
// 活动未开始
ERROR_ACTIVITY_NOSTART: {
code: `220002`,
defaultMsg: `活动未开始`
},
// 活动已结束
ERROR_ACTIVITY_OVER: {
code: `220003`,
defaultMsg: `活动已结束`
},
// 用户不存在
ERROR_NO_USER: {
code: `310002`,
defaultMsg: `用户不存在`
},
// 非店铺会员
ERROR_NO_VIP: {
code: `310003`,
defaultMsg: '非店铺会员'
},
// 暂无次数可领取
ERROR_TASK_NORECEIVE: {
code: `430001`,
defaultMsg: `该任务暂无领取次数`
},
// 任务奖励已领取
ERROR_TASK_ALREADYRECEIVE: {
code: `430002`,
defaultMsg: `任务奖励已领取`
},
// 任务已完成
ERROR_TASK_COMPLETE: {
code: `430003`,
defaultMsg: `任务已完成`
},
ERROR_INVALID_INVITE_ID: {
code: `430004`,
defaultMsg: `邀请码无效`
},
ERROR_NO_CREDITS: {
code: `430005`,
defaultMsg: `任务所需积分不足`
},
ERROR_TASK_LIMIT: {
code: `430006`,
defaultMsg: `今日该任务次数超限`
},
ERROR_AREADY_INVITE_SUCCESS: {
code: `430007`,
defaultMsg: `已经成功邀请过`
},
ERROR_NO_INVITE_SELF: {
code: `430008`,
defaultMsg: `自己不能给自己助力`
},
ERROR_FORBIDDEN_OPE: {
code: `530001`,
defaultMsg: `非法操作`
},
ERROR_RECEIVE_PRIZE: {
code: `630002`,
defaultMsg: `奖励已领取`
},
ERROR_SEND_PRIZE: {
code: `730001`,
defaultMsg: `发奖失败`
},
ERROR_NO_PRIZE: {
code: `730002`,
defaultMsg: `奖品不存在`
},
ERROR_NO_STOCK: {
code: `730003`,
defaultMsg: `库存不足`
},
ERROR_PRIZE_EXPIRED: {
code: `740001`,
defaultMsg: `奖品已超过领取时间`
}
}
export const CODE_TYPES = Object.assign({}, DEFAULT_CODE_TYPES, BusinessError)
export * from './errorCode'
// tb 接口返回部分错误
export const TBERROR = {
......@@ -123,14 +29,6 @@ export const DRAW_STATUS = {
RETRY: 6
}
export const appId = '${需要补充}'
// 商铺id 拼接vip链接用
export const sellerId = '${商铺id}'
// C端的APP NAME
export const C_APP_NAME: string = `promotioncenter-${appId}`
// 订单状态
export const TAOBAO_SUCCESS_ORDER_STATUS: string[] = [
'WAIT_SELLER_SEND_GOODS',
......@@ -199,3 +97,11 @@ export enum STAT_TYPE {
CLICK_INVITE = 1,
CLICK_FOLLOW_TASK
}
export const appId = '${需要补充}'
// 商铺id 拼接vip链接用
export const sellerId = '${商铺id}'
// C端的APP NAME
export const C_APP_NAME: string = `promotioncenter-${appId}`
......@@ -3,7 +3,7 @@
import { services, paramsCheck, userCheck, activityTimeCheck } from '../decorator'
import { resultsModel } from '../sdk'
import { AwardsService } from '../service'
import { PRIZE_TYPE, PRIZE_DATA_TYPE, DRAW_STATUS, CODE_TYPES } from '../constants'
import { PRIZE_TYPE, DRAW_STATUS, CODE_TYPES } from '../constants'
import { getToday, logger } from '../utils'
import { CodeType } from 'taobao-mini-sdk/lib/utils/codetypes'
......@@ -130,7 +130,7 @@ export default class AwardsController {
prize = thanksPrize
}
let reduceResult: ICodeType | 1 = 1
let reduceResult: ICodeType | number = 1
// 不是积分奖品, 检查是否扣库存
if (prize.type !== PRIZE_TYPE.CREDITS && prize.type !== PRIZE_TYPE.THANKS) {
......
......@@ -10,6 +10,30 @@ import { UserService, AccessService, TaskService } from '../service'
import { registeInfos } from '../decorator/registeInfos'
export default class Share {
/**
* 获取邀请信息
*/
@paramsCheck(['activityId'])
@registeInfos(['userInfo', 'activityInfo'])
@services([UserService])
async getShareInfo(
context: IContext<{
activityId: string
}>,
{ userInfo }: IControllerInfos
): Promise<
IResult<{
rewards: number
}>
> {
const {
remainTimes: { invites }
} = userInfo
return resultsModel.success({
rewards: invites
})
}
/**
* 完成分享
*/
......@@ -18,9 +42,12 @@ export default class Share {
@registeInfos(['userInfo', 'vipInfo', 'activityInfo'])
@services([UserService, TaskService, AccessService])
async doHelp(
context: IContext<IParams>,
context: IContext<{
activityId: string
inviteId: string
}>,
{ userInfo, vipInfo, activityInfo }: IControllerInfos,
[userService, taskService, accessService]: [UserService, TaskService, AccessService]
[userService, taskService]: [UserService, TaskService]
): Promise<IResult<boolean>> {
const { inviteId } = context.data
const { openId } = context
......@@ -31,21 +58,19 @@ export default class Share {
// inviteId的用户信息查询不到, 则inviteId无效
if (!inviteUserInfo) return resultsModel.error(CODE_TYPES.ERROR_INVALID_INVITE_ID)
const inviteCompleteList = taskService.getCompleteTaskByUserTaskInfo('invites', inviteUserInfo)
const { taskInfo } = taskService.getCompleteTaskByUserTaskInfo('invites', inviteUserInfo)
// 邀请成功列表有该用户信息
if (inviteCompleteList.some(v => v.openId === openId)) {
if (taskInfo.some(v => v.openId === openId)) {
return resultsModel.error(CODE_TYPES.ERROR_AREADY_INVITE_SUCCESS)
}
// const isFirstLogin: boolean = (await accessService.getAccessCount()) === 1
// 获取活动基本信息
const { tasks } = activityInfo
// 获取分享奖励
const {
invites: { value }
}: ITasks = tasks || {}
}: ITasks = tasks
// 新会员
const isNewVip = userService.checkNewVip(userInfo, vipInfo)
......
......@@ -51,29 +51,56 @@ export default class StatController {
const UV = (
await accessDao.aggregate([
{ $match: { activityId, createDay: day } },
{ $group: { _id: '$openId', count: { $sum: 1 } } }
{ $group: { _id: '$openId', count: { $sum: 1 } } },
{ $count: 'uv' }
])
).length
)?.[0]?.uv
// 新增UV
const newUV = await userDao.count({
activityId,
createDay: day
})
// 已入会PV
const vipPV = await accessDao.count({ activityId, createDay: day, isVip: true })
// 已入会(老会员)PV
const vipPV = await accessDao.count({
activityId,
createDay: day,
//@ts-ignore
$or: [{ 'member.flag': true }, { 'member.newMember': true }],
'member.bememberDay': {
$not: {
$eq: day
}
}
})
// 已入会(老会员)UV
const vipUV = (
await accessDao.aggregate(
[
{
$match: {
activityId,
createDay: day,
$or: [{ 'member.flag': true }, { 'member.newMember': true }],
'member.bememberDay': {
$not: {
$eq: day
}
}
}
},
{ $project: { openId: true } },
{ $group: { _id: '$openId', count: { $sum: 1 } } },
{ $count: 'uv' }
],
{ allowDiskUse: true }
)
)?.[0]?.uv
// 未入会PV
const noVipPV = await accessDao.count({ activityId, createDay: day, isVip: false })
// 已入会UV
const vipUV = (
await accessDao.aggregate([
{ $match: { activityId, createDay: day, isVip: true } },
{ $group: { _id: '$openId', count: { $sum: 1 } } }
])
).length
// 未入会UV
const noVipUV = (
await accessDao.aggregate([
......@@ -95,21 +122,16 @@ export default class StatController {
'follow.followDay': day
})
// 签到任务
// const signTaskUV = await userDao.count({
// activityId,
// [`taskInfo.${day}.sign`]: {
// $exists: true
// }
// })
// 收藏商品
// const collectGoodsTaskUV = await userDao.count({
// activityId,
// [`taskInfo.${day}.collecctGoods`]: {
// $exists: true
// }
// })
// 根据任务类型获取完成任务的人数
// example: await getTaskCompleteUV('collectGoods', day)
const getTaskCompleteUV = async (task: string, day: string) => {
return await userDao.count({
activityId,
[`taskInfo.${day}.${task}`]: {
$exists: true
}
})
}
const keyValueMapper = {
时间: day,
......@@ -122,9 +144,9 @@ export default class StatController {
未入会UV: noVipUV,
新入会UV: newVipUV,
新增关注UV: newFollowUV
// 收藏商品UV: collectGoodsTaskUV
// 签到任务UV: signTaskUV
//收藏商品UV: await getTaskCompleteUV('collectGoods', day)
}
console.log(keyValueMapper, 'xlsxData')
if (day === startDay) {
xlsxData.push(Object.keys(keyValueMapper))
......@@ -142,13 +164,10 @@ export default class StatController {
}
])
// let result = {}
console.log(xlsxData, 'xlsxData')
let result = await context.cloud.file.uploadFile({
fileContent: buffer,
fileName: `数据统计${startDay.replace(/\//g, '-')}-${endDay.replace(/\//g, '-')}.xlsx`
})
console.log(xlsxData, 'xlsxData')
if (result.url) {
result.url = result.url.replace('http', 'https').replace('-internal', '')
}
......
......@@ -40,35 +40,16 @@ export default class Task {
// 返回对应的任务时, B端b_activity_config tasks 需配置对应的任务
// 会员任务
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)
// // 浏览商品任务
// const browseGoodsTask = taskService.initBrowseGoodsTask(updatedUserInfo, tasks)
// // 收藏商品任务
// const collectGoodsTask = taskService.initCollectGoodsTask(updatedUserInfo, tasks)
// // 跳转链接任务
// const jumpLinkTask = taskService.initJumpLinkTask(updatedUserInfo, tasks)
// // 邀请任务
// const invitesTask = taskService.initInvitesTask(updatedUserInfo, tasks)
// 积分兑换
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
return resultsModel.success([
//signTask,
vipTask,
followTask
// orderGoodsTask,
// browseGoodsTask,
// invitesTask,
// collectGoodsTask,
// jumpLinkTask
taskService.initTask('member', '加入会员', tasks, updatedUserInfo),
taskService.initTask('follow', '关注店铺', tasks, updatedUserInfo)
// taskService.initTask('sign', '签到', tasks, updatedUserInfo),
// taskService.initTask('orderGoods', '购买商品', tasks, updatedUserInfo),
// taskService.initTask('browseGoods', '浏览商品', tasks, updatedUserInfo),
// taskService.initTask('collectGoods', '收藏商品', tasks, updatedUserInfo),
// taskService.initTask('jumpLink', '浏览页面', tasks, updatedUserInfo),
// taskService.initTask('invites', '邀请好友', tasks, updatedUserInfo),
// taskService.initTask('exchangeCredits', '积分兑换', tasks, updatedUserInfo)
])
}
......@@ -176,8 +157,7 @@ export default class Task {
const { todayTaskInfo, todayCompleteTimes } = taskService.getTodayCompleteTask('browseGoods', userInfo)
const hasCompleteToday =
todayTaskInfo.some((v: { itemId: string }) => v.itemId === itemId) && taskRateType === TASK_RATE_TYPE.EVERYDAY
const hasCompleteToday = todayTaskInfo.some(v => v.itemId === itemId) && taskRateType === TASK_RATE_TYPE.EVERYDAY
// 今日任务已经完成
if (hasCompleteToday) {
......@@ -225,8 +205,7 @@ export default class Task {
const { todayTaskInfo, todayCompleteTimes } = taskService.getTodayCompleteTask(taskType, userInfo)
const hasCompleteToday =
todayTaskInfo.filter((v: { itemId: string }) => v.itemId === itemId).length &&
taskRateType === TASK_RATE_TYPE.EVERYDAY
todayTaskInfo.filter(v => v.itemId === itemId).length && taskRateType === TASK_RATE_TYPE.EVERYDAY
// 今日任务已经完成
if (hasCompleteToday) {
......@@ -297,7 +276,10 @@ export default class Task {
context: IContext<IParams>,
{ userInfo }: IControllerInfos,
[taskService]: [TaskService]
): Promise<IResult<boolean>> {
): Promise<IResult<{ rewards: number }>> {
// 根据需求自定义领取任务增加的key值 如: gameTimes
const awardsTargetKey = `gameTimes`
const { taskType } = context.data
const { remainTimes, _id } = userInfo
......@@ -307,9 +289,6 @@ export default class Task {
const waitReceiveTimes = remainTimes?.[taskType]
// 根据需求自定义领取任务增加的key值 如: gameTimes
const awardsTargetKey = `gameTimes`
await taskService.updateUser(_id, {
$set: {
[`remainTimes.${taskType}`]: 0
......@@ -319,7 +298,9 @@ export default class Task {
}
})
return resultsModel.success(true)
return resultsModel.success({
rewards: waitReceiveTimes
})
}
/**
......@@ -336,13 +317,13 @@ export default class Task {
const { itemIds } = context.data
const list = await baseService.getItemListByIds(itemIds, session)
const completeList = taskService.getCompleteTaskByUserTaskInfo('collectGoods', userInfo)
const { taskInfo } = taskService.getCompleteTaskByUserTaskInfo('collectGoods', userInfo)
const listWithCollectStatus = list.map(v => {
return {
...v,
// 完成列表是否含有itemId
collected: completeList.some(completeItem => completeItem.itemId === v.itemId)
collected: taskInfo.some(completeItem => completeItem.itemId === v.itemId)
}
})
......
/** @format */
import { services, paramsCheck, activityTimeCheck, registeInfos } from '../decorator'
import { resultsModel } from '../sdk'
import { UserService, AccessService } from '../service'
import { getConfig } from '../config'
import { formatVipCbUrl } from '../utils/package/vip'
import { logger } from '../utils/package/logger'
import { formatVipCbUrl, getShopVip } from '../utils/package/vip'
export interface IVipParams {
activityId: string
callbackUrl?: string
......@@ -34,8 +32,6 @@ export default class User {
): Promise<IResult<{ openId: string }>> {
const { openId } = context
const { isFollow } = context.data
if (!userInfo) {
userInfo = await userService.initUserData(vipInfo, activityInfo)
} else {
......@@ -54,15 +50,14 @@ export default class User {
*/
@paramsCheck(['activityId'])
@registeInfos(['session'])
@services([UserService])
@services([])
async getVipInfo(
context: IContext<IVipParams>,
{ session, activityUserNick }: IControllerInfos,
[userService]: [UserService]
{ session, activityUserNick }: IControllerInfos
): Promise<IResult<IVipInfo>> {
const { callbackUrl } = context.data
// 拼接回调参数
const result = await userService.getShopVip(session, callbackUrl || formatVipCbUrl(context), activityUserNick)
const result = await getShopVip(context, session, callbackUrl || formatVipCbUrl(context), activityUserNick)
return resultsModel.success(result)
}
......
......@@ -2,9 +2,9 @@
import { resultsModel } from '../sdk'
import { CODE_TYPES } from '../constants'
import { UserService, BaseService } from '../service'
import { getSellerSession } from '../utils'
import { getSellerSession, logFn } from '../utils'
import { getConfig } from '../config'
import { formatVipCbUrl } from '../utils/package/vip'
import { formatVipCbUrl, getShopVip } from '../utils/package/vip'
// 检验参数是否存在
export const paramsCheck = (params: string[]) => {
return function (target: Object, name: string, descriptor: PropertyDescriptor) {
......@@ -15,8 +15,10 @@ export const paramsCheck = (params: string[]) => {
const dataKeys = Object.keys(context.data)
for (let i = 0; i < params.length; i++) {
const param = params[i]
if (!dataKeys.includes(param) || context.data?.[param] === '')
if (!dataKeys.includes(param) || context.data?.[param] === '') {
logFn(context)
return resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少${param}参数`)
}
}
return method.apply(target, [context, { ...otherArgs }])
}
......@@ -51,7 +53,7 @@ export const vipCheck = ({ intercept = true }) => {
const userService = new UserService(context)
const { session, userNick } = await getSellerSession(context)
const vipInfo = await userService.getShopVip(session, formatVipCbUrl(context), userNick)
const vipInfo = await getShopVip(context, session, formatVipCbUrl(context), userNick)
if (!vipInfo.isVip && intercept) return resultsModel.error(CODE_TYPES.ERROR_NO_VIP, '非店铺会员', vipInfo)
return method.apply(target, [context, { ...otherArgs, vipInfo, session }])
......
/** @format */
import { UserService } from '../service'
import { getSellerSession, logFn, recordErrorLog } from '../utils'
import { resultsModel } from '../sdk'
import { CODE_TYPES } from '../constants'
import { formatVipCbUrl } from '../utils/package/vip'
import { getSellerSession } from '../utils'
import { formatVipCbUrl, getShopVip } from '../utils/package/vip'
export type IInfo = 'userInfo' | 'session' | 'activityInfo' | 'vipInfo'
......@@ -28,7 +26,7 @@ async function initBaseInfo(context: IContext<IParams>, baseInfos: IControllerIn
baseInfos.session = session
baseInfos.activityUserNick = userNick
}
const vipInfo = await userService.getShopVip(baseInfos.session, formatVipCbUrl(context), baseInfos.activityUserNick)
const vipInfo = await getShopVip(context, baseInfos.session, formatVipCbUrl(context), baseInfos.activityUserNick)
baseInfos.vipInfo = vipInfo
}
return baseInfos
......
/** @format */
import { UserService } from '../service'
import { getSellerSession, logFn, recordErrorLog } from '../utils'
import { logFn, recordErrorLog } from '../utils'
import { resultsModel } from '../sdk'
import { CODE_TYPES } from '../constants'
import { formatVipCbUrl } from '../utils/package/vip'
// async function initBaseInfo(context: IContext<IParams>, baseInfos: IControllerInfos) {
// const handler = context?.cloud?.dataspace?.context?.handler
// const userService = new UserService(context)
// if (!baseInfos.userInfo) {
// const userInfo = await userService.getUserInfo()
// baseInfos.userInfo = userInfo
// }
// if (!baseInfos.session) {
// const { session, userNick } = await getSellerSession(context)
// baseInfos.session = session
// baseInfos.activityUserNick = userNick
// }
// if (!baseInfos.vipInfo && handler !== 'getVipInfo') {
// const vipInfo = await userService.getShopVip(baseInfos.session, formatVipCbUrl(context), baseInfos.activityUserNick)
// baseInfos.vipInfo = vipInfo
// }
// return baseInfos
// }
type Constructor = new (...args: any[]) => {}
......@@ -37,8 +15,6 @@ export const services = (services: Constructor[]) => {
let [context, otherArgs = {}] = args
const servicesInstance = services.map(v => new v(context))
// const baseInfos: IControllerInfos = await initBaseInfo(context, otherArgs)
logFn(context)
const baseInfos = otherArgs
......
/** @format */
import { DEFAULT_CODE_TYPES } from './sdk'
export const BusinessError = {
// 更新重试失败(用于并发更新)
ERROR_UPDATE_RETRY: {
code: `210001`,
defaultMsg: `系统错误`
},
// 活动不存在
ERROR_NO_ACTIVITY: {
code: `220001`,
defaultMsg: `活动不存在`
},
// 活动未开始
ERROR_ACTIVITY_NOSTART: {
code: `220002`,
defaultMsg: `活动未开始`
},
// 活动已结束
ERROR_ACTIVITY_OVER: {
code: `220003`,
defaultMsg: `活动已结束`
},
// 用户不存在
ERROR_NO_USER: {
code: `310002`,
defaultMsg: `用户不存在`
},
// 非店铺会员
ERROR_NO_VIP: {
code: `310003`,
defaultMsg: '非店铺会员'
},
// 暂无次数可领取
ERROR_TASK_NORECEIVE: {
code: `430001`,
defaultMsg: `该任务暂无领取次数`
},
// 任务奖励已领取
ERROR_TASK_ALREADYRECEIVE: {
code: `430002`,
defaultMsg: `任务奖励已领取`
},
// 任务已完成
ERROR_TASK_COMPLETE: {
code: `430003`,
defaultMsg: `任务已完成`
},
ERROR_INVALID_INVITE_ID: {
code: `430004`,
defaultMsg: `邀请码无效`
},
ERROR_NO_CREDITS: {
code: `430005`,
defaultMsg: `任务所需积分不足`
},
ERROR_TASK_LIMIT: {
code: `430006`,
defaultMsg: `今日该任务次数超限`
},
ERROR_AREADY_INVITE_SUCCESS: {
code: `430007`,
defaultMsg: `已经成功邀请过`
},
ERROR_NO_INVITE_SELF: {
code: `430008`,
defaultMsg: `自己不能给自己助力`
},
ERROR_FORBIDDEN_OPE: {
code: `530001`,
defaultMsg: `非法操作`
},
ERROR_RECEIVE_PRIZE: {
code: `630002`,
defaultMsg: `奖励已领取`
},
ERROR_SEND_PRIZE: {
code: `730001`,
defaultMsg: `发奖失败`
},
ERROR_NO_PRIZE: {
code: `730002`,
defaultMsg: `奖品不存在`
},
ERROR_NO_STOCK: {
code: `730003`,
defaultMsg: `库存不足`
},
ERROR_PRIZE_EXPIRED: {
code: `740001`,
defaultMsg: `奖品已超过领取时间`
}
}
export const CODE_TYPES = Object.assign({}, DEFAULT_CODE_TYPES, BusinessError)
......@@ -26,7 +26,7 @@ const { getMyPrizeList, receiveObjectPrize, receiveEnamePrize, drawLotteryPrize
const { doHelp } = new ShareController()
const { getStats } = new StatController()
const { getStats, addStat } = new StatController()
export default {
login,
......@@ -38,5 +38,6 @@ export default {
receiveObjectPrize,
receiveEnamePrize,
doHelp,
getStats
getStats,
addStat
}
......@@ -31,7 +31,7 @@ export default class UserAccessService {
isReceiveShare: !!inviteId,
inviteId,
isFollow: userInfo.follow.flag || userInfo.follow.newFollow,
isVip: userInfo.member.flag || userInfo.member.newMember,
isVip: !!(userInfo.member.flag || userInfo.member.newMember),
follow: userInfo.follow,
member: userInfo.member,
accessTime: Date.now(),
......
......@@ -26,7 +26,7 @@ export default class StatService {
* @return {boolean}
* @memberof StatService
*/
async addStat(type: number, userInfo: IUserInfo = {} as IUserInfo, customStatData: object = {}): Promise<number> {
async addStat(type: number, userInfo: IUserInfo = {} as IUserInfo, customStatData: object = {}): Promise<string> {
const { openId } = this.context
const { activityId } = this.context.data
const { userNick } = userInfo
......
......@@ -6,7 +6,7 @@
import { merge } from 'lodash'
import UserService from './user.service'
import { getToday, getUserOrderlist, logger } from '../utils'
import { getToday, getUserOrderlist, logger, generateVipUrl, formatVipCbUrl, sleep } from '../utils'
import { TASK_RATE_TYPE, TASK_STATUS } from '../constants'
export interface ITaskInfo {
......@@ -26,214 +26,43 @@ export default class TaskService extends UserService {
constructor(context: IContext<IParams>) {
super(context)
}
initVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): ITaskInfo {
const { remainTimes } = userInfo
// 后台配置奖励
const {
member: { value }
} = tasks
return {
taskType: `member`,
title: `加入会员`,
url: vipInfo.url,
rewards: value,
taskRateType: TASK_RATE_TYPE.FOREVER,
waitReceive: remainTimes.member,
status: this.setTaskStatus(userInfo, 'member', TASK_RATE_TYPE.FOREVER, 1)
}
}
// 初始化下单任务
initOrderGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo {
const {
orderGoods: { value, itemIds, taskRateType, times }
} = tasks
const { remainTimes } = userInfo
const { todayCompleteTimes } = this.getTodayCompleteTask('orderGoods', userInfo)
const orderGoodsCompleteList: object[] = this.getCompleteTaskByUserTaskInfo('orderGoods', userInfo)
let orderTask: ITaskInfo = {
taskType: `orderGoods`,
title: `下单商品`,
itemIds,
rewards: value,
taskRateType,
times,
todayCompleteTimes,
completeTimes: orderGoodsCompleteList.length,
status: this.setTaskStatus(userInfo, 'orderGoods', taskRateType, times),
waitReceive: remainTimes.orderGoods
}
return orderTask
}
// 初始化浏览商品任务
initBrowseGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo {
/**
* 根据任务类型初始化 b端 tasks字段必须有相应的配置
*
* @param {ITaskType} taskType 任务类型
* @param {string} title 任务标题
* @param {ITasks} tasks 任务配置
* @param {IUserInfo} userInfo 用户信息
* @return {ITaskInfo} {ITaskInfo} 任务信息
* @memberof TaskService
*/
initTask(taskType: ITaskType, title: string, tasks: ITasks, userInfo: IUserInfo): ITaskInfo {
const {
browseGoods: { value, itemIds, taskRateType, times }
[taskType]: { value, itemIds = '', taskRateType, times = 1, link = '' }
} = tasks
const { remainTimes } = userInfo
const { todayCompleteTimes } = this.getTodayCompleteTask('browseGoods', userInfo)
const browseGoodsCompleteList: object[] = this.getCompleteTaskByUserTaskInfo('browseGoods', userInfo)
let orderTask: ITaskInfo = {
taskType: `browseGoods`,
title: `浏览商品`,
itemIds,
times,
rewards: value,
waitReceive: remainTimes.browseGoods,
todayCompleteTimes,
completeTimes: browseGoodsCompleteList.length,
status: this.setTaskStatus(userInfo, 'browseGoods', taskRateType, times),
taskRateType
}
return orderTask
}
// 初始化收藏商品任务
initCollectGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo {
const { value, itemIds, taskRateType, times } = tasks.collectGoods
const { remainTimes } = userInfo
const { todayCompleteTimes } = this.getTodayCompleteTask('collectGoods', userInfo)
const completeList: object[] = this.getCompleteTaskByUserTaskInfo('collectGoods', userInfo)
const { todayCompleteTimes } = this.getTodayCompleteTask(taskType, userInfo)
const { completeTimes } = this.getCompleteTaskByUserTaskInfo(taskType, userInfo)
let orderTask: ITaskInfo = {
taskType: `collectGoods`,
title: `收藏商品`,
return {
taskType,
title,
itemIds,
times,
rewards: value,
waitReceive: remainTimes.collectGoods,
todayCompleteTimes,
completeTimes: completeList.length,
taskRateType,
status: this.setTaskStatus(userInfo, 'collectGoods', taskRateType, times)
}
return orderTask
}
// 初始化跳转任务
initJumpLinkTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo {
const { value, link, taskRateType, times } = tasks.jumpLink
const { remainTimes } = userInfo
const { todayCompleteTimes } = this.getTodayCompleteTask('jumpLink', userInfo)
const completeList: object[] = this.getCompleteTaskByUserTaskInfo('jumpLink', userInfo)
let orderTask: ITaskInfo = {
taskType: `jumpLink`,
title: `跳转链接`,
url: link,
times,
rewards: value,
waitReceive: remainTimes.jumpLink,
todayCompleteTimes,
completeTimes: completeList.length,
taskRateType,
status: this.setTaskStatus(userInfo, 'jumpLink', taskRateType, times)
}
return orderTask
}
// 初始化邀请任务
initInvitesTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo {
const {
invites: { value, taskRateType, times }
} = tasks
const { remainTimes } = userInfo
const { todayCompleteTimes } = this.getTodayCompleteTask('invites', userInfo)
const invitesCompleteList: object[] = this.getCompleteTaskByUserTaskInfo('invites', userInfo)
let orderTask: ITaskInfo = {
taskType: `invites`,
title: `邀请`,
rewards: value,
taskRateType,
times,
url: taskType === 'member' ? generateVipUrl(formatVipCbUrl(this.context)) : link,
todayCompleteTimes,
completeTimes: invitesCompleteList.length,
waitReceive: remainTimes.invites,
status: this.setTaskStatus(userInfo, 'invites', taskRateType, times)
}
return orderTask
}
// 关注店铺
initFollowTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo {
const {
follow: { value }
} = tasks
const { remainTimes } = userInfo
const followCompleteList: object[] = this.getCompleteTaskByUserTaskInfo('follow', userInfo)
return {
taskType: `follow`,
title: `关注店铺`,
rewards: value,
taskRateType: TASK_RATE_TYPE.FOREVER,
waitReceive: remainTimes.follow,
completeTimes: followCompleteList.length,
status: this.setTaskStatus(userInfo, 'follow', TASK_RATE_TYPE.FOREVER, 1)
}
}
// 初始化签到任务
initSignTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo {
const {
sign: { value, times }
} = tasks
const { remainTimes } = userInfo
const completeList: object[] = this.getCompleteTaskByUserTaskInfo('sign', userInfo)
const { todayCompleteTimes } = this.getTodayCompleteTask('sign', userInfo)
return {
taskType: `sign`,
title: `每日签到`,
rewards: value,
times,
taskRateType: TASK_RATE_TYPE.EVERYDAY,
waitReceive: remainTimes.sign,
completeTimes: completeList.length,
todayCompleteTimes,
status: this.setTaskStatus(userInfo, 'sign', TASK_RATE_TYPE.EVERYDAY, times)
}
}
// 积分兑换 /固定为每日限制
initExchangeCreditsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo {
const {
exchangeCredits: { value, times }
} = tasks
const { remainTimes, taskInfo } = userInfo
const { todayCompleteTimes } = this.getTodayCompleteTask('exchangeCredits', userInfo)
return {
taskType: `exchangeCredits`,
title: `积分兑换`,
rewards: value,
times,
taskRateType: TASK_RATE_TYPE.EVERYDAY,
todayCompleteTimes,
waitReceive: remainTimes.exchangeCredits,
status: this.setTaskStatus(userInfo, 'exchangeCredits', TASK_RATE_TYPE.EVERYDAY)
completeTimes,
status: this.setTaskStatus(userInfo, taskType, taskRateType, times),
waitReceive: remainTimes[taskType]
}
}
// 根据会员状态更新
updateVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks) {
let { member, remainTimes, taskInfo } = userInfo
let { member } = userInfo
const { newMember } = member
const today = getToday()
......@@ -265,13 +94,14 @@ export default class TaskService extends UserService {
// 根据下单下单记录,更新状态
async updateOrderGoodsTask(userInfo: IUserInfo, tasks: ITasks, activityStartTime: number, session?: string) {
const taskType = 'orderGoods'
const {
orderGoods: { value, itemIds, taskRateType, times }
[taskType]: { value, itemIds, taskRateType, times }
} = tasks
const orderGoodsCompleteList: object[] = this.getCompleteTaskByUserTaskInfo('orderGoods', userInfo)
const { todayCompleteTimes } = this.getTodayCompleteTask('orderGoods', userInfo)
const { completeTimes, taskInfo } = this.getCompleteTaskByUserTaskInfo(taskType, userInfo)
const { todayCompleteTimes } = this.getTodayCompleteTask(taskType, userInfo)
// 永久任务且已完成
if (taskRateType === TASK_RATE_TYPE.FOREVER && orderGoodsCompleteList.length) {
if (taskRateType === TASK_RATE_TYPE.FOREVER && completeTimes) {
return {}
}
......@@ -293,17 +123,20 @@ export default class TaskService extends UserService {
let projection = {
$inc: {
'remainTimes.orderGoods': 0
[`remainTimes.${taskType}`]: 0
},
$set: {}
}
let targetOrders = []
let targetOrders = userInfo?.taskInfo?.[today]?.[taskType] || []
orderResult.forEach(v => {
// @ts-ignore
// 商品订单包含目标商品 且orderId为新订单
if (itemIdsArr.includes(v.itemId) && !orderGoodsCompleteList.some(order => order.orderId === v.orderId)) {
projection.$inc['remainTimes.orderGoods'] += +value
if (itemIdsArr.includes(v.itemId) && !taskInfo.some(order => order.orderId === v.orderId)) {
if (taskRateType === TASK_RATE_TYPE.EVERYDAY && targetOrders.length >= times) {
return
}
projection.$inc[`remainTimes.${taskType}`] += +value
targetOrders.push({
itemId: v.itemId,
orderId: v.orderId,
......@@ -311,13 +144,8 @@ export default class TaskService extends UserService {
createTime: Date.now()
})
}
if (targetOrders.length) {
if (userInfo.taskInfo[today] && userInfo.taskInfo[today]['orderGoods']) {
const targetList = userInfo.taskInfo[today]['orderGoods'].concat(targetOrders)
projection.$set[`taskInfo.${today}.orderGoods`] = targetList
} else {
projection.$set[`taskInfo.${today}.orderGoods`] = targetOrders
}
if (targetOrders?.length) {
projection.$set[`taskInfo.${today}.${taskType}`] = targetOrders
}
})
......@@ -334,8 +162,6 @@ export default class TaskService extends UserService {
const { todayCompleteTimes } = this.getTodayCompleteTask('sign', userInfo)
const today = getToday()
logger(todayCompleteTimes)
// 今天没有有完成记录
return todayCompleteTimes === 0
? {
......@@ -397,7 +223,7 @@ export default class TaskService extends UserService {
* @return {taskTatus} 1未完成 2 待领取 3 已完成
* @memberof TaskService
*/
setTaskStatus(useInfo: IUserInfo, taskType: string, taskRateType: number, limitTimesEveryday?: number): number {
setTaskStatus(useInfo: IUserInfo, taskType: string, taskRateType: number, limitTimesEveryday: number = 1): number {
const waitReceive = useInfo?.remainTimes?.[taskType] || 0
if (waitReceive) return TASK_STATUS.WAIT_RECEIVE
......@@ -405,7 +231,7 @@ export default class TaskService extends UserService {
const { todayCompleteTimes } = this.getTodayCompleteTask(taskType, useInfo)
// 总共的完成次数
const completeTimes = this.getCompleteTaskByUserTaskInfo(taskType, useInfo).length
const { completeTimes } = this.getCompleteTaskByUserTaskInfo(taskType, useInfo)
switch (taskRateType) {
case TASK_RATE_TYPE.FOREVER:
......@@ -429,7 +255,13 @@ export default class TaskService extends UserService {
* @returns {number} todayTimes 今日任务完成次数 todayTaskInfo 今日对应任务完成详情
* @memberof TaskService
*/
getTodayCompleteTask(taskType: string, userInfo: IUserInfo) {
getTodayCompleteTask(
taskType: string,
userInfo: IUserInfo
): {
todayCompleteTimes: number
todayTaskInfo: ITaskDetail[]
} {
const today = getToday()
return {
todayCompleteTimes: userInfo?.taskInfo?.[today]?.[taskType]?.length || 0,
......@@ -444,7 +276,13 @@ export default class TaskService extends UserService {
* @returns {array}
* @memberof TaskService
*/
getCompleteTaskByUserTaskInfo(taskType: string, userInfo: IUserInfo) {
getCompleteTaskByUserTaskInfo(
taskType: string,
userInfo: IUserInfo
): {
completeTimes: number
taskInfo: ITaskDetail[]
} {
const { taskInfo = {} } = userInfo
let targetTaskList = []
......@@ -457,7 +295,10 @@ export default class TaskService extends UserService {
}
})
return targetTaskList
return {
completeTimes: targetTaskList?.length || 0,
taskInfo: targetTaskList
}
}
/**
......@@ -525,6 +366,10 @@ export default class TaskService extends UserService {
}
await this.updateUser(id, updateKeys)
// 更新数据库后 延迟10ms 执行
await sleep(10)
return await this.getUserInfo()
}
}
......@@ -7,7 +7,7 @@
import { BaseDao, TBAPIS } from '../sdk'
import BaseService from './base.service'
import { USER_DB_NAME } from '../db'
import { formatVipCbUrl, getToday, isUseVipMock } from '../utils'
import { formatVipCbUrl, getToday, isUseVipMock, generateVipUrl } from '../utils'
import { VIP_MOCK } from '../vipMock'
import { sellerId } from '../constants'
class UserService extends BaseService {
......@@ -39,32 +39,6 @@ class UserService extends BaseService {
return record
}
/**
* @desc 获取是否是会员
* @param {调用淘宝接口的session} session
* @returns {isVip: boolean(是否是会员), url: string(入会链接) }
*/
async getShopVip(session: string, callbackUrl: string = '', activityUserNick: string = ''): Promise<IVipInfo> {
if (isUseVipMock(this.context, activityUserNick)) {
return VIP_MOCK
}
let result = {
result: {
member_info: ''
}
}
let shopUrl = `https://market.m.taobao.com/app/sj/member-center-rax/pages/pages_index_index?wh_weex=true&sellerId=${sellerId}&extraInfo=${encodeURIComponent(
JSON.stringify({ source: 'isvapp', entrance: 'duiba' })
)}&callbackUrl=${encodeURIComponent(callbackUrl)}`
result = await TBAPIS.queryVipinfo(this.context, session)
console.log(`result, shopUrl`, result, shopUrl)
return {
isVip: !!(result.result && result.result.member_info),
url: shopUrl
}
}
/**
* 初始化用户数据
*
......@@ -236,6 +210,35 @@ class UserService extends BaseService {
])
}
/**
* 获取用户排名
*/
async getUserRank(hotValue: number) {
let { activityId } = this.context.data
const { openId } = this.context
let sameScoreList = await this.userdao.find<IUserInfo>(
{ hotValue, activityId },
{
sort: { updateTime: 1 }
}
)
let rank: string | number = '未上榜'
let gap = 0
//说明有多个跟自己同分数的人
for (let j = 0; j < sameScoreList.length; j++) {
if (sameScoreList[j].openId == openId) {
gap = j
}
}
rank = await this.userdao.count({ hotValue: { $gt: hotValue }, activityId })
rank = rank + 1 + gap
if (rank > 1000) {
rank = '1000+'
}
return rank
}
/**
* updateUser projection 格式化
*
......
......@@ -15,18 +15,30 @@ interface IActivityInfo {
awardReceiveExpiredTime?: number
tasks?: ITasks
}
type ITaskType =
| 'follow'
| 'member'
| 'sign'
| 'exchangeCredits'
| 'browseGoods'
| 'orderGoods'
| 'collectGoods'
| 'jumpLink'
| 'invites'
interface ITasks {
follow?: ITaskConfig
member?: ITaskConfig
sign?: ITaskConfig
exchangeCredits?: ITaskConfig
browseGoods?: ITaskConfig
orderGoods?: ITaskConfig
collectGoods?: ITaskConfig
jumpLink?: ITaskConfig
invites?: ITaskConfig
}
type ITasks = { [key in ITaskType]: ITaskConfig }
// interface ITasks {
// // follow?: ITaskConfig
// // member?: ITaskConfig
// // sign?: ITaskConfig
// // exchangeCredits?: ITaskConfig
// // browseGoods?: ITaskConfig
// // orderGoods?: ITaskConfig
// // collectGoods?: ITaskConfig
// // jumpLink?: ITaskConfig
// // invites?: ITaskConfig
// [key in ITaskType]: ITaskConfig
// }
interface ITaskConfig {
title?: string // 任务标题
......
......@@ -20,18 +20,18 @@ interface IBaseDao {
* 插入单条数据
* @param document
*/
insertOne<T>(document: any): Promise<number>
insertOne<T>(document: any): Promise<string>
/**
* 插入多条数据
* @param documents 插入对象
*/
insertMany(documents: object[]): Promise<number[]>
insertMany(documents: object[]): Promise<string[]>
/**
* 更新数据
* @param query
* @param options
*/
update(query: object, options?: IUpdateQuery): Promise<any>
update(query: object, options?: IUpdateQuery): Promise<number>
/**
* 删除多条数据
* @param filter
......
......@@ -44,3 +44,11 @@ interface IFollowInfo {
followTime?: number
followDay?: string
}
interface ITaskDetail {
createTime: number
openId?: string
orderId?: string
itemId?: string
payTime?: string
}
......@@ -21,3 +21,5 @@ export * from './package/getUserOrderlist'
export * from './package/vip'
export * from './package/exportHandlers'
export * from './package/helper'
/** @format */
export function sleep(time: number) {
return new Promise(resolve => setTimeout(resolve, time))
}
/** @format */
import { getConfig } from '../../config/index'
import { sellerId } from '../../constants'
import { VIP_MOCK } from '../../vipMock'
import { TBAPIS } from '../../sdk'
/** @format */
// 测试环境 duib2账户mock数据 或者本地
......@@ -12,6 +17,42 @@ export const isUseVipMock = (context: IContext<IParams>, userNick: string) => {
return (isTestEnv && isDuibaAccount) || isMockEnv
}
/**
* @desc 获取是否是会员
* @param {调用淘宝接口的session} session
* @returns {isVip: boolean(是否是会员), url: string(入会链接) }
*/
export const getShopVip = async (
context: IContext<any>,
session: string,
callbackUrl: string = '',
activityUserNick: string = ''
): Promise<IVipInfo> => {
if (isUseVipMock(context, activityUserNick)) {
return VIP_MOCK
}
let result = {
result: {
member_info: ''
}
}
result = await TBAPIS.queryVipinfo(context, session)
const shopUrl = generateVipUrl(callbackUrl)
return {
isVip: !!(result.result && result.result.member_info),
url: shopUrl
}
}
// 生成会员链接
export const generateVipUrl = (callbackUrl: string) => {
return `https://market.m.taobao.com/app/sj/member-center-rax/pages/pages_index_index?wh_weex=true&sellerId=${sellerId}&extraInfo=${encodeURIComponent(
JSON.stringify({ source: 'isvapp', entrance: 'duiba' })
)}&callbackUrl=${encodeURIComponent(callbackUrl)}`
}
// 格式化Vip回调地址
export const formatVipCbUrl = (context: IContext<IParams>) => {
const { activityId, inviteId = '' } = context.data
......
......@@ -2,6 +2,6 @@
// 测试环境下 duiba2及其子账号自动开启VIP_MOCK, 返回数据可在此设置
export const VIP_MOCK = {
isVip: false,
isVip: true,
url: '//taobao.com'
}
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