123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <template>
- <section class="service-intro-card bg-white">
- <header
- v-if="showHeader"
- class="service-intro-header bg-white flex flex-(items-center justify-between)"
- >
- <h5 class="service-intro-title">
- <slot name="title">{{ title }}</slot>
- </h5>
- <div class="service-intro-header-actions">
- <slot name="header-actions">
- <span class="header-action-item">
- <span class="header-action-item-text">查看服务介绍</span>
- <van-icon name="arrow" />
- </span>
- </slot>
- </div>
- </header>
- <main
- class="service-intro-main flex flex-(col items-center justify-center)"
- >
- <slot name="default">
- <p class="service-name-text">{{ serviceNameText }}</p>
- <p class="service-desc-text">{{ serviceDescText }}</p>
- <div class="action-group">
- <van-button
- class="action-button plain"
- type="primary"
- plain
- @click="leftButtonClick"
- v-if="plainButtonShow"
- >
- {{ plainButtonText }}
- </van-button>
- <van-button
- class="action-button"
- type="primary"
- @click="rightButtonClick"
- v-if="confirmButtonShow"
- >
- {{ confirmButtonText }}
- </van-button>
- </div>
- </slot>
- </main>
- </section>
- </template>
- <script>
- import { Icon, Button } from 'vant'
- export default {
- name: 'ServiceIntroCard',
- components: {
- [Icon.name]: Icon,
- [Button.name]: Button
- },
- props: {
- title: {
- type: String,
- default: '标题'
- },
- showHeader: {
- type: Boolean,
- default: false
- },
- serviceNameText: {
- type: String,
- default: '权限名称'
- },
- serviceDescText: {
- type: String,
- default: '权限介绍'
- },
- plainButtonShow: {
- type: Boolean,
- default: false
- },
- plainButtonText: {
- type: String,
- default: '了解详情'
- },
- confirmButtonShow: {
- type: Boolean,
- default: true
- },
- confirmButtonText: {
- type: String,
- default: '免费体验'
- }
- },
- created() {},
- methods: {
- leftButtonClick() {
- this.$emit('leftButtonClick')
- },
- rightButtonClick() {
- this.$emit('rightButtonClick')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .service-intro-card {
- border-radius: 8px;
- overflow: hidden;
- border: 1px solid rgba(0, 0, 0, 0.05);
- box-shadow: 0px 2px 8px 0px rgba(54, 147, 179, 0.05);
- }
- .service-intro-header {
- padding: 8px 16px;
- min-height: 36px;
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
- background: linear-gradient(270deg, #f1d090 0%, #fae7ca 100%);
- }
- .service-intro-main {
- padding: 8px 24px 16px;
- background: linear-gradient(180deg, #fff 0%, #f4f4f4 100%);
- }
- .service-intro-title {
- font-size: 14px;
- line-height: 20px;
- font-weight: normal;
- }
- .service-name-text {
- font-size: 18px;
- font-weight: 700;
- line-height: 26px;
- }
- .service-desc-text {
- margin: 8px 0;
- color: #5f5e64;
- font-size: 14px;
- line-height: 20px;
- text-align: center;
- }
- .action-group {
- .action-button {
- height: 32px;
- font-size: 16px;
- &:not(:first-of-type) {
- margin-left: 24px;
- }
- }
- }
- </style>
|