This commit is contained in:
zhuguoqing 2022-05-25 21:16:26 +08:00
parent a49cff7fa0
commit bc1d37b98a
5 changed files with 85 additions and 90 deletions

View File

@ -22,7 +22,7 @@ export var allBaseNet = {
japan: '-z2-test.cebg.games', japan: '-z2-test.cebg.games',
singapore: '-z3-test.cebg.games', singapore: '-z3-test.cebg.games',
turkey: '-z4-test.cebg.games', turkey: '-z4-test.cebg.games',
test: '-test.kingsome.cn', // test: '-test.kingsome.cn',
}; };
const netIdHash = (function () { const netIdHash = (function () {

View File

@ -131,6 +131,8 @@ cc.Class({
} }
}, },
refreshwait(data) { refreshwait(data) {
console.log(`队伍信息---${data}`);
for (var i = 0; i < 4; i++) { for (var i = 0; i < 4; i++) {
var name = ''; var name = '';
var headid = ''; var headid = '';

View File

@ -1,34 +1,32 @@
var Utils = require("Utils") var Utils = require('Utils');
cc.Class({ cc.Class({
extends: cc.Component, extends: cc.Component,
properties: { properties: {
lb_name: { lb_name: {
default: null, default: null,
type: cc.Label type: cc.Label,
}, },
sp_icon: { sp_icon: {
default: null, default: null,
type: cc.Sprite type: cc.Sprite,
}, },
sp_frame: { sp_frame: {
default: null, default: null,
type: cc.Sprite type: cc.Sprite,
}, },
}, },
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
// onLoad () {}, // onLoad () {},
start() { start() {},
initdata(obj) {
this.lb_name.string = obj.name;
Utils.setitem(this, obj.headid, this.sp_icon);
Utils.setitem(this, obj.head_frame, this.sp_frame);
},
}, // update (dt) {},
initdata(obj) { });
this.lb_name.string = obj.name
Utils.setitem(this, obj.headid, this.sp_icon)
Utils.setitem(this, obj.head_frame, this.sp_frame)
}
// update (dt) {},
});

View File

@ -266,9 +266,9 @@ cc.Class({
this.allCountry[data]; this.allCountry[data];
} }
if (cc.sys.isBrowser) { // if (cc.sys.isBrowser) {
localStorage.setItem('currentNet', allBaseNet.test); // localStorage.setItem('currentNet', allBaseNet.test);
} // }
getSwitch(() => { getSwitch(() => {
if (!Config.isTest) { if (!Config.isTest) {

View File

@ -7,68 +7,63 @@
// Learn life-cycle callbacks: // Learn life-cycle callbacks:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html // - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
var SDKManage = require("SDKManage") var SDKManage = require('SDKManage');
const {ccclass, property} = cc._decorator; const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class httpTest extends cc.Component { export default class httpTest extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
// LIFE-CYCLE CALLBACKS: start() {
// this.node.getComponent(cc.Button).interactable = false;
// this.node.getComponent(cc.ScrollView).stopAutoScroll
//cc.Notifier.on('refreshcpa', this, this.refresh.bind(this));
// cc.Notifier.on("testPhpFunc",this,this.testCallBack.bind(this));
// let tmpData =
// {
// "name":"匹诺曹和白雪公主"
// }
// this.scheduleOnce(()=>{
// SDKManage.sendMsgToPhpServer("TestPhp","testPhpFunc",tmpData,this.httpCallBack);
// },2);
// console.log("开始测试Http====02=");
//
//数字描述 1 = 普通树 3 = 路 4 = 浆果 5 = 平原到雪山过度带 6 = 过渡带中心 7 = 雪山到平原过度带
// 8 = 苹果树 9 农作物
//少量矿石,水果正常,农作物较多,小动物较多,树正常 草正常-
//7 7 7 7 7 3 7 7 7 7 7 7 7 7 3 7 7 7 7 7//雪山到平原过度带
//6 6 6 6 6 3 3 3 6 6 6 6 6 6 3 3 3 6 6 6//平原雪山 过度带中心
//5 5 5 5 5 5 5 3 5 5 5 5 5 5 5 5 3 5 5 5//平原到雪山过度带
//3 0 0 1 1 1 0 3 0 0 3 3 3 3 0 11 3 8 1 0
//3 3 3 8 8 1 0 3 9 0 3 8 0 3 3 3 3 8 1 0
//4 4 3 1 1 1 0 3 3 3 3 8 0 3 0 0 4 4 4 4
//4 4 3 0 0 0 0 3 4 4 1 8 1 0 9 1 1 0 0 4
//4 3 3 3 3 3 3 3 0 0 1 0 0 3 3 3 3 3 3 3
//4 3 8 1 1 1 0 0 3 3 3 3 3 3 1 0 0 3 0 0
//1 3 8 0 0 1 0 0 3 0 8 0 0 3 0 0 1 3 0 0
//0 3 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0
//0 3 0 9 9 9 9 9 9 9 9 0 0 3 0 9 9 0 0
//0 3 0 0 0 0 0 0 0 9 8 0 0 3 0 0 0 0 0 0
//1 3 3 3 3 3 3 3 3 9 8 0 0 3 1 0 0 3 0 0
//1 1 1 4 3 0 8 8 8 9 8 3 3 3 3 3 3 3 3 3
//1 1 1 4 3 1 1 1 0 3 3 3 0 0 0 4 4 4 4 4
//1 1 1 4 3 0 0 0 0 0 0 3 0 0 0 4 4 4 4 4
// onLoad () {} this.getComponent('tableView').initTableView(2, {
array: null,
start () { target: this,
// this.node.getComponent(cc.ScrollView).stopAutoScroll });
//cc.Notifier.on('refreshcpa', this, this.refresh.bind(this)); }
// cc.Notifier.on("testPhpFunc",this,this.testCallBack.bind(this)); httpCallBack(_code, _msg, _data) {
// let tmpData = if (!_code) {
// { console.log('HttpBack======', _data);
// "name":"匹诺曹和白雪公主" }
// } }
// this.scheduleOnce(()=>{ testCallBack(_data) {
// SDKManage.sendMsgToPhpServer("TestPhp","testPhpFunc",tmpData,this.httpCallBack); console.log('测试Http====', _data);
// },2); }
// console.log("开始测试Http====02="); // update (dt) {}
// //
//数字描述 1 = 普通树 3 = 路 4 = 浆果 5 = 平原到雪山过度带 6 = 过渡带中心 7 = 雪山到平原过度带
// 8 = 苹果树 9 农作物
//少量矿石,水果正常,农作物较多,小动物较多,树正常 草正常-
//7 7 7 7 7 3 7 7 7 7 7 7 7 7 3 7 7 7 7 7//雪山到平原过度带
//6 6 6 6 6 3 3 3 6 6 6 6 6 6 3 3 3 6 6 6//平原雪山 过度带中心
//5 5 5 5 5 5 5 3 5 5 5 5 5 5 5 5 3 5 5 5//平原到雪山过度带
//3 0 0 1 1 1 0 3 0 0 3 3 3 3 0 11 3 8 1 0
//3 3 3 8 8 1 0 3 9 0 3 8 0 3 3 3 3 8 1 0
//4 4 3 1 1 1 0 3 3 3 3 8 0 3 0 0 4 4 4 4
//4 4 3 0 0 0 0 3 4 4 1 8 1 0 9 1 1 0 0 4
//4 3 3 3 3 3 3 3 0 0 1 0 0 3 3 3 3 3 3 3
//4 3 8 1 1 1 0 0 3 3 3 3 3 3 1 0 0 3 0 0
//1 3 8 0 0 1 0 0 3 0 8 0 0 3 0 0 1 3 0 0
//0 3 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0
//0 3 0 9 9 9 9 9 9 9 9 0 0 3 0 9 9 0 0
//0 3 0 0 0 0 0 0 0 9 8 0 0 3 0 0 0 0 0 0
//1 3 3 3 3 3 3 3 3 9 8 0 0 3 1 0 0 3 0 0
//1 1 1 4 3 0 8 8 8 9 8 3 3 3 3 3 3 3 3 3
//1 1 1 4 3 1 1 1 0 3 3 3 0 0 0 4 4 4 4 4
//1 1 1 4 3 0 0 0 0 0 0 3 0 0 0 4 4 4 4 4
this.getComponent("tableView").initTableView(2, {
array: null,
target: this
});
}
httpCallBack(_code,_msg,_data)
{
if(!_code)
{
console.log("HttpBack======",_data);
}
}
testCallBack(_data)
{
console.log("测试Http====",_data);
}
// update (dt) {}
//
} }