Merge branch 'main' of 47.107.44.202:xionglijia/18xchat

This commit is contained in:
2025-09-22 12:00:39 +08:00
5 changed files with 47 additions and 8 deletions
@@ -107,10 +107,33 @@ export class PurchaseConfig extends BaseConfig {
return oneData.count; return oneData.count;
} }
/** 根据商品 id 获取商品价格 */ /** 根据商品 id 获取商品的原来价格,除100,卢币 */
public getOriginalPriceById(id: number): number {
let oneData = this.getConfigById(id);
if (!oneData) return 0;
let price = oneData.price;
return price/100;
}
/** 根据商品 id 获取商品价格,卢币 */
public getPriceById(id: number): number | null { public getPriceById(id: number): number | null {
let oneData = this.getConfigById(id); let oneData = this.getConfigById(id);
if (!oneData) return null; if (!oneData) return null;
return oneData.price; return oneData.price;
} }
/** 根据商品 id 获取商品的原来价格,除100,usd */
public getOriginalUsdPriceById(id: number): number {
let oneData = this.getConfigById(id);
if (!oneData) return 0;
let price = oneData.usd;
return price/100;
}
/** 根据商品 id 获取商品价格,usd */
public getUsdPriceById(id: number): number | null {
let oneData = this.getConfigById(id);
if (!oneData) return null;
return oneData.usd;
}
} }
+2 -2
View File
@@ -70,8 +70,8 @@ export class ChatAIService {
}, },
}); });
console.log("-------AI 启动成功-------"); logger.log("-------AI 启动成功-------");
console.log(this.ai); logger.log(this.ai);
this.ai.operations; this.ai.operations;
} catch (error) { } catch (error) {
TipsPanel.show(LanguageUtils.getText("chat_error_code_2001")); TipsPanel.show(LanguageUtils.getText("chat_error_code_2001"));
+19 -3
View File
@@ -37,7 +37,8 @@ export class ShopData extends BaseData {
id: g.id, // 商品 id id: g.id, // 商品 id
name: g.name, // 商品名字 name: g.name, // 商品名字
count: g.count, // 商品数量 count: g.count, // 商品数量
price: g.price, // 商品价格 price: g.price, // 商品价格,卢币
usd: g.usd, // 商品价格,usd
}; };
this._goods.set(vo.id, vo); this._goods.set(vo.id, vo);
this._goodIds.push(vo.id); this._goodIds.push(vo.id);
@@ -143,7 +144,7 @@ export class ShopData extends BaseData {
return oneData.name; return oneData.name;
} }
/** 根据商品 id 获取商品的原来价格,除100 */ /** 根据商品 id 获取商品的原来价格,除100,卢币 */
public getOriginalPriceById(id: number): number { public getOriginalPriceById(id: number): number {
let oneData = this.getGoodDataById(id); let oneData = this.getGoodDataById(id);
if (!oneData) return 0; if (!oneData) return 0;
@@ -151,13 +152,28 @@ export class ShopData extends BaseData {
return price/100; return price/100;
} }
/** 根据商品 id 获取商品价格 */ /** 根据商品 id 获取商品价格,卢币 */
public getPriceById(id: number): number { public getPriceById(id: number): number {
let oneData = this.getGoodDataById(id); let oneData = this.getGoodDataById(id);
if (!oneData) return 0; if (!oneData) return 0;
return oneData.price; return oneData.price;
} }
/** 根据商品 id 获取商品的原来价格,除100,usd */
public getOriginalUsdPriceById(id: number): number {
let oneData = this.getGoodDataById(id);
if (!oneData) return 0;
let price = oneData.usd;
return price/100;
}
/** 根据商品 id 获取商品价格,usd */
public getUsdPriceById(id: number): number {
let oneData = this.getGoodDataById(id);
if (!oneData) return 0;
return oneData.usd;
}
/** 根据商品 id 获取商品数量 */ /** 根据商品 id 获取商品数量 */
public getCountById(id: number): number | null { public getCountById(id: number): number | null {
let oneData = this.getGoodDataById(id); let oneData = this.getGoodDataById(id);
+1 -1
View File
@@ -171,7 +171,7 @@ export class ErrorHandler {
*/ */
public clearErrorLog(): void { public clearErrorLog(): void {
this.errorLog = []; this.errorLog = [];
console.log("Error log cleared"); logger.log("Error log cleared");
} }
/** /**