Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
2c143171
Commit
2c143171
authored
Feb 21, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Plain Diff
1
parents
17da29c7
201afcec
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
414 additions
and
181 deletions
+414
-181
index.html
egret/index.html
+53
-73
MainBase.ts
egret/libs/new_wx/MainBase.ts
+2
-0
copyCodeBg.png
egret/resource/assets/shareCodePanel/copyCodeBg.png
+0
-0
lijiqianwang.png
egret/resource/assets/shareCodePanel/lijiqianwang.png
+0
-0
default.res.json
egret/resource/default.res.json
+8
-9
default.thm.json
egret/resource/default.thm.json
+99
-99
ShareCodePanelSkin.exml
egret/resource/skins/ShareCodePanelSkin.exml
+42
-0
ShareCodePanel.ts
egret/src/panels/ShareCodePanel.ts
+210
-0
No files found.
egret/index.html
View file @
2c143171
...
...
@@ -40,79 +40,59 @@
</head>
<body>
<div
style=
"margin: auto;width: 100%;height: 100%;"
class=
"egret-player"
data-entry-class=
"Main"
data-orientation=
"auto"
data-scale-mode=
"showAll"
data-frame-rate=
"60"
data-content-width=
"750"
data-content-height=
"1624"
data-multi-fingered=
"2"
data-show-fps=
"false"
data-show-log=
"true"
data-show-fps-style=
"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"
>
</div>
<script
src=
"libs/modules/egret/egret.js"
></script>
<script
src=
"libs/modules/egret/egret.web.js"
></script>
<script
src=
"libs/modules/eui/eui.js"
></script>
<script
src=
"libs/modules/assetsmanager/assetsmanager.js"
></script>
<script
src=
"libs/modules/tween/tween.js"
></script>
<script
src=
"libs/zepto.min.js"
></script>
<script
src=
"libs/security.js"
></script>
<script
src=
"libs/downloadApp.js"
></script>
<script
src=
"libs/svga.egret.min2.js"
></script>
<script
src=
"libs/aes.js"
></script>
<script
src=
"libs/pad-zeropadding.js"
></script>
<!-- //线上不需要 -->
<script
src=
"libs/fileSave.js"
></script>
<img
id=
"pic"
style=
"width:100%;position: absolute;z-index: 999;display: none;"
/>
<script>
window
.
fresp
=
0.00001
;
// localStorage.clear();
window
[
'testUrl'
]
=
'http://cuxiaoprexg.m.cnsuning.com/scms/cx521.html?activityId=SL446689024459878400&subactivityId=SUB446689681678090240&businessid=cx521'
;
window
[
'hbRainTime'
]
=
30
;
// 红包雨倒计时
window
[
'plugs'
]
=
[
1
,
2
,
3
];
// localStorage.clear();
window
[
'isInvitePage'
]
=
0
;
var
targetUrl
=
'https://gameact.suning.com/sngame-web/api/duiba/private/v1/getLoginUrl.do?appCode=duiba&activityCode=3651404'
;
/*
* 邀请有礼分享
*/
function
inviteShare
(
shareCode
)
{
let
title
=
"求求你可以帮我点一下吗?还差一点点就可以领红包了~"
;
let
content
=
"我在狮狮连萌等你,一起天天领福利哦"
;
let
targetUrl
=
"https://gameact.suning.com/duiba/customShare/share?id=3531"
+
"&shareCode="
+
shareCode
;
// 待修改
let
iconUrl
=
"http://yun.duiba.com.cn/db_games/xiaoxiaole2.jpg"
;
let
shareWays
=
"1,2"
;
console
.
log
(
"AppReady"
);
if
(
isIphone
())
{
console
.
log
(
"IOS"
);
console
.
log
(
window
.
SNNativeClient
);
window
.
callNativeShareResult
=
function
()
{
};
window
.
SNNativeClient
.
callNativeShare
(
title
,
content
,
targetUrl
,
iconUrl
,
shareWays
);
}
else
{
console
.
log
(
"安卓"
);
console
.
log
(
shareApi
);
console
.
log
(
shareApi
.
callMediaShare
);
shareApi
.
callNativeShare
(
title
,
content
,
targetUrl
,
iconUrl
,
shareWays
);
}
}
function
share
()
{
let
title
=
""
;
let
content
=
""
;
let
targetUrl
=
""
;
let
iconUrl
=
"http://yun.duiba.com.cn/db_games/xiaoxiaole.jpg"
;
let
shareWays
=
""
;
console
.
log
(
"AppReady"
);
if
(
isIphone
())
{
console
.
log
(
"IOS"
);
console
.
log
(
window
.
SNNativeClient
);
window
.
callNativeShareResult
=
function
()
{
};
window
.
SNNativeClient
.
callNativeShare
(
title
,
content
,
targetUrl
,
iconUrl
,
shareWays
);
}
else
{
console
.
log
(
"安卓"
);
console
.
log
(
shareApi
);
console
.
log
(
shareApi
.
callMediaShare
);
shareApi
.
callNativeShare
(
title
,
content
,
targetUrl
,
iconUrl
,
shareWays
);
}
<div
style=
"margin: auto;width: 100%;height: 100%;"
class=
"egret-player"
data-entry-class=
"Main"
data-orientation=
"auto"
data-scale-mode=
"showAll"
data-frame-rate=
"60"
data-content-width=
"750"
data-content-height=
"1624"
data-multi-fingered=
"2"
data-show-fps=
"false"
data-show-log=
"true"
data-show-fps-style=
"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9"
>
</div>
<script
src=
"libs/modules/egret/egret.js"
></script>
<script
src=
"libs/modules/egret/egret.web.js"
></script>
<script
src=
"libs/modules/eui/eui.js"
></script>
<script
src=
"libs/modules/assetsmanager/assetsmanager.js"
></script>
<script
src=
"libs/modules/tween/tween.js"
></script>
<script
src=
"libs/zepto.min.js"
></script>
<script
src=
"libs/security.js"
></script>
<script
src=
"libs/downloadApp.js"
></script>
<script
src=
"libs/svga.egret.min2.js"
></script>
<script
src=
"libs/aes.js"
></script>
<script
src=
"libs/pad-zeropadding.js"
></script>
<!-- 复制口令苏宁提供的js,线上需要添加 -->
<script
src=
"https://yun.dui88.com/DS-tech/dtt_tech/suning/snShare.min.js"
></script>
<!-- //线上不需要 -->
<script
src=
"libs/fileSave.js"
></script>
<img
id=
"pic"
style=
"width:100%;position: absolute;z-index: 999;display: none;"
/>
<script>
window
.
fresp
=
0.00001
;
// localStorage.clear();
window
[
'testUrl'
]
=
'http://cuxiaoprexg.m.cnsuning.com/scms/cx521.html?activityId=SL446689024459878400&subactivityId=SUB446689681678090240&businessid=cx521'
;
window
[
'hbRainTime'
]
=
30
;
// 红包雨倒计时
window
[
'plugs'
]
=
[
1
,
2
,
3
];
// localStorage.clear();
window
[
'isInvitePage'
]
=
0
;
var
targetUrl
=
'https://gameact.suning.com/sngame-web/api/duiba/private/v1/getLoginUrl.do?appCode=duiba&activityCode=3651404'
;
/*
* 邀请有礼分享
*/
function
inviteShare
(
shareCode
)
{
let
title
=
"求求你可以帮我点一下吗?还差一点点就可以领红包了~"
;
let
content
=
"我在狮狮连萌等你,一起天天领福利哦"
;
let
targetUrl
=
"https://gameact.suning.com/duiba/customShare/share?id=3531"
+
"&shareCode="
+
shareCode
;
// 待修改
let
iconUrl
=
"http://yun.duiba.com.cn/db_games/xiaoxiaole2.jpg"
;
let
shareWays
=
"1,2"
;
console
.
log
(
"AppReady"
);
if
(
isIphone
())
{
console
.
log
(
"IOS"
);
console
.
log
(
window
.
SNNativeClient
);
window
.
callNativeShareResult
=
function
()
{
};
window
.
SNNativeClient
.
callNativeShare
(
title
,
content
,
targetUrl
,
iconUrl
,
shareWays
);
}
else
{
console
.
log
(
"安卓"
);
console
.
log
(
shareApi
);
console
.
log
(
shareApi
.
callMediaShare
);
shareApi
.
callNativeShare
(
title
,
content
,
targetUrl
,
iconUrl
,
shareWays
);
}
function
isIphone
()
{
...
...
egret/libs/new_wx/MainBase.ts
View file @
2c143171
...
...
@@ -78,6 +78,7 @@ import ShopTipPanel from "../../src/panels/ShopTipPanel";
import
RechargePanel
from
"../../src/panels/RechargePanel"
;
import
BombTips2Panel
from
"../../src/panels/BombTips2Panel"
;
import
BackIndexPanel
from
"../../src/panels/BackIndexPanel"
;
import
{
ShareCodePanel
}
from
"../../src/panels/ShareCodePanel"
;
export
default
class
MainBase
extends
eui
.
UILayer
{
constructor
()
{
...
...
@@ -166,6 +167,7 @@ export default class MainBase extends eui.UILayer {
[
'taskCenterNoPrize'
,
{
cls
:
TaskCenterNoPrize
}],
[
'shopTip'
,
{
cls
:
ShopTipPanel
}],
[
'recharge'
,
{
cls
:
RechargePanel
}],
[
'ShareCodePanel'
,
{
cls
:
ShareCodePanel
}],
];
const
scenes
=
[
...
...
egret/resource/assets/shareCodePanel/copyCodeBg.png
0 → 100644
View file @
2c143171
60.4 KB
egret/resource/assets/shareCodePanel/lijiqianwang.png
0 → 100644
View file @
2c143171
24 KB
egret/resource/default.res.json
View file @
2c143171
...
...
@@ -231,6 +231,10 @@
{
"keys"
:
"backindex_png"
,
"name"
:
"backindex"
},
{
"keys"
:
"lijiqianwang_png,copyCodeBg_png"
,
"name"
:
"sharecodepanel"
}
],
"resources"
:
[
...
...
@@ -4490,19 +4494,14 @@
"name"
:
"iconnow_png"
},
{
"url"
:
"assets/startpanel2/startpanel_ele34.png"
,
"type"
:
"image"
,
"name"
:
"startpanel_ele34_png"
},
{
"url"
:
"assets/mainScene/ele34.png"
,
"url"
:
"assets/shareCodePanel/copyCodeBg.png"
,
"type"
:
"image"
,
"name"
:
"
ele34
_png"
"name"
:
"
copyCodeBg
_png"
},
{
"url"
:
"assets/
mainScene/honey
.png"
,
"url"
:
"assets/
shareCodePanel/lijiqianwang
.png"
,
"type"
:
"image"
,
"name"
:
"
honey
_png"
"name"
:
"
lijiqianwang
_png"
}
]
}
\ No newline at end of file
egret/resource/default.thm.json
View file @
2c143171
{
"skins"
:
{},
"autoGenerateExmlsList"
:
true
,
"exmls"
:
[
"resource/skins/ADSkin.exml"
,
"resource/skins/ADSmallSkin.exml"
,
"resource/skins/AlertSkin.exml"
,
"resource/skins/AvatarSkin.exml"
,
"resource/skins/BackIndexSkin.exml"
,
"resource/skins/BackSkin.exml"
,
"resource/skins/BagItem2Skin.exml"
,
"resource/skins/BagItemSkin.exml"
,
"resource/skins/BagQuitSkin.exml"
,
"resource/skins/BagSkin.exml"
,
"resource/skins/Blood2Skin.exml"
,
"resource/skins/BloodSkin.exml"
,
"resource/skins/Box2Skin.exml"
,
"resource/skins/BoxSkin.exml"
,
"resource/skins/Buy1Skin.exml"
,
"resource/skins/Buy2Skin.exml"
,
"resource/skins/Buy3Skin.exml"
,
"resource/skins/ExchangeSkin.exml"
,
"resource/skins/FailSkin.exml"
,
"resource/skins/FriendItem2Skin.exml"
,
"resource/skins/FriendItemSkin.exml"
,
"resource/skins/FriendShareSkin.exml"
,
"resource/skins/FriendSkin.exml"
,
"resource/skins/H52Skin.exml"
,
"resource/skins/H5Skin.exml"
,
"resource/skins/HbCutTimeSkin.exml"
,
"resource/skins/HbGameSkin.exml"
,
"resource/skins/HbNoPrizeSkin.exml"
,
"resource/skins/HbPrizeSkin.exml"
,
"resource/skins/HbRuleSkin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/InviteCutTimePanelSkin.exml"
,
"resource/skins/InviteItemSkin.exml"
,
"resource/skins/InvitePrizePanelSkin.exml"
,
"resource/skins/InviteRulePanelSkin.exml"
,
"resource/skins/InviteRuleSkin.exml"
,
"resource/skins/InviteSkin.exml"
,
"resource/skins/Main2Skin.exml"
,
"resource/skins/MapBottomSkin.exml"
,
"resource/skins/MapRepeatSkin.exml"
,
"resource/skins/MapSkin.exml"
,
"resource/skins/MapTopSkin.exml"
,
"resource/skins/NoPrizeSkin.exml"
,
"resource/skins/OptionItemSkin.exml"
,
"resource/skins/OptionsSkin.exml"
,
"resource/skins/PlaySkin.exml"
,
"resource/skins/Prize2Skin.exml"
,
"resource/skins/PrizeSkin.exml"
,
"resource/skins/QuitSkin.exml"
,
"resource/skins/RankFriendListSkin.exml"
,
"resource/skins/RankItemSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/RechargeSkin.exml"
,
"resource/skins/RedBagActivitySkin.exml"
,
"resource/skins/RedBagAlertSkin.exml"
,
"resource/skins/RedBombAlertSkin.exml"
,
"resource/skins/RedBombRuleSkin.exml"
,
"resource/skins/RedBombTips2Skin.exml"
,
"resource/skins/RedBombTipsSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/ScratchItemSkin.exml"
,
"resource/skins/ScratchPrizeSkin.exml"
,
"resource/skins/ScratchRuleSkin.exml"
,
"resource/skins/ScratchSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/Share3Skin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/ShareTipsSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
"resource/skins/ShopTipSkin.exml"
,
"resource/skins/ShowOffSkin.exml"
,
"resource/skins/SignItemSkin.exml"
,
"resource/skins/SignPrizeSkin.exml"
,
"resource/skins/SignSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/StartPanelSkin.exml"
,
"resource/skins/StartSkin.exml"
,
"resource/skins/TargetItemSkin.exml"
,
"resource/skins/TaskCenterItemSkin.exml"
,
"resource/skins/TaskCenterNoPrizeSkin.exml"
,
"resource/skins/TaskCenterPrizeSkin.exml"
,
"resource/skins/TaskCenterSkin.exml"
,
"resource/skins/TaskItemSkin.exml"
,
"resource/skins/TaskPrizeSkin.exml"
,
"resource/skins/TaskSkin.exml"
,
"resource/skins/Toast2Skin.exml"
,
"resource/skins/ToastSkin.exml"
,
"resource/skins/TurnRuleSkin.exml"
,
"resource/skins/TurntableNoPrizeSkin.exml"
,
"resource/skins/TurntablePrize2Skin.exml"
,
"resource/skins/TurntablePrizeSkin.exml"
,
"resource/skins/TurntableSkin.exml"
,
"resource/skins/VScrollBarSkin.exml"
],
"path"
:
"resource/default.thm.json"
"skins"
:
{},
"autoGenerateExmlsList"
:
true
,
"exmls"
:
[
"resource/skins/ADSkin.exml"
,
"resource/skins/ADSmallSkin.exml"
,
"resource/skins/AlertSkin.exml"
,
"resource/skins/AvatarSkin.exml"
,
"resource/skins/BackIndexSkin.exml"
,
"resource/skins/BackSkin.exml"
,
"resource/skins/BagItem2Skin.exml"
,
"resource/skins/BagItemSkin.exml"
,
"resource/skins/BagQuitSkin.exml"
,
"resource/skins/BagSkin.exml"
,
"resource/skins/Blood2Skin.exml"
,
"resource/skins/BloodSkin.exml"
,
"resource/skins/Box2Skin.exml"
,
"resource/skins/BoxSkin.exml"
,
"resource/skins/Buy1Skin.exml"
,
"resource/skins/Buy2Skin.exml"
,
"resource/skins/Buy3Skin.exml"
,
"resource/skins/ExchangeSkin.exml"
,
"resource/skins/FailSkin.exml"
,
"resource/skins/FriendItem2Skin.exml"
,
"resource/skins/FriendItemSkin.exml"
,
"resource/skins/FriendShareSkin.exml"
,
"resource/skins/FriendSkin.exml"
,
"resource/skins/H52Skin.exml"
,
"resource/skins/H5Skin.exml"
,
"resource/skins/HbCutTimeSkin.exml"
,
"resource/skins/HbGameSkin.exml"
,
"resource/skins/HbNoPrizeSkin.exml"
,
"resource/skins/HbPrizeSkin.exml"
,
"resource/skins/HbRuleSkin.exml"
,
"resource/skins/IconButtonSkin.exml"
,
"resource/skins/InviteCutTimePanelSkin.exml"
,
"resource/skins/InviteItemSkin.exml"
,
"resource/skins/InvitePrizePanelSkin.exml"
,
"resource/skins/InviteRulePanelSkin.exml"
,
"resource/skins/InviteRuleSkin.exml"
,
"resource/skins/InviteSkin.exml"
,
"resource/skins/Main2Skin.exml"
,
"resource/skins/MapBottomSkin.exml"
,
"resource/skins/MapRepeatSkin.exml"
,
"resource/skins/MapSkin.exml"
,
"resource/skins/MapTopSkin.exml"
,
"resource/skins/NoPrizeSkin.exml"
,
"resource/skins/OptionItemSkin.exml"
,
"resource/skins/OptionsSkin.exml"
,
"resource/skins/PlaySkin.exml"
,
"resource/skins/Prize2Skin.exml"
,
"resource/skins/PrizeSkin.exml"
,
"resource/skins/QuitSkin.exml"
,
"resource/skins/RankFriendListSkin.exml"
,
"resource/skins/RankItemSkin.exml"
,
"resource/skins/RankSkin.exml"
,
"resource/skins/RechargeSkin.exml"
,
"resource/skins/RedBagActivitySkin.exml"
,
"resource/skins/RedBagAlertSkin.exml"
,
"resource/skins/RedBombAlertSkin.exml"
,
"resource/skins/RedBombRuleSkin.exml"
,
"resource/skins/RedBombTips2Skin.exml"
,
"resource/skins/RedBombTipsSkin.exml"
,
"resource/skins/ReliveSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/ScratchItemSkin.exml"
,
"resource/skins/ScratchPrizeSkin.exml"
,
"resource/skins/ScratchRuleSkin.exml"
,
"resource/skins/ScratchSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/Share3Skin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/ShareTipsSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
"resource/skins/ShopTipSkin.exml"
,
"resource/skins/ShowOffSkin.exml"
,
"resource/skins/SignItemSkin.exml"
,
"resource/skins/SignPrizeSkin.exml"
,
"resource/skins/SignSkin.exml"
,
"resource/skins/StarSkin.exml"
,
"resource/skins/StartPanelSkin.exml"
,
"resource/skins/StartSkin.exml"
,
"resource/skins/TargetItemSkin.exml"
,
"resource/skins/TaskCenterItemSkin.exml"
,
"resource/skins/TaskCenterNoPrizeSkin.exml"
,
"resource/skins/TaskCenterPrizeSkin.exml"
,
"resource/skins/TaskCenterSkin.exml"
,
"resource/skins/TaskItemSkin.exml"
,
"resource/skins/TaskPrizeSkin.exml"
,
"resource/skins/TaskSkin.exml"
,
"resource/skins/Toast2Skin.exml"
,
"resource/skins/ToastSkin.exml"
,
"resource/skins/TurnRuleSkin.exml"
,
"resource/skins/TurntableNoPrizeSkin.exml"
,
"resource/skins/TurntablePrize2Skin.exml"
,
"resource/skins/TurntablePrizeSkin.exml"
,
"resource/skins/TurntableSkin.exml"
,
"resource/skins/VScrollBarSkin.exml"
],
"path"
:
"resource/default.thm.json"
}
\ No newline at end of file
egret/resource/skins/ShareCodePanelSkin.exml
0 → 100644
View file @
2c143171
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"ShareCodePanelSkin"
width=
"750"
height=
"1206"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<w:Config
id=
"16cd6d4c8ff"
/>
<e:Rect
id=
"clickBg"
width=
"750"
height=
"1624"
fillAlpha=
"0.5"
/>
<e:Group
id=
"inviteGroup"
x=
"0"
bottom=
"0"
>
<e:Image
source=
"朋友圈中间分享蒙层1_jpg"
y=
"0"
x=
"0"
/>
<e:Group
y=
"66"
x=
"261"
>
<e:Button
id=
"wxpyq"
label=
""
x=
"0"
y=
"0"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"share_btn1_png"
source.down=
"share_btn1_png"
source.disabled=
"share_btn1_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button
id=
"wx"
label=
""
x=
"152"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"share_btn2_png"
source.down=
"share_btn2_png"
source.disabled=
"share_btn2_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
</e:Group>
<e:Group
id=
"panelGroup"
horizontalCenter=
"0"
visible=
"false"
>
<e:Rect
width=
"750"
height=
"1624"
fillAlpha=
"0.7"
/>
<e:Image
y=
"223"
source=
"copyCodeBg_png"
horizontalCenter=
"0.5"
/>
<e:Label
id=
"msg"
text=
""
lineSpacing=
"10"
size=
"32"
multiline=
"true"
y=
"542"
textColor=
"0xf54500"
fontFamily=
"FZY4JW"
horizontalCenter=
"0.5"
textAlign=
"center"
/>
<e:Image
id=
"goBtn"
y=
"611"
source=
"lijiqianwang_png"
horizontalCenter=
"0"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"625"
y=
"220"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
<e:Image
width=
"100%"
height=
"100%"
source=
"closeCommonBtn_png"
source.down=
"closeCommonBtn_png"
source.disabled=
"closeCommonBtn_png"
/>
<e:Label
id=
"labelDisplay"
horizontalCenter=
"0"
verticalCenter=
"0"
/>
</e:Skin>
</e:skinName>
</e:Button>
</e:Group>
</e:Skin>
\ No newline at end of file
egret/src/panels/ShareCodePanel.ts
0 → 100644
View file @
2c143171
import
Panel
from
"../../libs/new_wx/components/Panel"
;
import
PanelCtrl
from
"../../libs/new_wx/ctrls/panelCtrl"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
getlogItem
}
from
"../Main"
;
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
export
enum
CodeChannels
{
/**
* 分享加体力
*/
AddBlood
=
"0"
,
/**
* 个人中心排行榜邀请好友一起玩
*/
RankPlay
=
"1"
,
/**
* 刮刮卡邀请
*/
Scratch
=
"2"
,
/**
* 邀请有礼
*/
InvitePrize
=
"3"
}
const
shareMsg
=
{
"0"
:
"打开苏宁APP快来和我一起玩游戏"
,
//打开苏宁APP帮我助力赢体力
"1"
:
"打开苏宁APP快来和我一起玩游戏"
,
"2"
:
"打开苏宁APP帮我刮卡赢现金"
,
"3"
:
"打开苏宁APP帮我闯一关赢现金"
}
export
class
ShareCodePanel
extends
Panel
{
public
closeBtn
:
eui
.
Button
;
public
clickBg
:
eui
.
Rect
;
public
inviteGroup
:
eui
.
Group
;
public
wxpyq
:
eui
.
Button
;
public
wx
:
eui
.
Button
;
public
panelGroup
:
eui
.
Group
;
public
msg
:
eui
.
Label
;
public
goBtn
:
eui
.
Image
;
/**
* 0表示微信,1表示朋友圈
*/
private
mark
:
0
|
1
data
:
{
channel
:
CodeChannels
,
shareCode
?:
string
,
}
/**
* 口令
*/
private
code
:
string
start
(
data
)
{
super
.
start
();
this
.
data
=
data
;
this
.
inviteGroup
.
bottom
=
this
.
stage
.
stageHeight
-
this
.
height
;
//直接生成码吧
}
//不再关闭
public
onTouchTap_closeBtn
()
{
// super.onTouchTap_closeBtn();
this
.
panelGroup
.
visible
=
false
;
}
initEvents
()
{
super
.
initEvents
();
// this.wx.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchBtn, this);
// this.wxpyq.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchBtn, this);
}
onTouchWxBtn
()
{
this
.
panelGroup
.
visible
=
true
;
this
.
mark
=
0
;
}
onTouchWxpyqBtn
()
{
this
.
panelGroup
.
visible
=
true
;
this
.
mark
=
1
;
}
codeOpr
()
{
if
(
!
this
.
code
)
{
this
.
enableMouseEvent
(
false
)
generateCode
((
s
,
res
)
=>
{
if
(
!
s
||
!
res
.
data
||
!
res
.
data
.
result
||
!
res
.
data
.
result
.
content
)
{
this
.
enableMouseEvent
(
true
)
showToast
(
"口令生成失败,请重试"
)
return
}
this
.
code
=
res
.
data
.
result
.
content
;
//复制口令
},
this
.
data
.
channel
,
this
.
data
.
shareCode
)
}
}
copyCodeOpr
(
code
:
string
){
// copyPassword()
}
private
enableMouseEvent
(
b
:
boolean
)
{
this
.
touchEnabled
=
b
;
this
.
touchChildren
=
b
;
}
removeEvents
()
{
super
.
removeEvents
();
// this.btn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchBtn, this);
}
get
skinKey
()
{
return
'ShareCodePanel'
}
}
// &snactCode&sceneCode&token
/**
* 生成口令
* @param channel
* @param shareCode 分享加体力暂时没有分享码(27号版本要加上),排行榜邀请一起玩也没有分享码,默认传0
*/
function
generateCode
(
callback
:
Function
,
channel
:
CodeChannels
,
shareCode
:
string
=
"0"
)
{
var
activityCode
=
getParamString
(
"snactCode"
)
||
"ACT0000002863"
;
var
sceneCode
=
channel
;
var
token
=
shareCode
||
"0"
;
window
[
'$'
].
ajax
({
type
:
"post"
,
url
:
"https://gameapi.suning.com/sngame-web/api/getShareGameInfo.do"
,
dataType
:
"json"
,
data
:
{
activityCode
,
sceneCode
,
token
},
async
:
true
,
success
:
(
result
)
=>
{
callback
(
true
,
result
)
},
error
:
(
message
)
=>
{
callback
(
false
,
message
)
}
});
}
/**
* 复制口令
*/
function
copyPassword
(
callback
:
Function
,
code
:
string
)
{
window
[
"snShare"
].
passwordShare
({
ele
:
'#kouling'
,
txt
:
code
+
""
,
success
:
function
(
e
)
{
callback
(
true
,
e
);
// console.log(e,e.text)
// alert('复制口令内容:'+e.text,function(){window.location.href='weixin://';});
},
error
:
function
(
e
)
{
callback
(
false
,
e
);
// console.log(e)
// alert('复制失败')
}
})
}
/**
* 唤起微信客户端
*/
function
linkWx
()
{
var
locatUrl
=
"weixin://"
;
if
(
/ipad|iphone|mac/i
.
test
(
navigator
.
userAgent
))
{
var
ifr
=
document
.
createElement
(
"iframe"
);
ifr
.
src
=
locatUrl
;
ifr
.
style
.
display
=
"none"
;
document
.
body
.
appendChild
(
ifr
);
}
else
{
window
.
location
.
href
=
locatUrl
;
}
}
/**
* 唤起微信朋友圈
* 暂未实现
*/
function
linkWxpyq
()
{
}
/**
* 获取链接字段信息
* @param name 字段名
*/
function
getParamString
(
name
)
{
var
paramUrl
=
window
.
location
.
search
.
substr
(
1
);
var
paramStrs
=
paramUrl
.
split
(
'&'
);
var
params
=
{};
for
(
var
index
=
0
;
index
<
paramStrs
.
length
;
index
++
)
{
params
[
paramStrs
[
index
].
split
(
'='
)[
0
]]
=
decodeURIComponent
(
paramStrs
[
index
].
split
(
'='
)[
1
]);
}
return
params
[
name
];
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment