73 lines
1.5 KiB
Vue
73 lines
1.5 KiB
Vue
<template>
|
|
<view class="page">
|
|
<u-navbar title="公告" :border-bottom="false" :background="bgc" back-icon-color="#262B37" title-color='#262B37'
|
|
title-size='36' height='46' id="navbar" :custom-back="btnfh">
|
|
</u-navbar>
|
|
<u-parse :html="obj.content" style="width: 100%;height: 100vh;padding: 10rpx;box-sizing: border-box;margin-top: 20rpx;overflow: scroll;"></u-parse>
|
|
|
|
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
bgc: {
|
|
backgroundColor: "#fff",
|
|
},
|
|
obj:{},
|
|
fanhui:''
|
|
}
|
|
},
|
|
onLoad(e) {
|
|
this.getgonggao(e.id)
|
|
if(e && e.fanhui){
|
|
this.fanhui = e.fanhui
|
|
}
|
|
},
|
|
// 分享到好友(会话)
|
|
onShareAppMessage: function() {
|
|
return {
|
|
title: '玩转福鼎',
|
|
path: '/pages/gonggao?id=' + (this.obj.id || '') + '&fanhui=1'
|
|
}
|
|
},
|
|
// 分享到朋友圈
|
|
onShareTimeline: function() {
|
|
return {
|
|
title: '玩转福鼎',
|
|
query: '',
|
|
path: '/pages/gonggao?id=' + (this.obj.id || '') + '&fanhui=1'
|
|
}
|
|
},
|
|
methods: {
|
|
btnfh(){
|
|
if(this.fanhui == 1){
|
|
uni.reLaunch({
|
|
url:'/pages/index/index'
|
|
})
|
|
}else{
|
|
uni.navigateBack()
|
|
}
|
|
},
|
|
// 请求公告
|
|
getgonggao(id){
|
|
this.$u.get(`/app/article/detail/${id}`).then(res =>{
|
|
if(res.code == 200){
|
|
this.obj = res.data
|
|
}
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
<style lang="less">
|
|
::v-deep .u-icon__icon,
|
|
::v-deep .u-title{
|
|
padding-bottom: 22rpx !important;
|
|
}
|
|
page {
|
|
background: #fff;
|
|
}
|
|
</style> |