Commit 1db12f0e authored by zhangjinzhou's avatar zhangjinzhou

奖品图片自适应

parent 39fefee6
...@@ -12,16 +12,30 @@ export default class PrizePanel extends Panel { ...@@ -12,16 +12,30 @@ export default class PrizePanel extends Panel {
const lottery = DataManager.ins.getCustomOrderStatusData.lottery; const lottery = DataManager.ins.getCustomOrderStatusData.lottery;
this.data = lottery; this.data = lottery;
this.data.score = `本局分数 ${DataManager.ins.getData('ngameSubmit').data.score}`; this.data.score = `本局分数 ${DataManager.ins.getData('ngameSubmit').data.score}`;
// let maxheight = 220;
// let imgwid = this.img.width;
// let imghei = this.img.height; var imgLoader: egret.ImageLoader = new egret.ImageLoader();
// console.error('图片信息==》',imghei,imgwid,this.img,this.img['$bitmapHeight'],this.img['$bitmapWidth']); egret.ImageLoader.crossOrigin = "anonymous";
// if(imghei>maxheight){ imgLoader.load(this.data.img);
// imgwid *= 220/imghei; imgLoader.once(egret.Event.COMPLETE, (evt: egret.Event) => {
// imghei = maxheight; if (evt.currentTarget.data) {
// this.img.width = imgwid; let texture = new egret.Texture();
// this.img.height = imghei; texture.bitmapData = evt.currentTarget.data;
// }
let maxheight = 220;
let imgwid = texture.textureWidth;
let imghei = texture.textureHeight;
if (imghei > maxheight) {
imgwid *= 220 / imghei;
imghei = maxheight;
}
this.img.width = imgwid;
this.img.height = imghei;
}
}, this);
// this.img.width = this.picBigWidth; // this.img.width = this.picBigWidth;
// this.img.height = this.picBigWidth / this.bigPicRatio; // this.img.height = this.picBigWidth / this.bigPicRatio;
...@@ -45,12 +59,12 @@ export default class PrizePanel extends Panel { ...@@ -45,12 +59,12 @@ export default class PrizePanel extends Panel {
const lottery = DataManager.ins.getCustomOrderStatusData.lottery; const lottery = DataManager.ins.getCustomOrderStatusData.lottery;
if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) { if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) {
window["downloadAppConfig"] = window["downloadAppConfig"] =
{ {
openUrl: lottery.openUrl, openUrl: lottery.openUrl,
iosDownloadUrl: lottery.iosDownloadUrl, iosDownloadUrl: lottery.iosDownloadUrl,
androidDownloadUrl: lottery.androidDownloadUrl, androidDownloadUrl: lottery.androidDownloadUrl,
confirm: lottery.confirm ? lottery.confirm : false confirm: lottery.confirm ? lottery.confirm : false
}; };
window["downloadApp"](); window["downloadApp"]();
if (lottery.type == "lucky") { if (lottery.type == "lucky") {
NetManager.ins.spmclick(DataManager.ins.getCustomOrderStatusData.exposure); NetManager.ins.spmclick(DataManager.ins.getCustomOrderStatusData.exposure);
......
...@@ -462,10 +462,10 @@ export class NetManager extends ABNetManager { ...@@ -462,10 +462,10 @@ export class NetManager extends ABNetManager {
param.rankId = rankId; param.rankId = rankId;
pp["rankId"] = rankId; pp["rankId"] = rankId;
} }
console.error("请求头处理submit===》", JSON.stringify(pp)); // console.error("请求头处理submit===》", JSON.stringify(pp));
//加密拼参数 //加密拼参数
pp = encrypt(pp); pp = encrypt(pp);
console.error("请求头处理submit加密后===》", JSON.stringify(pp)); // console.error("请求头处理submit加密后===》", JSON.stringify(pp));
const net: INetData = { const net: INetData = {
name: 'ngameSubmit', name: 'ngameSubmit',
// uri: '/hdtool/recon/ngame/ngameSubmit', // uri: '/hdtool/recon/ngame/ngameSubmit',
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Group width="511" height="239" x="121" y="530" anchorOffsetX="0" anchorOffsetY="0"> <e:Group width="511" height="239" x="121" y="530" anchorOffsetX="0" anchorOffsetY="0">
<e:Image id="img" touchEnabled="true" source="{data.img}" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" fillMode="scale" width="370" height="230"/> <e:Image id="img" touchEnabled="true" source="{data.img}" scaleX="1" scaleY="1" horizontalCenter="0" verticalCenter="0" fillMode="scale"/>
</e:Group> </e:Group>
<e:Label text="{data.name}" y="789" horizontalCenter="0" width="508" textAlign="center" size="28" textColor="0x9f3804"/> <e:Label text="{data.name}" y="789" horizontalCenter="0" width="508" textAlign="center" size="28" textColor="0x9f3804"/>
<e:Label y="360" horizontalCenter="0" width="508" textAlign="center" size="40" text="{data.score}" textColor="0xff3e02" verticalAlign="middle"/> <e:Label y="360" horizontalCenter="0" width="508" textAlign="center" size="40" text="{data.score}" textColor="0xff3e02" verticalAlign="middle"/>
......
...@@ -110,6 +110,8 @@ export default class PlayScene extends Scene { ...@@ -110,6 +110,8 @@ export default class PlayScene extends Scene {
createSpecialRegTriangle(this, 232, 1351 - 3 - 5 - 3, 400, 30);//2块斜面地面2 createSpecialRegTriangle(this, 232, 1351 - 3 - 5 - 3, 400, 30);//2块斜面地面2
createSpecialRegTriangle(this, 750 - 232, 1351 - 3 - 5 - 3, 400, -30);//2块斜面地面2 createSpecialRegTriangle(this, 750 - 232, 1351 - 3 - 5 - 3, 400, -30);//2块斜面地面2
// this.gameOver();
} }
private startGame() { private startGame() {
......
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