| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import SubHallManger from '../view/SubHallManger'
- cc.Class({
- extends: SubHallManger,
- properties: {
- gamesNode:cc.Node,
- webview: cc.WebView,
- },
- onLoad(){
- // cc.vv.userMgr.agentLogin(this.gameid,function (ret) {
- // this.reqSuccess(ret)
- // }.bind(this))
- },
- onWebFinishLoad: function (sender, event) {
- var loadStatus = "";
- if (event === cc.WebView.EventType.LOADED) {
- loadStatus = " is loaded!";
- } else if (event === cc.WebView.EventType.LOADING) {
- loadStatus = " is loading!";
- } else if (event === cc.WebView.EventType.ERROR) {
- loadStatus = ' load error!';
- }
- console.log(loadStatus)
- },
-
- // setView(gameid){
- // this.gameid = gameid
- // },
- initScene()
- {
- cc.vv.userMgr.agentLogin(this.gameid,function (ret) {
- this.reqSuccess(ret)
- }.bind(this))
- },
- reqSuccess(ret){
- if(ret.status !== 1){
- this.visitURL('http://sports.meme100.com/m/#/')
- }else{
- this.visitURL(ret.data.url)
- }
-
- },
- visitURL: function (url) {
- this.webview.url = url;
- }
- });
|