https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/miniapp/api/miniapp/shareImageMessage.htmlhttps://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/private-message.html
imageClick(e) {
wx.miniapp.shareImageMessage({
imagePath: '存储图片的本地路径',
thumbPath: '存储图片的本地路径',
scene: 0,
success(res) {
wx.showToast({
title: '成功:分享图片',
})
},
fail() {
wx.showToast({
title: '失败:分享图片',
})
}
})
}
需要open能力?能不能把这个写详细一点。完整代码太多了,就不贴出来了,我直接添加了点击事件,开发者工具报错
MiniProgramError
undefined is not an object (evaluating 'wx.miniapp.shareImageMessage')
TypeError: undefined is not an object (evaluating 'wx.miniapp.shareImageMessage')
@https://usr//pages/CustomComponents/bill_image/bill_image.appservice.js:2:2315
@[native code]
h@https://lib/WAServiceMainContext.js:1:41733
imageClick@[native code]
imageClick@https://usr//pages/CustomComponents/bill_image/bill_image.appservice.js:2:2892
@https://lib/WASubContext.js:1:193687
@https://lib/WASubContext.js:1:392726
pe@https://lib/WASubContext.js:1:282486
de@https://lib/WASubContext.js:1:282379
@https://lib/WASubContext.js:1:283060
@https://lib/WAServiceMainContext.js:1:932431
emit@https://lib/WAServiceMainContext.js:1:339104
emit@[native code]
dispatch@https://lib/WAServiceMainContext.js:1:350899
cb@https://lib/WAServiceMainContext.js:1:351440
cb@[native code]
emit@https://lib/WAServiceMainContext.js:1:338476
subscribeHandler@https://lib/WAServiceMainContext.js:1:346736
@[native code]
global code@
是什么原因呢?去哪里可以设置呢?没有文档吗?让开发者去猜吗?
wx.miniapp.shareImageMessage 多端应用api,小程序不能用哈。
你提问的时候不也一样,多写点能死啊
wx.miniapp.shareImageMessage 多端应用api,小程序不能用