pubgv3/assets/scripts/ts/httpTest.ts
zhuguoqing bc1d37b98a update
2022-05-25 21:16:26 +08:00

70 lines
2.7 KiB
TypeScript

// Learn TypeScript:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/typescript.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
// - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - [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
var SDKManage = require('SDKManage');
const { ccclass, property } = cc._decorator;
@ccclass
export default class httpTest extends cc.Component {
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
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
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) {}
//
}