This API is used via wx.hideShareMenu(Object object).
Attribute | Type | Default value | Required | Description |
hideShareItems | Array.<string> | ['qq', 'qzone', 'wechatFriends', 'wechatMoment'] | No | QQ: Control the visibility of the "Forward" option. Qzone: Manage the visibility of the "Share to Host Client QQ Space" option. WeChatFriends: Manage the visibility of the "Share to Host Client We Chat Friends" option. WeChatMoment: Manage the visibility of the "Share to Host Client We Chat Moments" option. Without the hideShareItems parameter, the "Forward", "Share to Host Client QQ Space", "Share to Host Client We Chat Friends", and "Control Visibility" options are all hidden by default. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.hideShareMenu({hideShareItems: ['qq', 'qzone', 'wechatFriends', 'wechatMoment']})
This API is used via wx.showShareMenu(Object object).
Attribute | Type | Default value | Required | Description |
showShareItems | Array.<string> | ['qq', 'qzone', 'wechatFriends', 'wechatMoment'] | No | |
withShareTicket | boolean | false | No | Whether to use forwarding with shareTicket, supported from Base Library version 1.4.0 on Android and from Base Library version 1.4.0 on iOS. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Value | Description |
'qq' | Control whether to display "Forwarding" |
'qzone' | Control whether to display "Share to host client QQ Space" |
'wechatFriends' | Control whether to display "Host Client We Chat Friends" |
'wechatMoment' | Control whether to hide "Share to Host Client We Chat Moments". Without the hideShareItems parameter, "Forwarding", "Share to Host Client QQ Space", "Share to Host Client We Chat Friends", and "Control whether to hide" are all hidden by default. |
wx.showShareMenu({showShareItems: ['qq', 'qzone', 'wechatFriends', 'wechatMoment']})
This API is used via wx.updateShareMenu(Object object).
Attribute | Type | Default value | Required | Description |
withShareTicket | boolean | false | No | Whether to use forwarding with shareTicket |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.updateShareMenu({withShareTicket: true})
This API is used via wx.showShareImageMenu(Object object)
Attribute | Type | Default value | Required | Description |
path | string | - | Yes | The image address to be shared must be a local path or a temporary path |
style | string | default | No | Share styles |
needShowEntrance | string | false | No | Whether the shared picture message needs to have a mini program entry (only some mini program categories are available) |
entrance | string | false | No | Open the path of the mini program from the entrance of the message mini program. If the current page allows sharing with friends, the default is the path of the current page. Otherwise, the default is the home page of the mini program. |
success | function | - | No | Callback Function of Successful Interface Call |
fail | function | - | No | Callback Function of Failing Interface Call |
complete | function | - | No | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
wx.downloadFile({url: 'https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg',success: (res) => {wx.showShareImageMenu({path: res.tempFilePath})}})
This API is used via wx.onCopyUrl(function listener)
Attribute | Type | Description |
query | string | The query string carried by the current page when opening the mini program with a short link. When used in a mini program, wx.onCopyUrl custom query should be called when entering the page, and wx.offCopyUrl should be called when exiting the page to prevent it from affecting other pages. |
//Bind shared parameterswx.onCopyUrl(() => {return { query: 'a=1&b=2' }})// Unbind shared parameterswx.offCopyUrl()
This API is used via wx.offCopyUrl()
//Bind shared parameterswx.onCopyUrl(() => {return { query: 'a=1&b=2' }})// Unbind shared parameterswx.offCopyUrl()
Was this page helpful?