Commit 55819f6c authored by shunx 马's avatar shunx 马

Merge branch 'disu0811' of gitlab2.dui88.com:wildfirecode13/wfc13 into disu0811

parents d7454b7a 27ceea23
......@@ -32,5 +32,5 @@
]
},
"message": "12312312",
"success": 0
"success": 1
}
\ No newline at end of file
......@@ -123,7 +123,7 @@
"surplusCount": 1,
"credits": 111111,
"needCredits": 110,
"type": 1,
"type": 2,
"isMember":1
},
"message": null,
......
......@@ -37,6 +37,7 @@ function uploadSingleJs(url) {
//单js文件上传
co(function* () {
const originPath = `/db_games/${url}/output.js`;
var client = new OSS({
region: 'oss-cn-hangzhou',
accessKeyId: 'LTAI4Fw25WcfcGv7FvcHoiHK',
......@@ -51,6 +52,17 @@ function uploadSingleJs(url) {
}
if (originFile.status === 404)
yield client.put(originPath, "./output.js");
const originPath2 = `/db_games/${url}/output.js.map`;
var originFile2;
try {
originFile2 = yield client.head(originPath2);
} catch (error) {
originFile2 = error;
}
if (originFile2.status === 404)
yield client.put(originPath2, "./output.js.map");
})
}
......
......@@ -3,6 +3,7 @@ import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import { Panel } from "../../module/views/Panel";
import centerTextField from "../common/centerTextField";
import { delayClick } from "../common/delayClick";
import getObject from "../common/getObject";
import { sendWebNetWithToken } from "../sendWebNetWithToken";
import { getWebData, sendLog, sendWebNet } from "../WebNet";
......@@ -20,14 +21,14 @@ export class CostPanel extends Panel {
getObject(this, "cost_tips").text = `消耗${cost}积分拆开1个盲盒`;
}
cost_open() {
cost_open(e) {
sendLog("click", 1);
this.dispatchEvent("stopIndexEnterFrame", {});
this.getPrize();
this.getPrize(e.target);
}
getPrize = async () => {
getPrize = async (btn:FYGE.Sprite) => {
btn.mouseEnable=false;
const indexResult = getWebData(WebNetName.index);
const params: any = {
......@@ -38,11 +39,16 @@ export class CostPanel extends Panel {
if (indexResult.data.type == 1) {
params.credits = indexResult.data.needCredits;
result = await sendWebNet(WebNetName.getCreditCost, params);
if(!result.success) return;
if(!result.success) {
btn.mouseEnable=true;
return;
}
prizeData = await sendWebNetWithToken(WebNetName.drawPrize, { ticket: result.data });
btn.mouseEnable=true;
}
else {
prizeData = await sendWebNetWithToken(WebNetName.drawPrize);
btn.mouseEnable=true;
}
sendWebNet(WebNetName.index).then(res => {
......
import { showPanel } from "../../module/ctrls";
import { RES } from "../../module/RES";
import { layers } from "../../module/views/layers";
import { delayClick } from "../common/delayClick";
import { CostPanel } from "../panels/cost";
import { getTimesPanel } from "../panels/getTimes";
import { NoPrizePanel } from "../panels/noprize";
import { notEnoughMoneyPanel } from "../panels/notEnoughMoney";
import { PrizePanel } from "../panels/prize";
import { timesNotEnoughPanel } from "../panels/timesNotEnough";
import { getWebData } from "../WebNet";
import { sendWebNetWithToken } from "../sendWebNetWithToken";
import { getWebData, sendWebNet } from "../WebNet";
import { WebNetName } from "../WebNetName";
import { Box } from "./Box";
......@@ -87,20 +91,51 @@ export class BoxGroup extends FYGE.Sprite {
indexsvga.startAniRange(1, indexsvga.totalFrames, 1, () => {
const result = getWebData(WebNetName.index);
if (result.data.surplusCount <= 0) {
if(result.data.type==2)
if (result.data.type == 2)
showPanel(timesNotEnoughPanel)
else
showPanel(getTimesPanel);
} else {
if (result.data.type == 2) {
this.getPrize();
} else {
if (result.data.needCredits > result.data.credits) {
showPanel(notEnoughMoneyPanel);
} else {
showPanel(CostPanel);
}
}
}
});
}
getPrize = async () => {
const indexResult = getWebData(WebNetName.index);
const params: any = {
toPlaywayId: 'dazzle', toActionId: 'drawPrize'
};
let result, prizeData;
prizeData = await sendWebNetWithToken(WebNetName.drawPrize);
sendWebNet(WebNetName.index).then(res => {
layers.stage.dispatchEvent('updateIndexData')
})
if (prizeData && prizeData.success) {
if (prizeData.data && prizeData.data.options) {
if (prizeData.data.options[0].optionId == "thanks") {
showPanel(NoPrizePanel)
} else {
showPanel(PrizePanel);
}
}
}
}
}
......@@ -178,7 +178,7 @@ export class IndexScene extends Scene {
reDegree.text = `${result.data.surplusCount}`;
getBoxButton.visible = true;
shareButton.visible = false;
hand.visible = true;
hand.visible = false;
} else {
reDegree.text = '0';
needCredits.text = `${result.data.needCredits}` + "积分/次";
......
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