Commit 5bc86ecb authored by qinhaitao's avatar qinhaitao

update

parent 87a622b0
......@@ -6,7 +6,8 @@ var online_1 = require("./online");
var test_1 = require("./test");
var configs = {
online: online_1.default,
test: test_1.default
test: test_1.default,
mock: test_1.default
};
exports.getConfig = function (context) {
var env = context.env;
......
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,mCAA6B;AAC7B,+BAAyB;AAMzB,IAAM,OAAO,GAAG;IACd,MAAM,kBAAA;IACN,IAAI,gBAAA;CACL,CAAA;AAEY,QAAA,SAAS,GAAG,UAAC,OAAgB;IACxC,IAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;IACvB,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,CAAA;AACrC,CAAC,CAAA"}
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";AAAA,cAAc;;;AAEd,mCAA6B;AAC7B,+BAAyB;AAMzB,IAAM,OAAO,GAAG;IACd,MAAM,kBAAA;IACN,IAAI,gBAAA;IACJ,IAAI,EAAE,cAAI;CACX,CAAA;AAEY,QAAA,SAAS,GAAG,UAAC,OAAgB;IACxC,IAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;IACvB,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,IAAI,CAAA;AACrC,CAAC,CAAA"}
\ No newline at end of file
"use strict";
/** @format */
Object.defineProperty(exports, "__esModule", { value: true });
var appId = '消费端ID';
exports.default = {
VIP_CALLBACK_URL: 'testUrl'
VIP_CALLBACK_URL: "https://m.duanqu.com/?_ariver_appid=" + appId
};
//# sourceMappingURL=online.js.map
\ No newline at end of file
{"version":3,"file":"online.js","sourceRoot":"","sources":["../../src/config/online.ts"],"names":[],"mappings":";AAAA,cAAc;;AAEd,kBAAe;IACb,gBAAgB,EAAE,SAAS;CAC5B,CAAA"}
\ No newline at end of file
{"version":3,"file":"online.js","sourceRoot":"","sources":["../../src/config/online.ts"],"names":[],"mappings":";AAAA,cAAc;;AAEd,IAAM,KAAK,GAAG,OAAO,CAAA;AAErB,kBAAe;IACb,gBAAgB,EAAE,yCAAuC,KAAO;CACjE,CAAA"}
\ No newline at end of file
......@@ -2,6 +2,6 @@
Object.defineProperty(exports, "__esModule", { value: true });
/** @format */
exports.default = {
VIP_CALLBACK_URL: 'onlineUrl'
VIP_CALLBACK_URL: 'testUrl'
};
//# sourceMappingURL=test.js.map
\ No newline at end of file
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/config/test.ts"],"names":[],"mappings":";;AAAA,cAAc;AACd,kBAAe;IACb,gBAAgB,EAAE,WAAW;CAC9B,CAAA"}
\ No newline at end of file
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/config/test.ts"],"names":[],"mappings":";;AAAA,cAAc;AACd,kBAAe;IACb,gBAAgB,EAAE,SAAS;CAC5B,CAAA"}
\ No newline at end of file
......@@ -67,7 +67,7 @@ var Task = /** @class */ (function () {
var userInfo = _a.userInfo, vipInfo = _a.vipInfo, activityInfo = _a.activityInfo, session = _a.session;
var taskService = _b[0];
return __awaiter(this, void 0, void 0, function () {
var tasks, updatedUserInfo, _c, _d, _e, _f, vipTask, followTask;
var tasks, updatedUserInfo, _c, _d, _e, _f, vipTask, followTask, browseGoodsTask;
return __generator(this, function (_g) {
switch (_g.label) {
case 0:
......@@ -85,15 +85,12 @@ var Task = /** @class */ (function () {
updatedUserInfo = _g.sent();
vipTask = taskService.initVipTask(updatedUserInfo, vipInfo, tasks);
followTask = taskService.initFollowTask(updatedUserInfo, tasks);
// // 下单任务
// const orderGoodsTask = taskService.initOrderGoodsTask(updatedUserInfo, tasks)
// // 浏览商品任务
// const browseGoodsTask = taskService.initBrowseGoodsTask(updatedUserInfo, tasks)
browseGoodsTask = taskService.initBrowseGoodsTask(updatedUserInfo, tasks);
// // 邀请任务
// const invitesTask = taskService.initInvitesTask(updatedUserInfo, tasks)
// 积分兑换
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
return [2 /*return*/, sdk_1.resultsModel.success([vipTask, followTask])];
return [2 /*return*/, sdk_1.resultsModel.success([vipTask, followTask, browseGoodsTask])];
}
});
});
......@@ -131,15 +128,15 @@ var Task = /** @class */ (function () {
var userInfo = _a.userInfo, activityInfo = _a.activityInfo, session = _a.session;
var userService = _b[0], taskService = _b[1];
return __awaiter(this, void 0, void 0, function () {
var openId, credits, _id, taskInfo, taskType, _c, value, times, taskRateType, today, todayTimes, myCredits, result;
return __generator(this, function (_d) {
switch (_d.label) {
var openId, credits, _id, _c, taskInfo, taskType, _d, value, times, taskRateType, today, todayTimes, myCredits, result;
return __generator(this, function (_e) {
switch (_e.label) {
case 0:
openId = context.openId;
credits = context.data.credits;
_id = userInfo._id, taskInfo = userInfo.taskInfo;
_id = userInfo._id, _c = userInfo.taskInfo, taskInfo = _c === void 0 ? {} : _c;
taskType = "exchangeCredits";
_c = activityInfo.tasks.exchangeCredits, value = _c.value, times = _c.times, taskRateType = _c.taskRateType;
_d = activityInfo.tasks.exchangeCredits, value = _d.value, times = _d.times, taskRateType = _d.taskRateType;
today = utils_1.getToday();
todayTimes = taskService.getTodayCompleteTask(taskType, userInfo).todayTimes;
// 如果每日限制次数并到达了限制次数
......@@ -148,7 +145,7 @@ var Task = /** @class */ (function () {
}
return [4 /*yield*/, sdk_1.TBAPIS.queryCredits(context, session)];
case 1:
myCredits = _d.sent();
myCredits = _e.sent();
console.log('myCredits', myCredits);
// 积分不足
if (myCredits < credits)
......@@ -162,7 +159,7 @@ var Task = /** @class */ (function () {
remark: "\u79EF\u5206\u5151\u6362\u4EFB\u52A1\u51CF\u79EF\u5206"
})];
case 2:
result = _d.sent();
result = _e.sent();
if (!result)
return [2 /*return*/, sdk_1.resultsModel.error(constants_1.CODE_TYPES.SYSTEM_ERROR)
// 更新user表
......@@ -171,7 +168,7 @@ var Task = /** @class */ (function () {
return [4 /*yield*/, taskService.updateUserTaskRecord(taskType, value, userInfo)];
case 3:
// 更新user表
_d.sent();
_e.sent();
return [2 /*return*/, sdk_1.resultsModel.success(true)];
}
});
......
{"version":3,"file":"task.controller.js","sourceRoot":"","sources":["../../src/controller/task.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2D;AAC3D,0CAA2F;AAE3F,8BAA6C;AAC7C,kCAAqD;AACrD,sCAAkE;AAElE,IAAI;AACJ,8BAA8B;AAC9B,cAAc;AACd,+CAA+C;AAC/C,MAAM;AACN,IAAI;AACJ;IAAA;IAgKA,CAAC;IA/JC;;OAEG;IAKG,0BAAW,GAAjB,UACE,OAAgB,EAChB,EAA8D,EAC9D,EAA4B;YAD1B,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA,EAAE,OAAO,aAAA;YACzC,WAAW,QAAA;;;;;;wBAEJ,KAAK,GAAK,YAAY,MAAjB,CAAiB;wBAGF,KAAA,CAAA,KAAA,WAAW,CAAA,CAAC,WAAW,CAAA;8BAAC,QAAQ,CAAC,GAAG;8BAC9D,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,CAAC;wBACzD,qBAAM,WAAW,CAAC,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,EAAA;4BAF5C,qBAAM;gCAE1B,SAAgE;iCAChE;wBAEF,OAAO;sBAFL;;wBAHE,eAAe,GAAG,SAGpB;wBAGI,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,eAAe,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;wBAElE,UAAU,GAAG,WAAW,CAAC,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;wBACrE,UAAU;wBACV,gFAAgF;wBAChF,YAAY;wBACZ,kFAAkF;wBAClF,UAAU;wBACV,0EAA0E;wBAE1E,OAAO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AU;wBACV,qBAAM,WAAW,CAAC,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;gCAChE,MAAM,QAAA;6BACP,CAAC,EAAA;;wBAHF,UAAU;wBACV,SAEE,CAAA;wBAEF,sBAAO,kBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;;;KAClC;IAvJD;QAJC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;2CA6BvB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;4CAavB;IASD;QAJC,uBAAW,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACtC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,CAAC,CAAC;;;;qDA6CpC;IASD;QAJC,uBAAW,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QACrC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;iDA0CvB;IACH,WAAC;CAAA,AAhKD,IAgKC;kBAhKoB,IAAI"}
\ No newline at end of file
{"version":3,"file":"task.controller.js","sourceRoot":"","sources":["../../src/controller/task.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2D;AAC3D,0CAA2F;AAE3F,8BAA6C;AAC7C,kCAAqD;AACrD,sCAAkE;AAElE,IAAI;AACJ,8BAA8B;AAC9B,cAAc;AAC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AAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;2CA4BvB;IAQD;QAHC,uBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;4CAavB;IASD;QAJC,uBAAW,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACtC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,CAAC,CAAC;;;;qDA6CpC;IASD;QAJC,uBAAW,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QACrC,qBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,6BAAiB;QACjB,oBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;iDA0CvB;IACH,WAAC;CAAA,AA/JD,IA+JC;kBA/JoB,IAAI"}
\ No newline at end of file
......@@ -10,6 +10,8 @@ interface ITaskInfo {
rewards: number;
done?: boolean;
itemIds?: string;
todayCompleteTimes?: number;
taskLimitTimes?: number;
waitReceive?: number;
title: string;
}
......
......@@ -100,7 +100,7 @@ var TaskService = /** @class */ (function (_super) {
TaskService.prototype.initOrderGoodsTask = function (userInfo, tasks) {
var _a;
var _b = tasks.orderGoods, value = _b.value, itemIds = _b.itemIds, taskRateType = _b.taskRateType, times = _b.times;
var remainTimes = userInfo.remainTimes, taskInfo = userInfo.taskInfo;
var remainTimes = userInfo.remainTimes, _c = userInfo.taskInfo, taskInfo = _c === void 0 ? {} : _c;
var orderTask = {
taskType: "orderGoods",
title: "\u4E0B\u5355\u5546\u54C1",
......@@ -125,13 +125,16 @@ var TaskService = /** @class */ (function (_super) {
TaskService.prototype.initBrowseGoodsTask = function (userInfo, tasks) {
var _a;
var _b = tasks.browseGoods, value = _b.value, itemIds = _b.itemIds, taskRateType = _b.taskRateType, times = _b.times;
var remainTimes = userInfo.remainTimes, taskInfo = userInfo.taskInfo;
var remainTimes = userInfo.remainTimes, _c = userInfo.taskInfo, taskInfo = _c === void 0 ? {} : _c;
var today = utils_1.getToday();
var orderTask = {
taskType: "browseGoods",
title: "\u6D4F\u89C8\u5546\u54C1",
itemIds: itemIds,
rewards: value,
waitReceive: remainTimes.browseGoods,
// todayCompeleTimes: taskInfo?.[today]?.browseGoods.length,
taskRateType: taskRateType,
done: false
};
var browseGoodsCompleteList = this.getCompleteTaskByUserTaskInfo('browseGoods', userInfo);
......@@ -140,8 +143,7 @@ var TaskService = /** @class */ (function (_super) {
orderTask.done = true;
}
// 每日限制完成且完成次数达到限制
var today = utils_1.getToday();
if (taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY && ((_a = taskInfo === null || taskInfo === void 0 ? void 0 : taskInfo[today]) === null || _a === void 0 ? void 0 : _a.browseGoods) >= times) {
if (taskRateType === constants_1.TASK_RATE_TYPE.EVERYDAY && ((_a = taskInfo === null || taskInfo === void 0 ? void 0 : taskInfo[today]) === null || _a === void 0 ? void 0 : _a.browseGoods.length) >= times) {
orderTask.done = true;
}
return orderTask;
......@@ -270,12 +272,12 @@ var TaskService = /** @class */ (function (_super) {
*/
TaskService.prototype.updateFollowTask = function (userInfo, activityInfo) {
return __awaiter(this, void 0, void 0, function () {
var today, remainTimes, _id, taskInfo, follow, tasks, value, followInfo;
return __generator(this, function (_a) {
switch (_a.label) {
var today, remainTimes, _id, _a, taskInfo, follow, tasks, value, followInfo;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
today = utils_1.getToday();
remainTimes = userInfo.remainTimes, _id = userInfo._id, taskInfo = userInfo.taskInfo, follow = userInfo.follow;
remainTimes = userInfo.remainTimes, _id = userInfo._id, _a = userInfo.taskInfo, taskInfo = _a === void 0 ? {} : _a, follow = userInfo.follow;
tasks = activityInfo.tasks;
value = (tasks || {}).attentionStore.value;
followInfo = __assign(__assign({}, follow), { newFollow: true, followTime: Date.now(), followDay: today });
......@@ -291,7 +293,7 @@ var TaskService = /** @class */ (function (_super) {
taskInfo: taskInfo
}
})];
case 1: return [2 /*return*/, _a.sent()];
case 1: return [2 /*return*/, _b.sent()];
}
});
});
......
This diff is collapsed.
......@@ -116,13 +116,15 @@ var UserService = /** @class */ (function (_super) {
if (activityUserNick === void 0) { activityUserNick = ''; }
if (callbackUrl === void 0) { callbackUrl = ''; }
return __awaiter(this, void 0, void 0, function () {
var result, shopUrl, e_1;
var activityId, result, shopUrl, cbUrl, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log(activityUserNick, 'activityUserNick');
if (utils_1.isUseVipMock(this.context, activityUserNick)) {
return [2 /*return*/, vipMock_1.VIP_MOCK];
}
activityId = this.context.data.activityId;
result = {
result: {
member_info: ''
......@@ -133,6 +135,7 @@ var UserService = /** @class */ (function (_super) {
result: ''
}
};
cbUrl = callbackUrl + "&query=activityId%3D" + activityId;
_a.label = 1;
case 1:
_a.trys.push([1, 4, , 5]);
......@@ -142,7 +145,7 @@ var UserService = /** @class */ (function (_super) {
return [4 /*yield*/, sdk_1.TBAPIS.getShopVipUrl(this.context, session, {
source: 'isvapp',
entrance: 'duiba'
}, callbackUrl)];
}, cbUrl)];
case 3:
shopUrl = _a.sent();
return [3 /*break*/, 5];
......
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../src/service/user.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAwC;AACxC,+CAAwC;AACxC,4BAAoC;AACpC,kCAAiD;AACjD,sCAAqC;AAErC;IAA0B,+BAAW;IAEnC,qBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,OAAO,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,iBAAY,CAAC,CAAA;;IACnD,CAAC;IACD;;;OAGG;IACG,iC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,UAAkB,QAAmB,EAAE,OAAiB;QAE1C,IAAA,IAAI,GACZ,QAAQ,YADI,CACJ;QAEJ,IAAA,KAAK,GAAK,OAAO,MAAZ,CAAY;QAEzB,OAAO,CAAC,IAAI,IAAI,KAAK,CAAA;IACvB,CAAC;IACH,kBAAC;AAAD,CAAC,AA3LD,CAA0B,sBAAW,GA2LpC;AAED,kBAAe,WAAW,CAAA"}
\ No newline at end of file
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../src/service/user.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,8BAAwC;AACxC,+CAAwC;AACxC,4BAAoC;AACpC,kCAAiD;AACjD,sCAAqC;AAErC;IAA0B,+BAAW;IAEnC,qBAAY,OAAgB;QAA5B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAI,CAAC,OAAO,GAAG,IAAI,aAAO,CAAC,OAAO,EAAE,iBAAY,CAAC,CAAA;;IACnD,CAAC;IACD;;;OAGG;IACG,iCAAW,GAAjB;;;;;;wBACM,KAAmB,IAAI,CAAC,OAAO,EAA7B,MAAM,YAAA,EAAE,IAAI,UAAA,CAAiB;wBAC7B,UAAU,GAAK,IAAI,WAAT,CAAS;wBACZ,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,QAAA,EAAE,UAAU,YAAA,EAAE,CAAC,EAAA;;wBAA3D,MAAM,GAAG,SAAkD;wBAC/D,sBAAO,MAAM,EAAA;;;;KACd;IAED;;;;;OAKG;IACG,yCAAmB,GAAzB,UAA0B,QAAgB;;;;;;wBAClC,UAAU,GAAK,IAAI,CAAC,OAAO,CAAC,IAAI,WAAtB,CAAsB;wBACzB,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,YAAA,EAAE,CAAC,EAAA;;wBAArE,MAAM,GAAG,SAA4D;w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BAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE;gCAClC,IAAI,EAAE;oCACJ,MAAM,EAAE,QAAQ,CAAC,MAAM;oCACvB,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;oCACxB,MAAM,EAAE,QAAQ,CAAC,MAAM;iCACxB;6BACF,CAAC,EAAA;;wBANF,SAME,CAAA;;;;;KACH;IAED;;;;;OAKG;IACG,gCAAU,GAAhB,UAAiB,GAAW,EAAE,UAAkB;;;;;wBAC9C,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;wBACvB,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;4BACtB,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;yBAC3C;wBACM,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,KAAA,EAAE,EAAE,UAAU,CAAC,EAAA;4BAArD,sBAAO,SAA8C,EAAA;;;;KACtD;IACD;;;;OAIG;IACG,qCAAe,GAArB,UAAsB,GAAW;;;;4BACxB,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,KAAA,EAAE,CAAC,EAAA;4BAA1C,sBAAO,SAAmC,EAAA;;;;KAC3C;IAED;;;;;;;OAOG;IACH,uCAAiB,GAAjB,UAAkB,QAAmB,EAAE,OAAiB;QAE1C,IAAA,IAAI,GACZ,QAAQ,YADI,CACJ;QAEJ,IAAA,KAAK,GAAK,OAAO,MAAZ,CAAY;QAEzB,OAAO,CAAC,IAAI,IAAI,KAAK,CAAA;IACvB,CAAC;IACH,kBAAC;AAAD,CAAC,AA/LD,CAA0B,sBAAW,GA+LpC;AAED,kBAAe,WAAW,CAAA"}
\ No newline at end of file
......@@ -9,7 +9,8 @@ interface Iconfig {
const configs = {
online,
test
test,
mock: test
}
export const getConfig = (context: Context): Iconfig => {
......
......@@ -41,14 +41,13 @@ export default class Task {
// // 下单任务
// const orderGoodsTask = taskService.initOrderGoodsTask(updatedUserInfo, tasks)
// // 浏览商品任务
// const browseGoodsTask = taskService.initBrowseGoodsTask(updatedUserInfo, tasks)
const browseGoodsTask = taskService.initBrowseGoodsTask(updatedUserInfo, tasks)
// // 邀请任务
// const invitesTask = taskService.initInvitesTask(updatedUserInfo, tasks)
// 积分兑换
//const exchangeCreditsTask = taskService.initExchangeCreditsTask(updatedUserInfo, tasks)
return resultsModel.success([vipTask, followTask])
return resultsModel.success([vipTask, followTask, browseGoodsTask])
}
/**
......@@ -85,7 +84,7 @@ export default class Task {
) {
const { openId } = context
const { credits } = context.data
const { _id, taskInfo } = userInfo
const { _id, taskInfo = {} } = userInfo
const taskType = `exchangeCredits`
const {
tasks: {
......
......@@ -16,6 +16,8 @@ interface ITaskInfo {
rewards: number
done?: boolean
itemIds?: string
todayCompleteTimes?: number
taskLimitTimes?: number // 任务每日限制次数
waitReceive?: number
title: string
}
......@@ -56,7 +58,7 @@ export default class TaskService extends UserService {
orderGoods: { value, itemIds, taskRateType, times }
} = tasks
const { remainTimes, taskInfo } = userInfo
const { remainTimes, taskInfo = {} } = userInfo
let orderTask: ITaskInfo = {
taskType: `orderGoods`,
......@@ -89,7 +91,8 @@ export default class TaskService extends UserService {
browseGoods: { value, itemIds, taskRateType, times }
} = tasks
const { remainTimes, taskInfo } = userInfo
const { remainTimes, taskInfo = {} } = userInfo
const today = getToday()
let orderTask: ITaskInfo = {
taskType: `browseGoods`,
......@@ -97,6 +100,8 @@ export default class TaskService extends UserService {
itemIds,
rewards: value,
waitReceive: remainTimes.browseGoods,
// todayCompeleTimes: taskInfo?.[today]?.browseGoods.length,
taskRateType: taskRateType,
done: false
}
......@@ -108,8 +113,8 @@ export default class TaskService extends UserService {
}
// 每日限制完成且完成次数达到限制
const today = getToday()
if (taskRateType === TASK_RATE_TYPE.EVERYDAY && taskInfo?.[today]?.browseGoods >= times) {
if (taskRateType === TASK_RATE_TYPE.EVERYDAY && taskInfo?.[today]?.browseGoods.length >= times) {
orderTask.done = true
}
......@@ -267,7 +272,7 @@ export default class TaskService extends UserService {
*/
async updateFollowTask(userInfo: IUserInfo, activityInfo: IActivityInfo) {
const today = getToday()
let { remainTimes, _id, taskInfo, follow } = userInfo
let { remainTimes, _id, taskInfo = {}, follow } = userInfo
// 获取活动基本信息
const { tasks } = activityInfo
// 获取关注店铺奖励
......
......@@ -45,6 +45,7 @@ class UserService extends BaseService {
* @returns {isVip: boolean(是否是会员), url: string(入会链接) }
*/
async getShopVip(session: string, activityUserNick: string = '', callbackUrl: string = ''): Promise<IVipInfo> {
console.log(activityUserNick, 'activityUserNick')
if (isUseVipMock(this.context, activityUserNick)) {
return VIP_MOCK
}
......
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