换ubuntu
This commit is contained in:
2
utils/dist/submit-bar/index.d.ts
vendored
2
utils/dist/submit-bar/index.d.ts
vendored
@@ -1 +1 @@
|
||||
export {};
|
||||
export {};
|
||||
|
||||
114
utils/dist/submit-bar/index.js
vendored
114
utils/dist/submit-bar/index.js
vendored
@@ -1,57 +1,57 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
classes: [
|
||||
'bar-class',
|
||||
'price-class',
|
||||
'button-class'
|
||||
],
|
||||
props: {
|
||||
tip: {
|
||||
type: null,
|
||||
observer: 'updateTip'
|
||||
},
|
||||
tipIcon: String,
|
||||
type: Number,
|
||||
price: {
|
||||
type: null,
|
||||
observer: 'updatePrice'
|
||||
},
|
||||
label: String,
|
||||
loading: Boolean,
|
||||
disabled: Boolean,
|
||||
buttonText: String,
|
||||
currency: {
|
||||
type: String,
|
||||
value: '¥'
|
||||
},
|
||||
buttonType: {
|
||||
type: String,
|
||||
value: 'danger'
|
||||
},
|
||||
decimalLength: {
|
||||
type: Number,
|
||||
value: 2,
|
||||
observer: 'updatePrice'
|
||||
},
|
||||
suffixLabel: String,
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updatePrice() {
|
||||
const { price, decimalLength } = this.data;
|
||||
this.setData({
|
||||
hasPrice: typeof price === 'number',
|
||||
priceStr: (price / 100).toFixed(decimalLength)
|
||||
});
|
||||
},
|
||||
updateTip() {
|
||||
this.setData({ hasTip: typeof this.data.tip === 'string' });
|
||||
},
|
||||
onSubmit(event) {
|
||||
this.$emit('submit', event.detail);
|
||||
}
|
||||
}
|
||||
});
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
classes: [
|
||||
'bar-class',
|
||||
'price-class',
|
||||
'button-class'
|
||||
],
|
||||
props: {
|
||||
tip: {
|
||||
type: null,
|
||||
observer: 'updateTip'
|
||||
},
|
||||
tipIcon: String,
|
||||
type: Number,
|
||||
price: {
|
||||
type: null,
|
||||
observer: 'updatePrice'
|
||||
},
|
||||
label: String,
|
||||
loading: Boolean,
|
||||
disabled: Boolean,
|
||||
buttonText: String,
|
||||
currency: {
|
||||
type: String,
|
||||
value: '¥'
|
||||
},
|
||||
buttonType: {
|
||||
type: String,
|
||||
value: 'danger'
|
||||
},
|
||||
decimalLength: {
|
||||
type: Number,
|
||||
value: 2,
|
||||
observer: 'updatePrice'
|
||||
},
|
||||
suffixLabel: String,
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updatePrice() {
|
||||
const { price, decimalLength } = this.data;
|
||||
this.setData({
|
||||
hasPrice: typeof price === 'number',
|
||||
priceStr: (price / 100).toFixed(decimalLength)
|
||||
});
|
||||
},
|
||||
updateTip() {
|
||||
this.setData({ hasTip: typeof this.data.tip === 'string' });
|
||||
},
|
||||
onSubmit(event) {
|
||||
this.$emit('submit', event.detail);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
14
utils/dist/submit-bar/index.json
vendored
14
utils/dist/submit-bar/index.json
vendored
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-button": "../button/index",
|
||||
"van-icon": "../icon/index"
|
||||
}
|
||||
}
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-button": "../button/index",
|
||||
"van-icon": "../icon/index"
|
||||
}
|
||||
}
|
||||
|
||||
84
utils/dist/submit-bar/index.wxml
vendored
84
utils/dist/submit-bar/index.wxml
vendored
@@ -1,42 +1,42 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class="van-submit-bar custom-class">
|
||||
<slot name="top" />
|
||||
|
||||
<view class="van-submit-bar__tip">
|
||||
<van-icon
|
||||
wx:if="{{ tipIcon }}"
|
||||
size="12px"
|
||||
name="{{ tipIcon }}"
|
||||
custom-class="van-submit-bar__tip-icon"
|
||||
/>
|
||||
<view wx:if="{{ hasTip }}" class="van-submit-bar__tip-text">
|
||||
{{ tip }}
|
||||
</view>
|
||||
<slot name="tip" />
|
||||
</view>
|
||||
|
||||
<view class="bar-class {{ utils.bem('submit-bar__bar', { safe: safeAreaInsetBottom }) }}">
|
||||
<slot />
|
||||
<view wx:if="{{ hasPrice }}" class="van-submit-bar__text">
|
||||
<text>{{ label || '合计:' }}</text>
|
||||
<text class="van-submit-bar__price price-class">
|
||||
<text class="van-submit-bar__currency">{{ currency }} </text>
|
||||
<text>{{ priceStr }}</text>
|
||||
</text>
|
||||
<text class="van-submit-bar__suffix-label">{{ suffixLabel }}</text>
|
||||
</view>
|
||||
<van-button
|
||||
square
|
||||
size="large"
|
||||
type="{{ buttonType }}"
|
||||
loading="{{ loading }}"
|
||||
disabled="{{ disabled }}"
|
||||
class="van-submit-bar__button"
|
||||
custom-class="button-class"
|
||||
bind:click="onSubmit"
|
||||
>
|
||||
{{ loading ? '' : buttonText }}
|
||||
</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class="van-submit-bar custom-class">
|
||||
<slot name="top" />
|
||||
|
||||
<view class="van-submit-bar__tip">
|
||||
<van-icon
|
||||
wx:if="{{ tipIcon }}"
|
||||
size="12px"
|
||||
name="{{ tipIcon }}"
|
||||
custom-class="van-submit-bar__tip-icon"
|
||||
/>
|
||||
<view wx:if="{{ hasTip }}" class="van-submit-bar__tip-text">
|
||||
{{ tip }}
|
||||
</view>
|
||||
<slot name="tip" />
|
||||
</view>
|
||||
|
||||
<view class="bar-class {{ utils.bem('submit-bar__bar', { safe: safeAreaInsetBottom }) }}">
|
||||
<slot />
|
||||
<view wx:if="{{ hasPrice }}" class="van-submit-bar__text">
|
||||
<text>{{ label || '合计:' }}</text>
|
||||
<text class="van-submit-bar__price price-class">
|
||||
<text class="van-submit-bar__currency">{{ currency }} </text>
|
||||
<text>{{ priceStr }}</text>
|
||||
</text>
|
||||
<text class="van-submit-bar__suffix-label">{{ suffixLabel }}</text>
|
||||
</view>
|
||||
<van-button
|
||||
square
|
||||
size="large"
|
||||
type="{{ buttonType }}"
|
||||
loading="{{ loading }}"
|
||||
disabled="{{ disabled }}"
|
||||
class="van-submit-bar__button"
|
||||
custom-class="button-class"
|
||||
bind:click="onSubmit"
|
||||
>
|
||||
{{ loading ? '' : buttonText }}
|
||||
</van-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user