<template>
    <view class="partner-container">
        <!-- 自定义导航栏 -->
        <u-navbar
            :is-back="true"
            title="合伙人"
            back-icon-color="#ffffff"
            title-color="#ffffff"
            :background="{ background: '#38C148' }"
        >
        </u-navbar>

        <!-- 内容区域 -->
        <view class="content-wrap">
            <u-parse :content="content"></u-parse>
        </view>

        <!-- 底部按钮 -->
        <view class="bottom-btn-wrap" @click="applyPartner" v-if="baseInfo.status !== 1">
            <image
                src="/pages-mine/static/partner-rule.png"
                mode="aspectFit"
                style="width: 100%; height: 120rpx"
            ></image>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            content: "", // 富文本内容
            baseInfo: "",
        };
    },
    onLoad() {
        this.getPartnerInfo();
    },
    methods: {
        async getPartnerInfo() {
            try {
                const res = await uni.$u.http.get("/token/getUserPartnerInfo");
                if (res.code === 200) {
                    this.baseInfo = res.data;
                    this.content = res.data.content;
                }
            } catch (e) {
                console.error(e);
            }
        },
        //跳转至合伙人申请页面
        applyPartner() {
            uni.navigateTo({
                url: "/pages-mine/pages/partner/partner-apply",
            });
        },
    },
};
</script>

<style lang="scss" scoped>
.partner-container {
    min-height: 100vh;
    background-color: #ffffff;

    .content-wrap {
        padding: 20rpx;
        margin-bottom: 120rpx;
    }

    // .bottom-btn-wrap {
    //     position: fixed;
    //     bottom: 0;
    //     left: 0;
    //     right: 0;
    //     background-color: #ffffff;
    //     display: flex;
    //     justify-content: center;
    //     box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
    // }
}
</style>
