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
03d04ea9
Commit
03d04ea9
authored
Aug 28, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bb353daf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
iswx.ts
egret/src/iswx.ts
+3
-0
shareCtrl.ts
egret/src/shareCtrl.ts
+28
-13
No files found.
egret/src/iswx.ts
0 → 100644
View file @
03d04ea9
export
const
iswx
=
()
=>
{
return
navigator
.
userAgent
.
toLowerCase
().
indexOf
(
'micromessenger'
)
!==
-
1
}
\ No newline at end of file
egret/src/shareCtrl.ts
View file @
03d04ea9
...
...
@@ -4,6 +4,7 @@ import { getPrintScreenData } from "./getShowOffPic";
import
{
NetManager
}
from
"../libs/tw/manager/NetManager"
;
import
{
DataManager
}
from
"../libs/tw/manager/DataManager"
;
import
getHomeData
from
"./getHomeData"
;
import
{
iswx
}
from
"./iswx"
;
const
img
:
any
=
document
.
getElementById
(
'pic'
);
img
.
style
.
display
=
'none'
;
...
...
@@ -13,12 +14,21 @@ class Share2 extends ComponentBase {
const
data
=
getHomeData
();
this
[
'lvTxt'
].
text
=
data
.
levels
.
length
;
this
[
'btn1'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
iswx
())
{
//微信端
}
else
{
//端内
this
.
getFunc
(
'2'
);
//朋友圈
}
hideShare
();
},
this
);
this
[
'btn2'
].
addEventListener
(
egret
.
TouchEvent
.
TOUCH_TAP
,
()
=>
{
if
(
iswx
())
{
//微信端
}
else
{
//端内
this
.
getFunc
(
'1'
);
//好友微信
}
hideShare
();
},
this
);
}
...
...
@@ -28,7 +38,7 @@ class Share2 extends ComponentBase {
NetManager
.
ins
.
imgUrl
((
success
)
=>
{
const
data
=
DataManager
.
ins
.
getData
(
'imgURL'
);
img
.
src
=
data
.
data
;
callShareApi
(
data
.
data
,
type
);
callShareApi
(
data
.
data
,
type
);
},
base64
);
}
...
...
@@ -67,6 +77,7 @@ const isIphone = () => {
}
//channel 1 好友 2 朋友圈
export
const
callShareApi
=
(
shareImgUrl
,
channel
)
=>
{
try
{
if
(
isIphone
())
{
console
.
log
(
"IOS"
);
console
.
log
(
window
[
'SNNativeClient'
]);
...
...
@@ -78,4 +89,8 @@ export const callShareApi = (shareImgUrl, channel) => {
//分享图片用下列方法
window
[
'shareApi'
].
callMediaShare
(
shareImgUrl
,
channel
,
(
message
)
=>
{
});
}
}
catch
(
error
)
{
console
.
log
(
error
)
}
}
\ No newline at end of file
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