Commit 7b730bf7 by Shawn Wang

分享

parent 022672e7
...@@ -70,6 +70,15 @@ class Main extends egret.DisplayObjectContainer { ...@@ -70,6 +70,15 @@ class Main extends egret.DisplayObjectContainer {
}) })
console.log(userInfo); console.log(userInfo);
platform.onShareAppMessage((...args) => {
return {
title: "恶魔妈妈买面膜",
imageUrl: "https://ws3.sinaimg.cn/large/006tKfTcly1fr102d837jj31kw11un5h.jpg"
}
})
platform.showShareMenu({
withShareTicket: false
})
platform.connectSocket({ platform.connectSocket({
url: "ws://192.168.50.118:9090", url: "ws://192.168.50.118:9090",
header: { header: {
...@@ -77,11 +86,11 @@ class Main extends egret.DisplayObjectContainer { ...@@ -77,11 +86,11 @@ class Main extends egret.DisplayObjectContainer {
}, },
method: "GET", method: "GET",
success: (...args) => { success: (...args) => {
console.error("success") console.error("connectSocket success")
console.error(args) console.error(args)
}, },
fail: (...args) => { fail: (...args) => {
console.error("fail") console.error("connectSocket fail")
console.error(args) console.error(args)
} }
}) })
......
...@@ -19,6 +19,8 @@ declare interface Platform { ...@@ -19,6 +19,8 @@ declare interface Platform {
sendSocketMessage(callback): void sendSocketMessage(callback): void
request(options): void request(options): void
exitMiniProgram(options): void exitMiniProgram(options): void
onShareAppMessage(callback): any
showShareMenu(options): any
} }
class DebugPlatform implements Platform { class DebugPlatform implements Platform {
...@@ -66,6 +68,12 @@ class DebugPlatform implements Platform { ...@@ -66,6 +68,12 @@ class DebugPlatform implements Platform {
exitMiniProgram(options){ exitMiniProgram(options){
} }
onShareAppMessage(callback){
}
showShareMenu(options){
}
} }
......
...@@ -69,6 +69,13 @@ class WxgamePlatform { ...@@ -69,6 +69,13 @@ class WxgamePlatform {
exitMiniProgram(options){ exitMiniProgram(options){
wx.exitMiniProgram(options) wx.exitMiniProgram(options)
} }
onShareAppMessage(callback){
return wx.onShareAppMessage(callback)
}
showShareMenu(options){
wx.showShareMenu(options)
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment