Commit 2c954424 authored by 邱旭's avatar 邱旭

--

parent 54697ff1
# Default ignored files
/workspace.xml
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/xiaoxiaole.iml" filepath="$PROJECT_DIR$/.idea/xiaoxiaole.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
...@@ -89,8 +89,12 @@ ...@@ -89,8 +89,12 @@
"name": "signprize" "name": "signprize"
}, },
{ {
"name": "preload", "keys": "namebg_png,avatar_png,invite_txtbg_png,invite_icon_png,taskicon_png,friend_avatar_png,ad_icon_png,testavatar_png",
"keys": "namebg_png,avatar_png,invite_txtbg_png,invite_icon_png,taskicon_png,friend_avatar_png,ad_icon_png,testavatar_png" "name": "preload"
},
{
"keys": "invite_bg_png,invite_help_png,invite_invite_png",
"name": "invite"
} }
], ],
"resources": [ "resources": [
...@@ -1975,44 +1979,59 @@ ...@@ -1975,44 +1979,59 @@
"name": "playSceneBg_jpg" "name": "playSceneBg_jpg"
}, },
{ {
"name": "namebg_png", "url": "assets/map/namebg.png",
"type": "image",
"name": "namebg_png"
},
{
"url": "assets/map/avatar.png",
"type": "image",
"name": "avatar_png"
},
{
"url": "assets/map/invite_txtbg.png",
"type": "image",
"name": "invite_txtbg_png"
},
{
"url": "assets/map/invite_icon.png",
"type": "image", "type": "image",
"url": "assets/map/namebg.png" "name": "invite_icon_png"
}, },
{ {
"name": "avatar_png", "url": "assets/map/taskicon.png",
"type": "image", "type": "image",
"url": "assets/map/avatar.png" "name": "taskicon_png"
}, },
{ {
"name": "invite_txtbg_png", "url": "assets/map/friend_avatar.png",
"type": "image", "type": "image",
"url": "assets/map/invite_txtbg.png" "name": "friend_avatar_png"
}, },
{ {
"name": "invite_icon_png", "url": "assets/map/ad_icon.png",
"type": "image", "type": "image",
"url": "assets/map/invite_icon.png" "name": "ad_icon_png"
}, },
{ {
"name": "taskicon_png", "url": "assets/testavatar.png",
"type": "image", "type": "image",
"url": "assets/map/taskicon.png" "name": "testavatar_png"
}, },
{ {
"name": "friend_avatar_png", "url": "assets/invite/invite_help.png",
"type": "image", "type": "image",
"url": "assets/map/friend_avatar.png" "name": "invite_help_png"
}, },
{ {
"name": "ad_icon_png", "url": "assets/invite/invite_invite.png",
"type": "image", "type": "image",
"url": "assets/map/ad_icon.png" "name": "invite_invite_png"
}, },
{ {
"name": "testavatar_png", "url": "assets/invite/invite_bg.png",
"type": "image", "type": "image",
"url": "assets/testavatar.png" "name": "invite_bg_png"
} }
] ]
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"> <e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="闯关失败_png" y="27" horizontalCenter="0"/> <e:Image y="45.33" horizontalCenter="0" source="invite_bg_png"/>
<e:Button id="closeBtn" label="" x="609" y="197"> <e:Image id="prizeImg" y="439.33" horizontalCenter="0.5" source=""/>
<e:Button id="closeBtn" label="" x="605" y="227.33">
<e:skinName> <e:skinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing"> <e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
<e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/> <e:Image width="100%" height="100%" source="closeCommonBtn_png" source.down="closeCommonBtn_png" source.disabled="closeCommonBtn_png"/>
...@@ -9,5 +10,22 @@ ...@@ -9,5 +10,22 @@
</e:Skin> </e:Skin>
</e:skinName> </e:skinName>
</e:Button> </e:Button>
<e:Label text="Invite" x="260" y="604"/> <e:Button id="helpBtn" label="" x="564" y="376.33">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image width="100%" height="100%" source="invite_help_png" source.down="invite_help_png" source.disabled="invite_help_png"/>
<e:Label id="labelDisplay" horizontalCenter="0" verticalCenter="0" xmlns:w="http://ns.egret.com/wing"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Label id="numLabel" text="仅差3人可获得" y="679.33" textColor="0xf54500" size="28" horizontalCenter="0"/>
<e:Label text="将在23:43:21后失效" y="877.33" size="28" id="numLabel0" textColor="0xffffff" horizontalCenter="0.5"/>
<e:Scroller id="scroller" width="554" height="83" y="766.33" anchorOffsetX="0" anchorOffsetY="0" horizontalCenter="0">
<e:Group id="scrollerGroup" anchorOffsetX="0">
<e:List id="list" width="0" x="0" height="83" y="0"/>
<e:layout>
<e:HorizontalLayout horizontalAlign="center" verticalAlign="middle" gap="66"/>
</e:layout>
</e:Group>
</e:Scroller>
</e:Skin> </e:Skin>
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel"; import Panel from "../../libs/new_wx/components/Panel";
import { showShare } from "../shareCtrl";
export default class InvitePanel extends Panel { export default class InvitePanel extends Panel {
public prizeImg: eui.Image;
public closeBtn: eui.Button;
public helpBtn: eui.Button;
public numLabel: eui.Label;
public numLabel0: eui.Label;
public scroller: eui.Scroller;
public scrollerGroup: eui.Group;
public list: eui.List;
start(data) { start(data) {
super.start(); super.start();
this.showlog(); this.showlog();
} }
showlog(){ showlog() {
// NetManager.ins.showLog(getlogItem(3)); // NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4)); // NetManager.ins.showLog(getlogItem(4));
} }
...@@ -17,9 +27,24 @@ export default class InvitePanel extends Panel { ...@@ -17,9 +27,24 @@ export default class InvitePanel extends Panel {
} }
onTapInvite() { onTapInvite() {
}
protected onSkinComplete() {
this.initUI();
}
initUI() {
// showShare();
}
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
get skinKey() {
return 'Invite'
} }
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
get skinKey() { return 'Invite' }
} }
\ No newline at end of file
...@@ -11,27 +11,29 @@ img.style.display = 'none'; ...@@ -11,27 +11,29 @@ img.style.display = 'none';
class Share2 extends ComponentBase { class Share2 extends ComponentBase {
type; type;
setType(type: any) { setType(type: any) {
this.type = type; this.type = type;
this['pic1'].visible = false; this['pic1'].visible = false;
this['pic2'].visible = false; this['pic2'].visible = false;
this['pic' + type].visible = true; this['pic' + type].visible = true;
} }
start() { start() {
this.once(egret.TouchEvent.ADDED_TO_STAGE,()=>{ this.once(egret.TouchEvent.ADDED_TO_STAGE, () => {
this.height = this.stage.stageHeight; this.height = this.stage.stageHeight;
},this); }, this);
this.addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{ this.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
hideShare(); hideShare();
},this); }, this);
const data = getHomeData(); const data = getHomeData();
this['tipsTxt0'].text = `超过了${Math.ceil(Math.random() * 100)}%的好友`; this['tipsTxt0'].text = `超过了${Math.ceil(Math.random() * 100)}%的好友`;
this['lvTxt'].text = data.levels.length ==0 ? 1 : data.levels.length; this['lvTxt'].text = data.levels.length == 0 ? 1 : data.levels.length;
this['lvTxt0'].text = data.levels.length; this['lvTxt0'].text = data.levels.length;
this['btn1'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['btn1'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if (iswx()) { //微信端 if(iswx()) { //微信端
} else {//端内 } else {//端内
this.getFunc('2');//朋友圈 this.getFunc('2');//朋友圈
...@@ -41,7 +43,7 @@ class Share2 extends ComponentBase { ...@@ -41,7 +43,7 @@ class Share2 extends ComponentBase {
}, this); }, this);
this['btn2'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => { this['btn2'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if (iswx()) { //微信端 if(iswx()) { //微信端
} else {//端内 } else {//端内
this.getFunc('1');//好友微信 this.getFunc('1');//好友微信
...@@ -49,6 +51,7 @@ class Share2 extends ComponentBase { ...@@ -49,6 +51,7 @@ class Share2 extends ComponentBase {
hideShare(); hideShare();
}, this); }, this);
} }
//channel 1 好友 2 朋友圈 //channel 1 好友 2 朋友圈
getFunc(channel: string) { getFunc(channel: string) {
// let base64; // let base64;
...@@ -57,13 +60,13 @@ class Share2 extends ComponentBase { ...@@ -57,13 +60,13 @@ class Share2 extends ComponentBase {
// else // else
// base64= getPrintScreenData(this['pic' + this.type], 0, 0, 600, 965); // base64= getPrintScreenData(this['pic' + this.type], 0, 0, 600, 965);
// NetManager.ins.imgUrl((success) => { // NetManager.ins.imgUrl((success) => {
// const data = DataManager.ins.getData('imgURL'); // const data = DataManager.ins.getData('imgURL');
// img.src = base64; // img.src = base64;
// img.src = data.data; // img.src = data.data;
if(this.type==1) if(this.type == 1)
callShareApi('https://yun.duiba.com.cn/db_games/xxshareshare.jpg', channel); callShareApi('https://yun.duiba.com.cn/db_games/xxshareshare.jpg', channel);
else else
callShareApi('https://yun.duiba.com.cn/db_games/xxlshare.jpg', channel); callShareApi('https://yun.duiba.com.cn/db_games/xxlshare.jpg', channel);
// }, base64); // }, base64);
} }
...@@ -71,6 +74,7 @@ class Share2 extends ComponentBase { ...@@ -71,6 +74,7 @@ class Share2 extends ComponentBase {
return 'Share2'; return 'Share2';
} }
} }
let inited = false; let inited = false;
let _share: Share2; let _share: Share2;
const initShare = () => { const initShare = () => {
...@@ -82,7 +86,7 @@ const initShare = () => { ...@@ -82,7 +86,7 @@ const initShare = () => {
_share = share; _share = share;
}; };
export const showShare = (type) => { export const showShare = (type) => {
if (!inited) { if(!inited) {
initShare(); initShare();
inited = true; inited = true;
} }
...@@ -96,27 +100,29 @@ export const hideShare = () => { ...@@ -96,27 +100,29 @@ export const hideShare = () => {
const isIphone = () => { const isIphone = () => {
const ua = navigator.userAgent.toLocaleLowerCase(); const ua = navigator.userAgent.toLocaleLowerCase();
if (ua.match(/iphone|ipad/)) { if(ua.match(/iphone|ipad/)) {
return true; return true;
} else if (ua.match(/android/)) { } else if(ua.match(/android/)) {
return false; return false;
} }
} }
//channel 1 好友 2 朋友圈 //channel 1 好友 2 朋友圈
export const callShareApi = (shareImgUrl, channel) => { export const callShareApi = (shareImgUrl, channel) => {
try { try {
if (isIphone()) { if(isIphone()) {
console.log("IOS"); console.log("IOS");
console.log(window['SNNativeClient']); console.log(window['SNNativeClient']);
//分享图片方法 //分享图片方法
window['SNNativeClient'].callMediaShare(shareImgUrl, channel, (message) => { }); window['SNNativeClient'].callMediaShare(shareImgUrl, channel, (message) => {
});
} else { } else {
console.log("安卓"); console.log("安卓");
console.log(window['shareApi']); console.log(window['shareApi']);
//分享图片用下列方法 //分享图片用下列方法
window['shareApi'].callMediaShare(shareImgUrl, channel, (message) => { }); window['shareApi'].callMediaShare(shareImgUrl, channel, (message) => {
});
} }
} catch (error) { } catch(error) {
console.log(error) console.log(error)
} }
......
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