新生报到移动端V1.0
This commit is contained in:
71
pages/notify/detail.vue
Normal file
71
pages/notify/detail.vue
Normal file
@@ -0,0 +1,71 @@
|
||||
<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>
|
Reference in New Issue
Block a user