2.9.0 • Published 8 months ago

nw-app-lofter v2.9.0

Weekly downloads
7
License
ISC
Repository
-
Last release
8 months ago

nw-app-lofter

功能

在H5中尝试打开Lofter App内的特定页面,如果没有安装APP,则跳转App下载页

重要更新

  • 2022-12-05 增加一项参数incantation,用于设置打开app的中转页的指定剪切板内容,防止被默认的下载归因剪切板内容覆盖

使用

npm: 通过npm安装nw-app-lofter

import {openAppLofter} from 'nw-app-lofter'
openAppLofter({
    path: 'webview',
    query: {
        url: 'http://qatest5.lofter.com'
    }
})

参数

参数为Object类型,参数各字段定义如下:

参数属性类型描述
pathStringwebview或具体页面类型
queryObject参数
actString非必须,活动包统计参数,跳下载会携带
incantationString非必须,path为WebView时,如未安装app,跳转下载中转页后,点击该页下载按钮需要写入剪切板的字符串

具体可用path和query参数如下:

pathquery描述
app只唤起app,不跳转其他页面
webviewurl:WAP页面的url如果指定WAP页面已实现APP打开功能,则打开APP内的对应页面;否则通过webview打开
homepageid:用户id个人主页
postid: 帖子id,userId:用户id单日志页
tagtagName:标签名标签页
publishTextuserId:用户id,tagName:标签名(逗号分隔)发布文字页
publishPhotouserId:用户id,tagName:标签名(逗号分隔)发布图片页
publishVideouserId:用户id,tagName:标签名(逗号分隔)发布视频页

其中,path为webview时,url指定为WAP页url。如APP可打开对应页面,则打开;否则通过webview打开。

示例:

个人主页

{
    path: 'webview',
    query: {
       // 个人主页WAP页url
       url: 'http://qatest5.lofter.com'
    }
}

{
    path: 'homepage',
    query: {
        id: 'qatest5'
    }
}

单日志页

{
    path: 'webview',
    query: {
       // 单日志页WAP页url
       url: 'http://newsexpress.lofter.com/post/1e7dc1d6_cea03e7'
    }
}

{
    path: 'post',
    query: {
        id: '1e7dc1d6_cea03e7',
        userId: 'newsexpress'
    }
}

标签页

{
    path: 'webview',
    query: {
       // 标签WAP页url
       url: 'http://www.lofter.com/tag/%E9%9F%B3%E4%B9%90'
    }
}

{
    path: 'tag',
    query: {
        tagName: '音乐'
    }
}

发布文字页

{
    path: 'webview',
    query: {
       //发布文字WAP页面url   
       url: 'http://www.lofter.com/blog/qatest5/new/text?extraTags=%E9%9F%B3%E4%B9%90,music,happy%20new%20year'
    }
}

{
    path: 'publishText',
    query: {
        userId: 'qatest5',
        tagName: '音乐,music,happy new year'
    }
}

等等...

2.9.0

8 months ago

2.8.0

8 months ago

2.7.0

1 year ago

2.6.0

1 year ago

2.5.0

2 years ago

2.5.1

2 years ago

2.4.2

2 years ago

2.4.1

2 years ago

2.4.0

3 years ago

2.3.0

3 years ago

2.2.3

4 years ago

1.27.0

4 years ago

1.26.4

5 years ago

1.12.21

6 years ago

1.12.20

6 years ago