| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <template>
- <view class="article">
- <u-parse :content="content"></u-parse>
- </view>
- </template>
- <script>
- import {getNewsRead} from "@/common/api/news.js";
- export default {
- data() {
- return {
- id: "",
- content: undefined,
- };
- },
- onLoad(options) {
- uni.hideShareMenu({});
- if (options.id) {
- this.id = options.id;
- this.getData();
- }
- },
- methods: {
- getData() {
- const data = {
- name: this.name,
- };
- getNewsRead({
- id: this.id,
- }).then(({data = {}}) => {
- uni.setNavigationBarTitle({
- title: data.name,
- });
- this.content = data.content;
- });
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .article {
- width: 100%;
- display: flex;
- align-items: center;
- flex-direction: column;
- padding: 20rpx 20rpx 40rpx;
- box-sizing: border-box;
- text-align: justify;
- }
- </style>
|