Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
This commit is contained in:
@@ -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 索引 */
|
||||
@@ -191,6 +208,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;
|
||||
@@ -1339,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[] {
|
||||
|
||||
@@ -57,7 +57,12 @@ export class GirlService implements IGirlService {
|
||||
// 获取排行榜列表
|
||||
public async reqGirlRankData(req: proto.cs.ICSGetRankReq): Promise<ApiResponse<proto.cs.ICSGetRankRes>> {
|
||||
return this.impl.reqGirlRankData(req);
|
||||
}
|
||||
}
|
||||
|
||||
// 查看图片或者视频上报,用于排行榜
|
||||
public async reqViewGirl(req: proto.cs.ICSViewGirlReq): Promise<ApiResponse<proto.cs.ICSViewGirlRes>> {
|
||||
return this.impl.reqViewGirl(req);
|
||||
}
|
||||
|
||||
// 收藏技师
|
||||
public async reqBookmarkGirl(req: proto.cs.ICSBookmarkReq): Promise<ApiResponse<proto.cs.ICSBookmarkRes>> {
|
||||
|
||||
@@ -84,6 +84,17 @@ export class HttpGirlService implements IGirlService {
|
||||
return this.api.call(epData, req);
|
||||
}
|
||||
|
||||
// 查看图片或者视频上报,用于排行榜
|
||||
async reqViewGirl(req: proto.cs.ICSViewGirlReq): Promise<ApiResponse<proto.cs.ICSViewGirlRes>> {
|
||||
let epData: Endpoint<proto.cs.ICSViewGirlReq, proto.cs.ICSViewGirlRes> = {
|
||||
path: "api/logic/viewGirl",
|
||||
method: "POST",
|
||||
codec: "json",
|
||||
needsAuth: true
|
||||
};
|
||||
return this.api.call(epData, req);
|
||||
}
|
||||
|
||||
// 收藏技师
|
||||
async reqBookmarkGirl(req: proto.cs.ICSBookmarkReq): Promise<ApiResponse<proto.cs.ICSBookmarkRes>> {
|
||||
let epData: Endpoint<proto.cs.ICSBookmarkReq, proto.cs.ICSBookmarkRes> = {
|
||||
|
||||
@@ -15,7 +15,9 @@ export interface IGirlService {
|
||||
// 获取可聊天的技师数据
|
||||
reqCanChatGirlData(req: proto.cs.ICSGetLastChatListReq): Promise<ApiResponse<proto.cs.ICSGetLastChatListRes>>;
|
||||
// 获取排行榜列表
|
||||
reqGirlRankData(req: proto.cs.ICSGetRankReq): Promise<ApiResponse<proto.cs.ICSGetRankRes>>;
|
||||
reqGirlRankData(req: proto.cs.ICSGetRankReq): Promise<ApiResponse<proto.cs.ICSGetRankRes>>;
|
||||
// 查看图片或者视频上报,用于排行榜
|
||||
reqViewGirl(req: proto.cs.ICSViewGirlReq): Promise<ApiResponse<proto.cs.ICSViewGirlRes>>;
|
||||
// 收藏技师
|
||||
reqBookmarkGirl(req: proto.cs.ICSBookmarkReq): Promise<ApiResponse<proto.cs.ICSBookmarkRes>>;
|
||||
// 获取收藏列表
|
||||
|
||||
@@ -324,6 +324,17 @@ export class MockGirlService implements IGirlService {
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
// 查看图片或者视频上报,用于排行榜
|
||||
async reqViewGirl(req: proto.cs.ICSViewGirlReq): Promise<ApiResponse<proto.cs.ICSViewGirlRes>> {
|
||||
// TODO
|
||||
|
||||
// 返回数据
|
||||
const res: proto.cs.ICSViewGirlRes = {
|
||||
|
||||
};
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
// 收藏技师
|
||||
async reqBookmarkGirl(req: proto.cs.ICSBookmarkReq): Promise<ApiResponse<proto.cs.ICSBookmarkRes>> {
|
||||
// TODO
|
||||
|
||||
@@ -32,11 +32,15 @@ export class LuffaPayFlow implements PaymentFlow {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const orderData = DataManager.I.getDataById<OrderData>(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<OrderData>(DataId.Order);
|
||||
orderData.applyQueryOrder(orderId, data);
|
||||
|
||||
// 返回结果
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user