<template>
    <!-- 公告 -->
    <view>
        <view class="news-box flex row" @click="$refs.gonggaoRulePop.getRule(3, '提示')">
            <image :src="$img1('common/notice.png')" style="width: 33rpx; height: 26.05rpx; margin-left: 16rpx;"
                mode="">
            </image>
            <view class="news-text">
                <uni-notice-bar :style="{ width: `100%` }" :speed="8" background-color="transparent" color="#333333"
                    scrollable single :text="$c.filterText(gonggao)"></uni-notice-bar>
            </view>

        </view>
        <rule-pop ref="gonggaoRulePop"></rule-pop>
    </view>
</template>

<script>
import {
    getDanYe
} from "../../common/server/config";
export default {
    name: 'home-page-gonggao',
    data() {
        return {
            gonggao: "",
        }
    },
    methods: {
        async getGonggao() {
            const gonggao = await getDanYe(3);
            this.gonggao = gonggao.content;
        }
    },
    mounted() {
        this.getGonggao();
    }
}
</script>

<style lang="scss" scoped>
.news-box {
    width: 686rpx;
    height: 52rpx;
    margin: 40rpx auto 0;
    display: flex;
    background-color: #F8F8F8;
    align-items: center;
    border-radius: 16rpx;
    background-size: 100% 100%;

    .news-text {
        width: 600rpx;
        height: 90rpx;
        display: flex;
        align-items: center;
        margin-left: 18rpx;

        ::v-deep.uni-noticebar__content-text {
            font-size: 24rpx;
        }
    }
}
</style>