mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[new feature] GoodsAction: 支持open-type等更多Button API (#798)
This commit is contained in:
parent
1ac81319a8
commit
f1e5a51c68
@ -3,7 +3,7 @@
|
|||||||
<van-goods-action-icon
|
<van-goods-action-icon
|
||||||
icon="chat"
|
icon="chat"
|
||||||
text="客服"
|
text="客服"
|
||||||
bind:click="onClickIcon"
|
open-type="contact"
|
||||||
/>
|
/>
|
||||||
<van-goods-action-icon
|
<van-goods-action-icon
|
||||||
icon="cart"
|
icon="cart"
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { link } from '../mixins/link';
|
|
||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
|
import { link } from '../mixins/link';
|
||||||
|
import { button } from '../mixins/button';
|
||||||
|
import { openType } from '../mixins/open-type';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
mixins: [link],
|
mixins: [link, button, openType],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
text: String,
|
text: String,
|
||||||
|
@ -5,7 +5,24 @@
|
|||||||
loading="{{ loading }}"
|
loading="{{ loading }}"
|
||||||
disabled="{{ disabled }}"
|
disabled="{{ disabled }}"
|
||||||
custom-class="custom-class"
|
custom-class="custom-class"
|
||||||
bind:click="onClick"
|
id="{{ id }}"
|
||||||
|
lang="{{ lang }}"
|
||||||
|
open-type="{{ openType }}"
|
||||||
|
app-parameter="{{ appParameter }}"
|
||||||
|
hover-stay-time="{{ hoverStayTime }}"
|
||||||
|
hover-start-time="{{ hoverStartTime }}"
|
||||||
|
hover-stop-propagation="{{ hoverStopPropagation }}"
|
||||||
|
session-from="{{ sessionFrom }}"
|
||||||
|
send-message-title="{{ sendMessageTitle }}"
|
||||||
|
send-message-path="{{ sendMessagePath }}"
|
||||||
|
send-message-img="{{ sendMessageImg }}"
|
||||||
|
show-message-card="{{ showMessageCard }}"
|
||||||
|
bind:tap="onClick"
|
||||||
|
binderror="bindError"
|
||||||
|
bindcontact="bindContact"
|
||||||
|
bindopensetting="bindOpenSetting"
|
||||||
|
bindgetuserinfo="bindGetUserInfo"
|
||||||
|
bindgetphonenumber="bindGetPhoneNumber"
|
||||||
>
|
>
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</van-button>
|
</van-button>
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { link } from '../mixins/link';
|
|
||||||
import { VantComponent } from '../common/component';
|
import { VantComponent } from '../common/component';
|
||||||
|
import { link } from '../mixins/link';
|
||||||
|
import { button } from '../mixins/button';
|
||||||
|
import { openType } from '../mixins/open-type';
|
||||||
|
|
||||||
VantComponent({
|
VantComponent({
|
||||||
mixins: [link],
|
mixins: [link, button, openType],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
text: String,
|
text: String,
|
||||||
|
@ -1,7 +1,27 @@
|
|||||||
<van-button
|
<van-button
|
||||||
custom-class="van-goods-action-icon"
|
custom-class="van-goods-action-icon"
|
||||||
size="large"
|
size="large"
|
||||||
|
disabled="{{ disabled }}"
|
||||||
|
loading="{{ loading }}"
|
||||||
|
square
|
||||||
|
id="{{ id }}"
|
||||||
|
lang="{{ lang }}"
|
||||||
|
open-type="{{ openType }}"
|
||||||
|
app-parameter="{{ appParameter }}"
|
||||||
|
hover-stay-time="{{ hoverStayTime }}"
|
||||||
|
hover-start-time="{{ hoverStartTime }}"
|
||||||
|
hover-stop-propagation="{{ hoverStopPropagation }}"
|
||||||
|
session-from="{{ sessionFrom }}"
|
||||||
|
send-message-title="{{ sendMessageTitle }}"
|
||||||
|
send-message-path="{{ sendMessagePath }}"
|
||||||
|
send-message-img="{{ sendMessageImg }}"
|
||||||
|
show-message-card="{{ showMessageCard }}"
|
||||||
bind:tap="onClick"
|
bind:tap="onClick"
|
||||||
|
binderror="bindError"
|
||||||
|
bindcontact="bindContact"
|
||||||
|
bindopensetting="bindOpenSetting"
|
||||||
|
bindgetuserinfo="bindGetUserInfo"
|
||||||
|
bindgetphonenumber="bindGetPhoneNumber"
|
||||||
>
|
>
|
||||||
<view class="van-goods-action-icon__content van-hairline--right">
|
<view class="van-goods-action-icon__content van-hairline--right">
|
||||||
<van-icon
|
<van-icon
|
||||||
|
@ -73,17 +73,43 @@ Page({
|
|||||||
| info | 图标右上角提示信息 | `String | Number` | - |
|
| info | 图标右上角提示信息 | `String | Number` | - |
|
||||||
| url | 跳转链接 | `String` | - |
|
| url | 跳转链接 | `String` | - |
|
||||||
| link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | `String` | `navigateTo` |
|
| link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | `String` | `navigateTo` |
|
||||||
|
| id | 标识符 | `String` | - |
|
||||||
|
| type | 按钮类型,可选值为 `primary` `warning` `danger` | `String` | `default` |
|
||||||
|
| disabled | 是否禁用按钮 | `Boolean` | `false` |
|
||||||
|
| loading | 是否显示为加载状态 | `Boolean` | `false` |
|
||||||
|
| open-type | 微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | `String` | - |
|
||||||
|
| app-parameter | 打开 APP 时,向 APP 传递的参数 | `String` | - |
|
||||||
|
| hover-start-time | 按住后多久出现点击态,单位毫秒 | `Number` | 20 |
|
||||||
|
| hover-stay-time | 手指松开后点击态保留时间,单位毫秒 | `Number` | 70 |
|
||||||
|
| lang | 指定返回用户信息的语言,zh_CN 简体中文,<br>zh_TW 繁体中文,en 英文 | `String` | `en` |
|
||||||
|
| session-from | 会话来源 | `String` | - |
|
||||||
|
| send-message-title | 会话内消息卡片标题 | `String` | 当前标题 |
|
||||||
|
| send-message-path | 会话内消息卡片点击跳转小程序路径 | `String` | 当前分享路径 |
|
||||||
|
| send-message-img | sendMessageImg | `String` | 截图 |
|
||||||
|
| show-message-card | 显示会话内消息卡片 | `String` | `false` |
|
||||||
|
|
||||||
### GoodsActionButton API
|
### GoodsActionButton API
|
||||||
|
|
||||||
| 参数 | 说明 | 类型 | 默认值 |
|
| 参数 | 说明 | 类型 | 默认值 |
|
||||||
|-----------|-----------|-----------|-------------|
|
|-----------|-----------|-----------|-------------|
|
||||||
| text | 按钮文字 | `String` | - |
|
| text | 按钮文字 | `String` | - |
|
||||||
| type | 按钮类型 | `String` | `danger` |
|
|
||||||
| disabled | 是否禁用按钮 | `Boolean` | `false` |
|
|
||||||
| loading | 是否显示为加载状态 | `Boolean` | `false` |
|
|
||||||
| url | 跳转链接 | `String` | - |
|
| url | 跳转链接 | `String` | - |
|
||||||
| link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | `String` | `navigateTo` |
|
| link-type | 链接跳转类型,可选值为 `redirectTo` `switchTab` `reLaunch` | `String` | `navigateTo` |
|
||||||
|
| id | 标识符 | `String` | - |
|
||||||
|
| type | 按钮类型,可选值为 `primary` `warning` `danger` | `String` | `default` |
|
||||||
|
| size | 按钮尺寸,可选值为 `normal` `large` `small` `mini` | `String` | `normal` |
|
||||||
|
| disabled | 是否禁用按钮 | `Boolean` | `false` |
|
||||||
|
| loading | 是否显示为加载状态 | `Boolean` | `false` |
|
||||||
|
| open-type | 微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | `String` | - |
|
||||||
|
| app-parameter | 打开 APP 时,向 APP 传递的参数 | `String` | - |
|
||||||
|
| hover-start-time | 按住后多久出现点击态,单位毫秒 | `Number` | 20 |
|
||||||
|
| hover-stay-time | 手指松开后点击态保留时间,单位毫秒 | `Number` | 70 |
|
||||||
|
| lang | 指定返回用户信息的语言,zh_CN 简体中文,<br>zh_TW 繁体中文,en 英文 | `String` | `en` |
|
||||||
|
| session-from | 会话来源 | `String` | - |
|
||||||
|
| send-message-title | 会话内消息卡片标题 | `String` | 当前标题 |
|
||||||
|
| send-message-path | 会话内消息卡片点击跳转小程序路径 | `String` | 当前分享路径 |
|
||||||
|
| send-message-img | sendMessageImg | `String` | 截图 |
|
||||||
|
| show-message-card | 显示会话内消息卡片 | `String` | `false` |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user