Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
# Conflicts: # assets/Scripts/chat18x/data/GirlData.ts # assets/Scripts/chat18x/uiitems/GirlListItem.ts
This commit is contained in:
@@ -211,6 +211,14 @@ export class GirlData extends BaseData {
|
||||
return oneData.getGrilPriceType();
|
||||
}
|
||||
|
||||
/** 获取原来的价格,除100 */
|
||||
public getGrilOriginalPrice(categoryId: string, girlId: number): number {
|
||||
let oneData = this.getGrilBrief(categoryId, girlId);
|
||||
if (!oneData) return 0;
|
||||
let price = oneData.getGrilPrice();
|
||||
return price / 100;
|
||||
}
|
||||
|
||||
/** 获取价格 */
|
||||
public getGrilPrice(categoryId: string, girlId: number): number {
|
||||
let oneData = this.getGrilBrief(categoryId, girlId);
|
||||
@@ -376,9 +384,21 @@ export class GirlData extends BaseData {
|
||||
): number {
|
||||
let oneData = this.getGrilDetail(categoryId, girlId);
|
||||
if (!oneData) return 0;
|
||||
|
||||
return oneData.getGrilPhotoUnlockCounts(id);
|
||||
}
|
||||
|
||||
/** 获取技师图片的原来价格,除100 */
|
||||
public getGrilPhotoOriginalPrice(
|
||||
categoryId: string,
|
||||
girlId: number,
|
||||
id: number
|
||||
): number {
|
||||
let oneData = this.getGrilDetail(categoryId, girlId);
|
||||
if (!oneData) return 0;
|
||||
let price = oneData.getGrilPhotoPrice(id);
|
||||
return price / 100;
|
||||
}
|
||||
/** 获取技师图片的价格 */
|
||||
public getGrilPhotoPrice(
|
||||
categoryId: string,
|
||||
@@ -500,6 +520,18 @@ export class GirlData extends BaseData {
|
||||
return oneData.getGrilVideoEmotion(id);
|
||||
}
|
||||
|
||||
/** 获取技师视频的原来价格,除100 */
|
||||
public getGrilVideoOriginalPrice(
|
||||
categoryId: string,
|
||||
girlId: number,
|
||||
id: number
|
||||
): number {
|
||||
let oneData = this.getGrilDetail(categoryId, girlId);
|
||||
if (!oneData) return 0;
|
||||
let price = oneData.getGrilVideoPrice(id);
|
||||
return price / 100;
|
||||
}
|
||||
|
||||
/** 获取技师视频的价格 */
|
||||
public getGrilVideoPrice(
|
||||
categoryId: string,
|
||||
@@ -565,6 +597,17 @@ export class GirlData extends BaseData {
|
||||
return oneData.getIsRelease();
|
||||
}
|
||||
|
||||
/** 保存 付费技师是否已经解锁 */
|
||||
public setIsRelease(
|
||||
categoryId: string,
|
||||
girlId: number,
|
||||
value: boolean
|
||||
): void {
|
||||
let oneData = this.getGrilUnlock(categoryId, girlId);
|
||||
if (!oneData) return;
|
||||
oneData.setIsRelease(value);
|
||||
}
|
||||
|
||||
/** 判断图片是否解锁 */
|
||||
public isImageUnlock(
|
||||
categoryId: string,
|
||||
|
||||
@@ -53,45 +53,60 @@ export class ShopData extends BaseData {
|
||||
/** 获取所有商品 id */
|
||||
public get goodIds(): number[] { return this._goodIds; }
|
||||
|
||||
/** 是否是充值商品,首位数字为 1 */
|
||||
public isRechargeId(id: number): boolean {
|
||||
const firstDigit = id.toString()[0]; // 取首位字符
|
||||
return firstDigit === "1";
|
||||
}
|
||||
|
||||
/** 获取 充值商品的id数组,首位数字为 1 */
|
||||
private getRechargeIds(): number[] {
|
||||
public getRechargeIds(): number[] {
|
||||
let allId = this._goodIds;
|
||||
if (!allId) return [];
|
||||
// 获取所有 id
|
||||
let resultId = [];
|
||||
for (let one of allId) {
|
||||
const firstDigit = one.toString()[0]; // 取首位字符
|
||||
if (firstDigit === "1") {
|
||||
if (this.isRechargeId(one)) {
|
||||
resultId.push(one);
|
||||
}
|
||||
}
|
||||
return resultId;
|
||||
}
|
||||
|
||||
/** 是否是会员商品,首位数字为 2 */
|
||||
public isMemberId(id: number): boolean {
|
||||
const firstDigit = id.toString()[0]; // 取首位字符
|
||||
return firstDigit === "2";
|
||||
}
|
||||
|
||||
/** 获取 会员商品的id数组,首位数字为 2 */
|
||||
private getMemberIds(): number[] {
|
||||
public getMemberIds(): number[] {
|
||||
let allId = this._goodIds;
|
||||
if (!allId) return [];
|
||||
// 获取所有 id
|
||||
let resultId = [];
|
||||
for (let one of allId) {
|
||||
const firstDigit = one.toString()[0]; // 取首位字符
|
||||
if (firstDigit === "2") {
|
||||
if (this.isMemberId(one)) {
|
||||
resultId.push(one);
|
||||
}
|
||||
}
|
||||
return resultId;
|
||||
}
|
||||
|
||||
/** 是否是聊天商品,首位数字为 3 */
|
||||
public isChatId(id: number): boolean {
|
||||
const firstDigit = id.toString()[0]; // 取首位字符
|
||||
return firstDigit === "3";
|
||||
}
|
||||
|
||||
/** 获取 聊天商品的id数组,首位数字为 3 */
|
||||
private getChatIds(): number[] {
|
||||
public getChatIds(): number[] {
|
||||
let allId = this._goodIds;
|
||||
if (!allId) return [];
|
||||
// 获取所有 id
|
||||
let resultId = [];
|
||||
for (let one of allId) {
|
||||
const firstDigit = one.toString()[0]; // 取首位字符
|
||||
if (firstDigit === "3") {
|
||||
if (this.isChatId(one)) {
|
||||
resultId.push(one);
|
||||
}
|
||||
}
|
||||
@@ -111,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* 钱包数据
|
||||
*/
|
||||
import { BaseData } from "./BaseData";
|
||||
import Utils from "../../Main/Common/Utils";
|
||||
import { InnerMsgCode } from "../../Main/Config/InnerMsgCode";
|
||||
|
||||
export class WalletData extends BaseData {
|
||||
// 余额
|
||||
@@ -28,6 +30,8 @@ export class WalletData extends BaseData {
|
||||
/** 设置余额 */
|
||||
public set balance(value: number) {
|
||||
this._balance = value;
|
||||
// 发出事件
|
||||
Utils.sendInnerMsg(InnerMsgCode.BalanceChange, this._balance);
|
||||
}
|
||||
|
||||
/** 获取余额 */
|
||||
@@ -38,6 +42,8 @@ export class WalletData extends BaseData {
|
||||
/** 设置vip失效时间戳 */
|
||||
public set vipExpire(value: number) {
|
||||
this._vipExpire = value;
|
||||
// 发出事件
|
||||
Utils.sendInnerMsg(InnerMsgCode.VipExpireChange, this._vipExpire);
|
||||
}
|
||||
|
||||
/** 获取vip失效时间戳 */
|
||||
|
||||
Reference in New Issue
Block a user