mazey-wechat-launch-app 2.1.1 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/lib/index.cjs.js +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/launch-app.min.js +1 -1
- package/package.json +1 -1
- package/examples/index.html +0 -20
- package/examples/index.ts +0 -1
- package/scripts/env.sh +0 -2
- package/scripts/release.js +0 -6
- package/scripts/webpack.config.dev.js +0 -40
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npm install mazey-wechat-launch-app --save
|
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
|
-
### NPM
|
|
23
|
+
### 1. NPM
|
|
24
24
|
|
|
25
25
|
```
|
|
26
26
|
import LAUNCH_APP from 'mazey-wechat-launch-app';
|
|
@@ -68,20 +68,20 @@ npm install js-sha1 jquery mazey --save
|
|
|
68
68
|
```
|
|
69
69
|
import sha1 from 'js-sha1';
|
|
70
70
|
import $ from 'jquery';
|
|
71
|
-
import mazey from 'mazey';
|
|
71
|
+
import * as mazey from 'mazey';
|
|
72
72
|
|
|
73
73
|
window.sha1 = sha1;
|
|
74
74
|
window.$ = $;
|
|
75
75
|
window.mazey = mazey;
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
### CDN
|
|
78
|
+
### 2. CDN
|
|
79
79
|
|
|
80
80
|
```
|
|
81
81
|
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
|
82
82
|
<script type="text/javascript" src="//i.mazey.net/lib/jquery/2.1.1/jquery.min.js"></script>
|
|
83
83
|
<script type="text/javascript" src="//i.mazey.net/lib/encode/js-sha1/0.6.0/sha1.min.js"></script>
|
|
84
|
-
<script type="text/javascript" src="//i.mazey.net/lib/mazey/3.
|
|
84
|
+
<script type="text/javascript" src="//i.mazey.net/lib/mazey/3.9.5/mazey.min.js"></script>
|
|
85
85
|
<script type="text/javascript" src="//i.mazey.net/lib/mazey-wechat-launch-app/1.1.2/launch-app.min.js"></script>
|
|
86
86
|
<script>
|
|
87
87
|
var options = {
|
|
@@ -102,11 +102,11 @@ window.mazey = mazey;
|
|
|
102
102
|
|
|
103
103
|
| 参数 | 说明 | 类型 | 值 |
|
|
104
104
|
| :------------ | :------------ | :------------ | :------------ |
|
|
105
|
-
| `weixinJsSdkTicket` | [jsapi_ticket](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62) 公众号用于调用微信JS接口的临时票据 | string | (必填)例如:`bxLdikRXVb` |
|
|
105
|
+
| `weixinJsSdkTicket` | [jsapi_ticket](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62) 公众号用于调用微信 JS 接口的临时票据 | string | (必填)例如:`bxLdikRXVb` |
|
|
106
106
|
| `launchContainerQuery` | [selectors](https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Selectors) 有效的 CSS 选择器字符串,通常是填充按钮的父容器 | string | (必填)例如:`.example-btn`, `#example-btn` |
|
|
107
107
|
| `serviceAccountAppId` | 公众号的唯一标识 AppId | string | (必填)例如:`wx123` |
|
|
108
108
|
| `openPlatformMobileAppId` | 开放平台内所需跳转的移动应用的 AppId | string | (必填)例如:`wx456` |
|
|
109
|
-
| `extInfo` | [extinfo](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html#%E8%B7%B3%E8%BD%ACAPP%EF%BC%9Awx-open-launch-app) 跳转所需额外信息 | string |
|
|
109
|
+
| `extInfo` | [extinfo](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html#%E8%B7%B3%E8%BD%ACAPP%EF%BC%9Awx-open-launch-app) 跳转所需额外信息 | string | (可选)例如:`example://example/example` |
|
|
110
110
|
| `launchBtnStyle` | 按钮内联样式 | string | (可选)例如:`top:0;right:0;bottom:0;left:0;` |
|
|
111
111
|
| `launchBtnText` | 按钮文字 | string | (可选)例如:`打开 App` |
|
|
112
112
|
|
|
@@ -114,9 +114,9 @@ window.mazey = mazey;
|
|
|
114
114
|
|
|
115
115
|
| 方法 | 说明 | 类型 |
|
|
116
116
|
| :------------ | :------------ | :------------ |
|
|
117
|
-
| start | 生成 | function |
|
|
118
|
-
| update | 更新 | function |
|
|
119
|
-
| destroy | 销毁 | function |
|
|
117
|
+
| `start` | 生成 | function |
|
|
118
|
+
| `update` | 更新 | function |
|
|
119
|
+
| `destroy` | 销毁 | function |
|
|
120
120
|
|
|
121
121
|
## FAQ
|
|
122
122
|
|
|
@@ -126,14 +126,14 @@ window.mazey = mazey;
|
|
|
126
126
|
|
|
127
127
|
**2\. 如何修改按钮样式?**
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
方法一(推荐):
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
如官方所说,模版的样式是和页面隔离的,建议将此处透明的开放标签覆盖在原按钮上,这样就可以保留原按钮的样式,同时又可以实现点击跳转。
|
|
132
132
|
|
|
133
|
+
方法二:
|
|
133
134
|
|
|
134
|
-
|
|
135
|
+
通过 `launchBtnStyle` 参数添加内联样式,通过 `launchBtnText` 参数修改按钮文字。
|
|
135
136
|
|
|
136
|
-
如官方所说,模版的样式是和页面隔离的,建议将此处透明的开放标签覆盖在原按钮上,这样就可以保留原按钮的样式,同时又可以实现点击跳转。
|
|
137
137
|
|
|
138
138
|
**3\. 如何确保满足唤起的所有前置条件?**
|
|
139
139
|
|
package/lib/index.cjs.js
CHANGED
package/lib/index.esm.js
CHANGED
package/lib/launch-app.min.js
CHANGED
package/package.json
CHANGED
package/examples/index.html
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>Test Page: mazey-wechat-launch-app</title>
|
|
6
|
-
<link rel="shortcut icon" type="image/png" href="https://mazey.cn/fav/logo-dark-circle-transparent-144x144.png">
|
|
7
|
-
<style>
|
|
8
|
-
.box {
|
|
9
|
-
color: #333;
|
|
10
|
-
}
|
|
11
|
-
</style>
|
|
12
|
-
</head>
|
|
13
|
-
<body>
|
|
14
|
-
<div class="container">
|
|
15
|
-
<div class="box">
|
|
16
|
-
<span>Content: mazey-wechat-launch-app </span>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
package/examples/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log('dev: mazey-wechat-launch-app');
|
package/scripts/env.sh
DELETED
package/scripts/release.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
|
-
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const _resolve = (_path) => path.resolve(__dirname, _path);
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
entry: {
|
|
10
|
-
index: _resolve('../examples/index.ts'),
|
|
11
|
-
},
|
|
12
|
-
output: {
|
|
13
|
-
filename: '[name].js',
|
|
14
|
-
path: _resolve('../dist'),
|
|
15
|
-
},
|
|
16
|
-
devServer: {
|
|
17
|
-
contentBase: _resolve('../dist'),
|
|
18
|
-
},
|
|
19
|
-
module: {
|
|
20
|
-
rules: [
|
|
21
|
-
{
|
|
22
|
-
test: /\.tsx?$/,
|
|
23
|
-
use: 'ts-loader',
|
|
24
|
-
exclude: /node_modules/,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
plugins: [
|
|
29
|
-
new HtmlWebpackPlugin({
|
|
30
|
-
filename: _resolve('../dist/index.html'),
|
|
31
|
-
template: _resolve('../examples/index.html'),
|
|
32
|
-
inject: true,
|
|
33
|
-
chunksSortMode: 'dependency',
|
|
34
|
-
}),
|
|
35
|
-
new CleanWebpackPlugin([_resolve('../dist')]),
|
|
36
|
-
],
|
|
37
|
-
resolve: {
|
|
38
|
-
extensions: ['.tsx', '.ts', '.js'],
|
|
39
|
-
},
|
|
40
|
-
};
|