|
|
@@ -41,6 +41,10 @@
|
|
|
<div class="detail">
|
|
|
<h2>{{ isActivity ? '活动' : '新闻' }}详情</h2>
|
|
|
|
|
|
+ <div class="introduction" v-if="info.introduction">
|
|
|
+ {{ info.introduction }}
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="html" v-html="info.content"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -54,6 +58,15 @@
|
|
|
>{{ isEnd ? '报名结束' : activityId ? '查看报名信息' : '立即报名' }}</van-button
|
|
|
>
|
|
|
</fixed-button>
|
|
|
+
|
|
|
+ <div class="imgList-btn" v-if="detailImgList.length > 0" @click="showImgs">
|
|
|
+ <van-image
|
|
|
+ :width="20"
|
|
|
+ :height="16"
|
|
|
+ src="http://imttech.oss-cn-hangzhou.aliyuncs.com/micro/icon_chakantupian.png"
|
|
|
+ fit="contain"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -65,7 +78,8 @@ export default {
|
|
|
return {
|
|
|
informationId: 0,
|
|
|
info: {},
|
|
|
- activityId: 0
|
|
|
+ activityId: 0,
|
|
|
+ detailImgList: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -96,6 +110,7 @@ export default {
|
|
|
this.informationId = options.id;
|
|
|
this.$http.get('/information/get/' + options.id).then(res => {
|
|
|
this.info = res;
|
|
|
+ this.getImgList(res.content);
|
|
|
});
|
|
|
},
|
|
|
onShow() {
|
|
|
@@ -133,8 +148,47 @@ export default {
|
|
|
this.activityId = 0;
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ getImgList(detailImg) {
|
|
|
+ if (detailImg) {
|
|
|
+ this.detailImgList = detailImg
|
|
|
+ .split('<img ')
|
|
|
+ .map(item => {
|
|
|
+ return item.split('/>')[0];
|
|
|
+ })
|
|
|
+ .map(item => {
|
|
|
+ return item.split('src="').length > 1 ? item.split('src="')[1] : '';
|
|
|
+ })
|
|
|
+ .map(item => {
|
|
|
+ return item.split('"')[0];
|
|
|
+ })
|
|
|
+ .filter(item => {
|
|
|
+ return item && this.checkImg(item);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.detailImgList = [];
|
|
|
+ }
|
|
|
+ console.log(this.detailImgList);
|
|
|
+ },
|
|
|
+ checkImg(file) {
|
|
|
+ const imglist = ['png', 'PNG', 'jpg', 'JPG', 'jpeg', 'JPEG', 'bmp', 'BMP', 'gif', 'GIF'];
|
|
|
+ const _info = file.split('.');
|
|
|
+ if (imglist.indexOf(_info[_info.length - 1]) !== -1) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showImgs() {
|
|
|
+ if (this.detailImgList.length > 0) {
|
|
|
+ wx.previewImage({
|
|
|
+ current: this.detailImgList[0], // 当前显示图片的http链接
|
|
|
+ urls: [...this.detailImgList] // 需要预览的图片http链接列表
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
onPageScroll() {},
|
|
|
onShareAppMessage(from, target) {
|
|
|
return {
|
|
|
@@ -197,5 +251,27 @@ export default {
|
|
|
.html {
|
|
|
padding-top: 14px;
|
|
|
}
|
|
|
+
|
|
|
+ .introduction {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #292c33;
|
|
|
+ line-height: 24px;
|
|
|
+ padding: 14px 0 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.imgList-btn {
|
|
|
+ position: fixed;
|
|
|
+ right: 10px;
|
|
|
+ bottom: 15vh;
|
|
|
+ background-color: @bgw;
|
|
|
+ z-index: 200;
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ border-radius: 100%;
|
|
|
+ box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
}
|
|
|
</style>
|