guideDetail.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view style="column hb">
  3. <view class="detail-cont">
  4. <view class="title">{{item.title}}</view>
  5. <view class="info">
  6. <view class="reads">阅读数:{{item.views?item.views:''}}</view>
  7. <view class="time">{{item.publishTime?item.publishTime:""}}</view>
  8. </view>
  9. <view class="video" v-if="item.videoUrl!=null">
  10. <video class="VerticalVideo" id="myVideo" :src="item.videoUrl" object-fit='cover'
  11. @error="videoErrorCallback" controls></video>
  12. </view>
  13. <!-- 正文 -->
  14. <view class="full-text" >
  15. <view v-html="item.content"></view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import {getbeilidetail} from '@/api/doc.js'
  22. export default {
  23. data() {
  24. return {
  25. id:"",
  26. item:{}
  27. }
  28. },
  29. onLoad(option) {
  30. if (option.title) {
  31. uni.setNavigationBarTitle({
  32. title: option.title
  33. });
  34. }
  35. this.id=option.id
  36. },
  37. mounted() {
  38. this.getclassification()
  39. },
  40. methods: {
  41. getclassification(){
  42. uni.showLoading({
  43. title: "加载中..."
  44. })
  45. const data={
  46. articleId:this.id
  47. }
  48. getbeilidetail(data).then(res=>{
  49. if(res.code==200){
  50. uni.hideLoading()
  51. this.item=res.data
  52. }
  53. })
  54. },
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .detail-cont{
  60. width: calc(100% - 80rpx) ;
  61. flex: 1;
  62. padding: 40upx;
  63. overflow-y: auto;
  64. .title{
  65. font-size: 40upx;
  66. font-family: PingFang SC;
  67. // font-weight: bold;
  68. color: #222222;
  69. line-height: 70upx;
  70. }
  71. .info{
  72. display: flex;
  73. align-items: center;
  74. font-size: 24upx;
  75. font-family: PingFang SC;
  76. font-weight: 500;
  77. color: #999999;
  78. line-height: 48upx;
  79. margin: 23upx 0;
  80. .reads{
  81. margin-right: 30upx;
  82. }
  83. }
  84. .full-text{
  85. width: 100%;
  86. font-size: 36upx;
  87. font-family: PingFang SC;
  88. // font-weight: 500;
  89. color: #222222;
  90. line-height: 60upx;
  91. }
  92. .video{
  93. width: 100%;
  94. display: flex;
  95. align-items: center;
  96. justify-content: center;
  97. .horizontalVideo{
  98. height: 1200rpx;
  99. }
  100. .VerticalVideo{
  101. height: 400rpx;
  102. }
  103. video{
  104. width: 100%;
  105. }
  106. }
  107. }
  108. </style>