notice.vue 786 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="u-content">
  3. <u-parse :html="content" v-show="!loading"></u-parse>
  4. <loading ref="loading" type="3"/>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. loading:true,
  12. content: ''
  13. }
  14. },
  15. onLoad() {
  16. this.$refs.loading.showLoading()
  17. this.fetchDetail()
  18. },
  19. methods:{
  20. fetchDetail(){
  21. let params={
  22. title:'投票须知'
  23. }
  24. this.$api.notice.detail(params).then(res=>{
  25. this.content=res.data.data.content
  26. this.hideLoading()
  27. })
  28. },
  29. hideLoading(){
  30. setTimeout(()=>{
  31. this.$refs.loading.hide()
  32. this.loading=false
  33. },300)
  34. }
  35. }
  36. }
  37. </script>
  38. <style >
  39. page{
  40. background-color: #FFFFFF;
  41. }
  42. .u-content {
  43. padding: 30rpx;
  44. line-height: 50rpx;
  45. color: #505050;
  46. }
  47. </style>