hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<template>
  <div class="policy_detail">
    <v-header title="详情"></v-header>
    <v-tool-scroll ids="police-detail-scroll" class="content">
      <p class="h2">标题:{{ detail.title }}</p>
      <div class="w_row clearfix">
        <p class="h2 w_col_8">阅览量:{{ detail.readingVolume }}人</p>
        <p class="h2 w_col_8">发布人:{{ detail.createByName }}</p>
      </div>
      <p class="h2">发布时间:{{ detail.publishAt }}</p>
      <!-- <section v-if="detail.cover !== null && detail.cover !== ''">
        <p class="label">封面:</p>
        <article>
          <img :src="detail.cover" @click="onScaleImage" alt="" class="logo" />
        </article>
      </section> -->
      <div class="fl-fw mr-t-10" v-if="detail.cover !== null && detail.cover !== ''">
        <div class="label-style">封面:</div>
         <span class="cover-img">
        <img :src="detail.cover" @click="onScaleImage" alt="" class="logo-img" />
         </span>
      </div>
      <section v-if="detail.jumpType == 2">
        <p class="label">活动内容:</p>
        <article>
          <div class="ql-snow">
            <div class="ql-editor">
              <div v-html="detail.content"></div>
            </div>
          </div>
        </article>
      </section>
      <section v-if="detail.jumpType == 1">
        <p class="label">跳转链接:</p>
        <article>
         <a :href="detail.jumpUrl" target="_blank">{{detail.jumpUrl}}</a>
        </article>
      </section>
    </v-tool-scroll>
    <div class="foot">
      <el-button size="small" @click="$router.go(-1)">返回</el-button>
    </div>
  </div>
</template>
 
<script>
export default {
  props: {
    aid: { type: [String, Number], default: 0 },
    type: { type: String, default: "2" },
  },
  components: {},
  data() {
    return {
      detail: {},
    };
  },
  watch: {
    aid(n) {
      if (n) {
        this.init(n);
      }
    },
  },
  methods: {
    // 查看大图
    onScaleImage() {
      this.$store.dispatch("setImage", {
        time: Date.now(),
        title: this.detail.title,
        pic: this.detail.cover,
        tool: true,
      });
    },
    init(id) {
      this.$api.get("communitypartybuilding/infodynamic", { id }, (e) => {
        this.detail = demo.copy(e);
      });
    },
  },
  mounted() {},
};
</script>
<style lang='less' scoped>
.policy_detail {
  font-size: 14px;
  overflow-y: auto;
  .cover-img {
    width: 150px;
    height: 100px;
    overflow: hidden;
    img {
      width: 100%;
    }
  }
  .img-cover {
    width: 150px !important;
    height: 80px;
    overflow: hidden;
    img {
      width: 100%;
    }
  }
  .content {
    height: calc(~"100% - 90px");
    .h2,
    .label {
      height: 35px;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
      line-height: 35px;
    }
    section {
      display: flex;
      margin: 5px 0;
      .label {
        width: 70px;
      }
      .logo {
        max-width: 40%;
        height: auto;
        display: block;
        border-radius: 8px;
      }
      article {
        width: calc(~"100% - 70px");
        line-height: 28px;
        padding-top: 5px;
      }
    }
  }
  .foot {
    margin-top: 4px;
  }
}
 
.label-style {
  height: 35px;
}
</style>