<template>
    <div>
        <div class="dialog-h-content scroll-h">
            <div v-if="initLoading" class="m-detail-main">
                <div class="m-info">

                    <div style="display: flex;">
                        <div class="m-info-prop" style="flex: 0 0 50%;">
                            <span class="u-info-title-2">文章标题: </span>
                            <span style="margin-right: 10px;">&nbsp;</span>
                            <span>{{ formData.title || "--" }}</span>
                        </div>
                        <div class="m-info-prop" style="flex: 0 0 50%;">
                            <span class="u-info-title-2">标签: </span>
                            <span style="margin-right: 10px;">&nbsp;</span>
                            <span>{{ formData.tagName || "--" }}</span>
                        </div>
                    </div>

                    <div style="display: flex;">
                        <div class="m-info-prop" style="flex: 0 0 50%;">
                            <span class="u-info-title-2">发布时间: </span>
                            <span style="margin-right: 10px;">&nbsp;</span>
                            <span>{{ formData.releaseTime || "--" }}至<span>{{ formData.endTime || "--" }}</span></span>
                        </div>
                        <div class="m-info-prop" style="flex: 0 0 50%;">
                            <span class="u-info-title-2">状态: </span>
                            <span style="margin-right: 10px;">&nbsp;</span>
                            <span>{{ formData.status === 1 ? '已下线' : '已发布' || "--" }}</span>
                        </div>
                    </div>


                    <div class="m-info-prop">
                        <span class="u-info-title-2" style="display: inline-block;white-space: nowrap;">活动内容: </span>
                        <span style="margin-right: 10px;">&nbsp;</span>
                        <!-- <span>{{ formData.content || "--" }}</span> -->
                        <p class="text_p" v-html="formData.content"></p>
                    </div>

                    <div class="m-info-prop">
                        <span class="u-info-title-2">是否置顶: </span>
                        <span style="margin-right: 10px;">&nbsp;</span>
                        <el-switch :value="formData.top === 1 ? true : false" :disabled="true"></el-switch>
                      
                    </div>
                    <div class="m-info-prop">
                        <span class="u-info-title-2"></span>
                        <div class="div_map">
                            <div id="app_detail_unit"></div>
                        </div>
                    </div>
                    <div class="m-info-prop">
                        <span class="u-info-title-2">点赞数: </span>
                        <span style="margin-right: 10px;">&nbsp;</span>
                        <span>{{ formData.address || "--" }}</span>
                    </div>

                    <div style="display: flex;">
                        <div class="m-info-prop" style="flex: 0 0 50%;">
                            <span class="u-info-title-2">转发数</span>
                            <span style="margin-right: 10px;">&nbsp;</span>
                            <span>{{ formData.cutOffTime || "--" }}</span>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <div class="m-detail-btn">
            <el-button size="small" @click="handleCancle">关 闭</el-button>
        </div>
    </div>
</template>

<script>
import { Loading } from "element-ui"; // 引入Loading服务
import nextTick from "dai-js/tools/nextTick";
import daiMap from "@/utils/dai-map";

var map;
var search;
var markers;
var infoWindowList;
var geocoder; // 新建一个正逆地址解析类

let loading; // 加载动画
export default {
    data() {
        return {
            formData: {},
            initLoading: false,
        };
    },
    components: {},
    created() { },

    mounted () {
    },

    methods: {
        async activityType () {
        const url = "/actual/base/activityType/page"
        let params = {
          // agencyId: this.agencyId
          pageSize: 20,
          pageNo: 1,
          typeName: "",
          enabled: 0
        }
        const { data, code, msg } = await requestPost(url, params)
        if (code === 0) {
          this.typeList = data.list
        } else {
          this.$message.error(msg)
        }
      },
        handleCancle() {
            // this.diaDestroy();
            this.$emit("dialogCancle");
        },

        diaDestroy() {
            if (map) {
                // map.destroy()
            }
        },

        async initForm(row) {
            this.startLoading();
            this.formData = JSON.parse(JSON.stringify(row));
            this.initLoading = true;
            console.log(this.formData,"sdf ");
            this.endLoading();
        },

        // 开启加载动画
        startLoading() {
            loading = Loading.service({
                lock: true, // 是否锁定
                text: "正在加载……", // 加载中需要显示的文字
                background: "rgba(0,0,0,.7)", // 背景颜色
            });
        },
        // 结束加载动画
        endLoading() {
            // clearTimeout(timer);
            if (loading) {
                loading.close();
            }
        },
    },
    computed: {},
    props: {},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/detail-main.scss";

// span {
//     display: inline-block;
//     white-space: nowrap; /* 避免换行 */
// }

</style>
<style scoped></style>
