收藏
回答

微信分享bug

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug wx.updateAppMessageShareData 微信安卓客户端 8.0.62 1.6.0

在微信中点击链接进入网页,分享时无法获取缩略图、描述等信息,生成分享卡片,而扫码进入或者在公众号中进入却可以。

wx.config({

          debug: true,

          appId: response.data.appId,

          timestamp: response.data.timestamp,

          nonceStr: response.data.nonceStr,

          signature: response.data.signature,

          jsApiList: ["updateAppMessageShareData"],

        });

        wx.ready(function () {

          //需在用户可能点击分享按钮前就先调用

          wx.updateAppMessageShareData({

            title: "服饰公司", // 分享标题

            desc: "生产服饰", // 分享描述

            link: "https://www.yunweaver.com/demo/test/index.html", // 分享链接,该链接域名或路径必须与当前页面对应的服务号JS安全域名一致

            imgUrl: "https://www.yunweaver.com/demo/test/9.jpg", // 分享图标

            success: function () {

              // 设置成功

              alert("微信分享设置成功");

            },

            fail: function (err) {

              alert("微信分享设置失败:" + err.errMsg);

            },

          });

        });

        wx.error(function (res) {

          console.error("微信分享配置错误:", res);

        });

      } else {

        console.error("获取微信分享配置失败:", response);

      }

最后一次编辑于  2025-08-28
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容