<template>
|
<!-- 页面主体 -->
|
<view>
|
<u-toast ref="uToast" /><u-no-network></u-no-network>
|
<u-navbar :title="title" safeAreaInsetTop fixed placeholder>
|
<view class="coreshop-navbar-left-slot" slot="left">
|
<u-icon name="arrow-left" size="19" @click="goNavigateBack"></u-icon>
|
<u-line direction="column" :hairline="false" length="16" margin="0 8px"></u-line>
|
<u-icon name="home" size="22" @click="goHome"></u-icon>
|
</view>
|
<view slot="right">
|
</view>
|
</u-navbar>
|
|
<view class="coreshop-bg-white coreshop-padding-10 coreshop-margin-10">
|
<u--image width="100%" height="150px" v-if="info.coverImage" :src="info.coverImage"></u--image>
|
<view class="article-title">
|
{{ info.title }}
|
</view>
|
<view class="article-time" v-if="info.createTime">{{ info.createTime }}</view>
|
<u-line dashed></u-line>
|
<view class="u-content">
|
<u-parse :content="contentBody" :selectable="true"></u-parse>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
|
export default {
|
|
data() {
|
return {
|
id: 0,
|
info: {},
|
contentBody: '',
|
shareUrl: this.$globalConstVars.shareUrl,
|
title: ''
|
};
|
},
|
onLoad(e) {
|
this.id = e.id;
|
this.noticeDetail();
|
},
|
methods: {
|
noticeDetail() {
|
let data = {
|
id: this.id
|
};
|
this.$u.api.noticeInfo(data).then(res => {
|
if (res.status) {
|
this.info = res.data;
|
this.contentBody = res.data.contentBody;
|
this.title = this.info.title;
|
} else {
|
this.$u.toast(res.msg);
|
}
|
});
|
},
|
//获取分享URL
|
getShareUrl() {
|
let data = {
|
client: this.$globalConstVars.shareClient.wxMiNiProgram,
|
url: this.$globalConstVars.shareUrl,
|
type: this.$globalConstVars.shareModel.url,
|
page: this.$globalConstVars.shareType.article,
|
params: {
|
noticeId: this.id,
|
}
|
};
|
let userToken = this.$db.get('userToken');
|
if (userToken && userToken != '') {
|
data.token = userToken
|
}
|
this.$u.api.share(data).then(res => {
|
this.shareUrl = res.data
|
});
|
}
|
},
|
watch: {
|
id: {
|
handler() {
|
this.getShareUrl();
|
},
|
deep: true
|
}
|
},
|
//分享
|
onShareAppMessage(res) {
|
return {
|
title: this.info.title,
|
path: this.shareUrl
|
}
|
},
|
onShareTimeline(res) {
|
return {
|
title: this.info.title,
|
path: this.shareUrl
|
}
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
@import "details.scss";
|
</style>
|