Просмотр исходного кода

1.提交微信登录方法。
2.提交分享方法

zhangmengjie 6 лет назад
Родитель
Сommit
f4ec368ffb
2 измененных файлов с 7 добавлено и 0 удалено
  1. 1 0
      pages/components/SharedDialog.js
  2. 6 0
      pages/utils/wechat.js

+ 1 - 0
pages/components/SharedDialog.js

@@ -224,6 +224,7 @@ export default class SharedDialog extends Component<Props> {
   wechat() {
     this.setModalVisible(false);
     wechat.shareToSessionText("测试测试测试shareToSessionText");
+    // wechat.wechatLogin();
   }
   circle() {
     this.setModalVisible(false);

+ 6 - 0
pages/utils/wechat.js

@@ -6,6 +6,12 @@ import * as WeChat from "react-native-wechat";
  */
 WeChat.registerApp("wx51acc19c8f7a0f6f");
 export default class wechat {
+  static wechatLogin() {
+    WeChat.sendAuthRequest("snsapi_userinfo").then(result => {
+      console.log(result);
+    });
+  }
+
   /**
    * 好友文字分享
    * @param  {string} descriptiontext      测试微信好友分享的文本内容