2025-01-06 10:55:00 +00:00
|
|
|
<template>
|
2025-01-16 10:25:21 +00:00
|
|
|
<div
|
|
|
|
class="custom-btn"
|
|
|
|
:class="[
|
|
|
|
props.isBottom ? 'custom-btn-bottom' : '',
|
|
|
|
props.subBtnText ? 'apposition-btn-style' : '',
|
|
|
|
]"
|
|
|
|
>
|
|
|
|
<wd-button custom-class="custom-sub-btn-class" v-if="props.subBtnText">
|
|
|
|
{{ props.subBtnText }}
|
|
|
|
</wd-button>
|
2025-01-23 08:45:49 +00:00
|
|
|
<wd-button
|
|
|
|
custom-class="custom-btn-class"
|
|
|
|
@click="clickBtn"
|
|
|
|
:disabled="props?.disabled"
|
2025-01-24 03:18:26 +00:00
|
|
|
:class="[props?.disabled ? 'custom-btn-class-disabled' : '']"
|
2025-01-23 08:45:49 +00:00
|
|
|
>
|
2025-01-16 10:25:21 +00:00
|
|
|
{{ props.btnText }}
|
|
|
|
</wd-button>
|
2025-01-06 10:55:00 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script setup>
|
|
|
|
import { reactive } from 'vue'
|
|
|
|
import { defineProps, defineEmits } from 'vue'
|
|
|
|
const state = reactive({})
|
|
|
|
const emits = defineEmits(['clickBtn'])
|
|
|
|
const props = defineProps({
|
|
|
|
isBottom: false, //是否底部按钮
|
|
|
|
btnText: '', //按钮文字
|
2025-01-16 10:25:21 +00:00
|
|
|
subBtnText: '', //次要按钮文字
|
2025-01-23 08:45:49 +00:00
|
|
|
disabled: false, //是否禁用
|
2025-01-06 10:55:00 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
//点击
|
|
|
|
const clickBtn = () => {
|
|
|
|
emits('clickBtn')
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.custom-btn {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2025-01-16 10:25:21 +00:00
|
|
|
.custom-sub-btn-class {
|
|
|
|
background-color: #eee9f8;
|
|
|
|
padding: 18rpx 185rpx;
|
|
|
|
border-radius: 8rpx;
|
|
|
|
box-shadow: 0 6px 12px 2px rgba(188, 188, 188, 0.08);
|
|
|
|
font-size: 28rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
line-height: 40rpx;
|
|
|
|
color: $theme-primary;
|
|
|
|
}
|
2025-01-06 10:55:00 +00:00
|
|
|
.custom-btn-class {
|
|
|
|
background-color: $theme-primary;
|
|
|
|
padding: 18rpx 185rpx;
|
|
|
|
border-radius: 8rpx;
|
|
|
|
box-shadow: 0 6px 12px 2px rgba(188, 188, 188, 0.08);
|
|
|
|
font-size: 28rpx;
|
|
|
|
font-weight: 500;
|
|
|
|
line-height: 40rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.custom-btn-bottom {
|
|
|
|
width: 100%;
|
|
|
|
background-color: #fff;
|
|
|
|
padding: 14rpx 0 72rpx;
|
2025-01-24 03:18:26 +00:00
|
|
|
box-shadow: 0 1px 0 2px rgba(231, 231, 231, 1);
|
2025-01-06 10:55:00 +00:00
|
|
|
}
|
2025-01-16 10:25:21 +00:00
|
|
|
.apposition-btn-style {
|
|
|
|
padding: 14rpx 30rpx 72rpx;
|
|
|
|
.custom-sub-btn-class {
|
|
|
|
padding: 18rpx 124rpx;
|
|
|
|
margin: 0 20rpx 0 0;
|
|
|
|
}
|
|
|
|
.custom-btn-class {
|
|
|
|
padding: 18rpx 124rpx;
|
|
|
|
}
|
|
|
|
}
|
2025-01-24 03:18:26 +00:00
|
|
|
.custom-btn-class-disabled {
|
|
|
|
background-color: #e6e6e6 !important;
|
|
|
|
color: #bebebe !important;
|
|
|
|
}
|
2025-01-06 10:55:00 +00:00
|
|
|
</style>
|