mazey-wechat-launch-app 2.0.0 → 2.1.0

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 CHANGED
@@ -49,7 +49,7 @@ app.start();
49
49
  >
50
50
  <script type="text/wxtag-template">
51
51
  <style>.mazey-launch-app-inner-btn { opacity: 0; width: 100%; height: 100%; backgroud: transparent; color: #300f54; border: none; box-sizing: border-box; text-align: center; vertical-align: middle; }</style>
52
- <button class="mazey-launch-app-inner-btn">Launch App</button>
52
+ <button class="mazey-launch-app-inner-btn">Launch App <br /><br /><br /></button>
53
53
  </script>
54
54
  </wx-open-launch-app>
55
55
  </div>
@@ -102,11 +102,13 @@ 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' |
106
- | launchContainerQuery | [selectors](https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Selectors) 有效的 CSS 选择器字符串,通常是填充按钮的父容器 | string | (必填)例如:'.example-btn', '#example-btn' |
107
- | serviceAccountAppId | 公众号的唯一标识 AppId | string | (必填)例如:'wx123' |
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 | (可选)例如:'example://example/example' |
105
+ | `weixinJsSdkTicket` | [jsapi_ticket](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62) 公众号用于调用微信JS接口的临时票据 | string | (必填)例如:`bxLdikRXVb` |
106
+ | `launchContainerQuery` | [selectors](https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Selectors) 有效的 CSS 选择器字符串,通常是填充按钮的父容器 | string | (必填)例如:`.example-btn`, `#example-btn` |
107
+ | `serviceAccountAppId` | 公众号的唯一标识 AppId | string | (必填)例如:`wx123` |
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 | (可选)例如:'example://example/example' |
110
+ | `launchBtnStyle` | 按钮内联样式 | string | (可选)例如:`top:0;right:0;bottom:0;left:0;` |
111
+ | `launchBtnText` | 按钮文字 | string | (可选)例如:`打开 App` |
110
112
 
111
113
  ### 方法
112
114
 
@@ -116,6 +118,33 @@ window.mazey = mazey;
116
118
  | update | 更新 | function |
117
119
  | destroy | 销毁 | function |
118
120
 
121
+ ## FAQ
122
+
123
+ **1\. 为什么微信里面通过分享卡片能唤起,直接打开链接却无法唤起的?**
124
+
125
+ 截止 2023-08-10,只有微信 SDK 生成的卡片和服务号推送的消息才能唤起 App。
126
+
127
+ **2\. 如何修改按钮样式?**
128
+
129
+ 方法一:
130
+
131
+ 通过 `launchBtnStyle` 参数添加内联样式,通过 `launchBtnText` 参数修改按钮文字。
132
+
133
+
134
+ 方法二(推荐):
135
+
136
+ 如官方所说,模版的样式是和页面隔离的,建议将此处透明的开放标签覆盖在原按钮上,这样就可以保留原按钮的样式,同时又可以实现点击跳转。
137
+
138
+ **3\. 如何确保满足唤起的所有前置条件?**
139
+
140
+ (1)开放平台、服务号已认证,并且主体一致;
141
+
142
+ (2)开放平台绑定服务号;
143
+
144
+ (3)开放平台绑定移动应用,并且已认证;
145
+
146
+ (4)服务号绑定域名。
147
+
119
148
  ## Contributing
120
149
 
121
150
  **Install Dependencies**
@@ -124,7 +153,7 @@ window.mazey = mazey;
124
153
  npm i
125
154
  ```
126
155
 
127
- **Serve**
156
+ **Development**
128
157
 
129
158
  ```
130
159
  npm run dev
package/lib/index.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * mazey-wechat-launch-app v2.0.0 https://www.npmjs.com/package/mazey-wechat-launch-app
2
+ * mazey-wechat-launch-app v2.1.0 https://www.npmjs.com/package/mazey-wechat-launch-app
3
3
  * (c) 2018-2023 Mazey Chu
4
4
  * Released under the MIT License.
5
5
  */
package/lib/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * mazey-wechat-launch-app v2.0.0 https://www.npmjs.com/package/mazey-wechat-launch-app
2
+ * mazey-wechat-launch-app v2.1.0 https://www.npmjs.com/package/mazey-wechat-launch-app
3
3
  * (c) 2018-2023 Mazey Chu
4
4
  * Released under the MIT License.
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mazey-wechat-launch-app",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Launch App in WeChat/Weixin",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",