You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
apply-assistant-v3/components/button.vue

222 lines
3.9 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view class="g-components-button">
<button class="bocai-btn" :class="['bocai_btn_size_' + size, 'bocai_btn_mode_' + mode, 'bocai_btn_type_' + type, 'g_w_' + width, 'g_h_' + height]" :hover-stop-propagation="true" hover-class="thover" @click="handleClick" :open-type="openType" @getphonenumber="getphonenumber">
<view class="g_flex_row_center">
<view class="g_flex_column_center" v-if="icon">
<view class="iconfont icon" :class="icon"></view>
</view>
<view class="g_flex_column_center">
{{ btnText }}
</view>
</view>
</button>
</view>
</template>
<script>
/* 按钮
* @params size 尺寸
* medium 大;
* default 默认(中);
* small 小;
* mini 迷你;
* @params btnText 按钮文本。
* @params mode 形状
* circle 胶囊式圆角square 圆角方形
* @parmas type 类型
* primary 主要按钮(底色是主题色)
* default 默认按钮(底色是白色)
* infro 信息按钮(底色是灰色)
* delete 删除按钮(白底红色)
* none 没有样式(白底黑字)
* @params openType 开放类型
* @params icon 图标 项目id 4374774
*/
export default {
props: {
size: {
type: String,
default: () => {
return "default";
},
},
btnText: {
type: String,
default: () => {
return "按钮";
},
},
mode: {
type: String,
default: () => {
return "circle";
},
},
type: {
type: String,
default: () => {
return "default";
},
},
openType: {
type: String,
default: () => {
return "";
},
},
icon: {
type: String,
default: () => {
return "";
},
},
width: {
default: () => {
return "auto";
},
},
height: {
default: () => {
return "auto";
},
},
},
methods: {
handleClick() {
this.$emit("clickBtn");
},
getphonenumber(e) {
this.$emit("clickTel", e);
},
},
};
</script>
<style lang="scss" scoped>
.g-components-button {
.bocai-btn {
width: 100%;
color: #ffffff;
box-sizing: border-box;
}
.bocai_btn_size {
&_medium {
height: 56px;
font-size: 18px;
line-height: 56px;
}
&_default {
width: 250px !important;
height: 42px;
font-size: 18px;
line-height: 42px;
.icon {
font-size: 27px;
}
&_auto {
width: 100%;
height: 42px;
font-size: 18px;
line-height: 42px;
}
}
&_small {
width: 120px !important;
height: 40px;
font-size: 16px;
line-height: 40px;
.icon {
font-size: 27px;
}
&_auto {
width: 100%;
height: 40px;
font-size: 16px;
line-height: 40px;
}
}
&_160 {
width: 160px !important;
height: 40px;
font-size: 16px;
line-height: 40px;
.icon {
font-size: 27px;
}
&_auto {
width: 100%;
height: 40px;
font-size: 16px;
line-height: 40px;
}
}
&_mini {
height: 28px;
padding: 0 8px;
font-size: 14px;
line-height: 28px;
.icon {
font-size: 12px;
}
}
}
.bocai_btn_mode {
&_circle {
border-radius: 60px;
}
&_square {
border-radius: 10px;
}
}
.bocai_btn_type {
&_primary {
background-color: #00b666;
color: #fff;
}
&_default {
background-color: #fff;
color: #00b666;
border: 1px solid #00b666;
&.thover {
opacity: 1;
background: #f5f5f5;
}
}
&_infro {
pointer-events: none;
background: #f5f5f5;
color: #666;
border: 0.5px solid #f5f5f5;
&.thover {
background: #cccccc;
}
}
&_delete {
border: 1rpx solid #fff;
background-color: #fff;
color: #fa5151;
&.thover {
background-color: #f5f5f5;
border: 1rpx solid #f5f5f5;
}
}
&_none {
background-color: #fff;
color: #666;
border: 1rpx solid #ccc;
&.thover {
background-color: #f5f5f5;
}
}
}
.g_w_260 {
width: 260px !important;
}
.g_h_48 {
height: 48px !important;
line-height: 48px !important;
}
}
</style>