收藏
回答

图片分享问题,showShareImageMenu无法感知是否分享?

export function showShareImageMenu(path, that) {
	//#ifdef APP-M
	uni.$emit('imagePreview', [path])
	return
	//#endif
	const { windowInfo } = getApp().globalData
	const { isPc } = getApp().globalData
	if (isPc) {
		uni.previewImage({
			urls: [path],
			current: 0,
		})
		return
	}
	wx.showShareImageMenu({
		path,
		style: windowInfo.screenWidth > 500 ? 'v2' : 'default',
		needShowEntrance: false,
		fail: ({ errMsg }) => {
			if (errMsg.includes('not supported')) {
				that.$showModal({
					title: '目前设备暂不支持分享图片格式',
					content:
						'解决方法:1、点击保存到相册然后发送给客户;\n2、在设置中使用网页链接分享;\n3、使用手机操作分享',
				})
			}
		},
	})
}
选择分享给朋友之后没有回调接口,要自己手动关闭wx.showShareImageMenu出现的窗口
回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    2025-07-25
    有用
登录 后发表内容