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
761251ff
Commit
761251ff
authored
Oct 15, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
c6a384b2
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
97 additions
and
41 deletions
+97
-41
share3.tmproject
egret/resource/TextureMerger/share3.tmproject
+1
-0
sharefriend.jpg
egret/resource/assets/sharefriend.jpg
+0
-0
sharefriend.png
egret/resource/assets/sharefriend/sharefriend.png
+0
-0
default.res.json
egret/resource/default.res.json
+14
-0
default.thm.json
egret/resource/default.thm.json
+1
-0
InvitePrizePanelSkin.exml
egret/resource/skins/InvitePrizePanelSkin.exml
+1
-1
Share3Skin.exml
egret/resource/skins/Share3Skin.exml
+40
-0
FriendPanel.ts
egret/src/panels/FriendPanel.ts
+16
-7
shareCtrl3.ts
egret/src/shareCtrl3.ts
+24
-33
No files found.
egret/resource/TextureMerger/share3.tmproject
0 → 100644
View file @
761251ff
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"share3","version":5,"files":["../assets/sharefriend/sharefriend.png"]}
\ No newline at end of file
egret/resource/assets/sharefriend.jpg
0 → 100644
View file @
761251ff
194 KB
egret/resource/assets/sharefriend/sharefriend.png
0 → 100644
View file @
761251ff
6.04 KB
egret/resource/default.res.json
View file @
761251ff
...
...
@@ -119,6 +119,10 @@
{
"keys"
:
"invateCut_btn_png,invateCut_bg_png"
,
"name"
:
"invitecuttimepanel"
},
{
"keys"
:
"sharefriend_png"
,
"name"
:
"share3"
}
],
"resources"
:
[
...
...
@@ -2236,6 +2240,16 @@
"url"
:
"assets/ad/ad_closebtn.png"
,
"type"
:
"image"
,
"name"
:
"ad_closebtn_png"
},
{
"url"
:
"assets/sharefriend.jpg"
,
"type"
:
"image"
,
"name"
:
"sharefriend_jpg"
},
{
"url"
:
"assets/sharefriend/sharefriend.png"
,
"type"
:
"image"
,
"name"
:
"sharefriend_png"
}
]
}
\ No newline at end of file
egret/resource/default.thm.json
View file @
761251ff
...
...
@@ -45,6 +45,7 @@
"resource/skins/ReliveSkin.exml"
,
"resource/skins/RuleSkin.exml"
,
"resource/skins/Share2Skin.exml"
,
"resource/skins/Share3Skin.exml"
,
"resource/skins/ShareSkin.exml"
,
"resource/skins/ShareTipsSkin.exml"
,
"resource/skins/ShopSkin.exml"
,
...
...
egret/resource/skins/InvitePrizePanelSkin.exml
View file @
761251ff
...
...
@@ -3,7 +3,7 @@
xmlns:w=
"http://ns.egret.com/wing"
>
<e:Image
y=
"45.33"
horizontalCenter=
"0"
source=
"invitePrize_bg_png"
/>
<e:Image
id=
"prizeImg"
y=
"426.77"
source=
""
horizontalCenter=
"0"
width=
"510"
height=
"228"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"6
32"
y=
"317
.33"
>
<e:Button
id=
"closeBtn"
label=
""
x=
"6
24"
y=
"313
.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"
...
...
egret/resource/skins/Share3Skin.exml
0 → 100644
View file @
761251ff
<?xml version="1.0" encoding="utf-8"?>
<e:Skin
class=
"Share2Skin"
width=
"750"
height=
"1624"
xmlns:e=
"http://ns.egret.com/eui"
xmlns:w=
"http://ns.egret.com/wing"
>
<w:Config
id=
"16cd6d4c8ff"
/>
<e:Rect
width=
"750"
height=
"1624"
fillAlpha=
"0.7"
/>
<e:Group
id=
"pic"
x=
"86"
y=
"46"
>
<e:Group
y=
"0"
x=
"0"
>
<e:Image
x=
"0"
y=
"0"
source=
"sharefriend_jpg"
/>
<e:Label
id=
"lvTxt"
text=
"14"
y=
"270.58"
anchorOffsetX=
"0"
anchorOffsetY=
"0"
bold=
"true"
textAlign=
"center"
verticalAlign=
"middle"
size=
"106"
textColor=
"0xb14d00"
horizontalCenter=
"0"
/>
</e:Group>
<e:Group
x=
"236.86"
y=
"44.78"
>
<e:Image
id=
"avatar"
y=
"0"
width=
"108"
height=
"108"
x=
"0"
source=
""
/>
<e:Rect
id=
"avatarMask"
width=
"108"
height=
"108"
y=
"0"
ellipseWidth=
"108"
ellipseHeight=
"108"
/>
<e:Group
x=
"-26.75"
y=
"87"
>
<e:Image
source=
"sharefriend_png"
y=
"0"
x=
"0"
/>
<e:Label
id=
"nameTxt"
text=
"打发顺丰"
width=
"149"
verticalAlign=
"middle"
textAlign=
"center"
size=
"18"
height=
"45"
x=
"16"
/>
</e:Group>
</e:Group>
</e:Group>
<e:Group
id=
"inviteGroup"
x=
"0"
bottom=
"0"
locked=
"true"
>
<e:Image
source=
"朋友圈中间分享蒙层1_jpg"
y=
"0"
x=
"0"
/>
<e:Group
y=
"66"
x=
"261"
>
<e:Button
id=
"btn1"
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=
"btn2"
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:Skin>
\ No newline at end of file
egret/src/panels/FriendPanel.ts
View file @
761251ff
...
...
@@ -3,6 +3,10 @@ import FriendItemRenderer from "./FriendItemRenderer";
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
DataManager
}
from
"../../libs/tw/manager/DataManager"
;
import
{
getNick
}
from
"../mapScene/MapScene"
;
import
{
iswx
}
from
"../iswx"
;
import
{
getShareUrl
}
from
"../getSharePic"
;
import
{
showShare
}
from
"../shareCtrl"
;
import
{
showShare3
}
from
"../shareCtrl3"
;
export
default
class
FriendPanel
extends
Panel
{
public
list
:
eui
.
List
;
...
...
@@ -23,17 +27,17 @@ export default class FriendPanel extends Panel {
this
[
'empty'
].
visible
=
false
;
NetManager
.
ins
.
hc_totalNumRank
(()
=>
{
let
{
data
:
hc_totalNumRank
}
=
DataManager
.
ins
.
getData
(
'hc_totalNumRank'
);
if
(
hc_totalNumRank
==
null
)
{
if
(
hc_totalNumRank
==
null
)
{
hc_totalNumRank
=
{}
}
const
{
rank
,
userRank
}
=
hc_totalNumRank
;
const
{
rank
,
userRank
}
=
hc_totalNumRank
;
if
(
userRank
)
{
this
.
progress
.
textFlow
=
(
new
egret
.
HtmlTextParser
).
parser
(
`第<font color=0xfff000><b>
${
userRank
.
levelNum
}
</b></font>关`
);
this
.
score
.
textFlow
=
(
new
egret
.
HtmlTextParser
).
parser
(
`<font color=0xfff000><b>
${
userRank
.
maxScore
}
</b></font>分`
);
this
[
'rankTxt'
].
text
=
userRank
.
rank
this
[
'star'
].
text
=
`X
${
userRank
.
stars
}
`
this
[
'rankTxt'
].
text
=
userRank
.
rank
this
[
'star'
].
text
=
`X
${
userRank
.
stars
}
`
}
if
(
rank
&&
rank
.
length
>
0
)
{
...
...
@@ -53,7 +57,7 @@ export default class FriendPanel extends Panel {
this
[
'avatar0'
].
visible
=
false
;
this
[
'nameTxt'
].
text
=
''
;
this
[
'nameTxt0'
].
text
=
''
;
NetManager
.
ins
.
hc_userInfo
(()
=>
{
this
[
'avatar'
].
visible
=
true
;
this
[
'avatar0'
].
visible
=
true
;
...
...
@@ -61,7 +65,7 @@ export default class FriendPanel extends Panel {
this
[
'avatar'
].
source
=
this
[
'avatar0'
].
source
=
data
.
avatar
;
this
[
'nameTxt'
].
text
=
getNick
(
data
.
nickname
);
this
[
'nameTxt0'
].
text
=
getNick
(
data
.
nickname
,
10
);
this
[
'nameTxt0'
].
text
=
getNick
(
data
.
nickname
,
10
);
});
}
...
...
@@ -77,7 +81,12 @@ export default class FriendPanel extends Panel {
}
onTapInvite
()
{
console
.
log
(
'onTapInvite'
)
console
.
log
(
'onTapInvite'
);
if
(
iswx
())
{
getShareUrl
(
this
.
stage
);
}
else
showShare3
();
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
...
...
egret/src/shareCtrl3.ts
View file @
761251ff
...
...
@@ -3,21 +3,20 @@ import layers from "../libs/new_wx/views/layers";
import
getHomeData
from
"./getHomeData"
;
import
{
iswx
}
from
"./iswx"
;
import
{
callShareApi
}
from
"./shareCtrl"
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
{
getNick
}
from
"./mapScene/MapScene"
;
import
{
getPrintScreenData
}
from
"./getShowOffPic"
;
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
const
img
:
any
=
document
.
getElementById
(
'pic'
);
img
.
style
.
display
=
'none'
;
class
Share3
extends
ComponentBase
{
type
;
setType
(
type
:
any
)
{
this
.
type
=
type
;
this
[
'pic1'
].
visible
=
false
;
this
[
'pic2'
].
visible
=
false
;
this
[
'pic'
+
type
].
visible
=
true
;
}
start
()
{
this
[
'avatar'
].
mask
=
this
[
'avatarMask'
];
const
{
data
:
user
}
=
DataManager
.
ins
.
getData
(
'hc_userInfo'
);
this
[
'avatar'
].
source
=
user
.
avatar
;
this
[
'nameTxt'
].
text
=
getNick
(
user
.
nickname
);
this
.
once
(
egret
.
TouchEvent
.
ADDED_TO_STAGE
,
()
=>
{
this
.
height
=
this
.
stage
.
stageHeight
;
},
this
);
...
...
@@ -27,45 +26,37 @@ class Share3 extends ComponentBase {
},
this
);
const
data
=
getHomeData
();
this
[
'tipsTxt0'
].
text
=
`超过了
${
Math
.
ceil
(
Math
.
random
()
*
100
)}
%的好友`
;
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
.
get
Func
(
'2'
);
//朋友圈
this
.
share
Func
(
'2'
);
//朋友圈
}
hideShare3
();
},
this
);
this
[
'btn2'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
iswx
())
{
//微信端
if
(
iswx
())
{
//微信端
}
else
{
//端内
this
.
get
Func
(
'1'
);
//好友微信
this
.
share
Func
(
'1'
);
//好友微信
}
hideShare3
();
},
this
);
}
//channel 1 好友 2 朋友圈
getFunc
(
channel
:
string
)
{
// let base64;
// if(this.type==1)
// base64= getPrintScreenData(this['pic' + this.type], 0, 0, 579, 866);
// else
// base64= getPrintScreenData(this['pic' + this.type], 0, 0, 600, 965);
// NetManager.ins.imgUrl((success) => {
// const data = DataManager.ins.getData('imgURL');
shareFunc
(
channel
:
string
)
{
const
base64
=
getPrintScreenData
(
this
[
'pic'
],
0
,
0
,
579
,
864
);
NetManager
.
ins
.
imgUrl
((
success
)
=>
{
const
data
=
DataManager
.
ins
.
getData
(
'imgURL'
);
img
.
src
=
data
.
data
;
// img.src = base64;
// img.src = data.data;
if
(
this
.
type
==
1
)
callShareApi
(
'https://yun.duiba.com.cn/db_games/xxshareshare2.jpg'
,
channel
);
else
callShareApi
(
'https://yun.duiba.com.cn/db_games/xxlshare.jpg'
,
channel
);
// }, base64);
callShareApi
(
data
.
data
,
channel
);
},
base64
);
}
get
skinKey
()
{
...
...
@@ -83,15 +74,15 @@ const initShare = () => {
layer
.
addChild
(
share
);
_share
=
share
;
};
const
showShare3
=
(
type
)
=>
{
if
(
!
inited
)
{
export
const
showShare3
=
(
)
=>
{
if
(
!
inited
)
{
initShare
();
inited
=
true
;
}
_share
.
setType
(
type
);
layers
.
shareLayer
.
visible
=
true
;
}
const
hideShare3
=
()
=>
{
export
const
hideShare3
=
()
=>
{
layers
.
shareLayer
.
visible
=
false
;
}
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