|
@@ -1,4 +1,4 @@
|
|
-import { _decorator, Component, Label, Node } from 'cc';
|
|
|
|
|
|
+import { _decorator, Component, Label, Node, Sprite, SpriteFrame } from 'cc';
|
|
import { att_count_down } from '../../../data/data';
|
|
import { att_count_down } from '../../../data/data';
|
|
import { view_ui_att_item } from './view_ui_att_item';
|
|
import { view_ui_att_item } from './view_ui_att_item';
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
@@ -10,6 +10,9 @@ export class count_down extends Component {
|
|
@property(Node) ProgressBar_Bar:Node = null;
|
|
@property(Node) ProgressBar_Bar:Node = null;
|
|
@property(Node) img_text:Node = null;
|
|
@property(Node) img_text:Node = null;
|
|
@property(Node) lab_time:Node = null;
|
|
@property(Node) lab_time:Node = null;
|
|
|
|
+ @property(SpriteFrame) sf_ProgressBar_Bg_default:SpriteFrame = null;
|
|
|
|
+ @property(SpriteFrame) sf_ProgressBar_Bar_default:SpriteFrame = null;
|
|
|
|
+ @property(SpriteFrame) sf_img_text_default:SpriteFrame = null;
|
|
public initView(data:att_count_down){
|
|
public initView(data:att_count_down){
|
|
this.m_data = data;
|
|
this.m_data = data;
|
|
this.updateView(this.m_data)
|
|
this.updateView(this.m_data)
|
|
@@ -25,6 +28,16 @@ export class count_down extends Component {
|
|
|
|
|
|
this.img_text.getComponent(view_ui_att_item).updateAtt(this.m_data.img_text)
|
|
this.img_text.getComponent(view_ui_att_item).updateAtt(this.m_data.img_text)
|
|
this.m_data.img_text = this.img_text.getComponent(view_ui_att_item).getData()
|
|
this.m_data.img_text = this.img_text.getComponent(view_ui_att_item).getData()
|
|
|
|
+
|
|
|
|
+ if(this.m_data.ProgressBar_Bar.res.length==0||this.m_data.ProgressBar_Bar.res_name.length==0) {
|
|
|
|
+ this.ProgressBar_Bar.getComponent(view_ui_att_item).getComponent(Sprite).spriteFrame = this.sf_ProgressBar_Bar_default
|
|
|
|
+ }
|
|
|
|
+ if(this.m_data.ProgressBar_Bg.res.length==0||this.m_data.ProgressBar_Bg.res_name.length==0) {
|
|
|
|
+ this.ProgressBar_Bg.getComponent(view_ui_att_item).getComponent(Sprite).spriteFrame = this.sf_ProgressBar_Bg_default
|
|
|
|
+ }
|
|
|
|
+ if(this.m_data.img_text.res.length==0||this.m_data.img_text.res_name.length==0) {
|
|
|
|
+ this.img_text.getComponent(view_ui_att_item).getComponent(Sprite).spriteFrame = this.sf_img_text_default
|
|
|
|
+ }
|
|
|
|
|
|
if(this.m_data.time_count>0){
|
|
if(this.m_data.time_count>0){
|
|
this.lab_time.getComponent(Label).string = `${this.m_data.time_count}秒`
|
|
this.lab_time.getComponent(Label).string = `${this.m_data.time_count}秒`
|