|
@@ -4,7 +4,8 @@ import { StringUtil } from '../../../framework/util/StringUtil';
|
|
import { MailData } from '../../data/MailData';
|
|
import { MailData } from '../../data/MailData';
|
|
import { Framework } from '../../../framework/Framework';
|
|
import { Framework } from '../../../framework/Framework';
|
|
import { ViewID } from '../../../framework/config/LayerConf';
|
|
import { ViewID } from '../../../framework/config/LayerConf';
|
|
-import { LoginManager } from '../../common/LoginManager';
|
|
|
|
|
|
+import { LoginMgr } from '../../common/LoginManager';
|
|
|
|
+import { GameEvent } from '../../data/GameEvent';
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('MailItem')
|
|
@ccclass('MailItem')
|
|
@@ -43,7 +44,7 @@ export class MailItem extends ResKeeper {
|
|
refreshItem(data) {
|
|
refreshItem(data) {
|
|
this.data = data;
|
|
this.data = data;
|
|
|
|
|
|
- this.titleTx.string = data.title;
|
|
|
|
|
|
+ this.titleTx.string = MailData.getMailText(data.title,true);
|
|
|
|
|
|
this.maskImg.active = false;
|
|
this.maskImg.active = false;
|
|
this.readIco.active = false;
|
|
this.readIco.active = false;
|
|
@@ -53,6 +54,7 @@ export class MailItem extends ResKeeper {
|
|
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
|
|
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
|
|
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + '';
|
|
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + '';
|
|
this.timeTx.string = Y + M + D;
|
|
this.timeTx.string = Y + M + D;
|
|
|
|
+
|
|
if (data.award && data.award.size > 0) {
|
|
if (data.award && data.award.size > 0) {
|
|
this.awardTips.active = false;
|
|
this.awardTips.active = false;
|
|
let showAward = MailData.getShowAward(data.id)
|
|
let showAward = MailData.getShowAward(data.id)
|
|
@@ -62,7 +64,7 @@ export class MailItem extends ResKeeper {
|
|
} else {
|
|
} else {
|
|
this.awardBg.active = true;
|
|
this.awardBg.active = true;
|
|
this.awardNode.active = false;
|
|
this.awardNode.active = false;
|
|
- this.load('sub_bundle', 'mail/texture/mail_3/', SpriteFrame, (res: SpriteFrame) => {
|
|
|
|
|
|
+ this.load('mail', 'texture/mail_3/spriteFrame', SpriteFrame, (res: SpriteFrame) => {
|
|
this.awardBg.getComponent(Sprite).spriteFrame = res;
|
|
this.awardBg.getComponent(Sprite).spriteFrame = res;
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -70,7 +72,7 @@ export class MailItem extends ResKeeper {
|
|
this.awardBg.active = true;
|
|
this.awardBg.active = true;
|
|
this.awardNode.active = false;
|
|
this.awardNode.active = false;
|
|
this.awardTips.active = false;
|
|
this.awardTips.active = false;
|
|
- this.load('sub_bundle', 'mail/texture/mail_3', SpriteFrame, (res: SpriteFrame) => {
|
|
|
|
|
|
+ this.load('mail', 'texture/mail_3/spriteFrame', SpriteFrame, (res: SpriteFrame) => {
|
|
this.awardBg.getComponent(Sprite).spriteFrame = res;
|
|
this.awardBg.getComponent(Sprite).spriteFrame = res;
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -81,7 +83,7 @@ export class MailItem extends ResKeeper {
|
|
this.awardTips.active = false;
|
|
this.awardTips.active = false;
|
|
this.readIco.active = true;
|
|
this.readIco.active = true;
|
|
this.maskImg.active = true;
|
|
this.maskImg.active = true;
|
|
- this.load('sub_bundle', 'mail/texture/mail_2', SpriteFrame, (res: SpriteFrame) => {
|
|
|
|
|
|
+ this.load('mail', 'texture/mail_2/spriteFrame', SpriteFrame, (res: SpriteFrame) => {
|
|
this.awardBg.getComponent(Sprite).spriteFrame = res;
|
|
this.awardBg.getComponent(Sprite).spriteFrame = res;
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -99,27 +101,20 @@ export class MailItem extends ResKeeper {
|
|
let target: any = event.target;
|
|
let target: any = event.target;
|
|
if (target.name == 'bg') {
|
|
if (target.name == 'bg') {
|
|
if (this.data.read == 1) {
|
|
if (this.data.read == 1) {
|
|
|
|
+ console.log('=============== aa')
|
|
Framework.layer.open(ViewID.MailDetail, null, this.data);
|
|
Framework.layer.open(ViewID.MailDetail, null, this.data);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (this.data.award && this.data.award.size > 0) {
|
|
if (this.data.award && this.data.award.size > 0) {
|
|
|
|
+ console.log('=============== bb')
|
|
Framework.layer.open(ViewID.MailDetail, null, this.data);
|
|
Framework.layer.open(ViewID.MailDetail, null, this.data);
|
|
} else {
|
|
} else {
|
|
- // LoginManager.sendPost('user', 'read_mail', (data) => {
|
|
|
|
- // // console.log(data);
|
|
|
|
- // if (data.awards) {
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- // if (data.equip) {
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- // if (data.gem) {
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- // MailData.setMailReadById(data.id)
|
|
|
|
-
|
|
|
|
|
|
+ LoginMgr.sendPost('user', 'read_mail', (data) => {
|
|
|
|
+ console.log(data);
|
|
|
|
+ MailData.setMailReadById(data.id)
|
|
|
|
+ // Framework.event.fireEvent(GameEvent.MailUpdate);
|
|
Framework.layer.open(ViewID.MailDetail, null, this.data);
|
|
Framework.layer.open(ViewID.MailDetail, null, this.data);
|
|
- // }, { id: this.data.id })
|
|
|
|
|
|
+ }, { id: this.data.id })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|