jhzh
2024-03-23 0d29d9a2bf0d893a67f1263bb9525131a50a2128
src/page/home/newPage.vue
@@ -1,6 +1,13 @@
<template>
  <div :class="` ${$state.theme === 'red' ? 'red-theme' : 'black-theme'}`"  class="">
  <div :class="` ${$state.theme === 'red' ? 'red-theme' : 'black-theme'}`"  class="new-page">
    <div class="head">
      <mt-header fixed :title="$t('hj238')">
        <router-link to="/home" slot="left">
          <mt-button icon="back"></mt-button>
        </router-link>
      </mt-header>
      <!-- <view>{{ $t('hj238') }}</view> -->
    </div>
    <div class="newsTop">
      <div class="newsTitle">{{list.title}}</div>
      <div class="newDetail-tits">{{ list.addTime| gettime}}</div>
@@ -15,66 +22,81 @@
</template>
<script>
import * as api from "@/axios/api";
import * as api from '@/axios/api'
   export default {
    created() {
        if (this.$route.query.listid) {
          this.list_id = this.$route.query.listid;
      this.list_id = this.$route.query.listid
        }
        this.getqueryNewsList(this.$route.query.listid);
    this.getqueryNewsList(this.$route.query.listid)
    },
     data () {
        return{
        list_id:"",
        list:[],
        }},
      list_id: '',
      list: []
    }
  },
     mounted(){
     },
     methods:{
     async getqueryNewsList(id){
        let data = await api.queryNewsDetail(id);
      let data = await api.queryNewsDetail(id)
          this.list = data.data
      }
      
     },
    filters:{
      gettime(time) {
        if (!time) {
          return "";
        return ''
        }
        var nd = new Date(time );
        var y = nd.getFullYear();
        var mm = nd.getMonth() + 1;
        var d = nd.getDate();
        var h = nd.getHours();
        var m = nd.getMinutes();
        var c = nd.getSeconds();
      var nd = new Date(time)
      var y = nd.getFullYear()
      var mm = nd.getMonth() + 1
      var d = nd.getDate()
      var h = nd.getHours()
      var m = nd.getMinutes()
      var c = nd.getSeconds()
        if (mm < 10) {
          mm = "0" + mm;
        mm = '0' + mm
        }
        if (d < 10) {
          d = "0" + d;
        d = '0' + d
        }
        if (h < 10) {
          h = "0" + h;
        h = '0' + h
        }
        if (m < 10) {
          m = "0" + m;
        m = '0' + m
        }
        if (c < 10) {
          c = "0" + c;
        c = '0' + c
        }
        //17:35:2922-06-2022
        return y + "-" + mm + "-" + d + " " + h + ":" + m + ":" + c;
      return y + '-' + mm + '-' + d + ' ' + h + ':' + m + ':' + c
      }
    },
  }
     }
</script>
<style scoped lang="less">
.new-page {
  height: calc(100% - 72px);
  overflow: hidden;
  .head {
    height: 60px;
    .mint-header {
      height: 60px;
      border-bottom: 1px solid #DDDDDD;
      /deep/ .mintui-back, /deep/ .mint-header-title {
        font-size: 28px;
        font-weight: 900;
      }
    }
  }
}
  .newDetail-tits{
    margin-top: 0.4rem;
    font-size: 0.4rem;
@@ -94,6 +116,8 @@
    font-weight: 500;
  }
  .newsDetail{
    height: calc(100% - 254px);
    overflow-y: auto;
    width: 96%;
    margin-left: 0;
    margin-right: 0;
@@ -102,6 +126,24 @@
    font-size: 0.35rem;
    line-height: 0.6rem;
  }
  /* 隐藏滚动条但能滚动 */
  .newsDetail {
    overflow: auto;
    /* 隐藏滚动条 */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }
  /* 隐藏滚动条的样式 */
  .newsDetail::-webkit-scrollbar {
    width: 0px;
    background-color: transparent;
  }
  .newsDetail::-webkit-scrollbar-thumb {
    background-color: transparent;
  }
  .newsDetail::-webkit-scrollbar-track {
    background-color: transparent;
  }
  .newsImg{
    width: 100%;
    margin-top: 0.4rem;