68 lines
1.9 KiB
TypeScript
68 lines
1.9 KiB
TypeScript
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 "./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");
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|