Commit cc986442 authored by qinhaitao's avatar qinhaitao

docs: ️ 增加注释

parent 3d922eb8
{
"component": true,
"usingComponents": {
"tb-label": "/components/form/tb-label/tb-label",
"tb-input": "/components/form/tb-input/tb-input",
"tb-config-input": "/components/form/tb-config-input/tb-config-input",
"tb-range-picker": "/components/form/tb-range-picker/tb-range-picker",
"question-tips": "/components/basic/question-tips/question-tips",
"tb-rule": "/components/form/tb-rule/tb-rule",
"probability-prize-table": "/components/prize/probability-prize-table/probability-prize-table",
"list-table": "/components/list/list-table/list-table",
"rank-config": "/components/rank/rank-config/rank-config",
"rank-table": "/components/rank/rank-table/rank-table",
"task-config": "/components/task/task-config/task-config",
"tb-image-upload": "/components/form/tb-image-upload/tb-image-upload",
"items-config": "/components/task/items-config/items-config"
}
}
\ No newline at end of file
......@@ -32,7 +32,7 @@ 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<IAwards | CodeType, true>>;
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>>;
/**
* 概率抽奖
*/
......
......@@ -177,7 +177,7 @@ var Task = /** @class */ (function () {
return [4 /*yield*/, sdk_1.TBAPIS.changeCredits(context, session, {
quantity: +credits,
change_type: 2,
opt_type: '1',
opt_type: 1,
remark: "\u79EF\u5206\u5151\u6362\u4EFB\u52A1\u51CF\u79EF\u5206"
})];
case 2:
......@@ -215,8 +215,7 @@ var Task = /** @class */ (function () {
if (!itemIdArray.includes(+itemId))
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '商品id不匹配')];
_d = taskService.getTodayCompleteTask('browseGoods', userInfo), todayTaskInfo = _d.todayTaskInfo, todayCompleteTimes = _d.todayCompleteTimes;
hasCompleteToday = todayTaskInfo.filter(function (v) { return v.itemId === itemId; }).length &&
taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY;
hasCompleteToday = todayTaskInfo.some(function (v) { return v.itemId === itemId; }) && taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY;
// 今日任务已经完成
if (hasCompleteToday) {
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.PARAMS_ERROR, '今日该浏览商品任务已完成')];
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ declare const _default: {
list: IAwards[];
}>>;
receiveObjectPrize: (context: IContext<import("./controller/awards.controller").IReceiveOjectParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<IResult<boolean>>;
receiveEnamePrize: (context: IContext<import("./controller/awards.controller").IReceiveEnameParams>, {}: {}, [awardSer]: [import("./service").AwardsService]) => Promise<import("taobao-mini-sdk/lib/utils/resultmodel").Result<string | boolean | object | string[] | object[] | number[], false> | import("taobao-mini-sdk/lib/utils/resultmodel").Result<IAwards | import("taobao-mini-sdk/lib/utils/codetypes").CodeType, 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>>;
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>>;
};
......
/** @format */
export declare const getToday: () => string;
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getToday = void 0;
var sdk_1 = require("../../sdk");
// 获取今天的时间
exports.getToday = function () {
console.log(sdk_1.transformBeijingDate(Date.now()));
return sdk_1.dateFormatter(sdk_1.transformBeijingDate(Date.now()), 'yyyy/MM/dd');
};
var getDayStartAndEnd = function (day) {
var startDate = new Date(day + " 00:00:00").getTime();
var endDate = new Date(day + " 23:59:59").getTime();
};
var getdaystarttime = function (day) {
var date = new Date(day + " 00:00:00").getTime();
var start = date - 8 * 60 * 60 * 1000;
console.log("getdaystarttime: ", start);
return start;
};
var getdayendtime = function (day) {
var date = new Date(day + " 23:59:59").getTime();
var end = date - 8 * 60 * 60 * 1000;
console.log("getdayendtime: ", end);
return end;
};
//# sourceMappingURL=time.js.map
\ No newline at end of file
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/utils/package/time.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,iCAA+D;AAE/D,UAAU;AACG,QAAA,QAAQ,GAAG;IACtB,OAAO,CAAC,GAAG,CAAC,0BAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAC7C,OAAO,mBAAa,CAAC,0BAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,CAAA;AACtE,CAAC,CAAA;AAED,IAAM,iBAAiB,GAAG,UAAA,GAAG;IAC3B,IAAI,SAAS,GAAG,IAAI,IAAI,CAAI,GAAG,cAAW,CAAC,CAAC,OAAO,EAAE,CAAA;IACrD,IAAI,OAAO,GAAG,IAAI,IAAI,CAAI,GAAG,cAAW,CAAC,CAAC,OAAO,EAAE,CAAA;AACrD,CAAC,CAAA;AAED,IAAM,eAAe,GAAG,UAAA,GAAG;IACzB,IAAI,IAAI,GAAG,IAAI,IAAI,CAAI,GAAG,cAAW,CAAC,CAAC,OAAO,EAAE,CAAA;IAChD,IAAI,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAA;IACvC,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,IAAM,aAAa,GAAG,UAAA,GAAG;IACvB,IAAI,IAAI,GAAG,IAAI,IAAI,CAAI,GAAG,cAAW,CAAC,CAAC,OAAO,EAAE,CAAA;IAChD,IAAI,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;IACnC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAA;IACnC,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
\ No newline at end of file
......@@ -132,8 +132,8 @@ export default class Task {
// 扣积分
let result = await TBAPIS.changeCredits(context, session, {
quantity: +credits,
change_type: 2,
opt_type: '1',
change_type: 2, //变更类型:0交易,1:互动活动,2:权益兑换,3:手工调整
opt_type: 1, // 操作类型,'0':增加,1:扣减
remark: `积分兑换任务减积分`
})
......@@ -173,8 +173,7 @@ export default class Task {
const { todayTaskInfo, todayCompleteTimes } = taskService.getTodayCompleteTask('browseGoods', userInfo)
const hasCompleteToday =
todayTaskInfo.filter((v: { itemId: string }) => v.itemId === itemId).length &&
taskRateType === TASK_RATE_TYPE.EVERYDAY
todayTaskInfo.some((v: { itemId: string }) => v.itemId === itemId) && taskRateType === TASK_RATE_TYPE.EVERYDAY
// 今日任务已经完成
if (hasCompleteToday) {
......
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