123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <view class="container">
- <view class="">
- <view class="ft36 header-title">
- {{info.title}}
- </view>
- <view class="ft24 coh header-time">
- {{info.create_time}}
- {{info.click}}次阅读
- </view>
- </view>
-
- <view class="pd10rpx">
- <rich-text :nodes="nodes" style="font-size: 14px;"></rich-text>
- </view>
-
- <view class="video" v-if="tabType==2">
- <video :src="video_url" controls></video>
- </view>
-
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- nodes:"",
- info:{},
- video_url:"",
- tabType:1,
- }
- },
- onLoad(e) {
- console.log(e,"e")
- this.tabType=e.tabType;
- let url=e.tabType==1?"Content/jcdetail":"Content/vddetail";
- wx.setNavigationBarTitle({
- title:e.tabType==1?'教程详情':'视频详情',
- success: (res) => {},
- fail: (res) => {},
- complete: (res) => {},
- })
- this.request({
- url,
- data: {
- id: e.id,
- },
- }).then(res => {
- console.log(res,"res")
- if (res.code === '200') {
- if(e.tabType==1){
- this.info=res.data;
- this.nodes = res.data.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
- }else{
- this.info=res.data;
- this.nodes = res.data.desc.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
- this.video_url = res.data.video_url;
- }
- }
- });
- },
-
- onShareAppMessage(e) {
-
- },
- methods: {
- }
- }
- </script>
- <style>
- page{
- width: 100%;
- height: 100%;
- }
- .container{
- padding: 0 40rpx;
- width: 100%;
- height: 100%;
- }
- .pd10rpx{
- padding: 0 10px;
- }
- .header-title{
- margin-bottom: 16rpx;
- }
- .header-time{
- margin-bottom: 20rpx;
- }
-
- .video{
- width: 100%;
- }
- .video video{
- width: 100%;
- }
- </style>
|