协议调试

This commit is contained in:
chen wei bo
2025-09-09 19:16:51 +08:00
parent a4b1ecd44a
commit fe67cf3814
3 changed files with 41 additions and 6 deletions
+11 -3
View File
@@ -126,10 +126,18 @@ export class ShopData extends BaseData {
return oneData.name;
}
/** 根据商品 id 获取商品价格 */
public getPriceById(id: number): number | null {
/** 根据商品 id 获取商品的原来价格,除100 */
public getOriginalPriceById(id: number): number {
let oneData = this.getGoodDataById(id);
if (!oneData) return null;
if (!oneData) return 0;
let price = oneData.price;
return price/100;
}
/** 根据商品 id 获取商品价格 */
public getPriceById(id: number): number {
let oneData = this.getGoodDataById(id);
if (!oneData) return 0;
return oneData.price;
}