Commit c5db0784 authored by wildfirecode13's avatar wildfirecode13

u

parent 4c5a133a
{
"code": null,
"data": {
"extra": null,
"options": [
{
"extra": null,
"optionId": "deserunt",
"optionImg": "consequat Ut",
"optionName": "magna eu do",
"position": -45488243,
"prizeId": "est adipisicing irure qui cillum",
"prizeType": -61249868,
"ruleId": "nisi aute ut",
"sendCount": -86055442,
"url": "anim qui",
"userRecordId": -31001876
},
{
"extra": null,
"optionId": "et esse laborum",
"optionImg": "mollit eiusmod et ullamco cillum",
"optionName": "aliquip dolore qui nulla",
"position": -13810392,
"prizeId": "non labore eiusmod consequat",
"prizeType": -25600732,
"ruleId": "fugiat minim in adipisicing",
"sendCount": 3860338,
"url": "eu veniam ipsum tempor",
"userRecordId": -15254782
}
]
},
"message": null,
"success": false
}
\ No newline at end of file
{ {
"code": null, "code": null,
"data": { "data": {
"surplusCount": 1, "surplusCount": -20577795,
"credits": 100, "credits": -89490523,
"needCredits": 10, "needCredits": -51255361,
"type": 2 "type": 2,
"isMember":1
}, },
"message": null, "message": null,
"success": true "success": 1
} }
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": {
"ruleIdList": [
"ru_1",
"ru_2",
"ru_3",
"ru_4"
],
"drawStatus": 12,
"prizeId": "aa",
"gameCounts": 1
}
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": 1234
}
\ No newline at end of file
{
"success": true,
"message": "",
"code": "",
"data": {
"type": 1,
"status": 1,
"prize": {
"prizeId": "sp_1",
"prizeType": 1,
"optionId": "sdhjfhjhjjj",
"optionName": "10元话费",
"optionImg": "https://www.baidu.com/xxoo2.png",
"userRecordId": 1235,
"url": "https://www.baidu.com/order/1235"
}
}
}
\ No newline at end of file
...@@ -71,6 +71,7 @@ export class Main { ...@@ -71,6 +71,7 @@ export class Main {
//加载通用资源 //加载通用资源
await RES.loadGroup("common"); await RES.loadGroup("common");
await RES.loadGroup("svga"); await RES.loadGroup("svga");
await sendWebNet(WebNetName.index);
console.log("通用资源加载完成") console.log("通用资源加载完成")
//h5环境时,隐藏加载中 //h5环境时,隐藏加载中
if (FYGE.getEnv() == "web" && document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none"; if (FYGE.getEnv() == "web" && document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none";
......
...@@ -4,18 +4,8 @@ ...@@ -4,18 +4,8 @@
*/ */
export enum WebNetName { export enum WebNetName {
login = "/customActivity/disu/login", login = "/customActivity/disu/login",
/**
* 首页
*/
index = "/projectx/{projectId}/game/index.do",
/**
* 参与
*/
join = "/projectx/{projectId}/game/join.do",
/**
* 获取结果
*/
queryResult = "/projectx/{projectId}/game/queryResult.do",
/** /**
* 获取规则 * 获取规则
*/ */
...@@ -23,5 +13,7 @@ ...@@ -23,5 +13,7 @@
/** /**
* 获取首页数据 * 获取首页数据
*/ */
projectIndex = "/projectx/{projectId}/dazzle/index.do" index = "/projectx/{projectId}/dazzle/index.do",
drawPrize = "/projectx/{projectId}/dazzle/drawPrize.do",
getFreeCount = "/projectx/{projectId}/dazzle/getFreeCount.do"
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ import { RulePanel } from "../panels/RulePanel"; ...@@ -14,7 +14,7 @@ import { RulePanel } from "../panels/RulePanel";
import { Box } from "./Box"; import { Box } from "./Box";
import { BoxGroup } from "./BoxGroup"; import { BoxGroup } from "./BoxGroup";
import { ScrollItem } from "./ScrollItem"; import { ScrollItem } from "./ScrollItem";
import { sendWebNet } from "../WebNet"; import { getWebData, sendWebNet } from "../WebNet";
import { WebNetName } from "../WebNetName"; import { WebNetName } from "../WebNetName";
...@@ -27,25 +27,25 @@ export class IndexScene extends Scene { ...@@ -27,25 +27,25 @@ export class IndexScene extends Scene {
constructor() { constructor() {
super(); super();
} }
start() { start() {
super.start(); super.start();
this.getIndex(); this.getIndex();
// showPanel(SharePanel); // showPanel(SharePanel);
getObject(this,'index_sharetips').visible=false; getObject(this, 'index_sharetips').visible = false;
this.initContainer(); this.initContainer();
this.initmask(); this.initmask();
const list = new FYGE.ScrollList(ScrollItem, 131+20, 131, 620, 154, false); const list = new FYGE.ScrollList(ScrollItem, 131 + 20, 131, 620, 154, false);
const array = ['//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png','//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png']; const array = ['//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png', '//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png', '//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png', '//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png', '//yun.duiba.com.cn/spark/assets/1398924a1b804f0f20f9d3e16ed3158c2b3d686b.png'];
list.updateData(array); list.updateData(array);
list.position.set(80, 1240+30); list.position.set(80, 1240 + 30);
this.addChild(list); this.addChild(list);
} }
initContainer() { initContainer() {
boxArea = new FYGE.Sprite; boxArea = new FYGE.Sprite;
boxArea.position.set(74,449+30) boxArea.position.set(74, 449 + 30)
this.addChild(boxArea); this.addChild(boxArea);
boxGroup = this.addChild(new BoxGroup()); boxGroup = this.addChild(new BoxGroup());
boxArea.addChild(boxGroup); boxArea.addChild(boxGroup);
...@@ -64,7 +64,7 @@ export class IndexScene extends Scene { ...@@ -64,7 +64,7 @@ export class IndexScene extends Scene {
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this); this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this);
const rulePop = getObject(this,'index_rule'); const rulePop = getObject(this, 'index_rule');
rulePop && rulePop.addEventListener(FYGE.MouseEvent.CLICK, this.toRule, this); rulePop && rulePop.addEventListener(FYGE.MouseEvent.CLICK, this.toRule, this);
} }
...@@ -83,18 +83,25 @@ export class IndexScene extends Scene { ...@@ -83,18 +83,25 @@ export class IndexScene extends Scene {
} }
getIndex = async () => { getIndex = async () => {
const result = await sendWebNet(WebNetName.projectIndex); const result = getWebData(WebNetName.index);
if (!result.success) return; if (result && result.data) {
if (result && result.data && result.data.type == 2) {
const reDegree = getObject(this, 'index_timestips2'); const reDegree = getObject(this, 'index_timestips2');
reDegree.text = result.data.surplusCount; reDegree.text = result.data.surplusCount;
const credits = getObject(this, 'index_moneytips2'); const credits = getObject(this, 'index_moneytips2');
credits.text = result.data.credits; credits.text = result.data.credits;
const needCredits = getObject(this, 'index_costtips'); const needCredits = getObject(this, 'index_costtips');
needCredits.text = result.data.needCredits + "积分/次"; needCredits.text = result.data.needCredits + "积分/次";
if (result.data.type == 2) {
} else if (result.data.type == 2) {
}
} }
} }
} }
...@@ -36,7 +36,7 @@ export class StartScene extends Scene { ...@@ -36,7 +36,7 @@ export class StartScene extends Scene {
//开始游戏 //开始游戏
this.startBtn.addEventListener(FYGE.MouseEvent.CLICK, async () => { this.startBtn.addEventListener(FYGE.MouseEvent.CLICK, async () => {
showWaiting(); showWaiting();
var res = await sendWebNet(WebNetName.join) var res = await sendWebNet(WebNetName.index)
hideWaiting(); hideWaiting();
if (res.success) { if (res.success) {
changeScene(PlayScene, { ...res.data }); changeScene(PlayScene, { ...res.data });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment