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
39d41fbc
Commit
39d41fbc
authored
Feb 25, 2020
by
wjf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l
parent
1c61b270
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
16 deletions
+55
-16
sharecodepanel.tmproject
egret/resource/TextureMerger/sharecodepanel.tmproject
+1
-1
ShareCodePanel.ts
egret/src/panels/ShareCodePanel.ts
+54
-15
No files found.
egret/resource/TextureMerger/sharecodepanel.tmproject
View file @
39d41fbc
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"sharecodepanel","version":5,"files":["..\\assets\\shareCodePanel\\lijiqianwang.png","..\\assets\\shareCodePanel\\copyCodeBg.png","..\\assets\\shareCodePanel\\shareWxpyqIcon.png","..\\assets\\shareCodePanel\\shareWxIcon.png","..\\assets\\shareCodePanel\\shareQqIcon.png","..\\assets\\shareCodePanel\\shareWeiboIcon.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"sharecodepanel","version":5,"files":["..\\assets\\shareCodePanel\\lijiqianwang.png","..\\assets\\shareCodePanel\\copyCodeBg.png","..\\assets\\shareCodePanel\\shareWxpyqIcon.png","..\\assets\\shareCodePanel\\shareWxIcon.png","..\\assets\\shareCodePanel\\shareQqIcon.png","..\\assets\\shareCodePanel\\shareWeiboIcon.png","..\\assets\\shareCodePanel\\zhantiegeihaoyou.png"]}
\ No newline at end of file
egret/src/panels/ShareCodePanel.ts
View file @
39d41fbc
...
...
@@ -54,14 +54,14 @@ interface ShareData {
const
jumpFun
=
[
function
()
{
//跳转微信
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
{
//
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
()
{
//跳转微信朋友圈,暂时用跳转微信代替
var
locatUrl
=
"weixin://"
;
...
...
@@ -75,10 +75,10 @@ const jumpFun = [
}
},
function
()
{
//跳转微博
showToast
(
"快打开微博,粘贴给好友吧"
)
},
function
()
{
//跳转qq
showToast
(
"快打开QQ,粘贴给好友吧"
)
},
]
...
...
@@ -107,11 +107,25 @@ class ShareCodePanel extends ComponentBase {
this
.
data
=
data
;
//显示提示文案
this
.
msg
.
text
=
panelMsg
[
this
.
data
.
channel
];
//获取code先
generateCode
((
s
,
res
)
=>
{
if
(
!
s
||
!
res
.
data
||
!
res
.
data
.
result
||
!
res
.
data
.
result
.
content
)
{
return
}
this
.
code
=
res
.
data
.
result
.
content
;
},
this
.
data
.
channel
,
this
.
data
.
shareCode
)
}
start
()
{
super
.
start
();
this
.
height
=
this
.
stage
.
stageHeight
;
//
// if (!document.getElementById("kouling")){
// var a='<div id="kouling" style="display:none" data-clipboard-text=""></div>';
// document.body.insertAdjacentHTML("afterbegin",a)
// }
}
...
...
@@ -128,19 +142,22 @@ class ShareCodePanel extends ComponentBase {
onTouchWxBtn
()
{
this
.
mark
=
0
;
this
.
codeOpr
()
this
.
codeOpr
();
NetManager
.
ins
.
showLog
(
getlogItem
(
84
));
}
onTouchWxpyqBtn
()
{
this
.
mark
=
1
;
this
.
codeOpr
()
this
.
codeOpr
()
;
}
onTouchWeiboBtn
()
{
this
.
mark
=
2
;
this
.
codeOpr
()
this
.
codeOpr
();
NetManager
.
ins
.
showLog
(
getlogItem
(
85
));
}
onTouchQqBtn
()
{
this
.
mark
=
3
;
this
.
codeOpr
()
this
.
codeOpr
();
NetManager
.
ins
.
showLog
(
getlogItem
(
86
));
}
onTouchGoBtn
()
{
...
...
@@ -203,7 +220,7 @@ class ShareCodePanel extends ComponentBase {
//曝光埋点
NetManager
.
ins
.
showLog
(
getlogItem
(
buridNums
[
this
.
data
.
channel
]))
}
else
{
showToast
(
"口令
生成
失败,请重试"
)
showToast
(
"口令
复制
失败,请重试"
)
}
},
(
window
[
"shareCodeHead"
]
||
"复制口令"
)
+
...
...
@@ -247,6 +264,10 @@ export const showShareCodePanel = (channel: CodeChannels, shareCode?: string, ad
initShare
();
inited
=
true
;
}
//三个渠道点击埋点
NetManager
.
ins
.
showLog
(
getlogItem
(
84
));
NetManager
.
ins
.
showLog
(
getlogItem
(
85
));
NetManager
.
ins
.
showLog
(
getlogItem
(
86
));
_share
.
setData
({
channel
,
shareCode
,
addFun
});
layers
.
shareCodeLayer
.
visible
=
true
;
}
...
...
@@ -302,9 +323,27 @@ function copyPassword(callback: Function, code: string) {
error
:
function
(
e
)
{
callback
(
false
,
e
);
// console.log(e)
// alert(JSON.stringify(e))
// alert('复制失败')
}
})
// var a='<div id="btn" style="display:none" data-clipboard-text=""></div>';document.body.insertAdjacentHTML("afterbegin",a)
// console.log(window["ClipboardJS"])
// var clipboard = new window["ClipboardJS"]("#kouling", {
// // text: code+""
// });
// clipboard.on("success", e => {
// clipboard.destroy();
// callback(true, e);
// });
// clipboard.on("error", e => {
// callback(false, e);
// alert(JSON.stringify(e))
// e.clearSelection();
// clipboard.destroy();
// });
// document.querySelector("#kouling")["click"]()
}
/**
...
...
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