| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import BaseUI from "../../../MOKA/component/BaseUI";
- import GameController from "../../GameController";
- import LoadingNode from "./LoadingNode";
- const { ccclass, menu, property } = cc._decorator;
- @ccclass
- export default class LoadingUI extends BaseUI {
- ui: LoadingNode = null;
- protected static prefabUrl = "module/loading/loading";
- protected static className = "LoadingUI";
- @property(cc.EditBox)
- lbl_usename: cc.EditBox = null;
- @property(cc.EditBox)
- lbl_server: cc.EditBox = null;
- @property(cc.Button)
- btn_login: cc.Button = null;
- @property(cc.ToggleContainer)
- toogle: cc.ToggleContainer = null;
- onLoad() {
- this.ui = this.node.addComponent(LoadingNode);
- let mac = GameController.storageData.getStorage("testmac", 1);
- this.lbl_usename.string = mac == null ? "c9:65:e2:1c:b0:23" : mac;
- }
- disPlayloginBtn() {
- this.btn_login.node.active = true;
- }
- clickLogin() {
- GameController.http.mac = this.lbl_usename.string;
- GameController.http.serverUrl = this.lbl_server.string;
- GameController.storageData.setStorage("testmac", GameController.http.mac, 1);
- GameController.login();
- }
- clickServer(){
- if(this.toogle.toggleItems[0].isChecked){
- this.lbl_server.string = 'https://tafang-test.duiweize.com/';
- }
- else{
- this.lbl_server.string = 'http://172.16.15.167:9092/';
- GameController.commonData.appid = 'wxef592f91d2d15555';
- GameController.commonData.version = '1.0';
- }
- }
- start() {
- }
- setProgress(percent: number) {
- this.ui.node_chuan.getComponent(cc.Sprite).fillRange = percent;
- let x = this.ui.node_chuan.width * percent;
- this.ui.img_chuan.setPosition(x, this.ui.img_chuan.y);
- this.setLoadingStr("加载不耗流量 " + (percent * 100) + "%");
- }
- setLoadingStr(str) {
- this.ui.lbl_loading.getComponent(cc.Label).string = str;
- }
- setTips(str) {
- this.ui.lbl_tips.getComponent(cc.Label).string = str;
- }
- }
|