You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.7 KiB

6 months ago
  1. <template>
  2. <view>
  3. <!-- 空白页 -->
  4. <empty v-if="!article" tip='没详细内容'></empty>
  5. <view style="display: flex;justify-content: center;">{{title}}</view>
  6. <view class="tip">
  7. <view class="type">类型:{{type}}</view>
  8. <view class="addtime">发布时间:{{time}}</view>
  9. </view>
  10. <view class="main" style="background:#FFF; padding:20rpx;">
  11. <!-- <u-parse :content="article" @preview="preview" @navigate="navigate" ></u-parse> -->
  12. <rich-text :nodes="article"></rich-text>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import uParse from '@/components/u-parse/u-parse.vue';
  18. import empty from "@/components/empty";
  19. export default {
  20. components: {
  21. uParse,empty
  22. },
  23. data() {
  24. return {
  25. adid:0,
  26. article: '',
  27. title:'',
  28. type:'',
  29. time:''
  30. }
  31. },
  32. onLoad(option) {
  33. console.log("option: " + JSON.stringify(option));
  34. let getadid = parseInt(option.id);
  35. this.adid=getadid;
  36. this.detaildesc(this.adid);
  37. },
  38. methods: {
  39. async detaildesc(adid){
  40. let info= await this.$api.detaildesc({action:'detaildesc',id:adid});
  41. this.title=info.data[0].title;
  42. this.time=info.data[0].create_time;
  43. this.type=info.data[0].type;
  44. this.article=info.data[0].contents.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
  45. },
  46. preview(src, e) {
  47. // do something
  48. console.log(src,'图片地址')
  49. console.log(e,'图片e')
  50. },
  51. navigate(href, e) {
  52. // do something
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. .main{
  59. color: #808080;
  60. font-size: 30rpx;
  61. }
  62. .tip{
  63. display: flex;
  64. justify-content: space-between;
  65. color: #808080;
  66. font-size: 30upx;
  67. margin:10upx 35upx;
  68. }
  69. // @import "../../components/u-parse/u-parse.css";
  70. </style>