收藏
回答

目前小程序可以分享给朋友 但是不能分享到朋友圈

框架类型 问题类型 操作系统 工具版本
小程序 Bug Windows 3.8.7

export default {

  install(app) {

    app.mixin({

      onLoad() {

        const page = getCurrentPages().pop()

        if (page) {

          uni.showShareMenu({

            withShareTicket: true,

            menus: ['shareAppMessage', 'shareTimeline'],

          })

        }

      },

      

      // 添加朋友圈分享支持

      methods: {

        // 好友分享

        onShareAppMessage() {

          return {

            title: '分享标题',

            path: '/pages/login',

            imageUrl: 'https://example.com/share-image.jpg'

          }

        },

        

        // 朋友圈分享

        onShareTimeline() {

          return {

            title: '分享到朋友圈的标题',

            query: '', // 朋友圈分享不支持带参数

            imageUrl: 'https://example.com/timeline-image.jpg' // 自定义分享图

          }

        }

      }

    })

  }

}

求大佬帮忙解决 实在不知道里的问题了

回答关注问题邀请回答
收藏
登录 后发表内容