Commit 1db12f0e authored by zhangjinzhou's avatar zhangjinzhou

奖品图片自适应

parent 39fefee6
......@@ -12,16 +12,30 @@ export default class PrizePanel extends Panel {
const lottery = DataManager.ins.getCustomOrderStatusData.lottery;
this.data = lottery;
this.data.score = `本局分数 ${DataManager.ins.getData('ngameSubmit').data.score}`;
// let maxheight = 220;
// let imgwid = this.img.width;
// let imghei = this.img.height;
// console.error('图片信息==》',imghei,imgwid,this.img,this.img['$bitmapHeight'],this.img['$bitmapWidth']);
// if(imghei>maxheight){
// imgwid *= 220/imghei;
// imghei = maxheight;
// this.img.width = imgwid;
// this.img.height = imghei;
// }
var imgLoader: egret.ImageLoader = new egret.ImageLoader();
egret.ImageLoader.crossOrigin = "anonymous";
imgLoader.load(this.data.img);
imgLoader.once(egret.Event.COMPLETE, (evt: egret.Event) => {
if (evt.currentTarget.data) {
let texture = new egret.Texture();
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.height = this.picBigWidth / this.bigPicRatio;
......@@ -45,12 +59,12 @@ export default class PrizePanel extends Panel {
const lottery = DataManager.ins.getCustomOrderStatusData.lottery;
if (lottery.type == LotteryType.COUPON || lottery.type == LotteryType.LUCKY) {
window["downloadAppConfig"] =
{
openUrl: lottery.openUrl,
iosDownloadUrl: lottery.iosDownloadUrl,
androidDownloadUrl: lottery.androidDownloadUrl,
confirm: lottery.confirm ? lottery.confirm : false
};
{
openUrl: lottery.openUrl,
iosDownloadUrl: lottery.iosDownloadUrl,
androidDownloadUrl: lottery.androidDownloadUrl,
confirm: lottery.confirm ? lottery.confirm : false
};
window["downloadApp"]();
if (lottery.type == "lucky") {
NetManager.ins.spmclick(DataManager.ins.getCustomOrderStatusData.exposure);
......
......@@ -462,10 +462,10 @@ export class NetManager extends ABNetManager {
param.rankId = rankId;
pp["rankId"] = rankId;
}
console.error("请求头处理submit===》", JSON.stringify(pp));
// console.error("请求头处理submit===》", JSON.stringify(pp));
//加密拼参数
pp = encrypt(pp);
console.error("请求头处理submit加密后===》", JSON.stringify(pp));
// console.error("请求头处理submit加密后===》", JSON.stringify(pp));
const net: INetData = {
name: 'ngameSubmit',
// uri: '/hdtool/recon/ngame/ngameSubmit',
......
......@@ -19,7 +19,7 @@
</e:skinName>
</e:Button>
<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: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"/>
......
......@@ -110,6 +110,8 @@ export default class PlayScene extends Scene {
createSpecialRegTriangle(this, 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() {
......
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