创作者微信小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

47 lines
987 B

<template>
<view>
<view>id:{{noticeDetail.id}}</view>
<view>标题:{{noticeDetail.title}}</view>
<view>内容:{{noticeDetail.content}}</view>
<view>图片:{{noticeDetail.img}}</view>
<view>创建时间:{{noticeDetail.createTime}}</view>
</view>
</template>
<script>
import {
getNoticeDetails
} from '@/api/userInfo.js'
export default {
data() {
return {
noticeDetail:{}
}
},
onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
this.id = option.id
//console.log('this.id',this.id)
this.getNoticeDetails(option.id);
},
methods: {
// 查询公告详情
async getNoticeDetails(id) {
const res = await getNoticeDetails(id)
console.log('res', res)
if (res.data.code === 200) {
this.noticeDetail = res.data.data
} else {
uni.showModal({
content: '公告详情数据加载失败!',
showCancel: false
});
}
},
}
}
</script>
<style>
</style>