zzzz
2024-04-24 fde4daf5bf6ace15c3f78eb3bb5b9dbdad763674
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,72 +22,87 @@
</template>
<script>
import * as api from "@/axios/api";
   export default {
    created() {
        if (this.$route.query.listid) {
          this.list_id = this.$route.query.listid;
        }
        this.getqueryNewsList(this.$route.query.listid);
    },
     data () {
        return{
        list_id:"",
        list:[],
        }},
     mounted(){
import * as api from '@/axios/api'
export default {
  created () {
    if (this.$route.query.listid) {
      this.list_id = this.$route.query.listid
    }
    this.getqueryNewsList(this.$route.query.listid)
  },
  data () {
    return {
      list_id: '',
      list: []
    }
  },
  mounted () {
     },
     methods:{
     async getqueryNewsList(id){
        let data = await api.queryNewsDetail(id);
          this.list = data.data
      }
     },
    filters:{
      gettime(time) {
        if (!time) {
          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();
        if (mm < 10) {
          mm = "0" + mm;
        }
        if (d < 10) {
          d = "0" + d;
        }
        if (h < 10) {
          h = "0" + h;
        }
        if (m < 10) {
          m = "0" + m;
        }
        if (c < 10) {
          c = "0" + c;
        }
        //17:35:2922-06-2022
        return y + "-" + mm + "-" + d + " " + h + ":" + m + ":" + c;
      }
    },
  },
  methods: {
    async getqueryNewsList (id) {
      let data = await api.queryNewsDetail(id)
      this.list = data.data
    }
     }
  },
  filters: {
    gettime (time) {
      if (!time) {
        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()
      if (mm < 10) {
        mm = '0' + mm
      }
      if (d < 10) {
        d = '0' + d
      }
      if (h < 10) {
        h = '0' + h
      }
      if (m < 10) {
        m = '0' + m
      }
      if (c < 10) {
        c = '0' + c
      }
      // 17:35:2922-06-2022
      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;
    margin-bottom: 0.4rem;
  }
  .newsTop{
  .newsTop {
    border-bottom: 0.01rem solid #cdcdcd;
    padding-top: 0.3rem;
    color: #000;
@@ -89,11 +111,13 @@
    margin-right: 0;
    margin: 0 auto;
  }
  .newsTitle{
  .newsTitle {
    font-size: 0.55rem;
    font-weight: 500;
  }
  .newsDetail{
  .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;