Commit 6b9ac21a authored by qinhaitao's avatar qinhaitao

feat: 🎸 任务优化

parent ea4236d9
/** @format */ /** @format */
export declare const BusinessError: { export * from './errorCode';
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 declare const TBERROR: { export declare const TBERROR: {
USER_PERMISSION_EXCEED_MAX_RIGHT_COUNT_IN_DAY: string; USER_PERMISSION_EXCEED_MAX_RIGHT_COUNT_IN_DAY: string;
COUPON_INVALID_OR_DELETED: string; COUPON_INVALID_OR_DELETED: string;
...@@ -184,9 +17,6 @@ export declare const DRAW_STATUS: { ...@@ -184,9 +17,6 @@ export declare const DRAW_STATUS: {
EXPIRED: number; EXPIRED: number;
RETRY: 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 TAOBAO_SUCCESS_ORDER_STATUS: string[];
export declare const enum ACTIVITY_STATUS { export declare const enum ACTIVITY_STATUS {
NORMAL = 1, NORMAL = 1,
...@@ -229,3 +59,6 @@ export declare enum STAT_TYPE { ...@@ -229,3 +59,6 @@ export declare enum STAT_TYPE {
CLICK_INVITE = 1, CLICK_INVITE = 1,
CLICK_FOLLOW_TASK = 2 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"; "use strict";
/** @format */ /** @format */
Object.defineProperty(exports, "__esModule", { value: true }); var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
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; if (k2 === undefined) k2 = k;
var sdk_1 = require("./sdk"); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
exports.BusinessError = { }) : (function(o, m, k, k2) {
// 更新重试失败(用于并发更新) if (k2 === undefined) k2 = k;
ERROR_UPDATE_RETRY: { o[k2] = m[k];
code: "210001", }));
defaultMsg: "\u7CFB\u7EDF\u9519\u8BEF" 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);
// 活动不存在
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"
}
}; };
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 接口返回部分错误 // tb 接口返回部分错误
exports.TBERROR = { exports.TBERROR = {
USER_PERMISSION_EXCEED_MAX_RIGHT_COUNT_IN_DAY: '今日领取达到上限,明日再来领取哦', USER_PERMISSION_EXCEED_MAX_RIGHT_COUNT_IN_DAY: '今日领取达到上限,明日再来领取哦',
...@@ -120,11 +38,6 @@ exports.DRAW_STATUS = { ...@@ -120,11 +38,6 @@ exports.DRAW_STATUS = {
// 重新领取 // 重新领取
RETRY: 6 RETRY: 6
}; };
exports.appId = '${需要补充}';
// 商铺id 拼接vip链接用
exports.sellerId = '${商铺id}';
// C端的APP NAME
exports.C_APP_NAME = "promotioncenter-" + exports.appId;
// 订单状态 // 订单状态
exports.TAOBAO_SUCCESS_ORDER_STATUS = [ exports.TAOBAO_SUCCESS_ORDER_STATUS = [
'WAIT_SELLER_SEND_GOODS', 'WAIT_SELLER_SEND_GOODS',
...@@ -176,4 +89,9 @@ var STAT_TYPE; ...@@ -176,4 +89,9 @@ var STAT_TYPE;
STAT_TYPE[STAT_TYPE["CLICK_INVITE"] = 1] = "CLICK_INVITE"; STAT_TYPE[STAT_TYPE["CLICK_INVITE"] = 1] = "CLICK_INVITE";
STAT_TYPE[STAT_TYPE["CLICK_FOLLOW_TASK"] = 2] = "CLICK_FOLLOW_TASK"; STAT_TYPE[STAT_TYPE["CLICK_FOLLOW_TASK"] = 2] = "CLICK_FOLLOW_TASK";
})(STAT_TYPE = exports.STAT_TYPE || (exports.STAT_TYPE = {})); })(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 //# 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,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD,QAAQ;IACR,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,OAAO;KACpB;IACD,UAAU;IACV,oBAAoB,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,wDAAW;KACxB;IACD,UAAU;IACV,yBAAyB,EAAE;QACzB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,4CAAS;KACtB;IACD,QAAQ;IACR,mBAAmB,EAAE;QACnB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,gCAAO;KACpB;IACD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HD,WAAY,SAAS;IACnB,yDAAgB,CAAA;IAChB,mEAAiB,CAAA;AACnB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"} {"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 \ No newline at end of file
...@@ -33,12 +33,12 @@ export default class AwardsController { ...@@ -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<{ 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; type: number;
name: string; name: string;
image: string; image: string;
......
...@@ -139,7 +139,7 @@ var AwardsController = /** @class */ (function () { ...@@ -139,7 +139,7 @@ var AwardsController = /** @class */ (function () {
var userInfo = _a.userInfo; var userInfo = _a.userInfo;
var awardSer = _b[0]; var awardSer = _b[0];
return __awaiter(this, void 0, void 0, function () { 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) { return __generator(this, function (_e) {
switch (_e.label) { switch (_e.label) {
case 0: case 0:
...@@ -177,7 +177,7 @@ var AwardsController = /** @class */ (function () { ...@@ -177,7 +177,7 @@ var AwardsController = /** @class */ (function () {
if (((_c = reduceResult) === null || _c === void 0 ? void 0 : _c.code) || !reduceResult) { if (((_c = reduceResult) === null || _c === void 0 ? void 0 : _c.code) || !reduceResult) {
prize = thanksPrize; 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; userNick = userInfo.userNick;
record = { record = {
openId: openId, openId: openId,
...@@ -186,6 +186,7 @@ var AwardsController = /** @class */ (function () { ...@@ -186,6 +186,7 @@ var AwardsController = /** @class */ (function () {
drawStatus: constants_1.DRAW_STATUS.WAITAWARD, drawStatus: constants_1.DRAW_STATUS.WAITAWARD,
prizeDataType: prizeDataType, prizeDataType: prizeDataType,
remark: '', remark: '',
useUrl: useUrl,
type: type, type: type,
ename: ename, ename: ename,
name: name, name: name,
......
{"version":3,"file":"awards.controller.js","sourceRoot":"","sources":["../../src/controller/awards.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,0CAAkF;AAClF,8BAAqC;AACrC,sCAA0C;AAC1C,0CAAmF;AACnF,kCAA2C;AAwB3C;IAAA;IA8IA,CAAC;IA7IC;;OAEG;IAIG,yCAAc,GAApB,UACE,OAAmC,EACnC,EAAE,EACF,EAA2B;YAA1B,QAAQ,QAAA;;;;;;wBAGP,MAAM,GAEJ,OAAO,OAFH,EACE,UAAU,GAChB,OAAO,gBADS,CACT;wBACE,qBAAM,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,QAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAAA;;wBAA9D,MAAM,GAAG,SAAqD;wBAClE,sBAAO,kBAAY,CAAC,OAAO,CAAC;gCAC1B,IAAI,EAAE,MAAM;6BACb,CAAC,EAAA;;;;KACH;IAED;;OAEG;IAIG,6CAAkB,GAAxB,UACE,OAAsC,EACtC,EAAE,EACF,EAA2B;YAA1B,QAAQ,QAAA;;;;;;wBAEL,KAAmF,OAAO,CAAC,IAAI,EAA7F,QAAQ,cAAA,EAAE,IAAI,UAAA,EAAE,IAAI,UAAA,EAAE,UAAU,gBAAA,EAAE,aAAa,mBAAA,EAAE,EAAE,QAAA,EAAE,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,UAAU,gBAAA,CAAiB;wBAEtF,qBAAM,QAAQ,CAAC,kBAAkB,CAAC,EAAE,EAAE;gCACjD,UAAU,YAAA;gCACV,QAAQ,UAAA;gCACR,IAAI,MAAA;gCACJ,IAAI,MAAA;gCACJ,UAAU,YAAA;gCACV,aAAa,eAAA;gCACb,IAAI,MAAA;gCACJ,KAAK,OAAA;6BACN,CAAC,EAAA;;wBATE,MAAM,GAAG,SASX;wBAEF,IAAK,MAAmB,CAAC,IAAI,EAAE;4BAC7B,sBAAO,kBAAY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,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;;;;4DAkEzB;IACH,uBAAC;CAAA,AA/ID,IA+IC;kBA/IoB,gBAAgB"}
\ No newline at end of file \ No newline at end of file
/** @format */ /** @format */
import { UserService, AccessService, TaskService } from '../service'; import { UserService, TaskService } from '../service';
export default class Share { 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"); ...@@ -56,14 +56,29 @@ var registeInfos_1 = require("../decorator/registeInfos");
var Share = /** @class */ (function () { var Share = /** @class */ (function () {
function Share() { 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) { Share.prototype.doHelp = function (context, _a, _b) {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo; 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 () { 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; var _c;
return __generator(this, function (_d) { return __generator(this, function (_d) {
switch (_d.label) { switch (_d.label) {
...@@ -80,13 +95,13 @@ var Share = /** @class */ (function () { ...@@ -80,13 +95,13 @@ var Share = /** @class */ (function () {
// inviteId的用户信息查询不到, 则inviteId无效 // inviteId的用户信息查询不到, 则inviteId无效
if (!inviteUserInfo) if (!inviteUserInfo)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.ERROR_INVALID_INVITE_ID)]; 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)]; return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.ERROR_AREADY_INVITE_SUCCESS)];
} }
tasks = activityInfo.tasks; tasks = activityInfo.tasks;
value = (tasks || {}).invites.value; value = tasks.invites.value;
isNewVip = userService.checkNewVip(userInfo, vipInfo); isNewVip = userService.checkNewVip(userInfo, vipInfo);
if (!(isNewVip && !userInfo.member.newMember)) return [3 /*break*/, 3]; if (!(isNewVip && !userInfo.member.newMember)) return [3 /*break*/, 3];
return [4 /*yield*/, userService.updateUser(userInfo._id, { return [4 /*yield*/, userService.updateUser(userInfo._id, {
...@@ -120,6 +135,14 @@ var Share = /** @class */ (function () { ...@@ -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([ __decorate([
check_1.paramsCheck(['activityId', 'inviteId']), check_1.paramsCheck(['activityId', 'inviteId']),
check_1.activityTimeCheck, 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,QA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,uBAAa,CAAC,CAAC;;;;uCA8DnD;IACH,YAAC;CAAA,AA9FD,IA8FC;kBA9FoB,KAAK"}
\ No newline at end of file \ No newline at end of file
...@@ -18,5 +18,5 @@ export default class StatController { ...@@ -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>>;
} }
This diff is collapsed.
{"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,CAAC,EAAA;;wBAAzC,SAAyC,CAAA;wBACzC,sBAAO,kBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;;;KAClC;IACD;;OAEG;IACG,iCAAQ,GAAd,UAAe,OAAkC;;;;;;wBACzC,KAAmC,OAAO,CAAC,IAAI,EAA7C,UAAU,gBAAA,EAAE,QAAQ,cAAA,EAAE,MAAM,YAAA,CAAiB;wBA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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 \ No newline at end of file
...@@ -33,7 +33,9 @@ export default class Task { ...@@ -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 () { ...@@ -71,7 +71,7 @@ var Task = /** @class */ (function () {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo; var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo;
var taskService = _b[0]; var taskService = _b[0];
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var tasks, startTime, updatedUserInfo, vipTask, followTask; var tasks, startTime, updatedUserInfo;
return __generator(this, function (_c) { return __generator(this, function (_c) {
switch (_c.label) { switch (_c.label) {
case 0: case 0:
...@@ -88,33 +88,18 @@ var Task = /** @class */ (function () { ...@@ -88,33 +88,18 @@ var Task = /** @class */ (function () {
if (!updatedUserInfo) if (!updatedUserInfo)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, '更新任务列表失败') return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR, '更新任务列表失败')
// 返回对应的任务时, B端b_activity_config tasks 需配置对应的任务 // 返回对应的任务时, B端b_activity_config tasks 需配置对应的任务
// 会员任务
]; ];
vipTask = taskService.initVipTask(updatedUserInfo, vipInfo, tasks); // 返回对应的任务时, B端b_activity_config 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)
return [2 /*return*/, sdk_1.resultsModel.success([ return [2 /*return*/, sdk_1.resultsModel.success([
//signTask, taskService.initTask('member', '加入会员', tasks, updatedUserInfo),
vipTask, taskService.initTask('follow', '关注店铺', tasks, updatedUserInfo)
followTask // taskService.initTask('sign', '签到', tasks, updatedUserInfo),
// orderGoodsTask, // taskService.initTask('orderGoods', '购买商品', tasks, updatedUserInfo),
// browseGoodsTask, // taskService.initTask('browseGoods', '浏览商品', tasks, updatedUserInfo),
// invitesTask, // taskService.initTask('collectGoods', '收藏商品', tasks, updatedUserInfo),
// collectGoodsTask, // taskService.initTask('jumpLink', '浏览页面', tasks, updatedUserInfo),
// jumpLinkTask // taskService.initTask('invites', '邀请好友', tasks, updatedUserInfo),
// taskService.initTask('exchangeCredits', '积分兑换', tasks, updatedUserInfo)
])]; ])];
} }
}); });
...@@ -255,8 +240,7 @@ var Task = /** @class */ (function () { ...@@ -255,8 +240,7 @@ var Task = /** @class */ (function () {
if (!itemIdArray.includes(+itemId)) if (!itemIdArray.includes(+itemId))
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '商品id不匹配')]; 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; _d = taskService.getTodayCompleteTask(taskType, userInfo), todayTaskInfo = _d.todayTaskInfo, todayCompleteTimes = _d.todayCompleteTimes;
hasCompleteToday = todayTaskInfo.filter(function (v) { return v.itemId === itemId; }).length && hasCompleteToday = todayTaskInfo.filter(function (v) { return v.itemId === itemId; }).length && taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY;
taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY;
// 今日任务已经完成 // 今日任务已经完成
if (hasCompleteToday) { if (hasCompleteToday) {
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '今日该收藏商品任务已完成')]; return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '今日该收藏商品任务已完成')];
...@@ -317,18 +301,18 @@ var Task = /** @class */ (function () { ...@@ -317,18 +301,18 @@ var Task = /** @class */ (function () {
var userInfo = _a.userInfo; var userInfo = _a.userInfo;
var taskService = _b[0]; var taskService = _b[0];
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var taskType, remainTimes, _id, waitReceiveTimes, awardsTargetKey; var awardsTargetKey, taskType, remainTimes, _id, waitReceiveTimes;
var _c, _d; var _c, _d;
return __generator(this, function (_e) { return __generator(this, function (_e) {
switch (_e.label) { switch (_e.label) {
case 0: case 0:
awardsTargetKey = "gameTimes";
taskType = context.data.taskType; taskType = context.data.taskType;
remainTimes = userInfo.remainTimes, _id = userInfo._id; remainTimes = userInfo.remainTimes, _id = userInfo._id;
// 暂无领取次数 // 暂无领取次数
if (!(remainTimes === null || remainTimes === void 0 ? void 0 : remainTimes[taskType])) if (!(remainTimes === null || remainTimes === void 0 ? void 0 : remainTimes[taskType]))
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.ERROR_TASK_NORECEIVE)]; return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.ERROR_TASK_NORECEIVE)];
waitReceiveTimes = remainTimes === null || remainTimes === void 0 ? void 0 : remainTimes[taskType]; waitReceiveTimes = remainTimes === null || remainTimes === void 0 ? void 0 : remainTimes[taskType];
awardsTargetKey = "gameTimes";
return [4 /*yield*/, taskService.updateUser(_id, { return [4 /*yield*/, taskService.updateUser(_id, {
$set: (_c = {}, $set: (_c = {},
_c["remainTimes." + taskType] = 0, _c["remainTimes." + taskType] = 0,
...@@ -339,7 +323,9 @@ var Task = /** @class */ (function () { ...@@ -339,7 +323,9 @@ var Task = /** @class */ (function () {
})]; })];
case 1: case 1:
_e.sent(); _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 () { ...@@ -351,7 +337,7 @@ var Task = /** @class */ (function () {
var session = _a.session, userInfo = _a.userInfo; var session = _a.session, userInfo = _a.userInfo;
var baseService = _b[0], taskService = _b[1]; var baseService = _b[0], taskService = _b[1];
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var itemIds, list, completeList, listWithCollectStatus; var itemIds, list, taskInfo, listWithCollectStatus;
return __generator(this, function (_c) { return __generator(this, function (_c) {
switch (_c.label) { switch (_c.label) {
case 0: case 0:
...@@ -359,11 +345,11 @@ var Task = /** @class */ (function () { ...@@ -359,11 +345,11 @@ var Task = /** @class */ (function () {
return [4 /*yield*/, baseService.getItemListByIds(itemIds, session)]; return [4 /*yield*/, baseService.getItemListByIds(itemIds, session)];
case 1: case 1:
list = _c.sent(); list = _c.sent();
completeList = taskService.getCompleteTaskByUserTaskInfo('collectGoods', userInfo); taskInfo = taskService.getCompleteTaskByUserTaskInfo('collectGoods', userInfo).taskInfo;
listWithCollectStatus = list.map(function (v) { listWithCollectStatus = list.map(function (v) {
return __assign(__assign({}, v), { return __assign(__assign({}, v), {
// 完成列表是否含有itemId // 完成列表是否含有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)]; return [2 /*return*/, sdk_1.resultsModel.success(listWithCollectStatus)];
} }
......
This diff is collapsed.
...@@ -22,5 +22,5 @@ export default class User { ...@@ -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 () { ...@@ -60,12 +60,11 @@ var User = /** @class */ (function () {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo; var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo;
var userService = _b[0], accessService = _b[1]; var userService = _b[0], accessService = _b[1];
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var openId, isFollow; var openId;
return __generator(this, function (_c) { return __generator(this, function (_c) {
switch (_c.label) { switch (_c.label) {
case 0: case 0:
openId = context.openId; openId = context.openId;
isFollow = context.data.isFollow;
if (!!userInfo) return [3 /*break*/, 2]; if (!!userInfo) return [3 /*break*/, 2];
return [4 /*yield*/, userService.initUserData(vipInfo, activityInfo)]; return [4 /*yield*/, userService.initUserData(vipInfo, activityInfo)];
case 1: case 1:
...@@ -91,18 +90,17 @@ var User = /** @class */ (function () { ...@@ -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 session = _a.session, activityUserNick = _a.activityUserNick;
var userService = _b[0];
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var callbackUrl, result; var callbackUrl, result;
return __generator(this, function (_c) { return __generator(this, function (_b) {
switch (_c.label) { switch (_b.label) {
case 0: case 0:
callbackUrl = context.data.callbackUrl; 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: case 1:
result = _c.sent(); result = _b.sent();
return [2 /*return*/, sdk_1.resultsModel.success(result)]; return [2 /*return*/, sdk_1.resultsModel.success(result)];
} }
}); });
...@@ -120,9 +118,9 @@ var User = /** @class */ (function () { ...@@ -120,9 +118,9 @@ var User = /** @class */ (function () {
__decorate([ __decorate([
decorator_1.paramsCheck(['activityId']), decorator_1.paramsCheck(['activityId']),
decorator_1.registeInfos(['session']), decorator_1.registeInfos(['session']),
decorator_1.services([service_1.UserService]), decorator_1.services([]),
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", [Object, Object, Array]), __metadata("design:paramtypes", [Object, Object]),
__metadata("design:returntype", Promise) __metadata("design:returntype", Promise)
], User.prototype, "getVipInfo", null); ], User.prototype, "getVipInfo", null);
return User; 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,EAA0D;YADxD,QAAQ,cAAA,EAAE,OAAO,aAAA,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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 \ No newline at end of file
...@@ -68,9 +68,11 @@ exports.paramsCheck = function (params) { ...@@ -68,9 +68,11 @@ exports.paramsCheck = function (params) {
var dataKeys = Object.keys(context.data); var dataKeys = Object.keys(context.data);
for (var i = 0; i < params.length; i++) { for (var i = 0; i < params.length; i++) {
var param = params[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 sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, "\u7F3A\u5C11" + param + "\u53C2\u6570");
} }
}
return method.apply(target, [context, __assign({}, otherArgs)]); return method.apply(target, [context, __assign({}, otherArgs)]);
}; };
}; };
...@@ -124,7 +126,7 @@ exports.vipCheck = function (_a) { ...@@ -124,7 +126,7 @@ exports.vipCheck = function (_a) {
return [4 /*yield*/, utils_1.getSellerSession(context)]; return [4 /*yield*/, utils_1.getSellerSession(context)];
case 1: case 1:
_b = _c.sent(), session = _b.session, userNick = _b.userNick; _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: case 2:
vipInfo = _c.sent(); vipInfo = _c.sent();
if (!vipInfo.isVip && intercept) 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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B,IAAI,WAAW,GAAG,SAAS,EAAE;4BAC3B,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,sBAAsB,EAAE,gCAAO,CAAC,EAAA;yBACtE;wBACD,IAAI,WAAW,GAAG,OAAO,EAAE;4BACzB,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,mBAAmB,EAAE,gCAAO,CAAC,EAAA;yBACnE;wBACD,sBAAO,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,wBAAO,SAAS,KAAE,YAAY,cAAA,IAAG,CAAC,EAAA;;;;KACvE,CAAA;AACH,CAAC,CAAA"}
\ No newline at end of file \ No newline at end of file
...@@ -84,7 +84,7 @@ function initBaseInfo(context, baseInfos, needInfos) { ...@@ -84,7 +84,7 @@ function initBaseInfo(context, baseInfos, needInfos) {
baseInfos.session = session; baseInfos.session = session;
baseInfos.activityUserNick = userNick; baseInfos.activityUserNick = userNick;
_f.label = 6; _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: case 7:
vipInfo = _f.sent(); vipInfo = _f.sent();
baseInfos.vipInfo = vipInfo; 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,W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,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 \ No newline at end of file
/** @format */
declare type Constructor = new (...args: any[]) => {}; declare type Constructor = new (...args: any[]) => {};
export declare const services: (services: Constructor[]) => (target: Object, name: string, descriptor: PropertyDescriptor) => void; export declare const services: (services: Constructor[]) => (target: Object, name: string, descriptor: PropertyDescriptor) => void;
export {}; export {};
"use strict"; "use strict";
/** @format */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
...@@ -56,7 +57,6 @@ exports.services = function (services) { ...@@ -56,7 +57,6 @@ exports.services = function (services) {
case 0: case 0:
context = args[0], _a = args[1], otherArgs = _a === void 0 ? {} : _a; context = args[0], _a = args[1], otherArgs = _a === void 0 ? {} : _a;
servicesInstance = services.map(function (v) { return new v(context); }); servicesInstance = services.map(function (v) { return new v(context); });
// const baseInfos: IControllerInfos = await initBaseInfo(context, otherArgs)
utils_1.logFn(context); utils_1.logFn(context);
baseInfos = otherArgs; baseInfos = otherArgs;
// 默认全局try catch 如果有noCatch参数则直接执行 // 默认全局try catch 如果有noCatch参数则直接执行
......
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/decorator/services.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kCAAkE;AAClE,8BAAqC;AACrC,0CAAyC;AA0BzC,OAAO;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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 \ No newline at end of file
...@@ -3,11 +3,13 @@ declare const _default: { ...@@ -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<{ 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; 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<{ getTaskList: (context: IContext<{
activityId: string; activityId: string;
}>, { userInfo, vipInfo, activityInfo }: IControllerInfos, [taskService]: [import("./service").TaskService]) => Promise<IResult<import("./service/task.service").ITaskInfo[]>>; }>, { 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<{ getActivityBaseInfoById: (context: IContext<{
activityId: string; activityId: string;
}>, {}: {}, [baseService]: [import("./service").BaseService]) => Promise<IResult<IActivityInfo>>; }>, {}: {}, [baseService]: [import("./service").BaseService]) => Promise<IResult<IActivityInfo>>;
...@@ -16,7 +18,11 @@ declare const _default: { ...@@ -16,7 +18,11 @@ declare const _default: {
}>>; }>>;
receiveObjectPrize: (context: IContext<import("./controller/awards.controller").IReceiveOjectParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<IResult<boolean>>; receiveObjectPrize: (context: IContext<import("./controller/awards.controller").IReceiveOjectParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<IResult<boolean>>;
receiveEnamePrize: (context: IContext<import("./controller/awards.controller").IReceiveEnameParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<import("taobao-mini-sdk/lib/utils/codetypes").CodeType | IAwards, true>>; receiveEnamePrize: (context: IContext<import("./controller/awards.controller").IReceiveEnameParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | 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>>; 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; export default _default;
...@@ -14,7 +14,7 @@ doFollowTask = _b.doFollowTask, doJumpLinkTask = _b.doJumpLinkTask, doBrowseGood ...@@ -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 _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 _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 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 = { exports.default = {
login: login, login: login,
getVipInfo: getVipInfo, getVipInfo: getVipInfo,
...@@ -25,6 +25,7 @@ exports.default = { ...@@ -25,6 +25,7 @@ exports.default = {
receiveObjectPrize: receiveObjectPrize, receiveObjectPrize: receiveObjectPrize,
receiveEnamePrize: receiveEnamePrize, receiveEnamePrize: receiveEnamePrize,
doHelp: doHelp, doHelp: doHelp,
getStats: getStats getStats: getStats,
addStat: addStat
}; };
//# sourceMappingURL=index.js.map //# 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"} {"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 \ No newline at end of file
...@@ -11,6 +11,6 @@ export default class UserAccessService { ...@@ -11,6 +11,6 @@ export default class UserAccessService {
* 增加访问记录 * 增加访问记录
* @param {是否关注店铺} isFollow * @param {是否关注店铺} isFollow
*/ */
addAccess(userInfo: IUserInfo): Promise<number>; addAccess(userInfo: IUserInfo): Promise<string>;
getAccessCount(): Promise<number>; getAccessCount(): Promise<number>;
} }
...@@ -69,7 +69,7 @@ var UserAccessService = /** @class */ (function () { ...@@ -69,7 +69,7 @@ var UserAccessService = /** @class */ (function () {
isReceiveShare: !!inviteId, isReceiveShare: !!inviteId,
inviteId: inviteId, inviteId: inviteId,
isFollow: userInfo.follow.flag || userInfo.follow.newFollow, isFollow: userInfo.follow.flag || userInfo.follow.newFollow,
isVip: userInfo.member.flag || userInfo.member.newMember, isVip: !!(userInfo.member.flag || userInfo.member.newMember),
follow: userInfo.follow, follow: userInfo.follow,
member: userInfo.member, member: userInfo.member,
accessTime: Date.now(), 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;gC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E,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,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC;gCAC5D,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 \ No newline at end of file
...@@ -9,12 +9,12 @@ export default class AwardsService extends UserService { ...@@ -9,12 +9,12 @@ export default class AwardsService extends UserService {
awardsdao: IBaseDao; awardsdao: IBaseDao;
activityprizedao: IBaseDao; activityprizedao: IBaseDao;
constructor(context: IContext<IParams>); constructor(context: IContext<IParams>);
reduceStock(_id: string): Promise<any>; reduceStock(_id: string): Promise<number | CodeType>;
/** /**
* 插入奖品记录 * 插入奖品记录
* @param {*} award * @param {*} award
*/ */
addAward(award: IAwards): Promise<number | CodeType>; addAward(award: IAwards): Promise<string | CodeType>;
/** /**
* 发放奖品 * 发放奖品
* @param {*} document * @param {*} document
......
...@@ -16,5 +16,5 @@ export default class StatService { ...@@ -16,5 +16,5 @@ export default class StatService {
* @return {boolean} * @return {boolean}
* @memberof StatService * @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 { ...@@ -19,15 +19,17 @@ export interface ITaskInfo {
} }
export default class TaskService extends UserService { export default class TaskService extends UserService {
constructor(context: IContext<IParams>); constructor(context: IContext<IParams>);
initVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): ITaskInfo; /**
initOrderGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo; * 根据任务类型初始化 b端 tasks字段必须有相应的配置
initBrowseGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo; *
initCollectGoodsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo; * @param {ITaskType} taskType 任务类型
initJumpLinkTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo; * @param {string} title 任务标题
initInvitesTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo; * @param {ITasks} tasks 任务配置
initFollowTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo; * @param {IUserInfo} userInfo 用户信息
initSignTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo; * @return {ITaskInfo} {ITaskInfo} 任务信息
initExchangeCreditsTask(userInfo: IUserInfo, tasks: ITasks): ITaskInfo; * @memberof TaskService
*/
initTask(taskType: ITaskType, title: string, tasks: ITasks, userInfo: IUserInfo): ITaskInfo;
updateVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): { updateVipTask(userInfo: IUserInfo, vipInfo: IVipInfo, tasks: ITasks): {
$set: {}; $set: {};
$inc: {}; $inc: {};
...@@ -55,7 +57,7 @@ export default class TaskService extends UserService { ...@@ -55,7 +57,7 @@ export default class TaskService extends UserService {
* @returns * @returns
* @memberof TaskService * @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 { ...@@ -78,8 +80,8 @@ export default class TaskService extends UserService {
* @memberof TaskService * @memberof TaskService
*/ */
getTodayCompleteTask(taskType: string, userInfo: IUserInfo): { getTodayCompleteTask(taskType: string, userInfo: IUserInfo): {
todayCompleteTimes: any; todayCompleteTimes: number;
todayTaskInfo: any; todayTaskInfo: ITaskDetail[];
}; };
/** /**
* 根据任务类型获取任务完成情况 * 根据任务类型获取任务完成情况
...@@ -89,7 +91,10 @@ export default class TaskService extends UserService { ...@@ -89,7 +91,10 @@ export default class TaskService extends UserService {
* @returns {array} * @returns {array}
* @memberof TaskService * @memberof TaskService
*/ */
getCompleteTaskByUserTaskInfo(taskType: string, userInfo: IUserInfo): any[]; getCompleteTaskByUserTaskInfo(taskType: string, userInfo: IUserInfo): {
completeTimes: number;
taskInfo: ITaskDetail[];
};
/** /**
*根据任务类型更新任务待领取次数和任务记录 *根据任务类型更新任务待领取次数和任务记录
* *
......
This diff is collapsed.
This diff is collapsed.
...@@ -19,12 +19,6 @@ declare class UserService extends BaseService { ...@@ -19,12 +19,6 @@ declare class UserService extends BaseService {
* @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象) * @returns 若用户不存在,返回null; 用户存在,返回用户信息(object对象)
*/ */
getUserInfoByOpenId(openId: string): Promise<IUserInfo>; 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 { ...@@ -41,7 +35,7 @@ declare class UserService extends BaseService {
* @param {更新的对象} document * @param {更新的对象} document
* @returns 若更新成功,返回为1; 若更新失败,返回为 0 或系统直接报错 * @returns 若更新成功,返回为1; 若更新失败,返回为 0 或系统直接报错
*/ */
updateUser(_id: string, projection: IUpdateQuery): Promise<any>; updateUser(_id: string, projection: IUpdateQuery): Promise<number>;
/** /**
* @desc 排行榜 * @desc 排行榜
* @param {查询条件} match * @param {查询条件} match
...@@ -55,6 +49,10 @@ declare class UserService extends BaseService { ...@@ -55,6 +49,10 @@ declare class UserService extends BaseService {
* @param {排序规则} sort * @param {排序规则} sort
*/ */
getMyRank(match: Object, sort: Object): Promise<any>; getMyRank(match: Object, sort: Object): Promise<any>;
/**
* 获取用户排名
*/
getUserRank(hotValue: number): Promise<string | number>;
/** /**
* updateUser projection 格式化 * updateUser projection 格式化
* *
......
...@@ -69,8 +69,6 @@ var sdk_1 = require("../sdk"); ...@@ -69,8 +69,6 @@ var sdk_1 = require("../sdk");
var base_service_1 = require("./base.service"); var base_service_1 = require("./base.service");
var db_1 = require("../db"); var db_1 = require("../db");
var utils_1 = require("../utils"); var utils_1 = require("../utils");
var vipMock_1 = require("../vipMock");
var constants_1 = require("../constants");
var UserService = /** @class */ (function (_super) { var UserService = /** @class */ (function (_super) {
__extends(UserService, _super); __extends(UserService, _super);
function UserService(context) { function UserService(context) {
...@@ -119,40 +117,6 @@ var UserService = /** @class */ (function (_super) { ...@@ -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) { ...@@ -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 格式化 * updateUser projection 格式化
* *
......
This diff is collapsed.
...@@ -8,3 +8,4 @@ export * from './package/rand'; ...@@ -8,3 +8,4 @@ export * from './package/rand';
export * from './package/getUserOrderlist'; export * from './package/getUserOrderlist';
export * from './package/vip'; export * from './package/vip';
export * from './package/exportHandlers'; export * from './package/exportHandlers';
export * from './package/helper';
...@@ -24,4 +24,5 @@ __exportStar(require("./package/rand"), exports); ...@@ -24,4 +24,5 @@ __exportStar(require("./package/rand"), exports);
__exportStar(require("./package/getUserOrderlist"), exports); __exportStar(require("./package/getUserOrderlist"), exports);
__exportStar(require("./package/vip"), exports); __exportStar(require("./package/vip"), exports);
__exportStar(require("./package/exportHandlers"), exports); __exportStar(require("./package/exportHandlers"), exports);
__exportStar(require("./package/helper"), exports);
//# sourceMappingURL=index.js.map //# 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"} {"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 \ No newline at end of file
/** /** @format */
* param 将要转为URL参数字符串的对象 export declare function sleep(time: number): Promise<unknown>;
* key URL参数字符串的前缀
* encode true/false 是否进行URL编码,默认为true
*
* return URL参数字符串
*
* @format
*/
export declare const urlEncode: (param: IParams | string | number | boolean, key: string, encode?: boolean) => string;
"use strict"; "use strict";
/** /** @format */
* param 将要转为URL参数字符串的对象
* key URL参数字符串的前缀
* encode true/false 是否进行URL编码,默认为true
*
* return URL参数字符串
*
* @format
*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.urlEncode = void 0; exports.sleep = void 0;
exports.urlEncode = function (param, key, encode) { function sleep(time) {
if (encode === void 0) { encode = true; } return new Promise(function (resolve) { return setTimeout(resolve, time); });
if (param == null) }
return ''; exports.sleep = sleep;
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;
};
//# sourceMappingURL=helper.js.map //# 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"} {"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 \ No newline at end of file
export declare const logFn: (context: IContext<IParams>) => void; 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; export declare const logger: (message: any) => void;
/** @format */ /** @format */
/** @format */ /** @format */
export declare const isUseVipMock: (context: IContext<IParams>, userNick: string) => boolean; 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; export declare const formatVipCbUrl: (context: IContext<IParams>) => string;
"use strict"; "use strict";
/** @format */ /** @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 }); 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 index_1 = require("../../config/index");
var constants_1 = require("../../constants");
var vipMock_1 = require("../../vipMock");
var sdk_1 = require("../../sdk");
/** @format */ /** @format */
// 测试环境 duib2账户mock数据 或者本地 // 测试环境 duib2账户mock数据 或者本地
exports.isUseVipMock = function (context, userNick) { exports.isUseVipMock = function (context, userNick) {
...@@ -11,6 +50,43 @@ exports.isUseVipMock = function (context, userNick) { ...@@ -11,6 +50,43 @@ exports.isUseVipMock = function (context, userNick) {
var isDuibaAccount = userNick.startsWith('duiba2'); var isDuibaAccount = userNick.startsWith('duiba2');
return (isTestEnv && isDuibaAccount) || isMockEnv; 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回调地址 // 格式化Vip回调地址
exports.formatVipCbUrl = function (context) { exports.formatVipCbUrl = function (context) {
var _a, _b, _c; 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,GAAG,KAAK,MAAM,CAAA;IACxC,IAAM,SAAS,GAAG,OAAO,CAAC,GAAG,KAAK,MAAM,CAAA;IACxC,IAAM,cAAc,GAAG,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;IAEpD,OAAO,CAAC,SAAS,IAAI,cAAc,CAAC,IAAI,SAAS,CAAA;AACnD,CAAC,CAAA;AAED,aAAa;AACA,QAAA,cAAc,GAAG,UAAC,OAA0B;;IACjD,IAAA,KAAgC,OAAO,CAAC,IAAI,EAA1C,UAAU,gBAAA,EAAE,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAiB,CAAA;IAE5C,IAAA,cAAc,GAAK,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,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4BACrD,GAAG,EAAE,OAAO;yBACb,EAAA;;;;CACF,CAAA;AAED,SAAS;AACI,QAAA,cAAc,GAAG,UAAC,WAAmB;IAChD,OAAO,wGAAsG,oBAAQ,mBAAc,kBAAkB,CACnJ,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CACxD,qBAAgB,kBAAkB,CAAC,WAAW,CAAG,CAAA;AACpD,CAAC,CAAA;AAED,aAAa;AACA,QAAA,cAAc,GAAG,UAAC,OAA0B;;IACjD,IAAA,KAAgC,OAAO,CAAC,IAAI,EAA1C,UAAU,gBAAA,EAAE,gBAAa,EAAb,QAAQ,mBAAG,EAAE,KAAiB,CAAA;IAE5C,IAAA,cAAc,GAAK,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 \ No newline at end of file
...@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); ...@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.VIP_MOCK = void 0; exports.VIP_MOCK = void 0;
// 测试环境下 duiba2及其子账号自动开启VIP_MOCK, 返回数据可在此设置 // 测试环境下 duiba2及其子账号自动开启VIP_MOCK, 返回数据可在此设置
exports.VIP_MOCK = { exports.VIP_MOCK = {
isVip: false, isVip: true,
url: '//taobao.com' url: '//taobao.com'
}; };
//# sourceMappingURL=vipMock.js.map //# 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"} {"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 \ No newline at end of file
/** @format */ /** @format */
import { DEFAULT_CODE_TYPES } from './sdk' export * from './errorCode'
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)
// tb 接口返回部分错误 // tb 接口返回部分错误
export const TBERROR = { export const TBERROR = {
...@@ -123,14 +29,6 @@ export const DRAW_STATUS = { ...@@ -123,14 +29,6 @@ export const DRAW_STATUS = {
RETRY: 6 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[] = [ export const TAOBAO_SUCCESS_ORDER_STATUS: string[] = [
'WAIT_SELLER_SEND_GOODS', 'WAIT_SELLER_SEND_GOODS',
...@@ -199,3 +97,11 @@ export enum STAT_TYPE { ...@@ -199,3 +97,11 @@ export enum STAT_TYPE {
CLICK_INVITE = 1, CLICK_INVITE = 1,
CLICK_FOLLOW_TASK 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 @@ ...@@ -3,7 +3,7 @@
import { services, paramsCheck, userCheck, activityTimeCheck } from '../decorator' import { services, paramsCheck, userCheck, activityTimeCheck } from '../decorator'
import { resultsModel } from '../sdk' import { resultsModel } from '../sdk'
import { AwardsService } from '../service' 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 { getToday, logger } from '../utils'
import { CodeType } from 'taobao-mini-sdk/lib/utils/codetypes' import { CodeType } from 'taobao-mini-sdk/lib/utils/codetypes'
...@@ -130,7 +130,7 @@ export default class AwardsController { ...@@ -130,7 +130,7 @@ export default class AwardsController {
prize = thanksPrize prize = thanksPrize
} }
let reduceResult: ICodeType | 1 = 1 let reduceResult: ICodeType | number = 1
// 不是积分奖品, 检查是否扣库存 // 不是积分奖品, 检查是否扣库存
if (prize.type !== PRIZE_TYPE.CREDITS && prize.type !== PRIZE_TYPE.THANKS) { if (prize.type !== PRIZE_TYPE.CREDITS && prize.type !== PRIZE_TYPE.THANKS) {
......
...@@ -10,6 +10,30 @@ import { UserService, AccessService, TaskService } from '../service' ...@@ -10,6 +10,30 @@ import { UserService, AccessService, TaskService } from '../service'
import { registeInfos } from '../decorator/registeInfos' import { registeInfos } from '../decorator/registeInfos'
export default class Share { 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 { ...@@ -18,9 +42,12 @@ export default class Share {
@registeInfos(['userInfo', 'vipInfo', 'activityInfo']) @registeInfos(['userInfo', 'vipInfo', 'activityInfo'])
@services([UserService, TaskService, AccessService]) @services([UserService, TaskService, AccessService])
async doHelp( async doHelp(
context: IContext<IParams>, context: IContext<{
activityId: string
inviteId: string
}>,
{ userInfo, vipInfo, activityInfo }: IControllerInfos, { userInfo, vipInfo, activityInfo }: IControllerInfos,
[userService, taskService, accessService]: [UserService, TaskService, AccessService] [userService, taskService]: [UserService, TaskService]
): Promise<IResult<boolean>> { ): Promise<IResult<boolean>> {
const { inviteId } = context.data const { inviteId } = context.data
const { openId } = context const { openId } = context
...@@ -31,21 +58,19 @@ export default class Share { ...@@ -31,21 +58,19 @@ export default class Share {
// inviteId的用户信息查询不到, 则inviteId无效 // inviteId的用户信息查询不到, 则inviteId无效
if (!inviteUserInfo) return resultsModel.error(CODE_TYPES.ERROR_INVALID_INVITE_ID) 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) return resultsModel.error(CODE_TYPES.ERROR_AREADY_INVITE_SUCCESS)
} }
// const isFirstLogin: boolean = (await accessService.getAccessCount()) === 1
// 获取活动基本信息 // 获取活动基本信息
const { tasks } = activityInfo const { tasks } = activityInfo
// 获取分享奖励 // 获取分享奖励
const { const {
invites: { value } invites: { value }
}: ITasks = tasks || {} }: ITasks = tasks
// 新会员 // 新会员
const isNewVip = userService.checkNewVip(userInfo, vipInfo) const isNewVip = userService.checkNewVip(userInfo, vipInfo)
......
...@@ -51,29 +51,56 @@ export default class StatController { ...@@ -51,29 +51,56 @@ export default class StatController {
const UV = ( const UV = (
await accessDao.aggregate([ await accessDao.aggregate([
{ $match: { activityId, createDay: day } }, { $match: { activityId, createDay: day } },
{ $group: { _id: '$openId', count: { $sum: 1 } } } { $group: { _id: '$openId', count: { $sum: 1 } } },
{ $count: 'uv' }
]) ])
).length )?.[0]?.uv
// 新增UV // 新增UV
const newUV = await userDao.count({ const newUV = await userDao.count({
activityId, activityId,
createDay: day createDay: day
}) })
// 已入会PV // 已入会(老会员)PV
const vipPV = await accessDao.count({ activityId, createDay: day, isVip: true }) 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 // 未入会PV
const noVipPV = await accessDao.count({ activityId, createDay: day, isVip: false }) 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 // 未入会UV
const noVipUV = ( const noVipUV = (
await accessDao.aggregate([ await accessDao.aggregate([
...@@ -95,21 +122,16 @@ export default class StatController { ...@@ -95,21 +122,16 @@ export default class StatController {
'follow.followDay': day 'follow.followDay': day
}) })
// 签到任务 // 根据任务类型获取完成任务的人数
// const signTaskUV = await userDao.count({ // example: await getTaskCompleteUV('collectGoods', day)
// activityId, const getTaskCompleteUV = async (task: string, day: string) => {
// [`taskInfo.${day}.sign`]: { return await userDao.count({
// $exists: true activityId,
// } [`taskInfo.${day}.${task}`]: {
// }) $exists: true
}
// 收藏商品 })
// const collectGoodsTaskUV = await userDao.count({ }
// activityId,
// [`taskInfo.${day}.collecctGoods`]: {
// $exists: true
// }
// })
const keyValueMapper = { const keyValueMapper = {
时间: day, 时间: day,
...@@ -122,9 +144,9 @@ export default class StatController { ...@@ -122,9 +144,9 @@ export default class StatController {
未入会UV: noVipUV, 未入会UV: noVipUV,
新入会UV: newVipUV, 新入会UV: newVipUV,
新增关注UV: newFollowUV 新增关注UV: newFollowUV
// 收藏商品UV: collectGoodsTaskUV //收藏商品UV: await getTaskCompleteUV('collectGoods', day)
// 签到任务UV: signTaskUV
} }
console.log(keyValueMapper, 'xlsxData')
if (day === startDay) { if (day === startDay) {
xlsxData.push(Object.keys(keyValueMapper)) xlsxData.push(Object.keys(keyValueMapper))
...@@ -142,13 +164,10 @@ export default class StatController { ...@@ -142,13 +164,10 @@ export default class StatController {
} }
]) ])
// let result = {}
console.log(xlsxData, 'xlsxData')
let result = await context.cloud.file.uploadFile({ let result = await context.cloud.file.uploadFile({
fileContent: buffer, fileContent: buffer,
fileName: `数据统计${startDay.replace(/\//g, '-')}-${endDay.replace(/\//g, '-')}.xlsx` fileName: `数据统计${startDay.replace(/\//g, '-')}-${endDay.replace(/\//g, '-')}.xlsx`
}) })
console.log(xlsxData, 'xlsxData')
if (result.url) { if (result.url) {
result.url = result.url.replace('http', 'https').replace('-internal', '') result.url = result.url.replace('http', 'https').replace('-internal', '')
} }
......
...@@ -40,35 +40,16 @@ export default class Task { ...@@ -40,35 +40,16 @@ export default class Task {
// 返回对应的任务时, B端b_activity_config tasks 需配置对应的任务 // 返回对应的任务时, 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([ return resultsModel.success([
//signTask, taskService.initTask('member', '加入会员', tasks, updatedUserInfo),
vipTask, taskService.initTask('follow', '关注店铺', tasks, updatedUserInfo)
followTask // taskService.initTask('sign', '签到', tasks, updatedUserInfo),
// orderGoodsTask, // taskService.initTask('orderGoods', '购买商品', tasks, updatedUserInfo),
// browseGoodsTask, // taskService.initTask('browseGoods', '浏览商品', tasks, updatedUserInfo),
// invitesTask, // taskService.initTask('collectGoods', '收藏商品', tasks, updatedUserInfo),
// collectGoodsTask, // taskService.initTask('jumpLink', '浏览页面', tasks, updatedUserInfo),
// jumpLinkTask // taskService.initTask('invites', '邀请好友', tasks, updatedUserInfo),
// taskService.initTask('exchangeCredits', '积分兑换', tasks, updatedUserInfo)
]) ])
} }
...@@ -176,8 +157,7 @@ export default class Task { ...@@ -176,8 +157,7 @@ export default class Task {
const { todayTaskInfo, todayCompleteTimes } = taskService.getTodayCompleteTask('browseGoods', userInfo) const { todayTaskInfo, todayCompleteTimes } = taskService.getTodayCompleteTask('browseGoods', userInfo)
const hasCompleteToday = const hasCompleteToday = todayTaskInfo.some(v => v.itemId === itemId) && taskRateType === TASK_RATE_TYPE.EVERYDAY
todayTaskInfo.some((v: { itemId: string }) => v.itemId === itemId) && taskRateType === TASK_RATE_TYPE.EVERYDAY
// 今日任务已经完成 // 今日任务已经完成
if (hasCompleteToday) { if (hasCompleteToday) {
...@@ -225,8 +205,7 @@ export default class Task { ...@@ -225,8 +205,7 @@ export default class Task {
const { todayTaskInfo, todayCompleteTimes } = taskService.getTodayCompleteTask(taskType, userInfo) const { todayTaskInfo, todayCompleteTimes } = taskService.getTodayCompleteTask(taskType, userInfo)
const hasCompleteToday = const hasCompleteToday =
todayTaskInfo.filter((v: { itemId: string }) => v.itemId === itemId).length && todayTaskInfo.filter(v => v.itemId === itemId).length && taskRateType === TASK_RATE_TYPE.EVERYDAY
taskRateType === TASK_RATE_TYPE.EVERYDAY
// 今日任务已经完成 // 今日任务已经完成
if (hasCompleteToday) { if (hasCompleteToday) {
...@@ -297,7 +276,10 @@ export default class Task { ...@@ -297,7 +276,10 @@ export default class Task {
context: IContext<IParams>, context: IContext<IParams>,
{ userInfo }: IControllerInfos, { userInfo }: IControllerInfos,
[taskService]: [TaskService] [taskService]: [TaskService]
): Promise<IResult<boolean>> { ): Promise<IResult<{ rewards: number }>> {
// 根据需求自定义领取任务增加的key值 如: gameTimes
const awardsTargetKey = `gameTimes`
const { taskType } = context.data const { taskType } = context.data
const { remainTimes, _id } = userInfo const { remainTimes, _id } = userInfo
...@@ -307,9 +289,6 @@ export default class Task { ...@@ -307,9 +289,6 @@ export default class Task {
const waitReceiveTimes = remainTimes?.[taskType] const waitReceiveTimes = remainTimes?.[taskType]
// 根据需求自定义领取任务增加的key值 如: gameTimes
const awardsTargetKey = `gameTimes`
await taskService.updateUser(_id, { await taskService.updateUser(_id, {
$set: { $set: {
[`remainTimes.${taskType}`]: 0 [`remainTimes.${taskType}`]: 0
...@@ -319,7 +298,9 @@ export default class Task { ...@@ -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 { ...@@ -336,13 +317,13 @@ export default class Task {
const { itemIds } = context.data const { itemIds } = context.data
const list = await baseService.getItemListByIds(itemIds, session) const list = await baseService.getItemListByIds(itemIds, session)
const completeList = taskService.getCompleteTaskByUserTaskInfo('collectGoods', userInfo) const { taskInfo } = taskService.getCompleteTaskByUserTaskInfo('collectGoods', userInfo)
const listWithCollectStatus = list.map(v => { const listWithCollectStatus = list.map(v => {
return { return {
...v, ...v,
// 完成列表是否含有itemId // 完成列表是否含有itemId
collected: completeList.some(completeItem => completeItem.itemId === v.itemId) collected: taskInfo.some(completeItem => completeItem.itemId === v.itemId)
} }
}) })
......
/** @format */ /** @format */
import { services, paramsCheck, activityTimeCheck, registeInfos } from '../decorator' import { services, paramsCheck, activityTimeCheck, registeInfos } from '../decorator'
import { resultsModel } from '../sdk' import { resultsModel } from '../sdk'
import { UserService, AccessService } from '../service' import { UserService, AccessService } from '../service'
import { getConfig } from '../config' import { formatVipCbUrl, getShopVip } from '../utils/package/vip'
import { formatVipCbUrl } from '../utils/package/vip'
import { logger } from '../utils/package/logger'
export interface IVipParams { export interface IVipParams {
activityId: string activityId: string
callbackUrl?: string callbackUrl?: string
...@@ -34,8 +32,6 @@ export default class User { ...@@ -34,8 +32,6 @@ export default class User {
): Promise<IResult<{ openId: string }>> { ): Promise<IResult<{ openId: string }>> {
const { openId } = context const { openId } = context
const { isFollow } = context.data
if (!userInfo) { if (!userInfo) {
userInfo = await userService.initUserData(vipInfo, activityInfo) userInfo = await userService.initUserData(vipInfo, activityInfo)
} else { } else {
...@@ -54,15 +50,14 @@ export default class User { ...@@ -54,15 +50,14 @@ export default class User {
*/ */
@paramsCheck(['activityId']) @paramsCheck(['activityId'])
@registeInfos(['session']) @registeInfos(['session'])
@services([UserService]) @services([])
async getVipInfo( async getVipInfo(
context: IContext<IVipParams>, context: IContext<IVipParams>,
{ session, activityUserNick }: IControllerInfos, { session, activityUserNick }: IControllerInfos
[userService]: [UserService]
): Promise<IResult<IVipInfo>> { ): Promise<IResult<IVipInfo>> {
const { callbackUrl } = context.data 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) return resultsModel.success(result)
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
import { resultsModel } from '../sdk' import { resultsModel } from '../sdk'
import { CODE_TYPES } from '../constants' import { CODE_TYPES } from '../constants'
import { UserService, BaseService } from '../service' import { UserService, BaseService } from '../service'
import { getSellerSession } from '../utils' import { getSellerSession, logFn } from '../utils'
import { getConfig } from '../config' import { getConfig } from '../config'
import { formatVipCbUrl } from '../utils/package/vip' import { formatVipCbUrl, getShopVip } from '../utils/package/vip'
// 检验参数是否存在 // 检验参数是否存在
export const paramsCheck = (params: string[]) => { export const paramsCheck = (params: string[]) => {
return function (target: Object, name: string, descriptor: PropertyDescriptor) { return function (target: Object, name: string, descriptor: PropertyDescriptor) {
...@@ -15,9 +15,11 @@ export const paramsCheck = (params: string[]) => { ...@@ -15,9 +15,11 @@ export const paramsCheck = (params: string[]) => {
const dataKeys = Object.keys(context.data) const dataKeys = Object.keys(context.data)
for (let i = 0; i < params.length; i++) { for (let i = 0; i < params.length; i++) {
const param = params[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 resultsModel.error(CODE_TYPES.PARAMS_ERROR, `缺少${param}参数`)
} }
}
return method.apply(target, [context, { ...otherArgs }]) return method.apply(target, [context, { ...otherArgs }])
} }
} }
...@@ -51,7 +53,7 @@ export const vipCheck = ({ intercept = true }) => { ...@@ -51,7 +53,7 @@ export const vipCheck = ({ intercept = true }) => {
const userService = new UserService(context) const userService = new UserService(context)
const { session, userNick } = await getSellerSession(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) if (!vipInfo.isVip && intercept) return resultsModel.error(CODE_TYPES.ERROR_NO_VIP, '非店铺会员', vipInfo)
return method.apply(target, [context, { ...otherArgs, vipInfo, session }]) return method.apply(target, [context, { ...otherArgs, vipInfo, session }])
......
/** @format */ /** @format */
import { UserService } from '../service' import { UserService } from '../service'
import { getSellerSession, logFn, recordErrorLog } from '../utils' import { getSellerSession } from '../utils'
import { resultsModel } from '../sdk' import { formatVipCbUrl, getShopVip } from '../utils/package/vip'
import { CODE_TYPES } from '../constants'
import { formatVipCbUrl } from '../utils/package/vip'
export type IInfo = 'userInfo' | 'session' | 'activityInfo' | 'vipInfo' export type IInfo = 'userInfo' | 'session' | 'activityInfo' | 'vipInfo'
...@@ -28,7 +26,7 @@ async function initBaseInfo(context: IContext<IParams>, baseInfos: IControllerIn ...@@ -28,7 +26,7 @@ async function initBaseInfo(context: IContext<IParams>, baseInfos: IControllerIn
baseInfos.session = session baseInfos.session = session
baseInfos.activityUserNick = userNick 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 baseInfos.vipInfo = vipInfo
} }
return baseInfos return baseInfos
......
/** @format */ /** @format */
import { UserService } from '../service'
import { getSellerSession, logFn, recordErrorLog } from '../utils' import { logFn, recordErrorLog } from '../utils'
import { resultsModel } from '../sdk' import { resultsModel } from '../sdk'
import { CODE_TYPES } from '../constants' 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[]) => {} type Constructor = new (...args: any[]) => {}
...@@ -37,8 +15,6 @@ export const services = (services: Constructor[]) => { ...@@ -37,8 +15,6 @@ export const services = (services: Constructor[]) => {
let [context, otherArgs = {}] = args let [context, otherArgs = {}] = args
const servicesInstance = services.map(v => new v(context)) const servicesInstance = services.map(v => new v(context))
// const baseInfos: IControllerInfos = await initBaseInfo(context, otherArgs)
logFn(context) logFn(context)
const baseInfos = otherArgs 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 ...@@ -26,7 +26,7 @@ const { getMyPrizeList, receiveObjectPrize, receiveEnamePrize, drawLotteryPrize
const { doHelp } = new ShareController() const { doHelp } = new ShareController()
const { getStats } = new StatController() const { getStats, addStat } = new StatController()
export default { export default {
login, login,
...@@ -38,5 +38,6 @@ export default { ...@@ -38,5 +38,6 @@ export default {
receiveObjectPrize, receiveObjectPrize,
receiveEnamePrize, receiveEnamePrize,
doHelp, doHelp,
getStats getStats,
addStat
} }
...@@ -31,7 +31,7 @@ export default class UserAccessService { ...@@ -31,7 +31,7 @@ export default class UserAccessService {
isReceiveShare: !!inviteId, isReceiveShare: !!inviteId,
inviteId, inviteId,
isFollow: userInfo.follow.flag || userInfo.follow.newFollow, isFollow: userInfo.follow.flag || userInfo.follow.newFollow,
isVip: userInfo.member.flag || userInfo.member.newMember, isVip: !!(userInfo.member.flag || userInfo.member.newMember),
follow: userInfo.follow, follow: userInfo.follow,
member: userInfo.member, member: userInfo.member,
accessTime: Date.now(), accessTime: Date.now(),
......
...@@ -26,7 +26,7 @@ export default class StatService { ...@@ -26,7 +26,7 @@ export default class StatService {
* @return {boolean} * @return {boolean}
* @memberof StatService * @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 { openId } = this.context
const { activityId } = this.context.data const { activityId } = this.context.data
const { userNick } = userInfo const { userNick } = userInfo
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
import { BaseDao, TBAPIS } from '../sdk' import { BaseDao, TBAPIS } from '../sdk'
import BaseService from './base.service' import BaseService from './base.service'
import { USER_DB_NAME } from '../db' 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 { VIP_MOCK } from '../vipMock'
import { sellerId } from '../constants' import { sellerId } from '../constants'
class UserService extends BaseService { class UserService extends BaseService {
...@@ -39,32 +39,6 @@ class UserService extends BaseService { ...@@ -39,32 +39,6 @@ class UserService extends BaseService {
return record 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 { ...@@ -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 格式化 * updateUser projection 格式化
* *
......
...@@ -15,18 +15,30 @@ interface IActivityInfo { ...@@ -15,18 +15,30 @@ interface IActivityInfo {
awardReceiveExpiredTime?: number awardReceiveExpiredTime?: number
tasks?: ITasks tasks?: ITasks
} }
type ITaskType =
| 'follow'
| 'member'
| 'sign'
| 'exchangeCredits'
| 'browseGoods'
| 'orderGoods'
| 'collectGoods'
| 'jumpLink'
| 'invites'
interface ITasks { type ITasks = { [key in ITaskType]: ITaskConfig }
follow?: ITaskConfig // interface ITasks {
member?: ITaskConfig // // follow?: ITaskConfig
sign?: ITaskConfig // // member?: ITaskConfig
exchangeCredits?: ITaskConfig // // sign?: ITaskConfig
browseGoods?: ITaskConfig // // exchangeCredits?: ITaskConfig
orderGoods?: ITaskConfig // // browseGoods?: ITaskConfig
collectGoods?: ITaskConfig // // orderGoods?: ITaskConfig
jumpLink?: ITaskConfig // // collectGoods?: ITaskConfig
invites?: ITaskConfig // // jumpLink?: ITaskConfig
} // // invites?: ITaskConfig
// [key in ITaskType]: ITaskConfig
// }
interface ITaskConfig { interface ITaskConfig {
title?: string // 任务标题 title?: string // 任务标题
......
...@@ -20,18 +20,18 @@ interface IBaseDao { ...@@ -20,18 +20,18 @@ interface IBaseDao {
* 插入单条数据 * 插入单条数据
* @param document * @param document
*/ */
insertOne<T>(document: any): Promise<number> insertOne<T>(document: any): Promise<string>
/** /**
* 插入多条数据 * 插入多条数据
* @param documents 插入对象 * @param documents 插入对象
*/ */
insertMany(documents: object[]): Promise<number[]> insertMany(documents: object[]): Promise<string[]>
/** /**
* 更新数据 * 更新数据
* @param query * @param query
* @param options * @param options
*/ */
update(query: object, options?: IUpdateQuery): Promise<any> update(query: object, options?: IUpdateQuery): Promise<number>
/** /**
* 删除多条数据 * 删除多条数据
* @param filter * @param filter
......
...@@ -44,3 +44,11 @@ interface IFollowInfo { ...@@ -44,3 +44,11 @@ interface IFollowInfo {
followTime?: number followTime?: number
followDay?: string followDay?: string
} }
interface ITaskDetail {
createTime: number
openId?: string
orderId?: string
itemId?: string
payTime?: string
}
...@@ -21,3 +21,5 @@ export * from './package/getUserOrderlist' ...@@ -21,3 +21,5 @@ export * from './package/getUserOrderlist'
export * from './package/vip' export * from './package/vip'
export * from './package/exportHandlers' export * from './package/exportHandlers'
export * from './package/helper'
/** @format */
export function sleep(time: number) {
return new Promise(resolve => setTimeout(resolve, time))
}
/** @format */ /** @format */
import { getConfig } from '../../config/index' import { getConfig } from '../../config/index'
import { sellerId } from '../../constants'
import { VIP_MOCK } from '../../vipMock'
import { TBAPIS } from '../../sdk'
/** @format */ /** @format */
// 测试环境 duib2账户mock数据 或者本地 // 测试环境 duib2账户mock数据 或者本地
...@@ -12,6 +17,42 @@ export const isUseVipMock = (context: IContext<IParams>, userNick: string) => { ...@@ -12,6 +17,42 @@ export const isUseVipMock = (context: IContext<IParams>, userNick: string) => {
return (isTestEnv && isDuibaAccount) || isMockEnv 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回调地址 // 格式化Vip回调地址
export const formatVipCbUrl = (context: IContext<IParams>) => { export const formatVipCbUrl = (context: IContext<IParams>) => {
const { activityId, inviteId = '' } = context.data const { activityId, inviteId = '' } = context.data
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
// 测试环境下 duiba2及其子账号自动开启VIP_MOCK, 返回数据可在此设置 // 测试环境下 duiba2及其子账号自动开启VIP_MOCK, 返回数据可在此设置
export const VIP_MOCK = { export const VIP_MOCK = {
isVip: false, isVip: true,
url: '//taobao.com' 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