收藏
回答

onShareTimeline()分享到朋友圈时,为什么苹果手机的自定义缩略图不显示?

onShareTimeline() {

        return {

            title: this.title,

            query: 'productId='+ this.id + '&resaleId=' + this.resaleId,

            imageUrl: this.coverPicUrl + '-cw200h200',

            success() {

                ui.toastSucc('分享成功');

            },

            fail() {

                ui.toastSucc('分享失败');

            }

        };

    }


自定义的是一个七牛的图片,https链接,安卓手机分享到朋友圈是有缩略图的,苹果手机没有,但是苹果手机分享给好友是有图片的,缩略图都是同一张图,为什么只有分享到朋友圈不显示呢?

回答关注问题邀请回答
收藏

2 个回答

  • 二次元
    二次元
    2025-12-16

    最行之有效的方式是:将缩略图片下载,使用小程序本地图片进行朋友圈分享:


    // 在页面加载时预下载分享图片
    onLoad() {
      this.preloadShareImage()
    },
    
    
    preloadShareImage() {
      wx.downloadFile({
        url: 'https://your-domain.com/share-image.jpg',
        success: (res) => {
          this.shareImagePath = res.tempFilePath
        }
      })
    },
    
    
    onShareTimeline() {
      return {
        title: '分享标题',
        imageUrl: this.shareImagePath || '/images/default-share.jpg'
      }
    }
    
    2025-12-16
    有用
    回复
  • 智能回答 智能回答 本次回答由AI生成
    2025-12-15
    有用
    回复
登录 后发表内容