Commit 974898de authored by 俞嘉婷's avatar 俞嘉婷

feat: 特殊任务处理

parent 8ca068bd
......@@ -22,6 +22,7 @@ export class TaskItem extends ScrollListItem {
btn: Node = null;
@property({type: SpriteFrame, displayName: "去完成"}) doSf: SpriteFrame = null;
@property({type: SpriteFrame, displayName: "继续加油"}) fightSf: SpriteFrame = null;
@property({type: SpriteFrame, displayName: "去邀请"}) inviteSf: SpriteFrame = null;
@property({type: SpriteFrame, displayName: "已完成"}) doneSf: SpriteFrame = null;
@property({type: SpriteFrame, displayName: "明日再来"}) tomorrowSf: SpriteFrame = null;
......@@ -44,6 +45,7 @@ export class TaskItem extends ScrollListItem {
code, title, subTitle,
completedSize, intervalLimitSize, taskStatus,
intervalType, extra,
desc,
} = data;
if (code?.startsWith("it")) {
......@@ -71,7 +73,17 @@ export class TaskItem extends ScrollListItem {
} else if (code?.startsWith("bt")) {
btnSp.spriteFrame = this.doSf;
} else {
btnSp.spriteFrame = this.doSf;
if (code === "bank_2202") { // 特殊任务
const descObj = desc ? JSON.parse(desc) : {};
// hasReceivedNum 特殊任务的已领奖次数
if (descObj.hasReceivedNum >= 1) {
btnSp.spriteFrame = this.fightSf;
} else {
btnSp.spriteFrame = this.doSf;
}
} else {
btnSp.spriteFrame = this.doSf;
}
}
break;
}
......@@ -91,11 +103,13 @@ export class TaskItem extends ScrollListItem {
}
clickBtn = _asyncThrottle(() => {
const {taskStatus} = this.data;
const {taskStatus, code} = this.data;
if (+taskStatus == 0) {
TaskCenter.handleClickTask(this.data);
if (code !== "bank_2202") { // 特殊任务
TaskCenter.handleClickTask(this.data);
}
} else if (+taskStatus == 1) {
......
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "9cadbe4b-6523-4415-b5a0-b6fc91f0a630",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "9cadbe4b-6523-4415-b5a0-b6fc91f0a630@6c48a",
"displayName": "继续加油",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "9cadbe4b-6523-4415-b5a0-b6fc91f0a630",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "9cadbe4b-6523-4415-b5a0-b6fc91f0a630@f9941",
"displayName": "继续加油",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 149,
"height": 55,
"rawWidth": 149,
"rawHeight": 55,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-74.5,
-27.5,
0,
74.5,
-27.5,
0,
-74.5,
27.5,
0,
74.5,
27.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
55,
149,
55,
0,
0,
149,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-74.5,
-27.5,
0
],
"maxPos": [
74.5,
27.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "9cadbe4b-6523-4415-b5a0-b6fc91f0a630@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "9cadbe4b-6523-4415-b5a0-b6fc91f0a630@6c48a"
}
}
......@@ -774,6 +774,10 @@
"__uuid__": "01031984-8366-4f71-9972-5a3392ba24bf@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"fightSf": {
"__uuid__": "9cadbe4b-6523-4415-b5a0-b6fc91f0a630@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"inviteSf": {
"__uuid__": "ddf89097-2f55-40a8-b255-861943780e36@f9941",
"__expectedType__": "cc.SpriteFrame"
......
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