diff --git a/assets/Scripts/Main/Common/Utils.ts b/assets/Scripts/Main/Common/Utils.ts index c69b2fa8..e78e00dc 100644 --- a/assets/Scripts/Main/Common/Utils.ts +++ b/assets/Scripts/Main/Common/Utils.ts @@ -359,19 +359,21 @@ export default class Utils { // 获取格式化字符串: vip失效时间 public static formatVipLeftTime(expiryTimestamp: number): string { - const dateNow = new Date(); - const timeDiff = Math.abs(expiryTimestamp - dateNow.getTime()); - const hours = Math.floor(timeDiff / (1000 * 60 * 60)); - - if (hours >= 24) { - return ( - (hours % 24).toString() + LanguageUtils.getText("purchasepanel.day") - ); + // 当前时间戳,单位:秒 + const nowSeconds = Math.floor(Date.now() / 1000); + // 差值(秒) + const diffSeconds = Math.max(0, expiryTimestamp - nowSeconds); + // 转换为天、小时、分钟 + const days = Math.floor(diffSeconds / (60 * 60 * 24)); + const hours = Math.floor((diffSeconds % (60 * 60 * 24)) / 3600); + const minutes = Math.floor((diffSeconds % 3600) / 60); + console.log("vip失效剩余时间差(秒):", diffSeconds, "天:", days, "小时:", hours, "分钟:", minutes); + if (days > 0) { + return `${days}${LanguageUtils.getText("purchasepanel.day")}`; } - const minutes = Math.floor((timeDiff / (1000 * 60)) % 60); - //const seconds = Math.floor((timeDiff / 1000) % 60); - return `${hours}${LanguageUtils.getText( - "purchasepanel.hour" - )}:${minutes}${LanguageUtils.getText("purchasepanel.minute")}`; + if (hours > 0) { + return `${hours}${LanguageUtils.getText("purchasepanel.hour")}:${minutes}${LanguageUtils.getText("purchasepanel.minute")}`; + } + return `${minutes}${LanguageUtils.getText("purchasepanel.minute")}`; } } diff --git a/assets/Scripts/chat18x/core/ChatAIService.ts b/assets/Scripts/chat18x/core/ChatAIService.ts index 582e2276..e629d0f1 100644 --- a/assets/Scripts/chat18x/core/ChatAIService.ts +++ b/assets/Scripts/chat18x/core/ChatAIService.ts @@ -210,13 +210,13 @@ export class ChatAIService { let userData = { isAi: false, msg: message, - msgId: new Date().getTime(), + msgId: new Date().getTime().toString(), }; msgList.push(userData); let aiData = { isAi: true, msg: response.text, - msgId: new Date().getTime() + 1, + msgId: (new Date().getTime() + 1).toString(), }; msgList.push(aiData); this.reqChatMsg(roleId, msgList); diff --git a/assets/Scripts/chat18x/data/ChatModel.ts b/assets/Scripts/chat18x/data/ChatModel.ts index c5c2b3c4..2879833e 100644 --- a/assets/Scripts/chat18x/data/ChatModel.ts +++ b/assets/Scripts/chat18x/data/ChatModel.ts @@ -525,10 +525,9 @@ export class ChatModel { //return false; const girlData = DataManager.I.getDataById(DataId.Girl); const roleData = this.rolesData.get(this.currentGirlId); - const leftTime = girlData.getChatRemainCount( + return girlData.isCanChat( roleData.categoryId, roleData.girlId ); - return leftTime === 0 ? false : true; } } diff --git a/assets/Scripts/chat18x/data/WalletData.ts b/assets/Scripts/chat18x/data/WalletData.ts index cd726fad..cba3c715 100644 --- a/assets/Scripts/chat18x/data/WalletData.ts +++ b/assets/Scripts/chat18x/data/WalletData.ts @@ -8,7 +8,7 @@ import { InnerMsgCode } from "../../Main/Config/InnerMsgCode"; export class WalletData extends BaseData { // 余额 private _balance: number = 0; - // vip失效时间戳 + // vip失效时间戳,秒 private _vipExpire: number = 0; public reset(): void { diff --git a/assets/Scripts/chat18x/manager/ChatHistoryManager.ts b/assets/Scripts/chat18x/manager/ChatHistoryManager.ts index 0cd71a23..d4d6a139 100644 --- a/assets/Scripts/chat18x/manager/ChatHistoryManager.ts +++ b/assets/Scripts/chat18x/manager/ChatHistoryManager.ts @@ -242,7 +242,7 @@ export class ChatHistoryManager { const message: ChatMessage = { role: serverMsg.isAi ? "model" : "user", parts: [{ text: serverMsg.msg }], - timestamp: serverMsg.msgId || Date.now(), + timestamp: Number(serverMsg.msgId) || Date.now(), }; messages.push(message); } @@ -396,7 +396,7 @@ export class ChatHistoryManager { const msg = girlData.getChatRecordMsg(category.toString(), roleId, id); if (msg) { serverMessages.push({ - msgId: id, + msgId: id.toString(), msg: msg, isAi: isAi, }); diff --git a/assets/bundles/DataTable/tbgirlsdetail.bin b/assets/bundles/DataTable/tbgirlsdetail.bin index 460a0835..e4975bc9 100644 Binary files a/assets/bundles/DataTable/tbgirlsdetail.bin and b/assets/bundles/DataTable/tbgirlsdetail.bin differ diff --git a/assets/bundles/DataTable/tbpurchaseconfig.bin b/assets/bundles/DataTable/tbpurchaseconfig.bin index f1d5c68e..b0e0536c 100644 --- a/assets/bundles/DataTable/tbpurchaseconfig.bin +++ b/assets/bundles/DataTable/tbpurchaseconfig.bin @@ -1,2 +1,2 @@ - 充值挡位1 充值挡位2 充值挡位3NN 充值挡位4u/u/ 充值挡位5oo 充值挡位6 -7天会员 30天会员Їϋ增加聊天次数 \ No newline at end of file + 充值挡位11$ 充值挡位2c 充值挡位3aD 充值挡位4 充值挡位5< 充值挡位6 ܇ +7天会员aD 30天会员 增加聊天次数T \ No newline at end of file diff --git a/xchat_cfg b/xchat_cfg index 1d62d883..dd961ccc 160000 --- a/xchat_cfg +++ b/xchat_cfg @@ -1 +1 @@ -Subproject commit 1d62d883f95da3e7aff2a630a9ba5f9da77cd3b4 +Subproject commit dd961ccc3b390e591abe30e5e7c126adba8379c7