Files
zhxg_xsbdV1.0/pages/notify/detail.vue

72 lines
1.3 KiB
Vue
Raw Normal View History

2025-07-16 17:44:45 +08:00
<template>
<view class="notify">
<view class="notify-title">{{detail.title}}</view>
<view class="notify-time">{{detail.createTime}}</view>
<view class="notify-front">
<image mode="heightFix" :src="getImgSrc(detail.front)"></image>
</view>
<view class="notify-content" v-html="getContent(detail.content)">
</view>
</view>
</template>
<script>
import {getNotify} from "@/api/notifyApi.js";
import {getImgSrc } from "@/api/helpFunc.js";
import {BASE_URL} from "@/config/baseUrl.js";
export default {
data() {
return {
detail:{
title:'',
front:null,
content:"",
createTime:""
},
getImgSrc,
}
},
onLoad(options) {
let id = options.id;
getNotify(id).then(res=>{
this.detail = {...res.data};
});
},
methods: {
getContent(v){
return v.replace("/dev-api",BASE_URL).replace("<img","<img style='width:100%'");
}
}
}
</script>
<style scoped lang="scss">
.notify{
padding:10rpx;
.notify-title{
text-align: center;
font-weight: bolder;
font-size:1.25rem ;
}
.notify-time{
text-align: right;
font-size: 0.8rem;
margin-right: 50rpx;
margin-top: 10rpx;
}
.notify-front{
text-align: center;
height: 400rpx;
image{
height: 100%;
}
}
.notify-content{
padding: 20rpx;
}
}
</style>