news.vue 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template name="news">
  2. <view slot="gBody" class="grace-body">
  3. <!-- 标题 -->
  4. <text :class="['grace-art-margin', 'grace-art-title', graceSkeleton ? 'grace-skeletons' : '']">{{item.name}}</text>
  5. <!-- 作者信息 -->
  6. <view class="grace-art-margin grace-nowrap grace-flex-vcenter" v-if="info">
  7. <view :class="['grace-art-author','grace-nowrap','grace-flex-vcenter', graceSkeleton ? 'grace-skeletons' : '']">
  8. <image class="grace-art-author-face" :src="item.author.avatar" mode="widthFix"></image>
  9. <text v-if="item.author.name" class="grace-art-author-name">{{item.author.name}}</text>
  10. </view>
  11. <text class="grace-art-btn grace-bg-green">+ 关注</text>
  12. </view>
  13. <!-- 其他基本信息 -->
  14. <view :class="['grace-art-info-line','grace-art-margin','grace-space-between', graceSkeleton ? 'grace-skeletons' : '']" v-if="info">
  15. <text class="grace-art-info-line-text grace-icons icon-eye" v-if="item.num_view"><text style="margin-left:2px">{{item.num_view}}</text></text>
  16. <text class="grace-art-info-line-text" v-if="item.date">发布于 : {{item.date}}</text>
  17. </view>
  18. <!-- 文章内容 -->
  19. <view class="grace-art-contents">
  20. <block v-for="(v, k) in item.content_array" :key="k">
  21. <view :class="[graceSkeleton ? 'grace-skeletons-img' : 'grace-img-in']" v-if="v.type == 'pic'">
  22. <image :src="v.content" class="grace-art-img" mode="widthFix" @click="Dever.viewPic(item.content_pic, v.content)"></image>
  23. </view>
  24. <view :class="[graceSkeleton ? 'grace-skeletons' : 'grace-art-content']" v-else-if="v.type == 'html'"><rich-text type="text" :nodes="v.content"></rich-text></view>
  25. </block>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: "news",
  32. props: {
  33. info : false,
  34. graceSkeleton : true,
  35. control : {
  36. type : Object,
  37. value : null
  38. },
  39. item : {
  40. type : Object,
  41. value : null
  42. },
  43. },
  44. methods:{
  45. start : function() {
  46. },
  47. stop : function() {
  48. }
  49. },
  50. }
  51. </script>
  52. <style>
  53. .grace-art-margin{margin-top:20rpx;}
  54. .grace-art-title{display:block; width:100%; font-size:38rpx; font-weight:bold; line-height:56rpx;}
  55. .grace-skeletons{background-color:#F8F8F8; border-radius:8rpx; height:60rpx;}
  56. .grace-skeletons-img{width:100%; background-color:#F8F8F8; height:300rpx; border-radius:8rpx;}
  57. .grace-art-author{width:700rpx; font-size:0;}
  58. .grace-art-author-face{width:66rpx; height:66rpx; border-radius:66rpx; margin-right:20rpx; flex-shrink:0;}
  59. .grace-art-author-name{display:block; line-height:80rpx; font-size:26rpx;}
  60. .grace-art-btn{width:120rpx; line-height:60rpx; text-align:center; border-radius:50rpx; font-size:26rpx; display:block; flex-shrink:0; margin-left:30rpx;}
  61. .grace-art-info-line{}
  62. .grace-art-info-line-text{font-size:22rpx; line-height:50rpx; color:#888888;}
  63. .grace-art-contents{padding:20rpx 0;}
  64. .grace-art-img{width:100%; margin:10rpx 0;}
  65. .grace-art-content{line-height:52rpx; font-size:28rpx;}
  66. </style>