Commit 7744061f authored by wildfirecode's avatar wildfirecode

1

parent b507d90e
...@@ -16,7 +16,7 @@ export default class NoPrizePanel extends Panel { ...@@ -16,7 +16,7 @@ export default class NoPrizePanel extends Panel {
this._level = parseInt(data.level + ''); this._level = parseInt(data.level + '');
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(16)); NetManager.ins.clickLog(getlogItem(16));
showShare() showShare(2)
}, this); }, this);
this.showlog(); this.showlog();
NetManager.ins.hc_home(() => { }, window['collectRuleId']); NetManager.ins.hc_home(() => { }, window['collectRuleId']);
......
...@@ -26,7 +26,7 @@ export default class PrizePanel extends Panel { ...@@ -26,7 +26,7 @@ export default class PrizePanel extends Panel {
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(15)); NetManager.ins.clickLog(getlogItem(15));
showShare(); showShare(2);
}, this); }, this);
this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
this.hidePanel(); this.hidePanel();
......
...@@ -2,9 +2,14 @@ ...@@ -2,9 +2,14 @@
<e:Skin class="Share2Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"> <e:Skin class="Share2Skin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<w:Config id="16cd6d4c8ff"/> <w:Config id="16cd6d4c8ff"/>
<e:Rect width="750" height="1624" fillAlpha="0.7"/> <e:Rect width="750" height="1624" fillAlpha="0.7"/>
<e:Group id="pic" x="86" y="46"> <e:Group id="pic1" x="86" y="46">
<e:Image source="share3_jpg" y="0" x="0"/> <e:Image source="share3_jpg" y="0" x="0"/>
<e:Label id="lvTxt" text="22" x="247.65" y="719.82" size="16" anchorOffsetX="0" width="61.33" textAlign="center" verticalAlign="middle" textColor="0xEA2917"/> <e:Label id="lvTxt" text="188" x="247.65" y="719.82" size="14" anchorOffsetX="0" width="61.33" textAlign="center" verticalAlign="middle" textColor="0xEA2917"/>
</e:Group>
<e:Group id="pic2" y="15" horizontalCenter="0" visible="false">
<e:Image source="showoff_jpg" x="0" y="0" height="931" width="579"/>
<e:Label id="lvTxt0" text="888" x="146.97" y="208.25" anchorOffsetX="0" width="179" anchorOffsetY="0" bold="true" textColor="0xEC1F09" textAlign="center" verticalAlign="middle" size="106"/>
<e:Label id="tipsTxt0" text="超过了60%的好友" y="324.22" anchorOffsetX="0" anchorOffsetY="0" textColor="0xEC1F09" textAlign="center" verticalAlign="middle" size="29" horizontalCenter="0"/>
</e:Group> </e:Group>
<e:Image source="朋友圈中间分享蒙层1_jpg" y="899.88" horizontalCenter="0"/> <e:Image source="朋友圈中间分享蒙层1_jpg" y="899.88" horizontalCenter="0"/>
<e:Group y="965.88" horizontalCenter="0"> <e:Group y="965.88" horizontalCenter="0">
......
...@@ -52,7 +52,7 @@ this['price1Txt'].text = window['price1'] ...@@ -52,7 +52,7 @@ this['price1Txt'].text = window['price1']
} }
onTapInvite() { onTapInvite() {
showShare(); showShare(1);
NetManager.ins.clickLog(getlogItem(4)); NetManager.ins.clickLog(getlogItem(4));
const data = getHomeData(); const data = getHomeData();
if (data.askForEnergy) { if (data.askForEnergy) {
......
...@@ -19,7 +19,7 @@ export default class Prize2Panel extends Panel { ...@@ -19,7 +19,7 @@ export default class Prize2Panel extends Panel {
this['tips'].text = `X${submitdata.prizeResponse.changeMoney}`; this['tips'].text = `X${submitdata.prizeResponse.changeMoney}`;
this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['shareBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
NetManager.ins.clickLog(getlogItem(15)); NetManager.ins.clickLog(getlogItem(15));
showShare(); showShare(2);
}, this); }, this);
this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['goBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
......
...@@ -10,6 +10,13 @@ const img: any = document.getElementById('pic'); ...@@ -10,6 +10,13 @@ const img: any = document.getElementById('pic');
img.style.display = 'none'; img.style.display = 'none';
class Share2 extends ComponentBase { class Share2 extends ComponentBase {
type;
setType(type: any) {
this.type=type;
this['pic1'].visible=false;
this['pic2'].visible=false;
this['pic'+type].visible=true;
}
start() { start() {
const data = getHomeData(); const data = getHomeData();
this['lvTxt'].text = data.levels.length; this['lvTxt'].text = data.levels.length;
...@@ -34,10 +41,11 @@ class Share2 extends ComponentBase { ...@@ -34,10 +41,11 @@ class Share2 extends ComponentBase {
} }
//channel 1 好友 2 朋友圈 //channel 1 好友 2 朋友圈
getFunc(type: string) { getFunc(type: string) {
const base64 = getPrintScreenData(this['pic'], 0, 0, 579, 866); const base64 = getPrintScreenData(this['pic'+this.type], 0, 0, 579, 866);
NetManager.ins.imgUrl((success) => { NetManager.ins.imgUrl((success) => {
const data = DataManager.ins.getData('imgURL'); const data = DataManager.ins.getData('imgURL');
img.src = data.data; img.src = base64;
// img.src = data.data;
callShareApi(data.data, type); callShareApi(data.data, type);
}, base64); }, base64);
} }
...@@ -47,18 +55,21 @@ class Share2 extends ComponentBase { ...@@ -47,18 +55,21 @@ class Share2 extends ComponentBase {
} }
} }
let inited = false; let inited = false;
let _share:Share2;
const initShare = () => { const initShare = () => {
const layer = layers.shareLayer; const layer = layers.shareLayer;
const share = new Share2(); const share = new Share2();
share.loadSkin(); share.loadSkin();
share.start(); share.start();
layer.addChild(share); layer.addChild(share);
_share=share;
}; };
export const showShare = () => { export const showShare = (type) => {
if (!inited) { if (!inited) {
initShare(); initShare();
inited = true; inited = true;
} }
_share.setType(type);
layers.shareLayer.visible = true; layers.shareLayer.visible = true;
} }
......
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