index.vue 938 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view>
  3. <view id="box">
  4. <u-parse :content="content" :noData="content" v-if="isShow"/>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import uParse from '@/components/gaoyia-parse/parse.vue'
  10. export default {
  11. components: {
  12. uParse
  13. },
  14. data() {
  15. return {
  16. content:"",
  17. isShow:false
  18. }
  19. },
  20. onLoad(options) {
  21. this.id = options.id || 0;
  22. this.get_article();
  23. },
  24. methods: {
  25. get_article(){
  26. this
  27. .request
  28. .post("getContent",{id : this.id})
  29. .then(res=>{
  30. console.log(res);
  31. if(res.code == 200) {
  32. this.content = res.data.content;
  33. uni.setNavigationBarTitle({
  34. title:res.data.title
  35. });
  36. this.isShow = true;
  37. }
  38. })
  39. .catch(err=>{
  40. this.utils.Tip("网络错误,请稍后尝试");
  41. });
  42. }
  43. }
  44. }
  45. </script>
  46. <style>
  47. @import url("/components/gaoyia-parse/parse.css");
  48. #box {
  49. z-index: -1;
  50. padding: 15px;
  51. }
  52. </style>