Commit 1ba3b551 authored by rockyl's avatar rockyl

修复url写死http的问题

parent 86c15430
......@@ -21,6 +21,6 @@ export default class TakeRewards extends DialogContent {
}
onclick() {
location.href = this.link
location.href = window['recordDetailNewUrl'] + this.link.substr(this.link.lastIndexOf('?'));
}
}
\ No newline at end of file
}
......@@ -100,12 +100,12 @@ export default class Game extends InteractComponent {
}
async loadTextures(){
async loadTextures() {
let urls = {
treasure: this.configInterface.indexBoxImg,
stone: this.configInterface.indexBlockImg
};
for(let key in urls){
for (let key in urls) {
this.blockTextures[key] = await engine.assetsManager.loadTexture(urls[key]);
}
}
......@@ -279,7 +279,7 @@ export default class Game extends InteractComponent {
let scale;
if (height <= 0) {
scale = entity.min;
}else{
} else {
scale = ts.scale.x * Math.min(height / thisHeight + 0.1, 0.8);
}
......@@ -459,7 +459,7 @@ export default class Game extends InteractComponent {
this.Button.getComponent(BuriedPoint).setConfig(point.dpm, point.dcm, true)
}
onClickActionBtn() {
async onClickActionBtn() {
this.clickable = false
this.stopRotate()
const renderer = this.toolTr
......@@ -500,29 +500,32 @@ export default class Game extends InteractComponent {
const index = this.elementList.findIndex(item => item === result)
this.elementList.splice(index, 1)
createTween(this, renderer, true)
await createTween(this, renderer, true)
.to({
anchor: {
y: this.toolTrAnchorY - per
}
}, distance / commonSpeedBefore * 1000)
.call(() => {
if (this.playable && !this.clickable) return
if (result.type === ElementType.Treasure) {
this.hitTreasure({entity: result.entity})
} else {
this.hitStone({entity: result.entity, toolDistance: distance})
}
})
.to({
anchor: {
y: this.toolTrAnchorY
}
}, distance / (result.type === ElementType.Treasure ? commonSpeedAfter : slowSpeed) * 1000, ease.cubicInOut)
.call(() => {
}).getPromise();
createTween(this, renderer).to({
anchor: {
y: this.toolTrAnchorY
}
}, distance / (result.type === ElementType.Treasure ? commonSpeedAfter : slowSpeed) * 1000, ease.cubicInOut)
.call(()=>{
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,33 +615,40 @@ export default class Game extends InteractComponent {
const local = locationTs.globalPositionToLocal(global)
ts.position.setXY(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 {x: sx, y: sy} = ts.scale
createTween(this, ts, true, {initFields: ['x', 'alpha']})
.to({
position: {x: local.x > 50 ? 50 : local.x < -50 ? -50 : 0},
scale: {
x: sx * 0.7,
y: sy * 0.7
}
}, time - 200)
.to({
position: {x: this.ox, y: this.oy},
scale: {x: sx * 0.5, y: sy * 0.5},
alpha: 0
}, 200)
.call(() => {
if (this.playable && !this.clickable) return
this.setDetail(++this.score, true, this.submit.bind(this));
})
createTween(this, ts, false, {initFields: ['y']})
.to({
position: {y: this.oy - 50}
}, time - 200, ease.cubicInOut)
.call(() => ts.scale.setXY(ox, oy))
console.log('hitTreasure');
return Promise.all([
createTween(this, ts, true, {initFields: ['x', 'alpha']})
.to({
position: {x: local.x > 50 ? 50 : local.x < -50 ? -50 : 0},
scale: {
x: sx * 0.7,
y: sy * 0.7
}
}, time - 200)
.to({
position: {x: this.ox, y: this.oy},
scale: {x: sx * 0.5, y: sy * 0.5},
alpha: 0
}, 200)
.call(() => {
console.log('hitTreasure2', this.playable, !this.clickable);
if (this.playable && !this.clickable) return
this.setDetail(++this.score, true, this.submit.bind(this));
})
.getPromise(),
createTween(this, ts, false, {initFields: ['y']})
.to({
position: {y: this.oy - 50}
}, time - 200, ease.cubicInOut)
.call(() => ts.scale.setXY(ox, oy))
.getPromise(),
])
}
private hitStone({entity, toolDistance}) {
......@@ -648,7 +658,7 @@ export default class Game extends InteractComponent {
const currLocation = curTs.position
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({
position: {
x: needLocaltion[0],
......@@ -662,6 +672,7 @@ export default class Game extends InteractComponent {
y: needLocaltion[1],
}
}, 330)
.getPromise();
}
private hitEdge(funcFromX, funcFromY) {
......
......@@ -340,7 +340,10 @@ export default class start extends ScillaComponent {
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() {
......
This diff is collapsed.
This diff is collapsed.
......@@ -288,7 +288,8 @@
<script>
var CFG = {
opId: 83189
}
};
var DEBUG = true;
</script>
<script src="//yun.duiba.com.cn/db_games/activity/public_js/fetch-jsonp.min.js"></script>
<script src="debug/bundle.js"></script>
......
......@@ -15,7 +15,7 @@
},
"entryScene": "main"
},
"webServiceUrl": "http://localhost:3000"
"webServiceUrl": "http://localhost:3001"
},
"dataCenterConfig": {
"dataCenterRoot": [
......
{
"success":false,
"success":true,
"code":"0901011",
"desc":"OK",
"timestamp":1543501361476,
......
......@@ -10,7 +10,7 @@
"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>",
"box":10,
"continueTime":5,
"continueTime":60,
"earnCreditsUrl": "//yun.duiba.com.cn/h5/activity/goldminer/images/indexRuleImg.png",
"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