newCenter.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <div class="w-screen pad:w-full">
  3. <big-title>{{lang===langType.cn?"新闻中心":getAbbrText("新闻中心")}}</big-title>
  4. <div class="container mx-auto newView">
  5. <a
  6. v-for="(news,i) in newArr"
  7. :key="news.key"
  8. :href="news.src"
  9. :class="`newChunk chunk${i}`">
  10. <span class="imgBox" v-if="news.img">
  11. <img :src="news.img" alt=""/>
  12. </span>
  13. <p class="newsContext">
  14. <span class="newsType">
  15. <span>{{getNewsTypeStr(news.type)}}</span>
  16. </span>
  17. <span class="title">
  18. {{lang===langType.cn?news.title:getLangText(news.title)}}
  19. </span>
  20. <span class="description">
  21. {{lang===langType.cn?news.description:getLangText(news.description)}}
  22. </span>
  23. <span class="time">
  24. {{news.time}}
  25. </span>
  26. </p>
  27. </a>
  28. </div>
  29. <div class="container mx-auto">
  30. <a class=" show-more" :href="hrefs.news">查看更多</a>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import langMap from "@/map/langMap";
  36. import {hrefs} from "@/map/hrefMap";
  37. import {newsType,getNewsTypeStr} from "@/map/newMap";
  38. import BigTitle from "~/components/public/bigTitle.vue";
  39. export default {
  40. name: "newCenter",
  41. components: {BigTitle},
  42. props: {
  43. lang:{
  44. default: langMap.lang.cn
  45. },
  46. },
  47. data(){
  48. return {
  49. langType: langMap.lang,
  50. hrefs: hrefs,
  51. newsType: newsType,
  52. newArr:[
  53. {
  54. key: 'one',
  55. title: "智慧能源解决方案",
  56. img: 'image/showing/fire_s.jpg',
  57. type: 2,
  58. description: "目前家庭光伏电站的运行维护主要基于对逆变器的监控,那么主流监控模式有哪些呢?小编带你逐一分解",
  59. src: '/solution',
  60. time: '2023-04-02',
  61. },
  62. {
  63. key: 'two',
  64. title: "解锁家庭光伏电站监控全姿势",
  65. type: 2,
  66. description: "目前家庭光伏电站的运行维护主要基于对逆变器的监控,那么主流监控模式有哪些呢?小编带你逐一分解",
  67. src: '/solution',
  68. time: '2022-01-02'
  69. },
  70. {
  71. key: 'three',
  72. title: "G8100 4G低功耗LTE无线模块简介",
  73. type: 2,
  74. description: "工业级高性能、高通平台,超低功耗,多种无线通信方式,丰富的I/O接口",
  75. src: '/solution',
  76. time: '2021-11-30'
  77. },
  78. {
  79. key: 'four',
  80. title: "ETC停车场的发展前景",
  81. type: 3,
  82. description: "1.无需人值守降低人工成本;2.非现金支付,杜绝跑冒滴漏;3.集中式管理,财务一目了然;4.无缝对接各类基于ETC的应用系统;5.兼容全国高速公路,ETC收费系统;6.不停车通行,提升通行效率;",
  83. src: '/news/info/pa?id=47',
  84. time: '2022-09-20'
  85. },{
  86. key: 'five',
  87. title: "森林防火4G摄像机视频监控解决方案",
  88. type: 1,
  89. description: "采用4G摄像机4G高清网络摄像机或4G高清视频服务器+摄像头组合,将监控点附近的相关视频实时回传至监控中心,林区负责人或监管部门可实时了解林区状态,如有隐患或火灾,可第一时间发现并采取相应措施。\n" ,
  90. src: '/solution/info/sol?id=49',
  91. time: '2022-01-02'
  92. }
  93. ]
  94. }
  95. },
  96. methods:{
  97. getLangText(str) {
  98. return langMap.getText(this.lang, str);
  99. },
  100. getAbbrText(str) {
  101. return langMap.getAbbrText(this.lang, str);
  102. },
  103. getNewsTypeStr(ind){
  104. return langMap.getAbbrText(
  105. this.lang,
  106. getNewsTypeStr(ind)
  107. );
  108. }
  109. }
  110. }
  111. </script>
  112. <style scoped>
  113. .newView{
  114. display: flex;
  115. align-items: center;
  116. flex-direction: column;
  117. }
  118. .newView .newChunk{
  119. box-shadow: 0 0 1px black;
  120. position: relative;
  121. overflow: hidden;
  122. cursor: pointer;
  123. box-sizing: border-box;
  124. padding: 15px 35px;
  125. width: 96%;
  126. }
  127. @media screen and (min-width: 1024px) {
  128. .newView{
  129. display: grid;
  130. grid-template-columns: repeat(3);
  131. grid-template-rows: repeat(2,270px);
  132. grid-template-areas:
  133. 'a b c'
  134. 'a d e';
  135. margin-bottom: 35px;
  136. }
  137. .newView .newChunk{
  138. width: 100%;
  139. }
  140. }
  141. .newView .newChunk:hover{
  142. box-shadow: 2px 2px 6px #484444;
  143. }
  144. .newChunk .imgBox{
  145. width: 100%;
  146. height: 240px;
  147. margin-bottom: 10px;
  148. }
  149. .newView .newChunk:hover .imgBox img{
  150. left: -10px;
  151. top: -10px;
  152. max-width: calc(100% + 20px);
  153. width: calc(100% + 20px);
  154. height: calc(100% + 20px);
  155. }
  156. .newsContext{
  157. display: block;
  158. width: 100%;
  159. height: 240px;
  160. }
  161. .newsContext .newsType{
  162. /*margin: 10px 0;*/
  163. display: flex;
  164. height: 35px;
  165. align-items: center;
  166. }
  167. .newsContext .newsType > span{
  168. color: #ea0000;
  169. background-color: #eecec5;
  170. padding: 1px 15px;
  171. border-radius: 3px;
  172. }
  173. .newsContext .title{
  174. font-size: 1.3em;
  175. display: flex;
  176. height: 55px;
  177. align-items: center;
  178. font-weight: bold;
  179. }
  180. .newsContext .description{
  181. display: block;
  182. width: 100%;
  183. height: calc(100% - 120px);
  184. }
  185. .newsContext .time{
  186. display: flex;
  187. height: 40px;
  188. }
  189. .show-more{
  190. height: 50px;
  191. display: flex;
  192. align-items: center;
  193. justify-content: flex-end;
  194. padding: 0 10px;
  195. box-sizing: border-box;
  196. font-size: 1.4em;
  197. margin-bottom: 35px;
  198. }
  199. .show-more:hover{
  200. color: orangered;
  201. }
  202. .newView .chunk0{
  203. grid-area: a;
  204. height: 100%;
  205. }
  206. /*.newView .chunk2{*/
  207. /* grid-area: b;*/
  208. /*}*/
  209. /*.newView .chunk3{*/
  210. /* grid-area: c;*/
  211. /*}*/
  212. /*.newView .chunk4{*/
  213. /* grid-area: d;*/
  214. /*}*/
  215. /*.newView .chunk5{*/
  216. /* grid-area: e;*/
  217. /*}*/
  218. </style>