onShareAppMessage必须要写path吗?
发布于 6 年前 作者 tianchao 10118 次浏览 来自 问答

我记得onShareAppMessage默认是当前页面路径的,刚刚发现刚审的版本分享页拿不到页面参数。打开上一个版本的分享记录,是可以拿到页面参数并能正常访问。

左图是新通过的版本,打开的分享页,query里没有scene,却多出一个sampshare;

右图是上一个版本,打开分享页后能拿到页面参数scene。

__
__

onShareAppMessage: function () {
        return {
            title: this.data.productDetail.name,
            imageUrl: this.data.productDetail.image,
            path: `/mall-detail/mall-detail?scene=${this.data.current_pid}`
        }
    }

只好在onShareAppMessage里把path写上了,之前是没写的。

1 回复

不写的话是默认当前页面的路径和参数

回到顶部