| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <template>
- <view class="safe-area-inset-bottom">
- <view class="flex justify-end padding-30">
- <view @click="edit" class="cu-btn radius sm bg-base">
- 编辑
- </view>
- </view>
- <view class="text-area" v-html="content"></view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- id: '',
- content: '',
- detail: {}
- }
- },
- onLoad(options) {
- this.id = options.id
- this.fetchDetail()
- },
- onShow() {
- this.fetchDetail()
- },
- methods: {
- edit(){
- uni.navigateTo({
- url:"notice?id="+this.id
- })
- },
- async fetchDetail() {
- let params = {
- id: this.id
- }
- let res=await this.$api.notice.detail(params)
- this.detail = res.data || {}
- this.content = decodeURIComponent(this.detail.content)
- if (this.$isNotEmpty(this.detail.title)) {
- uni.setNavigationBarTitle({
- title:this.detail.title
- })
- }
- }
- }
- }
- </script>
- <style>
- page {
- background-color: #FFFFFF;
- }
- </style>
- <style lang="scss" scoped>
- .text-area {
- padding: 20rpx;
- }
-
- .title{
- text-align: center;
- font-size: 34rpx;
- font-weight: 800;
- }
- </style>
|