ui修改
This commit is contained in:
@@ -349,7 +349,8 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
}
|
||||
|
||||
returnBtn() {
|
||||
NavigationManager.Instance.switchToPanel(PanelType.THEME);
|
||||
// GirlDetailPanel现在是subpanel,关闭自己即可
|
||||
NavigationManager.Instance.closeSubPanel(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -445,9 +446,9 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
}
|
||||
|
||||
// 回收所有使用中的节点到对象池
|
||||
for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) {
|
||||
DetailImageItemPool.Instance.put(this.imgsLayout.children[i]);
|
||||
}
|
||||
// for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) {
|
||||
// DetailImageItemPool.Instance.put(this.imgsLayout.children[i]);
|
||||
// }
|
||||
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export class NavigationPanel extends li_BaseView {
|
||||
private currentActivePanel: PanelType = PanelType.THEME;
|
||||
|
||||
private themeBtn: NavigationBtn;
|
||||
private girlDetailBtn: NavigationBtn;
|
||||
private rankBtn: NavigationBtn;
|
||||
private pastGirlListBtn: NavigationBtn;
|
||||
private settingBtn: NavigationBtn;
|
||||
|
||||
@@ -26,8 +26,7 @@ export class NavigationPanel extends li_BaseView {
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
|
||||
this.themeBtn = this._nodeTab.themeBtn.getComponent(NavigationBtn);
|
||||
this.girlDetailBtn =
|
||||
this._nodeTab.girlDetailBtn.getComponent(NavigationBtn);
|
||||
this.rankBtn = this._nodeTab.rankBtn.getComponent(NavigationBtn);
|
||||
this.pastGirlListBtn = this._nodeTab.chatBtn.getComponent(NavigationBtn);
|
||||
this.settingBtn = this._nodeTab.settingBtn.getComponent(NavigationBtn);
|
||||
this.loadingView = this._nodeTab.loadingView;
|
||||
@@ -54,8 +53,8 @@ export class NavigationPanel extends li_BaseView {
|
||||
this
|
||||
);
|
||||
GButton.BandClick(
|
||||
this.girlDetailBtn.node,
|
||||
() => NavigationManager.Instance.switchToPanel(PanelType.GIRL_DETAIL),
|
||||
this.rankBtn.node,
|
||||
() => NavigationManager.Instance.switchToPanel(PanelType.RANK),
|
||||
this
|
||||
);
|
||||
GButton.BandClick(
|
||||
@@ -108,9 +107,7 @@ export class NavigationPanel extends li_BaseView {
|
||||
);
|
||||
|
||||
this.themeBtn.setFocus(this.currentActivePanel === PanelType.THEME);
|
||||
this.girlDetailBtn.setFocus(
|
||||
this.currentActivePanel === PanelType.GIRL_DETAIL
|
||||
);
|
||||
this.rankBtn.setFocus(this.currentActivePanel === PanelType.RANK);
|
||||
this.pastGirlListBtn.setFocus(
|
||||
this.currentActivePanel === PanelType.PAST_GIRL_LIST
|
||||
);
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
_decorator,
|
||||
Label,
|
||||
Sprite,
|
||||
} from "cc";
|
||||
import { _decorator, isCCObject, Label, Node, Sprite } from "cc";
|
||||
import Utils from "../../../Main/Common/Utils";
|
||||
import li_BaseView from "../../../Main/Common/li_BaseView";
|
||||
import { GButton } from "../../../Main/Common/GButton";
|
||||
@@ -10,8 +6,7 @@ import { DataManager, DataId } from "../../data/DataManager";
|
||||
import { PlayerData } from "../../data/PlayerData";
|
||||
import { AccountData } from "../../data/AccountData";
|
||||
import { WalletData } from "../../data/WalletData";
|
||||
import LanguageUtils, {
|
||||
} from "../../../Main/Common/LanguageUtils";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import {
|
||||
NavigationManager,
|
||||
PageTransitionType,
|
||||
@@ -19,6 +14,7 @@ import {
|
||||
import { PlayerDataService } from "../../network/services/PlayerDataService";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
import { TipsPanel } from "./TipsPanel";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -41,6 +37,12 @@ export class PersonalPanel extends li_BaseView {
|
||||
@property(Sprite)
|
||||
private avatarSprite: Sprite = null;
|
||||
|
||||
@property([Node])
|
||||
private vipStuff: Node[] = [];
|
||||
|
||||
@property([Node])
|
||||
private notVipStuff: Node[] = [];
|
||||
|
||||
private playerData: PlayerData = null;
|
||||
private accountData: AccountData = null;
|
||||
private walletData: WalletData = null;
|
||||
@@ -79,6 +81,11 @@ export class PersonalPanel extends li_BaseView {
|
||||
if (this._nodeTab.settingBtn) {
|
||||
GButton.BandClick(this._nodeTab.settingBtn, this.openSettings, this);
|
||||
}
|
||||
|
||||
//
|
||||
if (this._nodeTab.favoritesBtn) {
|
||||
GButton.BandClick(this._nodeTab.favoritesBtn, this.openFavorites, this);
|
||||
}
|
||||
}
|
||||
|
||||
private async refresh() {
|
||||
@@ -125,20 +132,25 @@ export class PersonalPanel extends li_BaseView {
|
||||
}
|
||||
|
||||
private updateVipStatus(): void {
|
||||
let isVip = false;
|
||||
if (this.vipStatusLabel && this.walletData) {
|
||||
const vipExpire = this.walletData.vipExpire;
|
||||
if (vipExpire && vipExpire > Date.now()) {
|
||||
const expireDate = new Date(vipExpire);
|
||||
|
||||
this.vipStatusLabel.string = `${LanguageUtils.getText(
|
||||
"purchasepanel.vip_left"
|
||||
)} ${expireDate.toLocaleDateString()}`;
|
||||
if (vipExpire && this.walletData.isVip) {
|
||||
const leftTime = Utils.formatVipLeftTime(vipExpire);
|
||||
|
||||
this.vipStatusLabel.string = leftTime;
|
||||
|
||||
isVip = true;
|
||||
} else {
|
||||
this.vipStatusLabel.string = LanguageUtils.getText(
|
||||
"purchasepanel.notvip"
|
||||
);
|
||||
// this.vipStatusLabel.string = LanguageUtils.getText(
|
||||
// "purchasepanel.notvip"
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
this.vipStuff.forEach((n) => (n.active = isVip));
|
||||
this.notVipStuff.forEach((n) => (n.active = !isVip));
|
||||
}
|
||||
|
||||
private openSettings(): void {
|
||||
@@ -156,4 +168,8 @@ export class PersonalPanel extends li_BaseView {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private openFavorites() {
|
||||
TipsPanel.show("敬请期待~");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import { Web3PopPanel } from "./Web3PopPanel";
|
||||
import { TipsPanel } from "./TipsPanel";
|
||||
import { logger } from "db://assets/Scripts/Main/Common/Logger";
|
||||
import { PaymentMethod } from 'db://assets/Scripts/chat18x/payment/types';
|
||||
import { PaymentMethod } from "db://assets/Scripts/chat18x/payment/types";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -30,8 +30,6 @@ export class PurchasePanel extends li_BaseView {
|
||||
private vipPrice30: Label;
|
||||
private vipTime30: Label;
|
||||
|
||||
private ScrollView: ScrollView;
|
||||
|
||||
private currentPayType: proto.cs.EnmPayType =
|
||||
proto.cs.EnmPayType.EPT_Cash_INR;
|
||||
private defaultNetworkType: proto.cs.EnmNetworkType =
|
||||
@@ -44,9 +42,7 @@ export class PurchasePanel extends li_BaseView {
|
||||
}
|
||||
|
||||
cashBtnSelecting;
|
||||
cashBtnNotSelect;
|
||||
web3BtnSelecting;
|
||||
web3BtnNotSelect;
|
||||
|
||||
base: Node;
|
||||
openUIDataCT(data: any): void {
|
||||
@@ -66,12 +62,8 @@ export class PurchasePanel extends li_BaseView {
|
||||
this.vipPrice30 = this._nodeTab.vipPrice30.getComponent(Label);
|
||||
this.vipTime30 = this._nodeTab.vipTime30.getComponent(Label);
|
||||
|
||||
this.ScrollView = this._nodeTab.ScrollView.getComponent(ScrollView);
|
||||
|
||||
this.cashBtnSelecting = this._nodeTab.cashBtn.getChildByName("selecting");
|
||||
this.cashBtnNotSelect = this._nodeTab.cashBtn.getChildByName("notSelect");
|
||||
this.web3BtnSelecting = this._nodeTab.web3Btn.getChildByName("selecting");
|
||||
this.web3BtnNotSelect = this._nodeTab.web3Btn.getChildByName("notSelect");
|
||||
|
||||
this.bandBtn();
|
||||
|
||||
@@ -172,7 +164,6 @@ export class PurchasePanel extends li_BaseView {
|
||||
const memberId30 = this.shopData.get30DayMemberId();
|
||||
const price30 = this.shopData.getOriginalPriceById(memberId30);
|
||||
this.vipPrice30.string = `$ ${price30}`;
|
||||
this.ScrollView.scrollToBottom();
|
||||
}
|
||||
|
||||
// 0:cash 1:web3
|
||||
@@ -195,7 +186,12 @@ export class PurchasePanel extends li_BaseView {
|
||||
const isRechargeId = shopData.isRechargeId(id);
|
||||
if (isRechargeId) {
|
||||
// 需要外部支付进行购买
|
||||
this.startPayment(id, this.currentPayType, networkType, PaymentMethod.CashPay);
|
||||
this.startPayment(
|
||||
id,
|
||||
this.currentPayType,
|
||||
networkType,
|
||||
PaymentMethod.CashPay
|
||||
);
|
||||
}
|
||||
//测试用
|
||||
// Utils.sendInnerMsg(InnerMsgCode.PayOrderCreateSucc, {
|
||||
@@ -288,7 +284,12 @@ export class PurchasePanel extends li_BaseView {
|
||||
}
|
||||
|
||||
// 创建订单
|
||||
async startPayment(goodId: number, payType: number, network: number, payMethod: PaymentMethod) {
|
||||
async startPayment(
|
||||
goodId: number,
|
||||
payType: number,
|
||||
network: number,
|
||||
payMethod: PaymentMethod
|
||||
) {
|
||||
// 请求数据
|
||||
const reqData = {
|
||||
goodId,
|
||||
@@ -319,15 +320,15 @@ export class PurchasePanel extends li_BaseView {
|
||||
onClickCashBtn() {
|
||||
if (this.curPayType == 0) return;
|
||||
this.curPayType = 0;
|
||||
this.cashBtnSelecting.active = this.web3BtnNotSelect.active = true;
|
||||
this.cashBtnNotSelect.active = this.web3BtnSelecting.active = false;
|
||||
this.cashBtnSelecting.active = true;
|
||||
this.web3BtnSelecting.active = false;
|
||||
this.updateShops(0);
|
||||
}
|
||||
onClickWeb3Btn() {
|
||||
if (this.curPayType == 1) return;
|
||||
this.curPayType = 1;
|
||||
this.cashBtnSelecting.active = this.web3BtnNotSelect.active = false;
|
||||
this.cashBtnNotSelect.active = this.web3BtnSelecting.active = true;
|
||||
this.cashBtnSelecting.active = false;
|
||||
this.web3BtnSelecting.active = true;
|
||||
this.updateShops(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -372,9 +372,7 @@ export class ThemePanel extends li_BaseView {
|
||||
if (leftTime == null) {
|
||||
LanguageUtils.getText("purchasepanel.notvip");
|
||||
} else {
|
||||
this.vipLeftTime.string = LanguageUtils.getText(
|
||||
"purchasepanel.vip_left"
|
||||
).replace("${leftTime}", leftTime);
|
||||
this.vipLeftTime.string = leftTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user