"use strict";
cc._RF.push(module, '92111lzIiBKVpFnK33PbaJU', 'pageview');
// Script/pageview.js

"use strict";

cc.Class({
    extends: cc.Component,
    properties: {
        pageview: {
            default: null,
            type: cc.PageView
        },
        label_custom: {
            default: null,
            type: cc.Label
        },
        znbg: {
            default: null,
            type: cc.Label
        },
        wlxy: {
            default: null,
            type: cc.Label
        },
        zwzc: {
            default: null,
            type: cc.Label
        },
        qyzc: {
            default: null,
            type: cc.Label
        },
        label0: {
            default: null,
            type: cc.Label
        },
        label1: {
            default: null,
            type: cc.Label
        },
        label2: {
            default: null,
            type: cc.Label
        },
        label3: {
            default: null,
            type: cc.Label
        },
        label4: {
            default: null,
            type: cc.Label
        },
        label5: {
            default: null,
            type: cc.Label
        },
        label6: {
            default: null,
            type: cc.Label
        },
        move_mask: {
            default: null,
            type: cc.Mask
        },

        layout: {
            default: null,
            type: cc.Layout
        }

    },

    // use this for initialization
    onLoad: function onLoad() {
        this.initPageIndex();
    },

    initPageIndex: function initPageIndex() {

        var currentPageIndex = this.pageview.getCurrentPageIndex();
        if (currentPageIndex == 0) {
            this.setColor(this.znbg.node);
        }
        if (currentPageIndex == 1) {
            this.setColor(this.wlxy.node);
        }
        if (currentPageIndex == 2) {
            this.setColor(this.zwzc.node);
        }
        if (currentPageIndex == 3) {
            this.setColor(this.qyzc.node);
        }
    },
    setColor: function setColor(label) {
        this.znbg.node.color = cc.color(255, 255, 255);
        this.wlxy.node.color = cc.color(255, 255, 255);
        this.zwzc.node.color = cc.color(255, 255, 255);
        this.qyzc.node.color = cc.color(255, 255, 255);
        label.color = cc.color(255, 0, 0);
    },
    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },

    onclick_custom: function onclick_custom(event, customEventData) {
        this.pageview.scrollToPage(customEventData, 0.3);
    }
});

cc._RF.pop();