vant
This commit is contained in:
1
utils/dist/goods-action-button/index.d.ts
vendored
Normal file
1
utils/dist/goods-action-button/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
41
utils/dist/goods-action-button/index.js
vendored
Normal file
41
utils/dist/goods-action-button/index.js
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { link } from '../mixins/link';
|
||||
import { button } from '../mixins/button';
|
||||
import { openType } from '../mixins/open-type';
|
||||
VantComponent({
|
||||
mixins: [link, button, openType],
|
||||
relation: {
|
||||
type: 'ancestor',
|
||||
name: 'goods-action',
|
||||
linked(parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
},
|
||||
props: {
|
||||
text: String,
|
||||
color: String,
|
||||
loading: Boolean,
|
||||
disabled: Boolean,
|
||||
type: {
|
||||
type: String,
|
||||
value: 'danger'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.updateStyle();
|
||||
},
|
||||
methods: {
|
||||
onClick(event) {
|
||||
this.$emit('click', event.detail);
|
||||
this.jumpLink();
|
||||
},
|
||||
updateStyle() {
|
||||
const { children = [] } = this.parent;
|
||||
const index = children.indexOf(this);
|
||||
this.setData({
|
||||
isFirst: index === 0,
|
||||
isLast: index === children.length - 1
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
6
utils/dist/goods-action-button/index.json
vendored
Normal file
6
utils/dist/goods-action-button/index.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-button": "../button/index"
|
||||
}
|
||||
}
|
||||
28
utils/dist/goods-action-button/index.wxml
vendored
Normal file
28
utils/dist/goods-action-button/index.wxml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<van-button
|
||||
square
|
||||
id="{{ id }}"
|
||||
lang="{{ lang }}"
|
||||
type="{{ type }}"
|
||||
color="{{ color }}"
|
||||
loading="{{ loading }}"
|
||||
disabled="{{ disabled }}"
|
||||
open-type="{{ openType }}"
|
||||
custom-class="{{ utils.bem('goods-action-button', [type, { first: isFirst, last: isLast }]) }}"
|
||||
business-id="{{ businessId }}"
|
||||
session-from="{{ sessionFrom }}"
|
||||
app-parameter="{{ appParameter }}"
|
||||
send-message-img="{{ sendMessageImg }}"
|
||||
send-message-path="{{ sendMessagePath }}"
|
||||
show-message-card="{{ showMessageCard }}"
|
||||
send-message-title="{{ sendMessageTitle }}"
|
||||
bind:click="onClick"
|
||||
binderror="bindError"
|
||||
bindcontact="bindContact"
|
||||
bindopensetting="bindOpenSetting"
|
||||
bindgetuserinfo="bindGetUserInfo"
|
||||
bindgetphonenumber="bindGetPhoneNumber"
|
||||
bindlaunchapp="bindLaunchApp"
|
||||
>
|
||||
{{ text }}
|
||||
</van-button>
|
||||
1
utils/dist/goods-action-button/index.wxss
vendored
Normal file
1
utils/dist/goods-action-button/index.wxss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-goods-action-button{border:none!important;height:40px!important;height:var(--goods-action-button-height,40px)!important;font-weight:500!important;font-weight:var(--font-weight-bold,500)!important;line-height:40px!important;line-height:var(--goods-action-button-height,40px)!important}.van-goods-action-button--first{display:block!important;margin-left:5px;border-top-left-radius:20px!important;border-top-left-radius:var(--goods-action-button-border-radius,20px)!important;border-bottom-left-radius:20px!important;border-bottom-left-radius:var(--goods-action-button-border-radius,20px)!important}.van-goods-action-button--last{display:block!important;margin-right:5px;border-top-right-radius:20px!important;border-top-right-radius:var(--goods-action-button-border-radius,20px)!important;border-bottom-right-radius:20px!important;border-bottom-right-radius:var(--goods-action-button-border-radius,20px)!important}.van-goods-action-button--warning{background:linear-gradient(90deg,#ffd01e,#ff8917);background:var(--goods-action-button-warning-color,linear-gradient(90deg,#ffd01e,#ff8917))}.van-goods-action-button--danger{background:linear-gradient(90deg,#ff6034,#ee0a24);background:var(--goods-action-button-danger-color,linear-gradient(90deg,#ff6034,#ee0a24))}@media (max-width:321px){.van-goods-action-button{font-size:13px}}
|
||||
Reference in New Issue
Block a user