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