1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template>
- <view class="ql-editor">
- <u-parse :html="content"></u-parse>
- <u-toast ref="uToast" />
- </view>
- </template>
- <script>
- export default{
- data(){
- return{
- content:''
- }
- },
- onLoad(page){
- if (page.artId) {
- this.getDetails(page.artId)
- }
- },
- onShow(){
-
- },
- methods:{
- // 获取详情
- getDetails(id) {
- this.$u.api.getPolicyNewsDetails({id:id})
- .then(res=>{
- console.log('getNewsDetails',JSON.parse(JSON.stringify(res)));
- if (res.code === 200) {
- console.log(res.data);
- this.content = res.data.artContent;
- } else {
- this.$refs.uToast.show({
- title: res.msg,
- type: 'error'
- })
- }
- })
- .catch(err => {
- this.$refs.uToast.show({
- title: '操作失败!',
- type: 'error'
- })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- // page{padding: 24rpx;}
- // @import './policyNewsDetails.scss'
- @import '@/static/css/quill.bubble.scss';
- @import '@/static/css/quill.core.scss';
- @import '@/static/css/quill.snow.scss';
- </style>
|