2.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. <template>
  2. <div class="listNewsBox">
  3. <div class="listNewsTitle" v-if="skinId==1">
  4. <NuxtLink
  5. v-if="titleLink.cid"
  6. :href="getLinkPath(titleLink)"
  7. :title="titleLink.alias"
  8. >
  9. {{titleLink.alias}}
  10. </NuxtLink>
  11. </div>
  12. <div class="listNewsTitle_skin2" v-if="skinId==2">
  13. <span>
  14. <NuxtLink
  15. v-if="titleLink.cid"
  16. :href="getLinkPath(titleLink)"
  17. :title="titleLink.alias"
  18. >
  19. {{titleLink.alias}}
  20. </NuxtLink>
  21. </span>
  22. </div>
  23. <div class="listNewsContent">
  24. <div class="listNewsContentLeft">
  25. <div class="listNewsImgNewsUl">
  26. <div class="listNewsImgNewsLi" v-for="item in component_style1_News3">
  27. <NuxtLink
  28. :href="getLinkPathDetail(item)"
  29. :title="item.title"
  30. :target="item.islink == 1 ? '_blank' : '_self'"
  31. >
  32. <div class="listNewsImgNewsMark" v-if="skinId==1">
  33. <div>重 点</div>
  34. <div>关 注</div>
  35. </div>
  36. <div class="listNewsImgNewsMark_skin2" v-if="skinId==2">
  37. <div>重 点</div>
  38. <div>关 注</div>
  39. </div>
  40. <div class="listNewsImgNewsTitle">{{ item.title }}</div>
  41. </NuxtLink>
  42. </div>
  43. </div>
  44. <div class="listNewsImgNewsBox">
  45. <div v-for="item in component_style1_News1Array" class="listNewsImgNewsItem">
  46. <NuxtLink
  47. :href="getLinkPathDetail(item)"
  48. :title="item.title"
  49. :target="item.islink == 1 ? '_blank' : '_self'"
  50. >
  51. <img :src="item.imgurl" />
  52. <div class="listNewsImgNewsItemContent">
  53. <div class="listNewsImgNewsItemTitle">
  54. {{ item.title }}
  55. </div>
  56. </div>
  57. </NuxtLink>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="listNewsContentRight">
  62. <div class="listNewsImgNewsBox">
  63. <div v-for="item in component_style1_News1Array_2" class="listNewsImgNewsItem">
  64. <NuxtLink
  65. :href="getLinkPathDetail(item)"
  66. :title="item.title"
  67. :target="item.islink == 1 ? '_blank' : '_self'"
  68. >
  69. <img :src="item.imgurl" />
  70. <div class="listNewsImgNewsItemContent">
  71. <div class="listNewsImgNewsItemTitle">
  72. {{ item.title }}
  73. </div>
  74. </div>
  75. </NuxtLink>
  76. </div>
  77. </div>
  78. <div class="adBox">
  79. <!-- 广告模块 -->
  80. <a href="http://nzgxw.org.cn/" v-if="templateAdData.image_url==null" target="_blank" :title="templateAdData.introduce">
  81. <img :src="templateAdData.thumb" :alt="templateAdData.introduce" :id="templateAdData.ad_tag" data-tag="templateAdData.ad_tag">
  82. </a>
  83. <a :href="templateAdData.image_url" v-else :title="templateAdData.introduce">
  84. <img :src="templateAdData.image_src" :alt="templateAdData.introduce" :id="templateAdData.ad_tag" data-tag="templateAdData.ad_tag">
  85. </a>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </template>
  91. <script setup>
  92. //引入vue
  93. import {ref} from 'vue';
  94. //获得新闻数据
  95. const props = defineProps({
  96. titleLink:Object,//板块名称
  97. templateData:Array,//新闻数据
  98. skinId:String,//皮肤id
  99. templateAdData:Object,//广告
  100. });
  101. //样式1与样式2共用 start ---------------------------------------->
  102. const component_style1_News1Array = ref({});
  103. component_style1_News1Array.value = props.templateData.img.slice(0,2);
  104. const component_style1_News1Array_2 = ref({});
  105. component_style1_News1Array_2.value = props.templateData.img.slice(2,3);
  106. const component_style1_News3 = ref({});
  107. component_style1_News3.value = props.templateData.text.slice(0,4);
  108. //样式1与样式2共用 end ---------------------------------------->
  109. </script>
  110. <style lang="less" scoped>
  111. .listNewsBox {
  112. width: 1200px;
  113. height: 480px;
  114. position: relative;
  115. .listNewsTitle {
  116. font-size:22px;
  117. font-weight:bold;
  118. height: 40px;
  119. line-height: 40px;
  120. border-bottom: 2px solid #004564;
  121. color:#004564;
  122. margin-bottom: 20px;
  123. box-sizing: border-box;
  124. a {
  125. color:#004564;
  126. display: block;
  127. height: 25px;
  128. line-height: 25px;
  129. }
  130. }
  131. .listNewsTitle_skin2 {
  132. font-size:22px;
  133. font-weight:bold;
  134. height: 40px;
  135. line-height: 40px;
  136. border-bottom: 2px solid #A91B33;
  137. color:#A91B33;
  138. margin-bottom: 20px;
  139. box-sizing: border-box;
  140. a {
  141. color:#A91B33;
  142. display: block;
  143. height: 25px;
  144. line-height: 25px;
  145. }
  146. span {
  147. color:#A91B33;
  148. height: 25px;
  149. line-height: 25px;
  150. border-left: 3px solid #A91B33;
  151. padding-left: 12px;
  152. display: block;
  153. }
  154. }
  155. .listNewsContent {
  156. display: flex;
  157. align-items: flex-start;
  158. justify-content: space-between;
  159. .listNewsContentLeft {
  160. width: 720px;
  161. height: 420px;
  162. .listNewsImgNewsBox {
  163. width: 720px;
  164. height: 110px;
  165. display: flex;
  166. align-items: flex-start;
  167. justify-content: space-between;
  168. margin-bottom: 20px;
  169. .listNewsImgNewsItem {
  170. a {
  171. display: flex;
  172. height: 110px;
  173. width: 350px;
  174. background: #F9FAFB;
  175. align-items: flex-start;
  176. justify-content: space-between;
  177. }
  178. .listNewsImgNewsItemContent {
  179. padding: 15px 8px;
  180. }
  181. .listNewsImgNewsItemTitle {
  182. color: #333333;
  183. font-size: 18px;
  184. box-sizing: border-box;
  185. overflow: hidden;
  186. text-overflow: ellipsis;
  187. display: -webkit-box;
  188. line-clamp: 2;
  189. -webkit-line-clamp: 2;
  190. -webkit-box-orient: vertical;
  191. }
  192. img {
  193. display: block;
  194. width: 170px;
  195. height: 110px;
  196. }
  197. }
  198. }
  199. .listNewsImgNewsUl {
  200. height: 290px;
  201. margin-bottom: 20px;
  202. .listNewsImgNewsLi {
  203. width: 720px;
  204. height: 62px;
  205. background: #F9FAFB;
  206. display: flex;
  207. margin-bottom: 14px;
  208. a {
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. }
  213. .listNewsImgNewsMark {
  214. background: #004564;
  215. color: #fff;
  216. width: 50px;
  217. height: 62px;
  218. box-sizing: border-box;
  219. padding: 12px 10px;
  220. font-size: 12px;
  221. font-weight: bold;
  222. margin-right: 10px;
  223. div {
  224. margin-bottom: 5px;
  225. &:last-child {
  226. margin-bottom: 0;
  227. }
  228. }
  229. }
  230. .listNewsImgNewsMark_skin2 {
  231. background: #A91B33;
  232. color: #fff;
  233. width: 50px;
  234. height: 62px;
  235. box-sizing: border-box;
  236. padding: 15px 10px;
  237. font-size: 12px;
  238. font-weight: bold;
  239. margin-right: 10px;
  240. div {
  241. margin-bottom: 5px;
  242. &:last-child {
  243. margin-bottom: 0;
  244. }
  245. }
  246. }
  247. .listNewsImgNewsTitle {
  248. flex:1;
  249. color:#333;
  250. font-size: 18px;
  251. height: 62px;
  252. line-height: 62px;
  253. overflow: hidden;
  254. text-overflow: ellipsis;
  255. white-space: nowrap;
  256. }
  257. &:first-child {
  258. .listNewsImgNewsTitle {
  259. font-weight: bold;
  260. }
  261. }
  262. &:last-child {
  263. margin-bottom: 0;
  264. }
  265. }
  266. }
  267. }
  268. .listNewsContentRight {
  269. width: 450px;
  270. height: 420px;
  271. .listNewsImgNewsBox {
  272. margin-bottom: 20px;
  273. .listNewsImgNewsItem {
  274. a {
  275. display: flex;
  276. height: 110px;
  277. width: 450px;
  278. background: #F9FAFB;
  279. align-items: flex-start;
  280. justify-content: space-between;
  281. }
  282. .listNewsImgNewsItemContent {
  283. padding: 15px 8px;
  284. }
  285. .listNewsImgNewsItemTitle {
  286. color: #333333;
  287. font-size: 18px;
  288. box-sizing: border-box;
  289. overflow: hidden;
  290. text-overflow: ellipsis;
  291. display: -webkit-box;
  292. line-clamp: 2;
  293. -webkit-line-clamp: 2;
  294. -webkit-box-orient: vertical;
  295. }
  296. img {
  297. display: block;
  298. width: 170px;
  299. height: 110px;
  300. }
  301. }
  302. }
  303. .adBox {
  304. box-sizing: border-box;
  305. position: relative;
  306. img {
  307. display: block;
  308. width: 450px;
  309. height: 290px;
  310. }
  311. .templateEditBtnBox {
  312. right: 0;
  313. }
  314. }
  315. }
  316. }
  317. }
  318. </style>