update
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
import {_decorator, Component, math, Node, Sprite} from 'cc';
|
||||
import {Config18x, PicInfo} from "db://assets/Scripts/Main/Config/Config18x";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import PicType = Config18x.PicType;
|
||||
import ImageState = Config18x.ImageState;
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
import {GirlDetailPanel} from "db://assets/Scripts/test/GirlDetailPanel";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@ccclass('DetailImageItem')
|
||||
export class DetailImageItem extends Component {
|
||||
@property(Sprite)
|
||||
img: Sprite;
|
||||
|
||||
@property(Node)
|
||||
lock: Node;
|
||||
@property(Node)
|
||||
question: Node;
|
||||
|
||||
base:GirlDetailPanel;
|
||||
url:string;
|
||||
|
||||
onLoad()
|
||||
{
|
||||
GButton.BandClick(this.node,this.onClickThis,this);
|
||||
}
|
||||
|
||||
onClickThis()
|
||||
{
|
||||
let data = {url:this.url,closeFunc:()=>{
|
||||
this.base.setVideEnable(true);
|
||||
|
||||
}
|
||||
}
|
||||
if(this.url){
|
||||
ViewManager.I.openBundlesView('ShowPanel',data);
|
||||
this.base.setVideEnable(false);
|
||||
}
|
||||
}
|
||||
refresh(info: PicInfo,base:GirlDetailPanel) {
|
||||
this.base = base;
|
||||
this.lock.active = info.imageState === ImageState.Lock;
|
||||
this.question.active = info.imageState === ImageState.UnKnown
|
||||
|
||||
if (info.picType == PicType.LocalImage) {
|
||||
this.url = info.url;
|
||||
if (info.imageState !== ImageState.Release) {
|
||||
this.url += '_blured';
|
||||
if (info.imageState === ImageState.Lock)
|
||||
this.img.color = new math.Color(127, 127, 127, 255);
|
||||
else
|
||||
this.img.color = new math.Color(50, 50, 50, 255);
|
||||
|
||||
} else {
|
||||
this.img.color = new math.Color(255, 255, 255, 255);
|
||||
}
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.img, this.url, "Chat18x");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "74c99e6b-07c8-45f8-a14f-be20e3b47a61",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import {_decorator, Component, Label, Node, Sprite,} from "cc";
|
||||
import {_decorator, Component, Label, Node, Sprite, UITransform,} 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";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -34,13 +36,19 @@ export class GirlListItem extends Component {
|
||||
this.girlName.string = data.name;
|
||||
let desc = '';
|
||||
for (let i = 0; i < data.tag.length; i++) {
|
||||
desc += data.tag[i]+"/";
|
||||
if(i!=0) desc += "&";
|
||||
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;
|
||||
|
||||
ResManager.I.changeBundleSpriteFrame(this.avatar,data.pic.url,"Chat18x",()=>{
|
||||
let sizeTran = this.avatar.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize,this.avatar.node,2);
|
||||
});
|
||||
|
||||
for (let i = 0; i <5; i++) {
|
||||
this.starParent.children[i].active =(i<data.starCount);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { _decorator, Component, Node,instantiate } 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, GirlsData} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import { GirlsData} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -6,6 +6,12 @@ import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
interface ShowPanelData
|
||||
{
|
||||
url: string;
|
||||
closeFunc:Function;
|
||||
}
|
||||
|
||||
@ccclass('ShowPanel')
|
||||
export class ShowPanel extends li_BaseView {
|
||||
@property(Sprite)
|
||||
@@ -13,18 +19,34 @@ export class ShowPanel extends li_BaseView {
|
||||
@property(Sprite)
|
||||
splash:Sprite;
|
||||
|
||||
url:string;
|
||||
func:Function;
|
||||
openUIDataCT(data:ShowPanelData) {
|
||||
super.openUIDataCT(data);
|
||||
this.url = data.url;
|
||||
this.func = data.closeFunc;
|
||||
}
|
||||
|
||||
onLoadCT() {
|
||||
this.show("Image/1/naked_1");
|
||||
this.show(this.url);
|
||||
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
//this.splash.node.on(Node.EventType.TOUCH_START,this.onclickback);
|
||||
GButton.BandClick(this.splash.node,()=>{this.close()},this);
|
||||
GButton.BandClick(this.splash.node,this.onClose,this);
|
||||
}
|
||||
|
||||
|
||||
protected onClose() {
|
||||
if(this.func)
|
||||
{
|
||||
this.func();
|
||||
}
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
show(path:string)
|
||||
{
|
||||
ResManager.I.changeBundleSpriteFrame(this.image,path,"Chat18x",()=>{
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { _decorator, Component, Label, Node, Sprite } from 'cc';
|
||||
import { _decorator, Component, Label, Node, Sprite, UITransform } 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";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ThemeItem')
|
||||
@@ -11,22 +13,32 @@ export class ThemeItem extends Component {
|
||||
@property(Label)
|
||||
titleName:Label;
|
||||
|
||||
@property(Sprite)
|
||||
img:Sprite;
|
||||
|
||||
private id:number;
|
||||
|
||||
private isLocked:boolean;
|
||||
start()
|
||||
{
|
||||
}
|
||||
refresh(themeData:Theme)
|
||||
{
|
||||
this.lockImg.node.active = !themeData.isRelease;
|
||||
this.isLocked = !themeData.isRelease;
|
||||
this.titleName.string = themeData.name;
|
||||
this.id = themeData.themeId;
|
||||
ResManager.I.changeBundleSpriteFrame(this.img,themeData.pic.url,"Chat18x",()=>{
|
||||
let sizeTran = this.img.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize,this.img.node,2);
|
||||
});
|
||||
GButton.RemoveAndBandClick(this.node,this.OnClickThis,this);
|
||||
|
||||
}
|
||||
|
||||
OnClickThis()
|
||||
{
|
||||
if(this.isLocked){ return;}
|
||||
DemoManager.getInstance().EnterGirlList(this.id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import {_decorator, Component, Node, instantiate, Label, Sprite} from 'cc';
|
||||
import {_decorator, Component, Node, instantiate, Label, Sprite, UITransform} 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 { GirlsData, 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";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
|
||||
const {ccclass, property} = _decorator;
|
||||
|
||||
@@ -58,8 +59,16 @@ export class ThemePanel extends li_BaseView {
|
||||
this.cache.push(item);
|
||||
this.content.addChild(newNode);
|
||||
}
|
||||
}
|
||||
|
||||
const rectInfo = GirlsData[0];
|
||||
this.recId = rectInfo.id;
|
||||
this.recName.string = rectInfo.name;
|
||||
ResManager.I.changeBundleSpriteFrame(this.recSprite,rectInfo.pic.url,"Chat18x",()=>{
|
||||
let sizeTran = this.recSprite.node.parent.getComponent(UITransform);
|
||||
Utils.adjustBgPixelRatioToSize(sizeTran.contentSize,this.recSprite.node,2);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private registerListener() {
|
||||
GButton.BandClick(this._nodeTab.settingBtn, this.openSetting, this);
|
||||
@@ -70,7 +79,6 @@ export class ThemePanel extends li_BaseView {
|
||||
|
||||
chatWithRec() {
|
||||
DemoManager.getInstance().EnterChat(this.recId);
|
||||
|
||||
}
|
||||
|
||||
openSetting() {
|
||||
|
||||
Reference in New Issue
Block a user