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
a4693fa2
Commit
a4693fa2
authored
Feb 22, 2020
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
f9cbf6be
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
126 additions
and
46 deletions
+126
-46
index.html
egret/index.html
+9
-0
layers.ts
egret/libs/new_wx/views/layers.ts
+8
-5
zhantiegeihaoyou.png
egret/resource/assets/shareCodePanel/zhantiegeihaoyou.png
+0
-0
default.res.json
egret/resource/default.res.json
+6
-1
ShareCodePanelSkin.exml
egret/resource/skins/ShareCodePanelSkin.exml
+1
-1
MapScene.ts
egret/src/mapScene/MapScene.ts
+11
-7
BloodPanel.ts
egret/src/panels/BloodPanel.ts
+11
-3
BloodPanel2.ts
egret/src/panels/BloodPanel2.ts
+11
-3
FriendPanel.ts
egret/src/panels/FriendPanel.ts
+2
-2
ShareCodePanel.ts
egret/src/panels/ShareCodePanel.ts
+56
-21
StartPanel.ts
egret/src/panels/StartPanel.ts
+11
-3
No files found.
egret/index.html
View file @
a4693fa2
...
...
@@ -63,6 +63,15 @@
<script
src=
"libs/fileSave.js"
></script>
<img
id=
"pic"
style=
"width:100%;position: absolute;z-index: 999;display: none;"
/>
<script>
//分享口令复制文案头部
window
[
"shareCodeHead"
]
=
"复制口令"
;
//分享口令文案后部
window
[
"shareCodeEnds"
]
=
[
"打开苏宁易购App,一起消消消消消!"
,
//快去请好友助力加体力吧
"打开苏宁APP快来和我一起玩游戏"
,
//排行榜分享好友,不用了
"我正在苏宁易购APP领现金,快来助我一臂之力"
,
//刮刮卡分享
"打开苏宁易购App,玩赚钱消消乐,迈出人生巅峰第一步!"
//邀请有礼
];
window
.
fresp
=
0.00001
;
// localStorage.clear();
window
[
'testUrl'
]
=
'http://cuxiaoprexg.m.cnsuning.com/scms/cx521.html?activityId=SL446689024459878400&subactivityId=SUB446689681678090240&businessid=cx521'
;
...
...
egret/libs/new_wx/views/layers.ts
View file @
a4693fa2
...
...
@@ -5,6 +5,7 @@ class Layers extends eui.UILayer {
private
_bottomLayer
:
egret
.
Sprite
;
private
_toastLayer
:
egret
.
Sprite
;
private
_shareLayer
:
egret
.
Sprite
;
private
_shareCodeLayer
:
egret
.
Sprite
;
init
(
root
:
eui
.
UILayer
)
{
root
.
addChild
(
this
);
this
.
_topLayer
=
new
egret
.
Sprite
();
...
...
@@ -14,12 +15,14 @@ class Layers extends eui.UILayer {
this
.
_bottomLayer
=
new
egret
.
Sprite
();
this
.
_toastLayer
=
new
egret
.
Sprite
();
this
.
_shareLayer
=
new
egret
.
Sprite
();
this
.
_shareCodeLayer
=
new
egret
.
Sprite
();
this
.
addChild
(
this
.
_bottomLayer
);
this
.
addChild
(
this
.
_sceneLayer
);
this
.
addChild
(
this
.
_popupLayer
);
this
.
addChild
(
this
.
_topLayer
);
this
.
addChild
(
this
.
_shareLayer
);
//toast和share替换下层级
this
.
addChild
(
this
.
_toastLayer
);
this
.
addChild
(
this
.
_popupLayer
);
//弹框
this
.
addChild
(
this
.
_topLayer
);
//loading所在的层级
this
.
addChild
(
this
.
_shareCodeLayer
);
//0224新加,因为需要在弹框上弹出,而原先的shareLayer在shareCtrl3还要用
this
.
addChild
(
this
.
_toastLayer
);
//toast
this
.
addChild
(
this
.
_shareLayer
);
//分享层,目前就排行榜的还在用
}
// _bg: egret.Bitmap;
...
...
@@ -34,7 +37,7 @@ class Layers extends eui.UILayer {
// this._bg = null;
// })
// }
get
shareCodeLayer
()
{
return
this
.
_shareCodeLayer
}
get
shareLayer
()
{
return
this
.
_shareLayer
}
get
topLayer
()
{
return
this
.
_topLayer
}
get
popupLayer
()
{
return
this
.
_popupLayer
}
...
...
egret/resource/assets/shareCodePanel/zhantiegeihaoyou.png
0 → 100644
View file @
a4693fa2
26.6 KB
egret/resource/default.res.json
View file @
a4693fa2
...
...
@@ -233,7 +233,7 @@
"name"
:
"backindex"
},
{
"keys"
:
"lijiqianwang_png,copyCodeBg_png,shareWxpyqIcon_png,shareWxIcon_png,shareQqIcon_png,shareWeiboIcon_png"
,
"keys"
:
"lijiqianwang_png,copyCodeBg_png,shareWxpyqIcon_png,shareWxIcon_png,shareQqIcon_png,shareWeiboIcon_png
,zhantiegeihaoyou_png
"
,
"name"
:
"sharecodepanel"
}
],
...
...
@@ -4537,6 +4537,11 @@
"url"
:
"assets/shareCodePanel/shareWxpyqIcon.png"
,
"type"
:
"image"
,
"name"
:
"shareWxpyqIcon_png"
},
{
"url"
:
"assets/shareCodePanel/zhantiegeihaoyou.png"
,
"type"
:
"image"
,
"name"
:
"zhantiegeihaoyou_png"
}
]
}
\ No newline at end of file
egret/resource/skins/ShareCodePanelSkin.exml
View file @
a4693fa2
...
...
@@ -48,7 +48,7 @@
<e:Rect
width=
"750"
height=
"1624"
fillAlpha=
"0.7"
/>
<e:Image
y=
"294"
source=
"copyCodeBg_png"
horizontalCenter=
"0.5"
/>
<e:Label
id=
"msg"
text=
""
lineSpacing=
"10"
size=
"32"
multiline=
"true"
y=
"613"
textColor=
"0xf54500"
fontFamily=
"FZY4JW"
horizontalCenter=
"3.5"
textAlign=
"center"
/>
<e:Image
id=
"goBtn"
y=
"682"
source=
"lijiqianwang_png"
horizontalCenter=
"0
"
/>
<e:Image
id=
"goBtn"
y=
"682"
horizontalCenter=
"0"
source=
"zhantiegeihaoyou_png
"
/>
<e:Button
id=
"closeBtn"
label=
""
x=
"625"
y=
"291"
>
<e:skinName>
<e:Skin
states=
"up,down,disabled"
>
...
...
egret/src/mapScene/MapScene.ts
View file @
a4693fa2
...
...
@@ -63,26 +63,30 @@ export default class MapScene extends Scene {
if
(
window
[
"test0228"
])
{
//测试助力,到时失败code再和后端对接
NetManager
.
ins
.
doHelpNew
((
s
,
res
)
=>
{
if
(
s
)
{
showToast
(
"助力成功!"
)
NetManager
.
ins
.
showLog
(
getlogItem
(
83
))
showToast
(
"助力成功!一起闯关赢现金吧"
)
}
else
if
(
res
)
{
if
(
res
.
code
==
"0000"
)
{
}
else
if
(
res
.
code
==
"00001"
)
{
}
if
(
res
.
code
==
"0000"
)
{
//code再和后端对接
showToast
(
"已经给好友助力过了哦~"
)
}
else
if
(
res
.
code
==
"00001"
)
{
//code再和后端对接
showToast
(
"今日助力次数已达上限啦!"
)
}
else
{
showToast
(
"助力失败"
)
}
}
else
{
showToast
(
"助力失败"
)
}
},
code
)
}
else
{
showToast
(
"欢迎
加入游戏,去闯关吧
"
);
showToast
(
"欢迎
小主,闯关就能拿现金~
"
);
}
}
else
if
(
sceneCode
==
CodeChannels
.
RankPlay
)
{
//排行榜邀请好友的,
else
if
(
sceneCode
==
CodeChannels
.
RankPlay
)
{
//排行榜邀请好友的,
不需要了
showToast
(
"欢迎加入游戏,去闯关吧"
);
}
//剩下的就是邀请有礼和刮刮卡了,本身code上有区分
else
if
(
code
.
indexOf
(
"12345678"
)
==
-
1
)
{
// 邀请有礼
const
dojoin
=
DataManager
.
ins
.
getData
(
'hc_doJoin'
);
if
(
!
dojoin
)
{
showToast
(
"
立即闯关赢现金!
"
)
showToast
(
"
开启消除之旅
"
)
return
;
}
NetManager
.
ins
.
doHelp
((
success
,
res
)
=>
{
...
...
@@ -126,7 +130,7 @@ export default class MapScene extends Scene {
if
(
!
success
)
{
return
;
}
showToast
(
"
帮刮成功!"
);
showToast
(
"
助力成功,参与闯关赢现金"
/*"帮刮成功!"*/
);
NetManager
.
ins
.
showLog
(
getlogItem
(
52
));
NetManager
.
ins
.
showLog
(
getlogItem
(
36
));
},
_code
);
...
...
egret/src/panels/BloodPanel.ts
View file @
a4693fa2
...
...
@@ -157,11 +157,19 @@ export default class BloodPanel extends Panel {
if
(
!
s
)
{
showToast
(
"获取分享信息失败,请重试"
)
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
)
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
,
()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功'
);
});
}
)
}
})
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
);
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
,
()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功'
);
});
}
);
}
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
...
...
@@ -177,7 +185,7 @@ export default class BloodPanel extends Panel {
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功
~
'
);
showToast
(
'分享成功'
);
});
})
}
...
...
egret/src/panels/BloodPanel2.ts
View file @
a4693fa2
...
...
@@ -155,11 +155,19 @@ export default class BloodPanel2 extends Panel {
if
(
!
s
)
{
showToast
(
"获取分享信息失败,请重试"
)
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
)
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
,
()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功'
);
});
}
)
}
})
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
);
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
,
()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功'
);
});
}
);
}
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
...
...
@@ -175,7 +183,7 @@ export default class BloodPanel2 extends Panel {
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功
~
'
);
showToast
(
'分享成功'
);
});
})
}
...
...
egret/src/panels/FriendPanel.ts
View file @
a4693fa2
...
...
@@ -93,8 +93,8 @@ export default class FriendPanel extends Panel {
if
(
iswx
())
{
getFriendShareUrl
(
this
.
stage
);
}
else
//
showShare3();
showShareCodePanel
(
CodeChannels
.
RankPlay
);
showShare3
();
// showShareCodePanel(CodeChannels.RankPlay);//mmp,排行榜的分享又不要口令了
}
protected
get
closeBtns
():
eui
.
Button
[]
{
return
[
this
[
'closeBtn'
]]
}
...
...
egret/src/panels/ShareCodePanel.ts
View file @
a4693fa2
import
{
showToast
}
from
"../../libs/new_wx/ctrls/toastCtrl"
;
import
ComponentBase
from
"../../libs/new_wx/components/ComponentBase"
;
import
layers
from
"../../libs/new_wx/views/layers"
;
import
{
NetManager
}
from
"../../libs/tw/manager/NetManager"
;
import
{
getlogItem
}
from
"../Main"
;
export
enum
CodeChannels
{
/**
...
...
@@ -8,7 +10,7 @@ export enum CodeChannels {
*/
AddBlood
=
"0"
,
/**
* 个人中心排行榜邀请好友一起玩
* 个人中心排行榜邀请好友一起玩
,不用了
*/
RankPlay
=
"1"
,
/**
...
...
@@ -20,18 +22,29 @@ export enum CodeChannels {
*/
InvitePrize
=
"3"
}
//口令文案
const
shareMsg
=
{
"0"
:
"打开苏宁
APP快来和我一起玩游戏
"
,
//打开苏宁APP帮我助力赢体力
"0"
:
"打开苏宁
易购App,一起消消消消消!
"
,
//打开苏宁APP帮我助力赢体力
"1"
:
"打开苏宁APP快来和我一起玩游戏"
,
"2"
:
"
打开苏宁APP帮我刮卡赢现金
"
,
"3"
:
"打开苏宁
APP帮我闯一关赢现金
"
"2"
:
"
我正在苏宁易购APP领现金,快来助我一臂之力~
"
,
"3"
:
"打开苏宁
易购App,玩赚钱消消乐,迈出人生巅峰第一步!
"
}
//弹框文案
const
panelMsg
=
{
"0"
:
"
快去分享好友加体力吧
"
,
//快去请好友助力加体力吧
"0"
:
"
邀请好友助力加体力
"
,
//快去请好友助力加体力吧
"1"
:
"快去分享好友一起玩吧"
,
"2"
:
"
快去邀请好友帮你刮卡
"
,
"3"
:
"
快去邀请好友闯关赢
现金"
"2"
:
"
邀请好友助力领现金
"
,
"3"
:
"
邀请好友闯关领
现金"
}
//四个埋点号
const
buridNums
=
{
"0"
:
78
,
"1"
:
null
,
//不用了
"2"
:
80
,
"3"
:
81
}
interface
ShareData
{
channel
:
CodeChannels
,
shareCode
?:
string
,
//0224期加体力和排行榜分享好友没有分享码
...
...
@@ -131,13 +144,28 @@ class ShareCodePanel extends ComponentBase {
}
onTouchGoBtn
()
{
//跳转
jumpFun
[
this
.
mark
]()
this
.
goBtn
.
touchEnabled
=
false
;
//点击埋点
NetManager
.
ins
.
clickLog
(
getlogItem
(
buridNums
[
this
.
data
.
channel
]))
//有回调执行
this
.
data
.
addFun
&&
this
.
data
.
addFun
();
if
(
this
.
data
.
addFun
)
{
this
.
data
.
addFun
();
//跳转,考虑到要发接口,0228版本就没有接口要发了,可以只保留点击埋点延时1秒
setTimeout
(()
=>
{
this
.
goBtn
.
touchEnabled
=
true
;
jumpFun
[
this
.
mark
]()
},
2000
)
}
else
{
//跳转,考虑到要发接口
setTimeout
(()
=>
{
this
.
goBtn
.
touchEnabled
=
true
;
jumpFun
[
this
.
mark
]()
},
1000
)
}
}
onTouchClickBg
()
{
layers
.
shareLayer
.
visible
=
false
;
layers
.
share
Code
Layer
.
visible
=
false
;
//关闭后要置null,因为不同渠道进来要获取不同的code
this
.
code
=
null
}
...
...
@@ -167,14 +195,21 @@ class ShareCodePanel extends ComponentBase {
}
private
copyCodeOpr
()
{
copyPassword
((
ss
)
=>
{
this
.
enableMouseEvent
(
true
)
if
(
ss
)
{
this
.
panelGroup
.
visible
=
true
;
}
else
{
showToast
(
"口令生成失败,请重试"
)
}
},
"复制口令"
+
this
.
code
+
shareMsg
[
this
.
data
.
channel
])
copyPassword
(
(
ss
)
=>
{
this
.
enableMouseEvent
(
true
)
if
(
ss
)
{
this
.
panelGroup
.
visible
=
true
;
//曝光埋点
NetManager
.
ins
.
showLog
(
getlogItem
(
buridNums
[
this
.
data
.
channel
]))
}
else
{
showToast
(
"口令生成失败,请重试"
)
}
},
(
window
[
"shareCodeHead"
]
||
"复制口令"
)
+
this
.
code
+
(
window
[
"shareCodeEnds"
][
this
.
data
.
channel
]
||
shareMsg
[
this
.
data
.
channel
])
)
}
private
enableMouseEvent
(
b
:
boolean
)
{
...
...
@@ -200,7 +235,7 @@ class ShareCodePanel extends ComponentBase {
let
inited
=
false
;
let
_share
:
ShareCodePanel
;
const
initShare
=
()
=>
{
const
layer
=
layers
.
shareLayer
;
const
layer
=
layers
.
share
Code
Layer
;
const
share
=
new
ShareCodePanel
();
share
.
loadSkin
();
layer
.
addChild
(
share
);
...
...
@@ -213,7 +248,7 @@ export const showShareCodePanel = (channel: CodeChannels, shareCode?: string, ad
inited
=
true
;
}
_share
.
setData
({
channel
,
shareCode
,
addFun
});
layers
.
shareLayer
.
visible
=
true
;
layers
.
share
Code
Layer
.
visible
=
true
;
}
...
...
egret/src/panels/StartPanel.ts
View file @
a4693fa2
...
...
@@ -128,11 +128,19 @@ export default class StartPanel extends Panel {
if
(
!
s
)
{
showToast
(
"获取分享信息失败,请重试"
)
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
)
showShareCodePanel
(
CodeChannels
.
AddBlood
,
res
.
data
,
()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功'
);
});
}
)
}
})
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
);
showShareCodePanel
(
CodeChannels
.
AddBlood
,
DataManager
.
ins
.
getData
(
"getUserShareCode"
).
data
,
()
=>
{
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功'
);
});
}
);
}
}
else
{
showShareCodePanel
(
CodeChannels
.
AddBlood
,
null
,
()
=>
{
...
...
@@ -141,7 +149,7 @@ export default class StartPanel extends Panel {
SceneCtrl
.
instance
.
updateScene
();
},
window
[
'collectRuleId'
]);
wait
(
2000
).
then
(()
=>
{
showToast
(
'分享成功
~
'
);
showToast
(
'分享成功'
);
});
})
});
...
...
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