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

Taro 3.3.3 微信小程序插件Taro. Current.page缺失onShareAppMessage函数 #10105

Closed
BinZhiZhu opened this issue Aug 23, 2021 · 3 comments · Fixed by #11284
Closed

Taro 3.3.3 微信小程序插件Taro. Current.page缺失onShareAppMessage函数 #10105

BinZhiZhu opened this issue Aug 23, 2021 · 3 comments · Fixed by #11284
Assignees
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@BinZhiZhu
Copy link

相关平台

微信小程序

复现仓库

https://github.com/BinZhiZhu/taro-wx-plugin
小程序基础库: 2.19.2
使用框架: React

复现步骤

taro init然后选择wxplugin模板,微信开发者工具打开模板,在插件模板页面增加自定义分享代码片段:

  onShareAppMessage(res) {
    console.log('onShareAppMessage',res)
    return {
      title: '享受会员福利,解锁品质生活',
      path: '/pages/index/index',
      imageUrl: ''
  }
  }

期望结果

插件页面可自定义分享

实际结果

没有触发onShareAppMessage

环境信息

➜  mini-plugin git:(master) ✗ taro info
👽 Taro v3.3.3


  Taro CLI 3.3.3 environment info:
    System:
      OS: macOS 11.2.3
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.17.3 - /usr/local/bin/node
      Yarn: 1.15.2 - /usr/local/bin/yarn
      npm: 6.14.13 - /usr/local/bin/npm
    npmPackages:
      @tarojs/components: 3.3.3 => 3.3.3 
      @tarojs/mini-runner: 3.3.3 => 3.3.3 
      @tarojs/react: 3.3.3 => 3.3.3 
      @tarojs/runtime: 3.3.3 => 3.3.3 
      @tarojs/taro: 3.3.3 => 3.3.3 
      @tarojs/webpack-runner: 3.3.3 => 3.3.3 
      babel-preset-taro: 3.3.3 => 3.3.3 
      eslint-config-taro: 3.3.3 => 3.3.3 
      react: ^17.0.0 => 17.0.2 
    npmGlobalPackages:
      typescript: 3.5.2


补充信息

我看到issue中,最新的版本修复了一些问题(例如文件修改报错问题),所以我直接升级到了3.3.3版本,Taro3.3.3开发小程序插件页面打印Taro. Current.page缺失页面处理函数:onShareAppMessage,看下方截图:

hilaQO.png

我用原生的微信小程序插件模板代码,插件页面打印this对象是存在onShareAppMessage且可支持自定义分享:

hilO6U.png

@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 23, 2021
@BinZhiZhu
Copy link
Author

对比来看,除了onShareAppMessage,其他一些页面函数也表现不一致,这个是因为Taro实例没同步好问题吗?印象中好像上一两个版本才修复,3.3.1中Taro实例还是undefined的

@BinZhiZhu
Copy link
Author

@luckyadam @Chen-jj 帮忙看看

@luckyadam luckyadam self-assigned this Aug 24, 2021
@BinZhiZhu
Copy link
Author

大佬,这个问题可确认是否是bug么?我们有个项目用Taro3开发小程序插件,还专门是搞分享的,准备上线了,现在直接卡在这边了,做到最后才发现分享有问题 = =,现在有点进退两难,能否告知一下具体啥情况,如果是bug要啥时可以修复发布,我们好评估一下是否选择其他方案了 😢 @luckyadam

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

Successfully merging a pull request may close this issue.

3 participants