Commit 1ba3b551 authored by rockyl's avatar rockyl

修复url写死http的问题

parent 86c15430
...@@ -21,6 +21,6 @@ export default class TakeRewards extends DialogContent { ...@@ -21,6 +21,6 @@ export default class TakeRewards extends DialogContent {
} }
onclick() { onclick() {
location.href = this.link location.href = window['recordDetailNewUrl'] + this.link.substr(this.link.lastIndexOf('?'));
} }
} }
...@@ -100,12 +100,12 @@ export default class Game extends InteractComponent { ...@@ -100,12 +100,12 @@ export default class Game extends InteractComponent {
} }
async loadTextures(){ async loadTextures() {
let urls = { let urls = {
treasure: this.configInterface.indexBoxImg, treasure: this.configInterface.indexBoxImg,
stone: this.configInterface.indexBlockImg stone: this.configInterface.indexBlockImg
}; };
for(let key in urls){ for (let key in urls) {
this.blockTextures[key] = await engine.assetsManager.loadTexture(urls[key]); this.blockTextures[key] = await engine.assetsManager.loadTexture(urls[key]);
} }
} }
...@@ -279,7 +279,7 @@ export default class Game extends InteractComponent { ...@@ -279,7 +279,7 @@ export default class Game extends InteractComponent {
let scale; let scale;
if (height <= 0) { if (height <= 0) {
scale = entity.min; scale = entity.min;
}else{ } else {
scale = ts.scale.x * Math.min(height / thisHeight + 0.1, 0.8); scale = ts.scale.x * Math.min(height / thisHeight + 0.1, 0.8);
} }
...@@ -459,7 +459,7 @@ export default class Game extends InteractComponent { ...@@ -459,7 +459,7 @@ export default class Game extends InteractComponent {
this.Button.getComponent(BuriedPoint).setConfig(point.dpm, point.dcm, true) this.Button.getComponent(BuriedPoint).setConfig(point.dpm, point.dcm, true)
} }
onClickActionBtn() { async onClickActionBtn() {
this.clickable = false this.clickable = false
this.stopRotate() this.stopRotate()
const renderer = this.toolTr const renderer = this.toolTr
...@@ -500,29 +500,32 @@ export default class Game extends InteractComponent { ...@@ -500,29 +500,32 @@ export default class Game extends InteractComponent {
const index = this.elementList.findIndex(item => item === result) const index = this.elementList.findIndex(item => item === result)
this.elementList.splice(index, 1) this.elementList.splice(index, 1)
createTween(this, renderer, true) await createTween(this, renderer, true)
.to({ .to({
anchor: { anchor: {
y: this.toolTrAnchorY - per y: this.toolTrAnchorY - per
} }
}, distance / commonSpeedBefore * 1000) }, distance / commonSpeedBefore * 1000)
.call(() => { .call(() => {
if (this.playable && !this.clickable) return }).getPromise();
if (result.type === ElementType.Treasure) {
this.hitTreasure({entity: result.entity}) createTween(this, renderer).to({
} else {
this.hitStone({entity: result.entity, toolDistance: distance})
}
})
.to({
anchor: { anchor: {
y: this.toolTrAnchorY y: this.toolTrAnchorY
} }
}, distance / (result.type === ElementType.Treasure ? commonSpeedAfter : slowSpeed) * 1000, ease.cubicInOut) }, distance / (result.type === ElementType.Treasure ? commonSpeedAfter : slowSpeed) * 1000, ease.cubicInOut)
.call(() => { .call(()=>{
this.startRotate() this.startRotate()
this.clickable = true
}) })
.getPromise();
if (this.playable && !this.clickable) return
if (result.type === ElementType.Treasure) {
await this.hitTreasure({entity: result.entity})
} else {
await this.hitStone({entity: result.entity, toolDistance: distance})
}
this.clickable = true
} }
} }
...@@ -612,11 +615,14 @@ export default class Game extends InteractComponent { ...@@ -612,11 +615,14 @@ export default class Game extends InteractComponent {
const local = locationTs.globalPositionToLocal(global) const local = locationTs.globalPositionToLocal(global)
ts.position.setXY(local.x, local.y) ts.position.setXY(local.x, local.y)
const distance = generatePointDistanceToZeroZero(local.x, local.y) const distance = generatePointDistanceToZeroZero(local.x, local.y)
const speed = 400 const speed = 500
const time = Number((distance / speed).toFixed(4)) * 1000 const time = Number((distance / speed).toFixed(4)) * 1000
const {x: sx, y: sy} = ts.scale const {x: sx, y: sy} = ts.scale
console.log('hitTreasure');
return Promise.all([
createTween(this, ts, true, {initFields: ['x', 'alpha']}) createTween(this, ts, true, {initFields: ['x', 'alpha']})
.to({ .to({
position: {x: local.x > 50 ? 50 : local.x < -50 ? -50 : 0}, position: {x: local.x > 50 ? 50 : local.x < -50 ? -50 : 0},
...@@ -631,14 +637,18 @@ export default class Game extends InteractComponent { ...@@ -631,14 +637,18 @@ export default class Game extends InteractComponent {
alpha: 0 alpha: 0
}, 200) }, 200)
.call(() => { .call(() => {
console.log('hitTreasure2', this.playable, !this.clickable);
if (this.playable && !this.clickable) return if (this.playable && !this.clickable) return
this.setDetail(++this.score, true, this.submit.bind(this)); this.setDetail(++this.score, true, this.submit.bind(this));
}) })
.getPromise(),
createTween(this, ts, false, {initFields: ['y']}) createTween(this, ts, false, {initFields: ['y']})
.to({ .to({
position: {y: this.oy - 50} position: {y: this.oy - 50}
}, time - 200, ease.cubicInOut) }, time - 200, ease.cubicInOut)
.call(() => ts.scale.setXY(ox, oy)) .call(() => ts.scale.setXY(ox, oy))
.getPromise(),
])
} }
private hitStone({entity, toolDistance}) { private hitStone({entity, toolDistance}) {
...@@ -648,7 +658,7 @@ export default class Game extends InteractComponent { ...@@ -648,7 +658,7 @@ export default class Game extends InteractComponent {
const currLocation = curTs.position const currLocation = curTs.position
const distance = generatePointsDistance(currLocation.x, currLocation.y, needLocaltion[0], needLocaltion[1]) const distance = generatePointsDistance(currLocation.x, currLocation.y, needLocaltion[0], needLocaltion[1])
createTween(this, curTs, true, {initFields: ['x', 'y']}) return createTween(this, curTs, true, {initFields: ['x', 'y']})
.to({ .to({
position: { position: {
x: needLocaltion[0], x: needLocaltion[0],
...@@ -662,6 +672,7 @@ export default class Game extends InteractComponent { ...@@ -662,6 +672,7 @@ export default class Game extends InteractComponent {
y: needLocaltion[1], y: needLocaltion[1],
} }
}, 330) }, 330)
.getPromise();
} }
private hitEdge(funcFromX, funcFromY) { private hitEdge(funcFromX, funcFromY) {
......
...@@ -340,7 +340,10 @@ export default class start extends ScillaComponent { ...@@ -340,7 +340,10 @@ export default class start extends ScillaComponent {
return return
} }
if (this.configError) return if (this.configError) return
if (this.isRunning()) location.href = this.homeInfo.prizeUrl if (this.isRunning()) {
const prizeUrl = this.homeInfo.prizeUrl;
location.href = window['recordUrl'] + prizeUrl.substr(prizeUrl.lastIndexOf('?'));
}
} }
showRule() { showRule() {
......
This diff is collapsed.
This diff is collapsed.
...@@ -288,7 +288,8 @@ ...@@ -288,7 +288,8 @@
<script> <script>
var CFG = { var CFG = {
opId: 83189 opId: 83189
} };
var DEBUG = true;
</script> </script>
<script src="//yun.duiba.com.cn/db_games/activity/public_js/fetch-jsonp.min.js"></script> <script src="//yun.duiba.com.cn/db_games/activity/public_js/fetch-jsonp.min.js"></script>
<script src="debug/bundle.js"></script> <script src="debug/bundle.js"></script>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
}, },
"entryScene": "main" "entryScene": "main"
}, },
"webServiceUrl": "http://localhost:3000" "webServiceUrl": "http://localhost:3001"
}, },
"dataCenterConfig": { "dataCenterConfig": {
"dataCenterRoot": [ "dataCenterRoot": [
......
{ {
"success":false, "success":true,
"code":"0901011", "code":"0901011",
"desc":"OK", "desc":"OK",
"timestamp":1543501361476, "timestamp":1543501361476,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"title":"title", "title":"title",
"rule":"<p><strong>测试测试</strong></p><p><em style=\"color: rgb(51, 51, 51);\">测试测试</em></p><p><strong style=\"color: rgb(51, 51, 51);\"><em>测试测试</em></strong></p>", "rule":"<p><strong>测试测试</strong></p><p><em style=\"color: rgb(51, 51, 51);\">测试测试</em></p><p><strong style=\"color: rgb(51, 51, 51);\"><em>测试测试</em></strong></p>",
"box":10, "box":10,
"continueTime":5, "continueTime":60,
"earnCreditsUrl": "//yun.duiba.com.cn/h5/activity/goldminer/images/indexRuleImg.png", "earnCreditsUrl": "//yun.duiba.com.cn/h5/activity/goldminer/images/indexRuleImg.png",
"prizeList":[ "prizeList":[
{ {
......
{"/Users/firefly/duiba/demoList/minner-tool/assets/scripts/HelloScilla.ts":1561020169937.0137,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/HelloScilla.ts":1561020169937.0137,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/DialogContent.ts":1561600311985.8552,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/Network.ts":1561600425062.0408,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/Normal.ts":1562566682279.367,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/Tips.ts":1563342864232.2847,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/TakeRewards.ts":1561604368987.917,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/scenes/start.ts":1563414744765.5208,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/game/Game.ts":1563517294108.954,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/utils/index.ts":1561701943800.5488,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/game/ToolAnimate.ts":1562061481431.2627,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/game/Treasure.ts":1562036486693.9104,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/game/Stone.ts":1562036497419.1833,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/Currency.ts":1562576376017.156,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/TakeFailed.ts":1562567908671.4026,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/utils/BuriedPoint.ts":1562566605218.4138,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/Currency.ts":1563759198037.1516,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/Normal.ts":1563759198037.4158,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/TakeFailed.ts":1563942766706.9917,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/TakeRewards.ts":1563759198037.9731,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/Tips.ts":1563759198038.2512,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/game/Game.ts":1563967580359.461,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/game/Stone.ts":1563877946954.2656,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/game/ToolAnimate.ts":1563759198039.2769,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/game/Treasure.ts":1563877946951.9539,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/scenes/start.ts":1563958374197.611,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/utils/BuriedPoint.ts":1563759198040.374,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/utils/index.ts":1563759198040.6511} {"/Users/firefly/duiba/demoList/minner-tool/assets/scripts/HelloScilla.ts":1561020169937.0137,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/HelloScilla.ts":1561020169937.0137,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/DialogContent.ts":1561600311985.8552,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/Network.ts":1561600425062.0408,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/Normal.ts":1562566682279.367,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/Tips.ts":1563342864232.2847,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/TakeRewards.ts":1561604368987.917,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/scenes/start.ts":1563414744765.5208,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/game/Game.ts":1563517294108.954,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/utils/index.ts":1561701943800.5488,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/game/ToolAnimate.ts":1562061481431.2627,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/game/Treasure.ts":1562036486693.9104,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/game/Stone.ts":1562036497419.1833,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/Currency.ts":1562576376017.156,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/dialog/TakeFailed.ts":1562567908671.4026,"/Users/firefly/duiba/demoList/miner-tool/assets/scripts/utils/BuriedPoint.ts":1562566605218.4138,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/Currency.ts":1563759198037.1516,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/Normal.ts":1563759198037.4158,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/TakeFailed.ts":1563942766706.9917,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/TakeRewards.ts":1568278918207.8828,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/dialog/Tips.ts":1563759198038.2512,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/game/Game.ts":1566887047804.8462,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/game/Stone.ts":1563877946954.2656,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/game/ToolAnimate.ts":1563759198039.2769,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/game/Treasure.ts":1563877946951.9539,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/scenes/start.ts":1568277429304.0603,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/utils/BuriedPoint.ts":1563759198040.374,"/Users/rockyl/WorkSpaces/scilla-projects/minner-tool/assets/scripts/utils/index.ts":1563759198040.6511}
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