<template>
  <div class="detail">
    <div class="detail-body">
      <div class="detail-card top-tit-card">
        <div class="left">
          <i class="iconfont icon-laba"></i>
        </div>
        <div class="right">
          <div class="top">
            {{ activityDetail.activityName }}
          </div>
          <div class="bottom">
            <span>{{ activityDetail.updatedAt }}</span>
            <span>园区管委会</span>
          </div>
        </div>
        <div></div>
      </div>
      <div class="detail-card info">
        <div class="card-title">详情</div>
        <div
          class="text"
          style="font-size: 24rpx"
          v-html="activityDetail.styleContent"
        ></div>
      </div>
    </div>
    <div class="white-bottom"></div>
  </div>
</template>
      
      <script>
import TelNum from "../../subPackages/components/tel-number";

import { clickCollect, getUserLocalStorageInfo } from "@/js_sdk/http";
import { getActivityById1 } from "@/js_sdk/api_activity";
export default {
  components: {
    TelNum,
  },

  data() {
    return {
      signInfo: {},
      signInCode: "",
      active: false,
      id: "",
      activityDetail: {
        referenceId: "",
      },
      number: 0,
    };
  },

  onLoad(option) {
    // this.getScanCode();
    console.log("option", option.id);
    this.id = option.id;
    this.getActivityById1();
  },

  methods: {
    openFile(url) {
      uni.downloadFile({
        url: url, // 网络文档地址
        success: (data) => {
          if (data.statusCode === 200) {
            uni.saveFile({
              tempFilePath: data.tempFilePath, //临时路径
              success: function (res) {
                // 保存路径

                setTimeout(() => {
                  //打开文档查看
                  uni.openDocument({
                    filePath: res.savedFilePath,
                    success: function (res) {},
                  });
                }, 3000);
              },
            });
          }
        },
        fail: (err) => {
          uni.showToast({
            title: "失败请重新下载",
          });
        },
      });
    },
    getActivityById1() {
      const _this = this;
      getActivityById1(this.id, getUserLocalStorageInfo().user.id).then(
        (res) => {
          if (res.data) {
            _this.activityDetail = res.data;
            this.activityDetail.styleContent = res.data.styleContent.replace(
              "<img",
              "<img style='max-width:100%'"
            );
            _this.activityDetail.updatedAt = this.$common.transServDate(
              _this.activityDetail.updatedAt
            );
          }
        }
      );
    },
  },
};
</script>
      
      <style lang="scss" type="text/scss" >
.detail {
  box-sizing: border-box;
  background-color: #f2f2f2;
  padding: 20rpx 30rpx 140rpx;
  overflow-y: auto;
  .card-title {
    background: #2a3980;
    color: #fff;
    font-size: 3.467vw;
    line-height: 11.2vw;
    padding: 0 2.667vw;
  }
  .detail-body {
    .detail-card {
      padding: 20rpx 30rpx;
      border-radius: 10rpx;
      box-sizing: border-box;
      background: #fff;
      .left {
        width: 70rpx;

        i {
          font-size: 50rpx;
        }
      }

      .right {
        .top {
          font-size: 24rpx;
          color: #666666;
        }
      }

      &:first-child {
        margin-bottom: 20rpx;
      }
    }

    .info {
      padding: 0;

      .text {
        padding: 30rpx;
        word-break: break-all;
        font-size: 26rpx;
        color: #333333;
        line-height: 1.4;

        img {
          max-width: 100%;
        }
      }
    }
  }
}
</style>
      <style lang="scss">
</style>