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:
@@ -27,6 +27,8 @@ export enum InnerMsgCode {
|
||||
Chat_EmotionUpdated,
|
||||
SimplePlayVide,
|
||||
LanguageChange,
|
||||
BalanceChange, // 余额发生变化
|
||||
VipExpireChange, // vip失效时间戳发生变化
|
||||
}
|
||||
|
||||
export enum InnerEventCode {
|
||||
|
||||
@@ -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失效时间戳 */
|
||||
|
||||
@@ -4,6 +4,10 @@ import type { IGirlService } from "./IGirlService";
|
||||
import { ConfigManager, ConfigId } from "../../manager/ConfigManager";
|
||||
import { GirlConfig } from "../../config/GirlConfig";
|
||||
import { GirlDetailConfig } from "../../config/GirlDetailConfig";
|
||||
import { DataManager, DataId } from "../../data/DataManager";
|
||||
import { GirlData } from "../../data/GirlData";
|
||||
import { WalletData } from "../../data/WalletData";
|
||||
|
||||
export class MockGirlService implements IGirlService {
|
||||
private delay(ms = 180) { return new Promise<void>(r => setTimeout(r, ms)); }
|
||||
private randInt(min: number, max: number) { return Math.floor(Math.random() * (max - min + 1)) + min; }
|
||||
@@ -240,20 +244,61 @@ export class MockGirlService implements IGirlService {
|
||||
}
|
||||
|
||||
// 解锁技师
|
||||
async reqUnlockGirl(_req: proto.cs.ICSUnlockGirlReq): Promise<ApiResponse<proto.cs.ICSUnlockGirlRes>> {
|
||||
async reqUnlockGirl(req: proto.cs.ICSUnlockGirlReq): Promise<ApiResponse<proto.cs.ICSUnlockGirlRes>> {
|
||||
// 延时
|
||||
await this.delay(180);
|
||||
// 请求数据
|
||||
const reqGirlId = req.id;
|
||||
// 数据层的数据
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
const category = girlData.getGrilCategoryById(reqGirlId);
|
||||
const price = girlData.getGrilPrice(category.toString(), reqGirlId);
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
// 余额
|
||||
let balanceNumber = Number(walletData.balance) - Number(price);
|
||||
let balance = balanceNumber.toString();
|
||||
// vip 30天后过期
|
||||
const nowSeconds = Math.floor(Date.now() / 1000);
|
||||
let vipExpire = nowSeconds + 30 * 24 * 3600;
|
||||
// 返回数据
|
||||
const res: proto.cs.ICSUnlockGirlRes = {};
|
||||
const res: proto.cs.ICSUnlockGirlRes = {
|
||||
balance,
|
||||
vipExpire,
|
||||
};
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
// 解锁资源
|
||||
async reqUnlockGirlRes(_req: proto.cs.ICSUnlockResourceReq): Promise<ApiResponse<proto.cs.ICSUnlockResourceRes>> {
|
||||
async reqUnlockGirlRes(req: proto.cs.ICSUnlockResourceReq): Promise<ApiResponse<proto.cs.ICSUnlockResourceRes>> {
|
||||
// 延时
|
||||
await this.delay(180);
|
||||
// 请求数据
|
||||
const reqGirlId = req.girlId;
|
||||
const resId = req.resId;
|
||||
const resType = req.type;
|
||||
// 数据层的数据
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
const category = girlData.getGrilCategoryById(reqGirlId);
|
||||
let price = 0;
|
||||
if (resType === proto.cs.EnmResType.ERT_Image) {
|
||||
// 图片
|
||||
price = girlData.getGrilPhotoPrice(category.toString(), reqGirlId, resId);
|
||||
} else if (resType === proto.cs.EnmResType.ERT_Video) {
|
||||
// 视频
|
||||
price = girlData.getGrilVideoPrice(category.toString(), reqGirlId, resId);
|
||||
}
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
// 余额
|
||||
let balanceNumber = Number(walletData.balance) - Number(price);
|
||||
let balance = balanceNumber.toString();
|
||||
// vip 30天后过期
|
||||
const nowSeconds = Math.floor(Date.now() / 1000);
|
||||
let vipExpire = nowSeconds + 30 * 24 * 3600;
|
||||
// 返回数据
|
||||
const res: proto.cs.ICSUnlockResourceRes = {};
|
||||
const res: proto.cs.ICSUnlockResourceRes = {
|
||||
balance,
|
||||
vipExpire,
|
||||
};
|
||||
return this.ok(res);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@ import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import type { IShopService } from "./IShopService";
|
||||
import { PurchaseConfig } from "../../config/PurchaseConfig";
|
||||
import { ConfigManager, ConfigId } from "../../manager/ConfigManager";
|
||||
import { DataManager, DataId } from "../../data/DataManager";
|
||||
import { GirlData } from "../../data/GirlData";
|
||||
import { WalletData } from "../../data/WalletData";
|
||||
import { ShopData } from "../../data/ShopData";
|
||||
|
||||
export class MockShopService implements IShopService {
|
||||
private delay(ms = 180) { return new Promise<void>(r => setTimeout(r, ms)); }
|
||||
@@ -26,7 +30,7 @@ export class MockShopService implements IShopService {
|
||||
}
|
||||
|
||||
// 获取商品列表
|
||||
async reqShopList(_req: proto.cs.ICSGetPurchaseReq): Promise<ApiResponse<proto.cs.ICSGetPurchaseRes>> {
|
||||
async reqShopList(req: proto.cs.ICSGetPurchaseReq): Promise<ApiResponse<proto.cs.ICSGetPurchaseRes>> {
|
||||
// 延时
|
||||
await this.delay();
|
||||
// 配置数据
|
||||
@@ -46,11 +50,42 @@ export class MockShopService implements IShopService {
|
||||
}
|
||||
|
||||
// 使用余额购买商品
|
||||
async reqBuyGood(_req: proto.cs.ICSBuyGoodReq): Promise<ApiResponse<proto.cs.ICSBuyGoodRes>> {
|
||||
async reqBuyGood(req: proto.cs.ICSBuyGoodReq): Promise<ApiResponse<proto.cs.ICSBuyGoodRes>> {
|
||||
// 延时
|
||||
await this.delay();
|
||||
// 请求数据
|
||||
const reqGirlId = req.girlId;
|
||||
const goodId = req.goodId;
|
||||
// 数据层的数据
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
const shopData = DataManager.I.getDataById<ShopData>(DataId.Shop);
|
||||
const category = girlData.getGrilCategoryById(reqGirlId);
|
||||
|
||||
let chatRemainCount = 0;
|
||||
if (shopData.isRechargeId(goodId)) {
|
||||
// 充值
|
||||
} else if (shopData.isMemberId(goodId)) {
|
||||
// 会员
|
||||
chatRemainCount = -1;
|
||||
} else if (shopData.isChatId(goodId)) {
|
||||
// 聊天
|
||||
const curCount = girlData.getChatRemainCount(category.toString(), reqGirlId);
|
||||
chatRemainCount = curCount + shopData.getCountById(goodId);
|
||||
}
|
||||
// 余额
|
||||
const price = shopData.getPriceById(goodId);
|
||||
let balanceNumber = Number(walletData.balance) - Number(price);
|
||||
let balance = balanceNumber.toString();
|
||||
// vip 30天后过期
|
||||
const nowSeconds = Math.floor(Date.now() / 1000);
|
||||
let vipExpire = nowSeconds + 30 * 24 * 3600;
|
||||
// 返回数据
|
||||
const res: proto.cs.ICSBuyGoodRes = {};
|
||||
const res: proto.cs.ICSBuyGoodRes = {
|
||||
balance,
|
||||
vipExpire,
|
||||
chatRemainCount,
|
||||
};
|
||||
return this.ok(res);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,35 @@
|
||||
import { _decorator, Button, Component, Node } from "cc";
|
||||
import { _decorator, Button, Component, Node, Label } from "cc";
|
||||
import li_BaseView from "../../../Main/Common/li_BaseView";
|
||||
import Utils from "../../../Main/Common/Utils";
|
||||
import { GButton } from "../../../Main/Common/GButton";
|
||||
import { PopupGirlDetailPanel } from "./PopupGirlDetailPanel";
|
||||
import { GirlListItem } from "../../uiitems/GirlListItem";
|
||||
import { GirlService } from "db://assets/Scripts/chat18x/network/services/GirlService";
|
||||
import { DataManager, DataId } from "../../data/DataManager";
|
||||
import { GirlData } from "../../data/GirlData";
|
||||
import { WalletData } from "../../data/WalletData";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlListPopupPanel")
|
||||
export class GirlListPopupPanel extends li_BaseView {
|
||||
private _nodeTab: any = {};
|
||||
|
||||
private priceLabel: Label;
|
||||
private category: number;
|
||||
private girlId: number;
|
||||
|
||||
base: GirlListItem;
|
||||
openUIDataCT(data) {
|
||||
this.category = data.category;
|
||||
this.girlId = data.id;
|
||||
this.base = data.base;
|
||||
}
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
// 价格
|
||||
this.priceLabel = this._nodeTab.Price.getComponent(Label);
|
||||
this.priceLabel.string = girlData.getGrilOriginalPrice(this.category.toString(), this.girlId).toString();
|
||||
this.registerListener();
|
||||
}
|
||||
registerListener() {
|
||||
@@ -28,13 +39,26 @@ export class GirlListPopupPanel extends li_BaseView {
|
||||
Close() {
|
||||
this.close();
|
||||
}
|
||||
buyCharacter() {
|
||||
async buyCharacter() {
|
||||
// 购买id为girlId的女生
|
||||
console.log(this.girlId);
|
||||
|
||||
if (true) {
|
||||
// 请求解锁
|
||||
const reqData = {
|
||||
id: this.girlId,
|
||||
};
|
||||
let res = await GirlService.I.reqUnlockGirl(reqData);
|
||||
console.log("请求解锁响应数据:", res);
|
||||
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
const resData = res.data;
|
||||
// 保存数据
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
girlData.setIsRelease(this.category.toString(), this.girlId, true);
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
walletData.balance = Number(resData.balance);
|
||||
walletData.vipExpire = Number(resData.vipExpire);
|
||||
// 刷新界面
|
||||
this.base.refreshBuy(true);
|
||||
this.close();
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,12 @@ export class ThemePanel extends li_BaseView {
|
||||
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
|
||||
this.recName.string = LanguageUtils.getText(this.rectNameKey);
|
||||
});
|
||||
Utils.addInnerEL(InnerMsgCode.BalanceChange, this, () => {
|
||||
|
||||
});
|
||||
Utils.addInnerEL(InnerMsgCode.VipExpireChange, this, () => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
enterShop() {
|
||||
|
||||
@@ -91,6 +91,8 @@ export class GirlListItem extends Component {
|
||||
this.nameKey = girlData.getGrilName(this.category.toString(), this.id);
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
this.tagKey = girlData.getGrilTagKey(this.category.toString(), this.id);
|
||||
// 是否已经解锁
|
||||
const isRelease = girlData.getIsRelease(this.category.toString(), this.id);
|
||||
let desc = "";
|
||||
const tags = LanguageUtils.getText(this.tagKey).split("|");
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
@@ -148,13 +150,17 @@ export class GirlListItem extends Component {
|
||||
}
|
||||
|
||||
onClickDetail() {
|
||||
if (true) {
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
// 是否已经解锁
|
||||
const isRelease = girlData.getIsRelease(this.category.toString(), this.id);
|
||||
if (isRelease) {
|
||||
NavigationManager.Instance.navigateToGirlDetail(this.id);
|
||||
ViewManager.I.closeView(this.baseNode);
|
||||
} else {
|
||||
//未解锁
|
||||
ViewManager.I.openBundlesView("GirlListPopupPanel", {
|
||||
base: this,
|
||||
category: this.category,
|
||||
id: this.id,
|
||||
});
|
||||
}
|
||||
|
||||
Vendored
+42
@@ -1129,6 +1129,12 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
|
||||
/** Properties of a CSUnlockGirlRes. */
|
||||
interface ICSUnlockGirlRes {
|
||||
|
||||
/** CSUnlockGirlRes balance */
|
||||
balance?: (number|Long|null);
|
||||
|
||||
/** CSUnlockGirlRes vipExpire */
|
||||
vipExpire?: (number|Long|null);
|
||||
}
|
||||
|
||||
/** Represents a CSUnlockGirlRes. */
|
||||
@@ -1140,6 +1146,12 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
*/
|
||||
constructor(properties?: cs.ICSUnlockGirlRes);
|
||||
|
||||
/** CSUnlockGirlRes balance. */
|
||||
balance: (number|Long);
|
||||
|
||||
/** CSUnlockGirlRes vipExpire. */
|
||||
vipExpire: (number|Long);
|
||||
|
||||
/**
|
||||
* Creates a new CSUnlockGirlRes instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
@@ -1335,6 +1347,12 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
|
||||
/** Properties of a CSUnlockResourceRes. */
|
||||
interface ICSUnlockResourceRes {
|
||||
|
||||
/** CSUnlockResourceRes balance */
|
||||
balance?: (number|Long|null);
|
||||
|
||||
/** CSUnlockResourceRes vipExpire */
|
||||
vipExpire?: (number|Long|null);
|
||||
}
|
||||
|
||||
/** Represents a CSUnlockResourceRes. */
|
||||
@@ -1346,6 +1364,12 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
*/
|
||||
constructor(properties?: cs.ICSUnlockResourceRes);
|
||||
|
||||
/** CSUnlockResourceRes balance. */
|
||||
balance: (number|Long);
|
||||
|
||||
/** CSUnlockResourceRes vipExpire. */
|
||||
vipExpire: (number|Long);
|
||||
|
||||
/**
|
||||
* Creates a new CSUnlockResourceRes instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
@@ -1529,6 +1553,15 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
|
||||
/** Properties of a CSBuyGoodRes. */
|
||||
interface ICSBuyGoodRes {
|
||||
|
||||
/** CSBuyGoodRes balance */
|
||||
balance?: (number|Long|null);
|
||||
|
||||
/** CSBuyGoodRes vipExpire */
|
||||
vipExpire?: (number|Long|null);
|
||||
|
||||
/** CSBuyGoodRes chatRemainCount */
|
||||
chatRemainCount?: (number|null);
|
||||
}
|
||||
|
||||
/** Represents a CSBuyGoodRes. */
|
||||
@@ -1540,6 +1573,15 @@ static getTypeUrl(typeUrlPrefix?: string): string;
|
||||
*/
|
||||
constructor(properties?: cs.ICSBuyGoodRes);
|
||||
|
||||
/** CSBuyGoodRes balance. */
|
||||
balance: (number|Long);
|
||||
|
||||
/** CSBuyGoodRes vipExpire. */
|
||||
vipExpire: (number|Long);
|
||||
|
||||
/** CSBuyGoodRes chatRemainCount. */
|
||||
chatRemainCount: number;
|
||||
|
||||
/**
|
||||
* Creates a new CSBuyGoodRes instance using the specified properties.
|
||||
* @param [properties] Properties to set
|
||||
|
||||
@@ -2585,6 +2585,8 @@ $root.cs = (function() {
|
||||
* Properties of a CSUnlockGirlRes.
|
||||
* @memberof cs
|
||||
* @interface ICSUnlockGirlRes
|
||||
* @property {number|Long|null} [balance] CSUnlockGirlRes balance
|
||||
* @property {number|Long|null} [vipExpire] CSUnlockGirlRes vipExpire
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -2602,6 +2604,22 @@ $root.cs = (function() {
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* CSUnlockGirlRes balance.
|
||||
* @member {number|Long} balance
|
||||
* @memberof cs.CSUnlockGirlRes
|
||||
* @instance
|
||||
*/
|
||||
CSUnlockGirlRes.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
||||
|
||||
/**
|
||||
* CSUnlockGirlRes vipExpire.
|
||||
* @member {number|Long} vipExpire
|
||||
* @memberof cs.CSUnlockGirlRes
|
||||
* @instance
|
||||
*/
|
||||
CSUnlockGirlRes.prototype.vipExpire = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
||||
|
||||
/**
|
||||
* Creates a new CSUnlockGirlRes instance using the specified properties.
|
||||
* @function create
|
||||
@@ -2626,6 +2644,10 @@ $root.cs = (function() {
|
||||
CSUnlockGirlRes.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.balance != null && Object.hasOwnProperty.call(message, "balance"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.balance);
|
||||
if (message.vipExpire != null && Object.hasOwnProperty.call(message, "vipExpire"))
|
||||
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.vipExpire);
|
||||
return writer;
|
||||
};
|
||||
|
||||
@@ -2662,6 +2684,14 @@ $root.cs = (function() {
|
||||
if (tag === error)
|
||||
break;
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
message.balance = reader.int64();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
message.vipExpire = reader.int64();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
@@ -2697,6 +2727,12 @@ $root.cs = (function() {
|
||||
CSUnlockGirlRes.verify = function verify(message) {
|
||||
if (typeof message !== "object" || message === null)
|
||||
return "object expected";
|
||||
if (message.balance != null && message.hasOwnProperty("balance"))
|
||||
if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high)))
|
||||
return "balance: integer|Long expected";
|
||||
if (message.vipExpire != null && message.hasOwnProperty("vipExpire"))
|
||||
if (!$util.isInteger(message.vipExpire) && !(message.vipExpire && $util.isInteger(message.vipExpire.low) && $util.isInteger(message.vipExpire.high)))
|
||||
return "vipExpire: integer|Long expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -2711,7 +2747,26 @@ $root.cs = (function() {
|
||||
CSUnlockGirlRes.fromObject = function fromObject(object) {
|
||||
if (object instanceof $root.cs.CSUnlockGirlRes)
|
||||
return object;
|
||||
return new $root.cs.CSUnlockGirlRes();
|
||||
var message = new $root.cs.CSUnlockGirlRes();
|
||||
if (object.balance != null)
|
||||
if ($util.Long)
|
||||
(message.balance = $util.Long.fromValue(object.balance)).unsigned = false;
|
||||
else if (typeof object.balance === "string")
|
||||
message.balance = parseInt(object.balance, 10);
|
||||
else if (typeof object.balance === "number")
|
||||
message.balance = object.balance;
|
||||
else if (typeof object.balance === "object")
|
||||
message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber();
|
||||
if (object.vipExpire != null)
|
||||
if ($util.Long)
|
||||
(message.vipExpire = $util.Long.fromValue(object.vipExpire)).unsigned = false;
|
||||
else if (typeof object.vipExpire === "string")
|
||||
message.vipExpire = parseInt(object.vipExpire, 10);
|
||||
else if (typeof object.vipExpire === "number")
|
||||
message.vipExpire = object.vipExpire;
|
||||
else if (typeof object.vipExpire === "object")
|
||||
message.vipExpire = new $util.LongBits(object.vipExpire.low >>> 0, object.vipExpire.high >>> 0).toNumber();
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -2723,8 +2778,33 @@ $root.cs = (function() {
|
||||
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
||||
* @returns {Object.<string,*>} Plain object
|
||||
*/
|
||||
CSUnlockGirlRes.toObject = function toObject() {
|
||||
return {};
|
||||
CSUnlockGirlRes.toObject = function toObject(message, options) {
|
||||
if (!options)
|
||||
options = {};
|
||||
var object = {};
|
||||
if (options.defaults) {
|
||||
if ($util.Long) {
|
||||
var long = new $util.Long(0, 0, false);
|
||||
object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
||||
} else
|
||||
object.balance = options.longs === String ? "0" : 0;
|
||||
if ($util.Long) {
|
||||
var long = new $util.Long(0, 0, false);
|
||||
object.vipExpire = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
||||
} else
|
||||
object.vipExpire = options.longs === String ? "0" : 0;
|
||||
}
|
||||
if (message.balance != null && message.hasOwnProperty("balance"))
|
||||
if (typeof message.balance === "number")
|
||||
object.balance = options.longs === String ? String(message.balance) : message.balance;
|
||||
else
|
||||
object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber() : message.balance;
|
||||
if (message.vipExpire != null && message.hasOwnProperty("vipExpire"))
|
||||
if (typeof message.vipExpire === "number")
|
||||
object.vipExpire = options.longs === String ? String(message.vipExpire) : message.vipExpire;
|
||||
else
|
||||
object.vipExpire = options.longs === String ? $util.Long.prototype.toString.call(message.vipExpire) : options.longs === Number ? new $util.LongBits(message.vipExpire.low >>> 0, message.vipExpire.high >>> 0).toNumber() : message.vipExpire;
|
||||
return object;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -3028,6 +3108,8 @@ $root.cs = (function() {
|
||||
* Properties of a CSUnlockResourceRes.
|
||||
* @memberof cs
|
||||
* @interface ICSUnlockResourceRes
|
||||
* @property {number|Long|null} [balance] CSUnlockResourceRes balance
|
||||
* @property {number|Long|null} [vipExpire] CSUnlockResourceRes vipExpire
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -3045,6 +3127,22 @@ $root.cs = (function() {
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* CSUnlockResourceRes balance.
|
||||
* @member {number|Long} balance
|
||||
* @memberof cs.CSUnlockResourceRes
|
||||
* @instance
|
||||
*/
|
||||
CSUnlockResourceRes.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
||||
|
||||
/**
|
||||
* CSUnlockResourceRes vipExpire.
|
||||
* @member {number|Long} vipExpire
|
||||
* @memberof cs.CSUnlockResourceRes
|
||||
* @instance
|
||||
*/
|
||||
CSUnlockResourceRes.prototype.vipExpire = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
||||
|
||||
/**
|
||||
* Creates a new CSUnlockResourceRes instance using the specified properties.
|
||||
* @function create
|
||||
@@ -3069,6 +3167,10 @@ $root.cs = (function() {
|
||||
CSUnlockResourceRes.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.balance != null && Object.hasOwnProperty.call(message, "balance"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.balance);
|
||||
if (message.vipExpire != null && Object.hasOwnProperty.call(message, "vipExpire"))
|
||||
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.vipExpire);
|
||||
return writer;
|
||||
};
|
||||
|
||||
@@ -3105,6 +3207,14 @@ $root.cs = (function() {
|
||||
if (tag === error)
|
||||
break;
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
message.balance = reader.int64();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
message.vipExpire = reader.int64();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
@@ -3140,6 +3250,12 @@ $root.cs = (function() {
|
||||
CSUnlockResourceRes.verify = function verify(message) {
|
||||
if (typeof message !== "object" || message === null)
|
||||
return "object expected";
|
||||
if (message.balance != null && message.hasOwnProperty("balance"))
|
||||
if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high)))
|
||||
return "balance: integer|Long expected";
|
||||
if (message.vipExpire != null && message.hasOwnProperty("vipExpire"))
|
||||
if (!$util.isInteger(message.vipExpire) && !(message.vipExpire && $util.isInteger(message.vipExpire.low) && $util.isInteger(message.vipExpire.high)))
|
||||
return "vipExpire: integer|Long expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -3154,7 +3270,26 @@ $root.cs = (function() {
|
||||
CSUnlockResourceRes.fromObject = function fromObject(object) {
|
||||
if (object instanceof $root.cs.CSUnlockResourceRes)
|
||||
return object;
|
||||
return new $root.cs.CSUnlockResourceRes();
|
||||
var message = new $root.cs.CSUnlockResourceRes();
|
||||
if (object.balance != null)
|
||||
if ($util.Long)
|
||||
(message.balance = $util.Long.fromValue(object.balance)).unsigned = false;
|
||||
else if (typeof object.balance === "string")
|
||||
message.balance = parseInt(object.balance, 10);
|
||||
else if (typeof object.balance === "number")
|
||||
message.balance = object.balance;
|
||||
else if (typeof object.balance === "object")
|
||||
message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber();
|
||||
if (object.vipExpire != null)
|
||||
if ($util.Long)
|
||||
(message.vipExpire = $util.Long.fromValue(object.vipExpire)).unsigned = false;
|
||||
else if (typeof object.vipExpire === "string")
|
||||
message.vipExpire = parseInt(object.vipExpire, 10);
|
||||
else if (typeof object.vipExpire === "number")
|
||||
message.vipExpire = object.vipExpire;
|
||||
else if (typeof object.vipExpire === "object")
|
||||
message.vipExpire = new $util.LongBits(object.vipExpire.low >>> 0, object.vipExpire.high >>> 0).toNumber();
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -3166,8 +3301,33 @@ $root.cs = (function() {
|
||||
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
||||
* @returns {Object.<string,*>} Plain object
|
||||
*/
|
||||
CSUnlockResourceRes.toObject = function toObject() {
|
||||
return {};
|
||||
CSUnlockResourceRes.toObject = function toObject(message, options) {
|
||||
if (!options)
|
||||
options = {};
|
||||
var object = {};
|
||||
if (options.defaults) {
|
||||
if ($util.Long) {
|
||||
var long = new $util.Long(0, 0, false);
|
||||
object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
||||
} else
|
||||
object.balance = options.longs === String ? "0" : 0;
|
||||
if ($util.Long) {
|
||||
var long = new $util.Long(0, 0, false);
|
||||
object.vipExpire = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
||||
} else
|
||||
object.vipExpire = options.longs === String ? "0" : 0;
|
||||
}
|
||||
if (message.balance != null && message.hasOwnProperty("balance"))
|
||||
if (typeof message.balance === "number")
|
||||
object.balance = options.longs === String ? String(message.balance) : message.balance;
|
||||
else
|
||||
object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber() : message.balance;
|
||||
if (message.vipExpire != null && message.hasOwnProperty("vipExpire"))
|
||||
if (typeof message.vipExpire === "number")
|
||||
object.vipExpire = options.longs === String ? String(message.vipExpire) : message.vipExpire;
|
||||
else
|
||||
object.vipExpire = options.longs === String ? $util.Long.prototype.toString.call(message.vipExpire) : options.longs === Number ? new $util.LongBits(message.vipExpire.low >>> 0, message.vipExpire.high >>> 0).toNumber() : message.vipExpire;
|
||||
return object;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -3434,6 +3594,9 @@ $root.cs = (function() {
|
||||
* Properties of a CSBuyGoodRes.
|
||||
* @memberof cs
|
||||
* @interface ICSBuyGoodRes
|
||||
* @property {number|Long|null} [balance] CSBuyGoodRes balance
|
||||
* @property {number|Long|null} [vipExpire] CSBuyGoodRes vipExpire
|
||||
* @property {number|null} [chatRemainCount] CSBuyGoodRes chatRemainCount
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -3451,6 +3614,30 @@ $root.cs = (function() {
|
||||
this[keys[i]] = properties[keys[i]];
|
||||
}
|
||||
|
||||
/**
|
||||
* CSBuyGoodRes balance.
|
||||
* @member {number|Long} balance
|
||||
* @memberof cs.CSBuyGoodRes
|
||||
* @instance
|
||||
*/
|
||||
CSBuyGoodRes.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
||||
|
||||
/**
|
||||
* CSBuyGoodRes vipExpire.
|
||||
* @member {number|Long} vipExpire
|
||||
* @memberof cs.CSBuyGoodRes
|
||||
* @instance
|
||||
*/
|
||||
CSBuyGoodRes.prototype.vipExpire = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
||||
|
||||
/**
|
||||
* CSBuyGoodRes chatRemainCount.
|
||||
* @member {number} chatRemainCount
|
||||
* @memberof cs.CSBuyGoodRes
|
||||
* @instance
|
||||
*/
|
||||
CSBuyGoodRes.prototype.chatRemainCount = 0;
|
||||
|
||||
/**
|
||||
* Creates a new CSBuyGoodRes instance using the specified properties.
|
||||
* @function create
|
||||
@@ -3475,6 +3662,12 @@ $root.cs = (function() {
|
||||
CSBuyGoodRes.encode = function encode(message, writer) {
|
||||
if (!writer)
|
||||
writer = $Writer.create();
|
||||
if (message.balance != null && Object.hasOwnProperty.call(message, "balance"))
|
||||
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.balance);
|
||||
if (message.vipExpire != null && Object.hasOwnProperty.call(message, "vipExpire"))
|
||||
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.vipExpire);
|
||||
if (message.chatRemainCount != null && Object.hasOwnProperty.call(message, "chatRemainCount"))
|
||||
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.chatRemainCount);
|
||||
return writer;
|
||||
};
|
||||
|
||||
@@ -3511,6 +3704,18 @@ $root.cs = (function() {
|
||||
if (tag === error)
|
||||
break;
|
||||
switch (tag >>> 3) {
|
||||
case 1: {
|
||||
message.balance = reader.int64();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
message.vipExpire = reader.int64();
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
message.chatRemainCount = reader.int32();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
@@ -3546,6 +3751,15 @@ $root.cs = (function() {
|
||||
CSBuyGoodRes.verify = function verify(message) {
|
||||
if (typeof message !== "object" || message === null)
|
||||
return "object expected";
|
||||
if (message.balance != null && message.hasOwnProperty("balance"))
|
||||
if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high)))
|
||||
return "balance: integer|Long expected";
|
||||
if (message.vipExpire != null && message.hasOwnProperty("vipExpire"))
|
||||
if (!$util.isInteger(message.vipExpire) && !(message.vipExpire && $util.isInteger(message.vipExpire.low) && $util.isInteger(message.vipExpire.high)))
|
||||
return "vipExpire: integer|Long expected";
|
||||
if (message.chatRemainCount != null && message.hasOwnProperty("chatRemainCount"))
|
||||
if (!$util.isInteger(message.chatRemainCount))
|
||||
return "chatRemainCount: integer expected";
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -3560,7 +3774,28 @@ $root.cs = (function() {
|
||||
CSBuyGoodRes.fromObject = function fromObject(object) {
|
||||
if (object instanceof $root.cs.CSBuyGoodRes)
|
||||
return object;
|
||||
return new $root.cs.CSBuyGoodRes();
|
||||
var message = new $root.cs.CSBuyGoodRes();
|
||||
if (object.balance != null)
|
||||
if ($util.Long)
|
||||
(message.balance = $util.Long.fromValue(object.balance)).unsigned = false;
|
||||
else if (typeof object.balance === "string")
|
||||
message.balance = parseInt(object.balance, 10);
|
||||
else if (typeof object.balance === "number")
|
||||
message.balance = object.balance;
|
||||
else if (typeof object.balance === "object")
|
||||
message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber();
|
||||
if (object.vipExpire != null)
|
||||
if ($util.Long)
|
||||
(message.vipExpire = $util.Long.fromValue(object.vipExpire)).unsigned = false;
|
||||
else if (typeof object.vipExpire === "string")
|
||||
message.vipExpire = parseInt(object.vipExpire, 10);
|
||||
else if (typeof object.vipExpire === "number")
|
||||
message.vipExpire = object.vipExpire;
|
||||
else if (typeof object.vipExpire === "object")
|
||||
message.vipExpire = new $util.LongBits(object.vipExpire.low >>> 0, object.vipExpire.high >>> 0).toNumber();
|
||||
if (object.chatRemainCount != null)
|
||||
message.chatRemainCount = object.chatRemainCount | 0;
|
||||
return message;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -3572,8 +3807,36 @@ $root.cs = (function() {
|
||||
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
||||
* @returns {Object.<string,*>} Plain object
|
||||
*/
|
||||
CSBuyGoodRes.toObject = function toObject() {
|
||||
return {};
|
||||
CSBuyGoodRes.toObject = function toObject(message, options) {
|
||||
if (!options)
|
||||
options = {};
|
||||
var object = {};
|
||||
if (options.defaults) {
|
||||
if ($util.Long) {
|
||||
var long = new $util.Long(0, 0, false);
|
||||
object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
||||
} else
|
||||
object.balance = options.longs === String ? "0" : 0;
|
||||
if ($util.Long) {
|
||||
var long = new $util.Long(0, 0, false);
|
||||
object.vipExpire = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
||||
} else
|
||||
object.vipExpire = options.longs === String ? "0" : 0;
|
||||
object.chatRemainCount = 0;
|
||||
}
|
||||
if (message.balance != null && message.hasOwnProperty("balance"))
|
||||
if (typeof message.balance === "number")
|
||||
object.balance = options.longs === String ? String(message.balance) : message.balance;
|
||||
else
|
||||
object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber() : message.balance;
|
||||
if (message.vipExpire != null && message.hasOwnProperty("vipExpire"))
|
||||
if (typeof message.vipExpire === "number")
|
||||
object.vipExpire = options.longs === String ? String(message.vipExpire) : message.vipExpire;
|
||||
else
|
||||
object.vipExpire = options.longs === String ? $util.Long.prototype.toString.call(message.vipExpire) : options.longs === Number ? new $util.LongBits(message.vipExpire.low >>> 0, message.vipExpire.high >>> 0).toNumber() : message.vipExpire;
|
||||
if (message.chatRemainCount != null && message.hasOwnProperty("chatRemainCount"))
|
||||
object.chatRemainCount = message.chatRemainCount;
|
||||
return object;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user