<template>
    <view class="b-title">
        <view class="c-font-big tit-text">
            <rich-text :nodes="text"></rich-text>
            <view class="prase-rate" v-if="praiseRate">(好评率{{praiseRate}}%)</view>
        </view>

        <b-navigate :url="url" :extra="{logName}">
            <view
                v-if="moreText"
                class="more-text c-font-13"
                @tap="handleChooseAllCommentTag('', 'register_comments', '')"
            >{{ moreText }}</view>
            <c-icon
                v-if="icon"
                name="right"
                class="right-icon">
            </c-icon>
        </b-navigate>
    </view>
</template>

<script>
/**
 * @file 挂号title
 * @author wangying51
 */
import Icon from '@baidu/med-ui/components/Icon/Icon';
import Navigate from '../common/navigate';

import {navigate} from '../../utils/navigate';

export default {
    config: {
        component: true
    },
    props: {
        text: String,
        moreText: String,
        moreUrl: String,
        url: String,
        logName: String,
        icon: {
            'type': Boolean,
            'default': true
        },
        praiseRate: {
            type: [Number, String]
        }
    },
    data() {
        return {
        };
    },
    components: {
        'c-icon': Icon,
        'b-navigate': Navigate
    },
    methods: {
        handleChooseAllCommentTag(index, tab, domId) {
            navigate({
                url: this.moreUrl + `&tagIndex=${index}&tab=${tab}&domId=${domId}`,
            })
        },
    }
};
</script>
<style lang="less" scoped>
.b-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .11rem 0 .13rem;
}
.tit-text {
    font-weight: bold;
    color: #333333;
    display: flex;
    .prase-rate {
        font-size: 14px;
        color: #2A2A2A;
        display: inline-block;
        font-weight: 400;
        margin-left: 10px;
    }
}

.more-text {
    color: #333;
    display: inline-block;
    vertical-align: bottom;
}
.right-icon {
    color: #666666;
    position: relative;
    right: -2px;
}
</style>


