From 953e90ce2a973278731852c6843f710c2b2ccc32 Mon Sep 17 00:00:00 2001 From: chen wei bo <1025839511@qq.com> Date: Thu, 9 Oct 2025 14:20:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=EF=BC=8C=E6=9F=A5=E7=9C=8B=E5=9B=BE=E7=89=87=E6=88=96=E8=80=85?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E4=B8=8A=E6=8A=A5=EF=BC=8C=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scripts/chat18x/data/GirlData.ts | 6 ++++++ .../Scripts/chat18x/network/services/GirlService.ts | 7 ++++++- .../chat18x/network/services/HttpGirlService.ts | 11 +++++++++++ .../Scripts/chat18x/network/services/IGirlService.ts | 4 +++- .../chat18x/network/services/MockGirlService.ts | 11 +++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/assets/Scripts/chat18x/data/GirlData.ts b/assets/Scripts/chat18x/data/GirlData.ts index fb23d911..7cd0aa27 100644 --- a/assets/Scripts/chat18x/data/GirlData.ts +++ b/assets/Scripts/chat18x/data/GirlData.ts @@ -191,6 +191,12 @@ export class GirlData extends BaseData { /** --------------------------------------------------------- 技师的排行榜数据 --------------------------------------------------------- */ + /** 清空 排行榜数据 */ + public clearGirlRank(): void { + if (!this._rankData) return; + this._rankData.clear(); + } + /** 保存 排行榜数据 */ public setGirlRank(rankType: proto.cs.EnmRankType, data: proto.cs.ICSGetRankRes): void { if (!data) return; diff --git a/assets/Scripts/chat18x/network/services/GirlService.ts b/assets/Scripts/chat18x/network/services/GirlService.ts index 3936a5ff..bdf106f7 100644 --- a/assets/Scripts/chat18x/network/services/GirlService.ts +++ b/assets/Scripts/chat18x/network/services/GirlService.ts @@ -57,7 +57,12 @@ export class GirlService implements IGirlService { // 获取排行榜列表 public async reqGirlRankData(req: proto.cs.ICSGetRankReq): Promise> { return this.impl.reqGirlRankData(req); - } + } + + // 查看图片或者视频上报,用于排行榜 + public async reqViewGirl(req: proto.cs.ICSViewGirlReq): Promise> { + return this.impl.reqViewGirl(req); + } // 收藏技师 public async reqBookmarkGirl(req: proto.cs.ICSBookmarkReq): Promise> { diff --git a/assets/Scripts/chat18x/network/services/HttpGirlService.ts b/assets/Scripts/chat18x/network/services/HttpGirlService.ts index 524fbc33..48081bb0 100644 --- a/assets/Scripts/chat18x/network/services/HttpGirlService.ts +++ b/assets/Scripts/chat18x/network/services/HttpGirlService.ts @@ -84,6 +84,17 @@ export class HttpGirlService implements IGirlService { return this.api.call(epData, req); } + // 查看图片或者视频上报,用于排行榜 + async reqViewGirl(req: proto.cs.ICSViewGirlReq): Promise> { + let epData: Endpoint = { + path: "api/logic/viewGirl", + method: "POST", + codec: "json", + needsAuth: true + }; + return this.api.call(epData, req); + } + // 收藏技师 async reqBookmarkGirl(req: proto.cs.ICSBookmarkReq): Promise> { let epData: Endpoint = { diff --git a/assets/Scripts/chat18x/network/services/IGirlService.ts b/assets/Scripts/chat18x/network/services/IGirlService.ts index d15dbede..50f41951 100644 --- a/assets/Scripts/chat18x/network/services/IGirlService.ts +++ b/assets/Scripts/chat18x/network/services/IGirlService.ts @@ -15,7 +15,9 @@ export interface IGirlService { // 获取可聊天的技师数据 reqCanChatGirlData(req: proto.cs.ICSGetLastChatListReq): Promise>; // 获取排行榜列表 - reqGirlRankData(req: proto.cs.ICSGetRankReq): Promise>; + reqGirlRankData(req: proto.cs.ICSGetRankReq): Promise>; + // 查看图片或者视频上报,用于排行榜 + reqViewGirl(req: proto.cs.ICSViewGirlReq): Promise>; // 收藏技师 reqBookmarkGirl(req: proto.cs.ICSBookmarkReq): Promise>; // 获取收藏列表 diff --git a/assets/Scripts/chat18x/network/services/MockGirlService.ts b/assets/Scripts/chat18x/network/services/MockGirlService.ts index f105c915..240f5fa2 100644 --- a/assets/Scripts/chat18x/network/services/MockGirlService.ts +++ b/assets/Scripts/chat18x/network/services/MockGirlService.ts @@ -324,6 +324,17 @@ export class MockGirlService implements IGirlService { return this.ok(res); } + // 查看图片或者视频上报,用于排行榜 + async reqViewGirl(req: proto.cs.ICSViewGirlReq): Promise> { + // TODO + + // 返回数据 + const res: proto.cs.ICSViewGirlRes = { + + }; + return this.ok(res); + } + // 收藏技师 async reqBookmarkGirl(req: proto.cs.ICSBookmarkReq): Promise> { // TODO From 9cebe447165279a8d637317e447a2effb39cff5d Mon Sep 17 00:00:00 2001 From: chen wei bo <1025839511@qq.com> Date: Thu, 9 Oct 2025 16:46:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=EF=BC=8C=E6=94=B6=E8=97=8F=E8=A7=92=E8=89=B2=EF=BC=8C=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scripts/chat18x/data/GirlData.ts | 30 +++++++++++++++++-- .../chat18x/uiitems/DetailImageItem.ts | 17 +++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/assets/Scripts/chat18x/data/GirlData.ts b/assets/Scripts/chat18x/data/GirlData.ts index 7cd0aa27..bf974460 100644 --- a/assets/Scripts/chat18x/data/GirlData.ts +++ b/assets/Scripts/chat18x/data/GirlData.ts @@ -103,7 +103,6 @@ export class GirlData extends BaseData { this.setGirlUnlock(categoryId, data.girls); this.setGirlFavorability(categoryId, data.girls); this.setGirlOther(categoryId, data.girls); - const bucket = this.ensureBucket(categoryId); logger.log("保存类别 ", categoryId, " 的技师列表: ", bucket); } @@ -119,7 +118,6 @@ export class GirlData extends BaseData { this.setGirlChat(categoryId, details); this.setGirlFavorability(categoryId, details); this.setGirlOther(categoryId, details); - const bucket = this.ensureBucket(categoryId); logger.log("保存类别 ", categoryId, " 的详细数据: ", bucket); } @@ -141,6 +139,25 @@ export class GirlData extends BaseData { logger.log("保存可聊天的技师数据: ", cats); } + /** 保存收藏列表 */ + public setBookmarkGirlList(data: proto.cs.ICSGetBookmarkRes): void { + if (!data) return; + let arrayData = data.girls; + // 遍历 + for (const oneData of arrayData) { + let briefData = oneData.girl; + let categoryId = briefData.category; + this.mergeOneBrief(categoryId.toString(), briefData); + let theArray = []; + theArray.push(oneData); + this.setGirlUnlock(categoryId.toString(), theArray); + this.setGirlFavorability(categoryId.toString(), theArray); + this.setGirlOther(categoryId.toString(), theArray); + } + const cats = this.ensureCategories(); + logger.log("保存收藏列表后,大分类的数据: ", cats); + } + /** --------------------------------------------------------- 每日推荐 --------------------------------------------------------- */ /** 保存每日推荐:放入特殊分类 DAILY_BUCKET,并维护 id 索引 */ @@ -1345,12 +1362,19 @@ export class GirlData extends BaseData { return oneData.getBookmarkTime(); } + /** 保存 收藏时间,时间戳,秒 */ + public setBookmarkTime(categoryId: string, girlId: number, value: number): void { + let oneData = this.getGirlFavorability(categoryId, girlId); + if (!oneData) return; + oneData.setBookmarkTime(value); + } + /** 是否已经收藏 */ public isBookmarkGirl(categoryId: string, girlId: number): boolean { let oneData = this.getGirlFavorability(categoryId, girlId); if (!oneData) return false; return oneData.isBookmarkGirl(); - } + } /** 获取所有已经收藏技师的 id */ public getAllBookmarkGirlIds(): number[] { diff --git a/assets/Scripts/chat18x/uiitems/DetailImageItem.ts b/assets/Scripts/chat18x/uiitems/DetailImageItem.ts index d49583e0..440ead0d 100644 --- a/assets/Scripts/chat18x/uiitems/DetailImageItem.ts +++ b/assets/Scripts/chat18x/uiitems/DetailImageItem.ts @@ -17,6 +17,7 @@ import { DataManager, DataId } from "../data/DataManager"; import { GirlData } from "../data/GirlData"; import { EnvData } from "../data/EnvData"; import { NavigationManager } from "../manager/NavigationManager"; +import { GirlService } from "db://assets/Scripts/chat18x/network/services/GirlService"; const { ccclass, property } = _decorator; @@ -68,6 +69,8 @@ export class DetailImageItem extends Component { if (this.url) { NavigationManager.Instance.openPopupPanel("ShowPanel", data); this.base.setVideEnable(false); + // 查看图片或者视频上报,用于排行榜 + this.reqViewGirl(this.girlId); } } else { NavigationManager.Instance.openPopupPanel("PopupGirlDetailPanel", { @@ -96,6 +99,20 @@ export class DetailImageItem extends Component { // } } + /** + * 查看图片或者视频上报,用于排行榜 + * @param girlId 角色Id + */ + private async reqViewGirl(girlId: number) { + const reqData = { + girlId + }; + let res = await GirlService.I.reqViewGirl(reqData); + if (res && res.code === proto.cs.EnmRetCode.SUCCESS) { + const resData = res.data; + } + } + scaleToFillItem() { if (!this.img || !this.img.spriteFrame) return; From dcccc5056e192606d9280c06a007083268c3e329 Mon Sep 17 00:00:00 2001 From: chen wei bo <1025839511@qq.com> Date: Thu, 9 Oct 2025 22:05:04 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9TODO=EF=BC=9ALuffa?= =?UTF-8?q?=E9=92=B1=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scripts/chat18x/payment/LuffaPayFlow.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/Scripts/chat18x/payment/LuffaPayFlow.ts b/assets/Scripts/chat18x/payment/LuffaPayFlow.ts index 769fecac..a5045541 100644 --- a/assets/Scripts/chat18x/payment/LuffaPayFlow.ts +++ b/assets/Scripts/chat18x/payment/LuffaPayFlow.ts @@ -32,11 +32,15 @@ export class LuffaPayFlow implements PaymentFlow { }); }); } + + const orderData = DataManager.I.getDataById(DataId.Order); // 构造交易参数 + const amount = orderData.getAmountById(orderId); + const walletUrl = orderData.getWalletById(orderId); const rawTx = { - toAddress: "Hm3g4xXM4JHt5EwFUcvVZ8RthR4KWUnR51fKHCbnKkiZ", // TODO - amount: 1 // TODO + toAddress: walletUrl, + amount: Number(amount) }; // 签名交易 @@ -54,7 +58,6 @@ export class LuffaPayFlow implements PaymentFlow { const data = await this.pollOrder(orderId); // 刷新订单数据 - const orderData = DataManager.I.getDataById(DataId.Order); orderData.applyQueryOrder(orderId, data); // 返回结果