Files
RentWeAppFront/pages-biz/notice/noticeDetail.vue

80 lines
1.6 KiB
Vue
Raw Normal View History

2025-11-14 11:39:33 +08:00
<template>
<view>
<u-navbar :is-back="true" :title="title" :border-bottom="false"></u-navbar>
<view class="u-content">
<u-parse :html="content"
:autosetTitle="true"
:show-with-animation="true"
:selectable="true"></u-parse>
</view>
2026-01-30 09:01:38 +08:00
<u-swiper :list="imgList" @change="change"></u-swiper>
<view v-for="(item,index) in attachments" :key="index">
<text @click="download(item)">{{ item.fileName }}</text>
</view>
2025-11-14 11:39:33 +08:00
</view>
</template>
<script>
export default {
data() {
return {
2026-01-15 17:18:24 +08:00
id:null,
2025-11-14 11:39:33 +08:00
title:'资讯',
2026-01-30 09:01:38 +08:00
content: ``,
imgList:[],
attachments:[]
2025-11-14 11:39:33 +08:00
}
},
onLoad(option) {
2026-01-15 17:18:24 +08:00
this.id = option.id
this.getDetail()
2025-11-14 11:39:33 +08:00
},
2026-01-15 17:18:24 +08:00
methods:{
getDetail(){
this.$u.get(`/notice/detail?id=${this.id}`,{},{
WT: this.$getToken()
}).then(res=>{
if(res.flag) {
this.title = res.data.noticeTitle;
this.content = res.data.noticeContent;
2026-01-30 09:01:38 +08:00
if(res.data.imgs) {
const _this = this;
res.data.imgs.forEach(img=>{
_this.imgList.push(_this.$config.staticUrl + img)
})
}
this.attachments = res.data.attachments;
2026-01-15 17:18:24 +08:00
}
})
2026-01-30 09:01:38 +08:00
},
download(item){
uni.downloadFile({
url: this.$config.staticUrl + item.url,
success(res) {
uni.openDocument({
filePath: res.tempFilePath
})
}
})
2026-01-15 17:18:24 +08:00
}
}
2025-11-14 11:39:33 +08:00
}
</script>
<style>
page{
background-color: #FFFFFF;
}
</style>
<style lang="scss" scoped>
.u-content{
margin:0 10rpx;
padding: 24rpx;
font-size: 34rpx;
color: $u-main-color;
line-height: 1.8;
white-space: pre-wrap !important;
}
</style>