Compare commits
5 Commits
479c309481
...
944a675af3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
944a675af3 | ||
![]() |
6fa3a8224c | ||
![]() |
2e84333776 | ||
![]() |
add9c7c562 | ||
![]() |
837e9b58c8 |
@ -22,10 +22,7 @@ export default async function (call: ApiCall<ReqTaskRec, ResTaskRec>) {
|
|||||||
return call.error('', { code: -3, message: globalThis.lng.yangchengmubiao_4 })
|
return call.error('', { code: -3, message: globalThis.lng.yangchengmubiao_4 })
|
||||||
}
|
}
|
||||||
_mydata.taskfinish.push(taskid)
|
_mydata.taskfinish.push(taskid)
|
||||||
let _addval = _con.addval
|
|
||||||
let _setData = {}
|
let _setData = {}
|
||||||
_mydata["val"] += _addval
|
|
||||||
_setData["val"] = _mydata.val
|
|
||||||
_setData["taskfinish"] = _mydata.taskfinish
|
_setData["taskfinish"] = _mydata.taskfinish
|
||||||
await Yuandanfun.setData(call.uid, _hd.hdid, { $set: _setData })
|
await Yuandanfun.setData(call.uid, _hd.hdid, { $set: _setData })
|
||||||
let _prize = _con.prize
|
let _prize = _con.prize
|
||||||
|
@ -23,6 +23,7 @@ export class Yuandanfun {
|
|||||||
exchange: {},
|
exchange: {},
|
||||||
taskfinish: [],
|
taskfinish: [],
|
||||||
taskval: await this.getTaskVal(call),
|
taskval: await this.getTaskVal(call),
|
||||||
|
qiandaoTime: data?.qiandaoTime || 0,
|
||||||
refreshTime: G.time
|
refreshTime: G.time
|
||||||
},
|
},
|
||||||
}, {upsert: true, returnDocument: 'after'})).value
|
}, {upsert: true, returnDocument: 'after'})).value
|
||||||
@ -40,7 +41,7 @@ export class Yuandanfun {
|
|||||||
let _tmp = _tasks[element]
|
let _tmp = _tasks[element]
|
||||||
_tmp["id"] = element
|
_tmp["id"] = element
|
||||||
// 每日登录直接完成
|
// 每日登录直接完成
|
||||||
if (element == "1") {
|
if (_tmp.stype == "128") {
|
||||||
_res[element] = 1
|
_res[element] = 1
|
||||||
} else {
|
} else {
|
||||||
_res[element] = 0
|
_res[element] = 0
|
||||||
@ -59,8 +60,7 @@ export class Yuandanfun {
|
|||||||
|
|
||||||
/**设置任务 */
|
/**设置任务 */
|
||||||
static async setTaskVal(call: ApiCall, stype: number, val: number, chkCall: Function, chkval: number = 0, isinc: number = 0, alchangeVal: Function, arg) {
|
static async setTaskVal(call: ApiCall, stype: number, val: number, chkCall: Function, chkval: number = 0, isinc: number = 0, alchangeVal: Function, arg) {
|
||||||
// let hdids = await this.gethdids(call)
|
// 活动过期,不计数
|
||||||
// if (hdids.length <= 0) return // 活动过期,不计数
|
|
||||||
let _hd = await this.getCon(call)
|
let _hd = await this.getCon(call)
|
||||||
if (!_hd) return
|
if (!_hd) return
|
||||||
|
|
||||||
@ -95,8 +95,8 @@ export class Yuandanfun {
|
|||||||
|
|
||||||
// 设置任务
|
// 设置任务
|
||||||
if (isset == 1) {
|
if (isset == 1) {
|
||||||
await G.mongodb.collection('event').updateMany(
|
await G.mongodb.collection('event').updateOne(
|
||||||
{uid: call.uid, type: {$regex: `yuandan${_hd.hdid}`}},
|
{uid: call.uid, type: `yuandan${_hd.hdid}`},
|
||||||
_setData
|
_setData
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ export class HuoDongHongDianFun {
|
|||||||
|
|
||||||
if (data?.gameNum < _hd.data.gamefree) return {show: true}
|
if (data?.gameNum < _hd.data.gamefree) return {show: true}
|
||||||
|
|
||||||
if (!PublicShared.chkSameDate(data.qiandaoTime || 0, G.time)) {
|
if (!PublicShared.chkSameDate(data?.qiandaoTime || 0, G.time)) {
|
||||||
return {show: true}
|
return {show: true}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -840,8 +840,7 @@ export class TaskAllEmitFun {
|
|||||||
|
|
||||||
if (node.call.service.name == 'event/yuandan/DMRec' && node.return.isSucc) {
|
if (node.call.service.name == 'event/yuandan/DMRec' && node.return.isSucc) {
|
||||||
// 今日参与{1}次抓娃娃小游戏
|
// 今日参与{1}次抓娃娃小游戏
|
||||||
let _val = node.call.conn.gud.helpHeros.length;
|
G.emit("Class_task_158", 'Class_task_158', node.call, 1, 0);
|
||||||
G.emit("Class_task_158", 'Class_task_158', node.call, _val, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user