import getSkinPath from "../../libs/new_wx/utils/getSkinPath";


export default class StartItem extends eui.ItemRenderer {
    constructor() {
        super();
        this.skinName = getSkinPath('Item');
    }

    dataChanged() {
        this.addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
            location.href = this.data.activityUrl;
        },this);
        this['img0'].visible=false;
        this['img2'].visible=false;
        this['img1'].visible=false;
        this['status0'].visible=false;
        this['status1'].visible=false;
        this['status2'].visible=false;
        this['status3'].visible=false;

        this[`status${this.data.userStatus}`].visible=true;
        this[`img${this.data.activityStatus}`].visible=true;

        if(this.data.userStatus==3) {
            this[`img${this.data.activityStatus}`].visible=false;
        }

        if(this.data.activityStatus == 2||this.data.activityStatus == 0) {
            if(this.data.userStatus!=3)
                this[`status${this.data.userStatus}`].visible=false;
        }
    }
}