import { createNamespace } from '../utils'; import Icon from '../icon'; import Button from '../button'; const [createComponent, bem, t] = createNamespace('submit-bar'); export default createComponent({ props: { tip: String, label: String, price: Number, tipIcon: String, loading: Boolean, disabled: Boolean, textAlign: String, buttonText: String, buttonColor: String, suffixLabel: String, safeAreaInsetBottom: { type: Boolean, default: true, }, decimalLength: { type: [Number, String], default: 2, }, currency: { type: String, default: '¥', }, buttonType: { type: String, default: 'danger', }, }, emits: ['submit'], setup(props, { emit, slots }) { return () => { const { tip, price, tipIcon } = props; function Text() { if (typeof price === 'number') { const priceArr = (price / 100) .toFixed(props.decimalLength) .split('.'); const decimalStr = props.decimalLength ? `.${priceArr[1]}` : ''; return (