123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <view class="notice_content">
- <block v-if="showLoading">
- <view class="loading_view tc mt100">
- <icon class="weui-loading f14"></icon>
- <text class="pl10">加载中...</text>
- </view>
- </block>
- <block v-else>
- <view class="notcie_title fw8 tc">{{article.title}}</view>
- <view class="push_time f12 grey tr">{{article.create_time}}</view>
- <view class="mt10">
- <uParse :content="article.describe" noData="加载中..."></uParse>
- </view>
- </block>
- </view>
- </template>
- <script>
- import uParse from '@/components/gaoyia-parse/parse.vue'
- export default {
- data() {
- return {
- article: {},
- showLoading: true,
- }
- },
- components: {
- uParse
- },
- onLoad(option) {
- var id = option.id;
- if (!id) {
- uni.showToast({
- icon: 'none',
- title: '缺少必有参数',
- success() {
- setTimeout(() => {
- uni.navigateBack({
- delta: 1
- })
- }, 1500)
- }
- })
- }
- this.getAdetail(id);
- },
- onShareAppMessage(res) {
- if (res.from === 'button') { // 来自页面内分享按钮
- console.log(res.target)
- }
- return {
- title: this.$config.appShareTitle
- }
- },
- methods: {
- getAdetail(id) {
- var that = this;
- that.$api.getAction(id, res => {
- if (res.code == 0) {
- that.showLoading = false;
- that.article = res.data;
- console.log(that.article)
- }
- })
- },
- //预览图片
- preview(src, e) {
- uni.previewImage({
- urls: src,
- })
- },
- navigate(href, e) {}
- }
- }
- </script>
- <style scoped>
- .notice_content {
- padding: 10rpx 20rpx;
- }
- @import url("@/components/u-parse/u-parse.css");
- .tc {
- text-align: center;
- }
- .mt100 {
- margin-top: 100rpx;
- }
- .fw8 {
- font-weight: 800;
- }
- .tr {
- text-align: right;
- }
- </style>
|