72 lines
1.3 KiB
Vue
72 lines
1.3 KiB
Vue
|
<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>
|