Commit 699a852d by MichaelJier

fix

1. 修复canvas里拆红包按钮实际触发位置移位的问题、字体排版优化
2. 对接拆红包接口sv错误的问题
parent 649aeedc
......@@ -82,7 +82,6 @@
}
};
this.hitted = function(sprite){
console.log(game)
if (Math.random() < 1 / 4 && ids.length > 0 && game.state.states.main.leftTime < time * 2 / 3) {
sprite.kill();
......@@ -97,9 +96,9 @@
openDialog.anchor.x = 0.5
openDialog.anchor.y = 0.5
const open = game.add.sprite(game.world.centerX, game.world.centerY + 100, 'open')
open.anchor.x = 0.5
open.anchor.y = 0.5
const open = game.add.sprite(game.world.centerX - 239 / 2, game.world.centerY - 239 / 2 + 100, 'open')
// open.anchor.x = 0.5
// open.anchor.y = 0.5
open.inputEnabled = true;
const result = game.add.sprite(game.world.centerX, game.world.centerY, 'redpacketResult')
......@@ -147,17 +146,19 @@
const res = await getRed()
const text = (isNaN(res) || '') ? [res, '', '', '', ''] : [`${res}元红包`, '恭喜您抢到', '红包已经放入', '个人中心-钱包' , ',记得提现哦']
// 3
tipText1 = game.add.text(0, game.world.centerY + result.height / 2 - goOn.height - 200, text[2], {fill: '#fff', fontSize: '25px', fontWeight: '400'})
tipText2 = game.add.text(0, game.world.centerY + result.height / 2 - goOn.height - 200, {fill: '#ffe67d', fontSize: '25px', fontWeight: '400'})
tipText3 = game.add.text(0, game.world.centerY + result.height / 2 - goOn.height - 200, {fill: '#fff', fontSize: '25px', fontWeight: '400'})
const tipTextTop = game.world.centerY + result.height / 2 - goOn.height - 150
tipText1 = game.add.text(0, tipTextTop, text[2], {fill: '#fff', fontSize: '25px', fontWeight: '400'})
tipText2 = game.add.text(0, tipTextTop, text[3], {fill: '#ffe67d', fontSize: '25px', fontWeight: '400'})
tipText3 = game.add.text(0, tipTextTop, text[4], {fill: '#fff', fontSize: '25px', fontWeight: '400'})
tipText1.left = game.world.centerX - (tipText1.width + tipText2.width + tipText3.width) / 2
tipText2.left = tipText1.left + tipText1.width
tipText3.left = tipText1.left + tipText1.width + tipText2.width
// 2
ticketText = game.add.text(0, game.world.centerY + result.height / 2 - goOn.height - 200 - tipText1.height - 20, text[0], {fill: '#ffe67d', fontSize: '50px', fontWeight: 'bolder'})
ticketText.left = game.world.centerX - ticketText.width / 2 // 文字相对于屏幕左右居中
// 2
const ticketTextTop = tipTextTop - tipText1.height - 50
ticketText = game.add.text(0, ticketTextTop, text[0], {fill: '#ffe67d', fontSize: '50px', fontWeight: 'bolder'})
ticketText.left = game.world.centerX - ticketText.width / 2 // 文字相对于屏幕左右居中
// 1
titleText = game.add.text(0, game.world.centerY + result.height / 2 - goOn.height - 200 - tipText1.height - 20 - ticketText.height - 20, text[1], {fill: '#fff', fontSize: '40px', fontWeight: 'bolder'})
titleText = game.add.text(0, ticketTextTop - ticketText.height - 20, text[1], {fill: '#fff', fontSize: '40px', fontWeight: 'bolder'})
titleText.left = game.world.centerX - titleText.width / 2
openDialog.visible = false
......
......@@ -105,8 +105,8 @@ export default {
const uin = this.channelInfo.uin
const channelId = this.channelInfo.id
const timestamp = ~~(new Date().getTime() / 1000)
const sv = this.$md5(`${this.channelInfo.uin}_${this.userInfo.id}_${this.$redSV.rob}_${this.rainInfo.svSalt || ''}`)
console.log(`${this.channelInfo.uin}_${this.userInfo.id}_${this.$redSV.rob}_${this.rainInfo.svSalt || ''}`)
const sv = this.$md5(`${this.channelInfo.uin}_${this.userInfo.id}_${this.$redSV.open}_${this.showRedInfo.id}_${this.rainInfo.svSalt || ''}`)
console.log()
const sign = sha1(channelId + '' + id + '' + sv + '' + timestamp + '' + uin + 'zf33f4248819bf94e73wx937fecfe9b8').toString()
const res = await openRedRainpacket({
id,
......
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 sign in to comment