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 @@
"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": [
......@@ -1975,44 +1979,59 @@
"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",
"url": "assets/map/namebg.png"
"name": "invite_icon_png"
},
{
"name": "avatar_png",
"url": "assets/map/taskicon.png",
"type": "image",
"url": "assets/map/avatar.png"
"name": "taskicon_png"
},
{
"name": "invite_txtbg_png",
"url": "assets/map/friend_avatar.png",
"type": "image",
"url": "assets/map/invite_txtbg.png"
"name": "friend_avatar_png"
},
{
"name": "invite_icon_png",
"url": "assets/map/ad_icon.png",
"type": "image",
"url": "assets/map/invite_icon.png"
"name": "ad_icon_png"
},
{
"name": "taskicon_png",
"url": "assets/testavatar.png",
"type": "image",
"url": "assets/map/taskicon.png"
"name": "testavatar_png"
},
{
"name": "friend_avatar_png",
"url": "assets/invite/invite_help.png",
"type": "image",
"url": "assets/map/friend_avatar.png"
"name": "invite_help_png"
},
{
"name": "ad_icon_png",
"url": "assets/invite/invite_invite.png",
"type": "image",
"url": "assets/map/ad_icon.png"
"name": "invite_invite_png"
},
{
"name": "testavatar_png",
"url": "assets/invite/invite_bg.png",
"type": "image",
"url": "assets/testavatar.png"
"name": "invite_bg_png"
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui">
<e:Image source="闯关失败_png" y="27" horizontalCenter="0"/>
<e:Button id="closeBtn" label="" x="609" y="197">
<e:Skin class="InviteSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image y="45.33" horizontalCenter="0" source="invite_bg_png"/>
<e:Image id="prizeImg" y="439.33" horizontalCenter="0.5" source=""/>
<e:Button id="closeBtn" label="" x="605" y="227.33">
<e:skinName>
<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"/>
......@@ -9,5 +10,22 @@
</e:Skin>
</e:skinName>
</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>
\ No newline at end of file
import Panel from "../../libs/new_wx/components/Panel";
import { showShare } from "../shareCtrl";
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) {
super.start();
this.showlog();
}
showlog(){
showlog() {
// NetManager.ins.showLog(getlogItem(3));
// NetManager.ins.showLog(getlogItem(4));
}
......@@ -20,6 +30,21 @@ export default class InvitePanel extends Panel {
}
protected get closeBtns(): eui.Button[] { return [this['closeBtn']] }
get skinKey() { return 'Invite' }
protected onSkinComplete() {
this.initUI();
}
initUI() {
// showShare();
}
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';
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() {
this.once(egret.TouchEvent.ADDED_TO_STAGE,()=>{
this.once(egret.TouchEvent.ADDED_TO_STAGE, () => {
this.height = this.stage.stageHeight;
},this);
}, this);
this.addEventListener(egret.TouchEvent.TOUCH_TAP,()=>{
this.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
hideShare();
},this);
}, this);
const data = getHomeData();
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['btn1'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if (iswx()) { //微信端
if(iswx()) { //微信端
} else {//端内
this.getFunc('2');//朋友圈
......@@ -41,7 +43,7 @@ class Share2 extends ComponentBase {
}, this);
this['btn2'].addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if (iswx()) { //微信端
if(iswx()) { //微信端
} else {//端内
this.getFunc('1');//好友微信
......@@ -49,6 +51,7 @@ class Share2 extends ComponentBase {
hideShare();
}, this);
}
//channel 1 好友 2 朋友圈
getFunc(channel: string) {
// let base64;
......@@ -60,7 +63,7 @@ class Share2 extends ComponentBase {
// const data = DataManager.ins.getData('imgURL');
// img.src = base64;
// img.src = data.data;
if(this.type==1)
if(this.type == 1)
callShareApi('https://yun.duiba.com.cn/db_games/xxshareshare.jpg', channel);
else
callShareApi('https://yun.duiba.com.cn/db_games/xxlshare.jpg', channel);
......@@ -71,6 +74,7 @@ class Share2 extends ComponentBase {
return 'Share2';
}
}
let inited = false;
let _share: Share2;
const initShare = () => {
......@@ -82,7 +86,7 @@ const initShare = () => {
_share = share;
};
export const showShare = (type) => {
if (!inited) {
if(!inited) {
initShare();
inited = true;
}
......@@ -96,27 +100,29 @@ export const hideShare = () => {
const isIphone = () => {
const ua = navigator.userAgent.toLocaleLowerCase();
if (ua.match(/iphone|ipad/)) {
if(ua.match(/iphone|ipad/)) {
return true;
} else if (ua.match(/android/)) {
} else if(ua.match(/android/)) {
return false;
}
}
//channel 1 好友 2 朋友圈
export const callShareApi = (shareImgUrl, channel) => {
try {
if (isIphone()) {
if(isIphone()) {
console.log("IOS");
console.log(window['SNNativeClient']);
//分享图片方法
window['SNNativeClient'].callMediaShare(shareImgUrl, channel, (message) => { });
window['SNNativeClient'].callMediaShare(shareImgUrl, channel, (message) => {
});
} else {
console.log("安卓");
console.log(window['shareApi']);
//分享图片用下列方法
window['shareApi'].callMediaShare(shareImgUrl, channel, (message) => { });
window['shareApi'].callMediaShare(shareImgUrl, channel, (message) => {
});
}
} catch (error) {
} catch(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