Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信小程序-分享好友失败-onShareAppMessage-函数不触发 #8451

Closed
nuts-cake opened this issue Jan 6, 2021 · 5 comments
Closed
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@nuts-cake
Copy link

相关平台

微信小程序

小程序基础库: 2.14.1
使用框架: React

复现步骤

分享按钮

期望结果

onShareAppMessage() {
const { memberInfo } = this.props.user
console.log('分享~', memberInfo)
// if (res.from === 'button') {
// 来自页面内转发按钮
// }
return {
title: ${memberInfo.name}的会员邀请,
path: '/pages/******/index',
}
}

实际结果

函数没有触发 log打印不出来

环境信息

� Taro v3.0.7


  Taro CLI 3.0.7 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.4 - C:\Users\Administrator\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.6 - C:\Program Files\nodejs\npm.CMD


补充信息

在Taro2可以

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Jan 6, 2021
@kala888
Copy link
Contributor

kala888 commented Jan 6, 2021

相应页面,添加 xxx.config.js
image

@nuts-cake
Copy link
Author

相应页面,添加 xxx.config.js
image

您好,图片打不开,
我的有index.config.ts的
配置内容如下:
export default {
navigationBarTitleText: '我的',
navigationBarBackgroundColor: '#e42220',
navigationBarTextStyle: 'white'
}

@Chen-jj
Copy link
Contributor

Chen-jj commented Jan 6, 2021

@nuts-cake
Copy link
Author

https://taro-docs.jd.com/taro/docs/next/react#onshareappmessage-object

谢谢!是我没仔细看文档,已实现功能,麻烦了

@quninnd
Copy link

quninnd commented Jun 22, 2021

enableShareAppMessage:true,在app.config.json能全局实现吗,我试了一下貌似不行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

4 participants