当前位置:网站首页>Taro2.* applet configuration sharing wechat circle of friends

Taro2.* applet configuration sharing wechat circle of friends

2022-07-07 01:17:00 yunchong_ zhao

if (Taro.getEnv() === Taro.ENV_TYPE.WEAPP) {
    
      Taro.showShareMenu({
    
        withShareTicket: true,
        menus: ["shareAppMessage", "shareTimeline"],
        success(res) {
    
          console.log(res);
        },
        fail(e) {
    
          console.log(e);
        },
      });
    }
//  Wechat sharing friends 
  onShareAppMessage() {
    
    return {
    
      title: this.state.shareMessage.Title,
      path: this.state.shareMessage.Path,
      imageUrl: this.state.shareMessage.ImgUrl,
    };
  }
  //  Share a circle of friends 
  onShareTimeline() {
    
    return {
    
      title: this.state.shareMessage.Title,
      query: this.state.shareMessage.Path,
      imageUrl: this.state.shareMessage.ImgUrl,
    };
  }

Pay attention :
If the applet page is embedded webview And then set up a h5 Address if . This does not support sharing a circle of friends , I wonder if I can

Pay attention to my continuous updating of front-end knowledge

原网站

版权声明
本文为[yunchong_ zhao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061729347978.html