12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- // Learn cc.Class:
- // - [Chinese] http://www.cocos.com/docs/creator/scripting/class.html
- // - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/class/index.html
- // Learn Attribute:
- // - [Chinese] http://www.cocos.com/docs/creator/scripting/reference/attributes.html
- // - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/reference/attributes/index.html
- // Learn life-cycle callbacks:
- // - [Chinese] http://www.cocos.com/docs/creator/scripting/life-cycle-callbacks.html
- // - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/life-cycle-callbacks/index.html
- cc.Class({
- extends: cc.Component,
- properties: {
- titleLabel: cc.Label,
- yinsiNode: cc.Node,
- xieyiNode: cc.Node,
- scrollJS1: cc.ScrollView,
- scrollJS2: cc.ScrollView,
- },
- // LIFE-CYCLE CALLBACKS:
- // onLoad () {},
- show (type) {
- this.node.active = true;
- this.yinsiNode.active = type == 1;
- this.xieyiNode.active = type == 2;
- let stri = "Política de Privacidade";
- if(type == 2) {
- stri = "Terms and conditions of use and services";
- this.scrollJS2.scrollToTop(0.1);
- }else{
- this.scrollJS1.scrollToTop(0.1);
- }
- this.titleLabel.string = stri;
- },
- onEventHideXieYi() {
- this.node.active = false;
- },
- // update (dt) {},
- });
|