小程序分享出来的card,第一次点击跳转的逻辑?

发布于 8 年前作者 heyong15044 次浏览最后编辑 8 年前来自 issues

小程序分享出来的小程序卡片,带参数,用户第一次点击时会默认跳到小程序首页,不是分享时设置的页面路径,

请问这个问题是什么导致的?

4 回复
libai
libai1 楼6 年前

检查你分享出来的card的path是否为首页的路径?

caichao
caichao2 楼6 年前

麻烦提供能复现问题的代码片段看下(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

qianxiulan
qianxiulan3 楼6 年前

分享的代码:

onShareAppMessage: function () {
    const { discountType, statusDesc, code } = this.data
    let imageUrl = '/images/activity/share2.png'
    let path = `/pages/red-packet/red-packet`
    if (discountType === 2) {
        path = '/pages/red-packet/red-packet'
        imageUrl = '/images/activity/share-bg.png'
    }
    return {
        title: statusDesc,
        path: `${path}?code=${code}&discountType=${discountType}`,
        imageUrl
    }
}
jqin
jqin4 楼6 年前

是第一次跳首页 再点后面跳相对页面吗?