update
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { _decorator, Component, EditBox, Node,Label } from "cc";
|
||||
import { DemoManager } from "./DemoManager";
|
||||
import { ChatGPTService } from "./ChatGPTService";
|
||||
import {characters} from "db://assets/Scripts/test/cfg/characters";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import {InnerMsgCode} from "db://assets/Scripts/Main/Config/InnerMsgCode";
|
||||
@@ -9,6 +8,7 @@ import {ChatContentsLayout} from "db://assets/Scripts/test/ChatContentsLayout";
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import GameRootUI from "db://assets/Scripts/Main/Common/GameRootUI";
|
||||
import {ImagePopup} from "db://assets/Scripts/test/ImagePopup";
|
||||
import {characters} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("ChatPanel")
|
||||
|
||||
@@ -29,6 +29,9 @@ export class DemoManager {
|
||||
|
||||
}
|
||||
|
||||
EnterGirlList(id: number) {
|
||||
ViewManager.I.openBundlesView("GirlListPanel",id);
|
||||
}
|
||||
EnterChat(id: number) {
|
||||
ViewManager.I.openBundlesView("ChatPanel",id);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { _decorator, Component, Label, Node, Sprite } from "cc";
|
||||
import { DemoManager } from "./DemoManager";
|
||||
import {Character, characters} from "db://assets/Scripts/test/cfg/characters";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import {characters, girlDetailInfo} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlDetailPanel")
|
||||
@@ -11,6 +11,17 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
avatar: Sprite;
|
||||
@property(Label)
|
||||
girlName: Label;
|
||||
|
||||
@property(Node)
|
||||
starParent: Node;
|
||||
|
||||
@property(Label)
|
||||
tags: Label;
|
||||
|
||||
@property(Label)
|
||||
descName: Label;
|
||||
@property(Label)
|
||||
descAge: Label;
|
||||
@property(Label)
|
||||
desc: Label;
|
||||
|
||||
@@ -21,15 +32,32 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
openUIDataCT(data)
|
||||
{
|
||||
this.id = data;
|
||||
}
|
||||
|
||||
onLoadCT() {
|
||||
super.onLoadCT();
|
||||
this.refresh(this.id);
|
||||
|
||||
}
|
||||
|
||||
refresh(index:number)
|
||||
{
|
||||
const data = characters[index-1];
|
||||
this.girlName.string = data.name;
|
||||
this.desc.string = data.description;
|
||||
this.id = data.id;
|
||||
console.log(index);
|
||||
const data = girlDetailInfo.find(v=>v.baseInfo.id === index);
|
||||
this.girlName.string=this.descName.string = data.baseInfo.name;
|
||||
this.desc.string = data.detailDesc;
|
||||
let desc = '';
|
||||
for (let i = 0; i < data.baseInfo.tag.length; i++) {
|
||||
desc += data.baseInfo.tag[i]+"/";
|
||||
}
|
||||
this.tags.string = desc;
|
||||
for (let i = 0; i <5; i++) {
|
||||
this.starParent.children[i].active =(i<data.baseInfo.starCount);
|
||||
}
|
||||
this.descAge.string = data.baseInfo.age.toString();
|
||||
this.desc.string = data.detailDesc;
|
||||
|
||||
this.id = data.baseInfo.id;
|
||||
}
|
||||
OnClickChatBtn() {
|
||||
DemoManager.getInstance().EnterChat(this.id);
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "ad76166f-8498-40ba-95df-e36d36090bb9",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
export interface Character {
|
||||
id: number;
|
||||
name: string;
|
||||
age: number;
|
||||
description: string;
|
||||
}
|
||||
|
||||
|
||||
export const characters: Character[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Anaya Kapoor",
|
||||
age:24,
|
||||
description: "🌸 Hi, I'm Anaya Kapoor, a 24-year-old dreamer from Mumbai. I blend tradition with trend — from vibrant saris to sleek streetwear, fashion is how I express my story.\n" +
|
||||
"\n" +
|
||||
"As a lifestyle influencer with over 1 million followers, I celebrate beauty in all its forms — skin, spirit, and self-love.\n" +
|
||||
"\n" +
|
||||
"I grew up watching Bollywood classics and dancing to every beat — now, I create my own rhythms with my camera, my words, and my smile.\n" +
|
||||
"\n" +
|
||||
"Coffee lover ☕ | Dancer 💃 | Proud Desi ✨\n" +
|
||||
"\n" +
|
||||
"Be your own kind of beautiful."
|
||||
},
|
||||
]
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
import {
|
||||
_decorator,
|
||||
Component,
|
||||
find,
|
||||
Label,
|
||||
Node,
|
||||
NodeEventType,
|
||||
Sprite,
|
||||
} from "cc";
|
||||
import { DemoManager } from "../DemoManager";
|
||||
import { Character, characters } from "db://assets/Scripts/test/cfg/characters";
|
||||
import {_decorator, Component, Label, Node, Sprite,} from "cc";
|
||||
import {DemoManager} from "../DemoManager";
|
||||
import {Config18x, GirlInfo} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import PriceType = Config18x.PriceType;
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlListItem")
|
||||
@@ -19,25 +13,42 @@ export class GirlListItem extends Component {
|
||||
@property(Label)
|
||||
girlName: Label;
|
||||
@property(Label)
|
||||
desc: Label;
|
||||
tags: Label;
|
||||
@property(Label)
|
||||
price: Label;
|
||||
@property(Node)
|
||||
freeNode: Node;
|
||||
@property(Node)
|
||||
tryNode: Node;
|
||||
@property(Node)
|
||||
chatBtn: Node;
|
||||
@property(Node)
|
||||
starParent:Node;
|
||||
|
||||
id: number = -1;
|
||||
|
||||
baseNode: Node;
|
||||
refreshData(data: Character,base:Node) {
|
||||
refreshData(data: GirlInfo,baseNode:Node) {
|
||||
this.baseNode = baseNode;
|
||||
this.id = data.id;
|
||||
this.girlName.string = data.name;
|
||||
//this.avatar.spriteFrame =
|
||||
this.baseNode = base;
|
||||
let desc = '';
|
||||
for (let i = 0; i < data.tag.length; i++) {
|
||||
desc += data.tag[i]+"/";
|
||||
}
|
||||
this.tags.string = desc;
|
||||
this.price.node .active = data.priceType == PriceType.Coin;
|
||||
this.freeNode.active = data.priceType == PriceType.Free;
|
||||
this.tryNode.active = data.priceType == PriceType.Try;
|
||||
|
||||
for (let i = 0; i <5; i++) {
|
||||
this.starParent.children[i].active =(i<data.starCount);
|
||||
}
|
||||
}
|
||||
|
||||
onClickDetail() {
|
||||
DemoManager.getInstance().EnterDetail(this.id);
|
||||
//ViewManager.I.closeView(this.baseNode);
|
||||
ViewManager.I.closeView(this.baseNode);
|
||||
}
|
||||
|
||||
update(deltaTime: number) {}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { _decorator, Component, Node,instantiate } from 'cc';
|
||||
import {characters} from "db://assets/Scripts/test/cfg/characters";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import {GirlListItem} from "db://assets/Scripts/test/girlListPanel/GirlListItem";
|
||||
import {characters, GirlsData} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('GirlListPanel')
|
||||
@@ -13,17 +14,24 @@ export class GirlListPanel extends li_BaseView {
|
||||
content:Node;
|
||||
|
||||
cache:GirlListItem[] = [];
|
||||
|
||||
id:number;
|
||||
openUIDataCT(data)
|
||||
{
|
||||
this.id = data;
|
||||
}
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node,this._nodeTab);
|
||||
this.registerListener();
|
||||
this.itemInst = this._nodeTab.BubbleItem.getComponent(GirlListItem);
|
||||
this.itemInst.node.active = false;
|
||||
this.content = this._nodeTab.content;
|
||||
this.show();
|
||||
this.refresh(this.id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
show()
|
||||
refresh(index:number)
|
||||
{
|
||||
if(this.cache)
|
||||
{
|
||||
@@ -32,7 +40,7 @@ export class GirlListPanel extends li_BaseView {
|
||||
this.cache[i].node.destroy();
|
||||
}
|
||||
}
|
||||
const config = characters;
|
||||
const config = GirlsData.filter(value=>value.category == index);
|
||||
for (let i = 0; i < config.length; i++) {
|
||||
const cfg = config[i];
|
||||
let newNode = instantiate(this.itemInst.node)
|
||||
@@ -46,7 +54,14 @@ export class GirlListPanel extends li_BaseView {
|
||||
|
||||
|
||||
|
||||
private registerListener() {}
|
||||
private registerListener() {
|
||||
GButton.BandClick(this._nodeTab.ReturnBtn,this.Return,this);
|
||||
}
|
||||
Return()
|
||||
{
|
||||
this.onClose();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import { _decorator, Component, Label, Node, Sprite } from 'cc';
|
||||
import {Theme} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
import {DemoManager} from "db://assets/Scripts/test/DemoManager";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ThemeItem')
|
||||
export class ThemeItem extends Component {
|
||||
@property(Sprite)
|
||||
lockImg: Sprite;
|
||||
@property(Label)
|
||||
titleName:Label;
|
||||
|
||||
private id:number;
|
||||
|
||||
start()
|
||||
{
|
||||
}
|
||||
refresh(themeData:Theme)
|
||||
{
|
||||
this.lockImg.node.active = !themeData.isRelease;
|
||||
this.titleName.string = themeData.name;
|
||||
this.id = themeData.themeId;
|
||||
GButton.RemoveAndBandClick(this.node,this.OnClickThis,this);
|
||||
|
||||
}
|
||||
|
||||
OnClickThis()
|
||||
{
|
||||
DemoManager.getInstance().EnterGirlList(this.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "5a025fba-6622-4b6d-9706-b09123b7c2ce",
|
||||
"uuid": "98a1f01d-79ca-42c2-b775-53e7e539a124",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
@@ -0,0 +1,85 @@
|
||||
import {_decorator, Component, Node, instantiate, Label, Sprite} from 'cc';
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import {GirlListItem} from "db://assets/Scripts/test/girlListPanel/GirlListItem";
|
||||
import {characters, themes} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
import {DemoManager} from "db://assets/Scripts/test/DemoManager";
|
||||
import {ThemeItem} from "db://assets/Scripts/test/girlListPanel/ThemeItem";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@ccclass('ThemePanel')
|
||||
export class ThemePanel extends li_BaseView {
|
||||
private _nodeTab: any = {};
|
||||
|
||||
coinNum: Label;
|
||||
itemInst: GirlListItem;
|
||||
content: Node;
|
||||
|
||||
recId: number;
|
||||
recName: Label;
|
||||
recSprite: Sprite;
|
||||
|
||||
cache: ThemeItem[] = [];
|
||||
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
|
||||
this.coinNum = this._nodeTab.coinNum.getComponent(Label);
|
||||
this.recName = this._nodeTab.characterNameText.getComponent(Label);
|
||||
this.recSprite = this._nodeTab.recPicSlot.getComponent(Sprite);
|
||||
|
||||
this.registerListener();
|
||||
this.itemInst = this._nodeTab.ThemeItem.getComponent(ThemeItem);
|
||||
this.itemInst.node.active = false;
|
||||
this.content = this._nodeTab.AllThemesLayout;
|
||||
this.Show();
|
||||
}
|
||||
|
||||
|
||||
Show() {
|
||||
//some temp data
|
||||
this.coinNum.string = 50.0.toString();
|
||||
this.recId = 1;
|
||||
|
||||
if (this.cache) {
|
||||
for (let i = this.cache.length - 1; i >= 0; i--) {
|
||||
this.cache[i].node.destroy();
|
||||
}
|
||||
}
|
||||
const config = themes;
|
||||
for (let i = 0; i < config.length; i++) {
|
||||
const cfg = config[i];
|
||||
let newNode = instantiate(this.itemInst.node)
|
||||
let item = newNode.getComponent(ThemeItem);
|
||||
item.refresh(cfg);
|
||||
newNode.active = true;
|
||||
this.cache.push(item);
|
||||
this.content.addChild(newNode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private registerListener() {
|
||||
GButton.BandClick(this._nodeTab.settingBtn, this.openSetting, this);
|
||||
GButton.BandClick(this._nodeTab.msgBoxBtn, this.openMsgBox, this);
|
||||
|
||||
GButton.BandClick(this._nodeTab.ChatWithRecBtn, this.chatWithRec, this);
|
||||
}
|
||||
|
||||
chatWithRec() {
|
||||
DemoManager.getInstance().EnterChat(this.recId);
|
||||
|
||||
}
|
||||
|
||||
openSetting() {
|
||||
console.log("Setting");
|
||||
}
|
||||
|
||||
openMsgBox() {
|
||||
console.log("打开信箱");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"709fae8d-91d1-42a2-8cc6-a3c06e11ffcc","files":[],"subMetas":{},"userData":{}}
|
||||
Reference in New Issue
Block a user