detail.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation></HomePageNavigation>
  6. <!-- 公司信息详情页 -->
  7. <section class="index_main">
  8. <!-- 列表页广告一 -->
  9. <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
  10. <!-- 面包屑导航 -->
  11. <div class="breadcrumb phone_none">
  12. <div class="inner">
  13. <span class="location">当前位置:</span>
  14. <el-breadcrumb :separator-icon="ArrowRight">
  15. <el-breadcrumb-item>
  16. <NuxtLink to="/">首页</NuxtLink>
  17. </el-breadcrumb-item>
  18. <el-breadcrumb-item v-if="routeName != ''">
  19. <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ routeName }}</NuxtLink>
  20. </el-breadcrumb-item>
  21. <el-breadcrumb-item v-if="parent_name">
  22. <NuxtLink :to="`list-1.html`"> {{ parent_name }}</NuxtLink>
  23. </el-breadcrumb-item>
  24. <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
  25. </el-breadcrumb>
  26. </div>
  27. </div>
  28. <div class="breadcrumb_box pc_none">
  29. <span class=" ">当前位置:</span>
  30. <NuxtLink to="/">首页</NuxtLink>
  31. <span class=" " v-if="routeName != ''">&gt;</span>
  32. <NuxtLink v-if="routeName != ''" :to="`/${parent_pinyin}/index.html`"> {{ routeName }}</NuxtLink>
  33. <span class=" " v-if="parent_name">&gt;</span>
  34. <NuxtLink :to="`list-1.html`"> {{ parent_name }}</NuxtLink>
  35. <span class="" >&gt;</span>
  36. <span class="" >{{ routeNewsTtitle }}</span>
  37. </div>
  38. <!-- 面包屑 end-->
  39. <div class="info_head_box clearfix phone_none">
  40. <div class="info_head_left">
  41. <a class="info_head_a info_head_only" :title="公司信息">公司信息</a>
  42. </div>
  43. </div>
  44. <div class="phone_box_1 pc_none" >
  45. <div class="phone_box_head">
  46. <a class="" >公司信息</a>
  47. </div>
  48. </div>
  49. <section class="index_2 clearfix">
  50. <img class="index_2_img" :src="detailImg[0]" :title="routeNewsTtitle" alt="">
  51. <div class="index_2_right">
  52. <h4 class="index_2_h4"> {{ routeNewsTtitle }}</h4>
  53. <div class="index_2_title_box clearfix">
  54. <time class="index_2_title">
  55. 成立日期:
  56. <span v-if="time"> {{ time }}</span>
  57. </time>
  58. <span class="index_2_title">
  59. 所在城市:
  60. <span v-if="newsDetail.city_name">{{ newsDetail.city_name }}</span>
  61. </span>
  62. </div>
  63. <div class="index_2_ul clearfix phone_none">
  64. <div class="index_2_ul_left">
  65. <div class="index_2_li clearfix">
  66. <label class="index_2_li_label">机构性质</label>
  67. <span class="index_2_li_text " v-if="newsDetail.jobnature_name">
  68. {{ newsDetail.jobnature_name }}</span>
  69. </div>
  70. <div class="index_2_li clearfix">
  71. <label class="index_2_li_label">负 责 人</label>
  72. <span class="index_2_li_text" v-if="newsDetail.manager">
  73. {{ newsDetail.manager }}
  74. </span>
  75. </div>
  76. <div class="index_2_li clearfix">
  77. <label class="index_2_li_label">联 系 人</label>
  78. <span class="index_2_li_text " v-if="newsDetail.content_person">
  79. {{ newsDetail.content_person }}
  80. </span>
  81. </div>
  82. <div class="index_2_li clearfix">
  83. <label class="index_2_li_label">联系电话</label>
  84. <span class="index_2_li_text ">{{ newsDetail.telephone }}</span>
  85. </div>
  86. <div class="index_2_li clearfix">
  87. <label class="index_2_li_label">手 &nbsp;&nbsp;&nbsp;&nbsp; 机</label>
  88. <span class="index_2_li_text ">{{ newsDetail.mobile }}</span>
  89. </div>
  90. <div class="index_2_li clearfix">
  91. <label class="index_2_li_label">地 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  92. <span class="index_2_li_text ">{{ newsDetail.adress }}</span>
  93. </div>
  94. </div>
  95. <div class="index_2_ul_left">
  96. <div class="index_2_li clearfix">
  97. <label class="index_2_li_label">所属行业</label>
  98. <span class="index_2_li_text ">{{ newsDetail.hy_name }}</span>
  99. </div>
  100. <div class="index_2_li clearfix">
  101. <label class="index_2_li_label">联系QQ</label>
  102. <span class="index_2_li_text ">{{ newsDetail.QQ }}</span>
  103. </div>
  104. <div class="index_2_li clearfix">
  105. <label class="index_2_li_label">网 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  106. <span class="index_2_li_text ">{{ newsDetail.company_url }}</span>
  107. </div>
  108. <div class="index_2_li clearfix">
  109. <label class="index_2_li_label">邮政编码</label>
  110. <span class="index_2_li_text ">{{ newsDetail.post_code }}</span>
  111. </div>
  112. <div class="index_2_li clearfix">
  113. <label class="index_2_li_label">传 &nbsp;&nbsp;&nbsp;&nbsp; 真</label>
  114. <span class="index_2_li_text ">{{ newsDetail.fax }}</span>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="index_2_ul clearfix pc_none">
  119. <div class="index_2_ul_left">
  120. <div class="index_2_li clearfix">
  121. <label class="index_2_li_label">机构性质</label>
  122. <span class="index_2_li_text " v-if="newsDetail.jobnature_name">
  123. {{ newsDetail.jobnature_name }}</span>
  124. </div>
  125. <div class="index_2_li clearfix">
  126. <label class="index_2_li_label">所属行业</label>
  127. <span class="index_2_li_text ">{{ newsDetail.hy_name }}</span>
  128. </div>
  129. <div class="index_2_li clearfix">
  130. <label class="index_2_li_label">负 责 人</label>
  131. <span class="index_2_li_text" v-if="newsDetail.manager">
  132. {{ newsDetail.manager }}
  133. </span>
  134. </div>
  135. <div class="index_2_li clearfix">
  136. <label class="index_2_li_label">联 系 人</label>
  137. <span class="index_2_li_text " v-if="newsDetail.content_person">
  138. {{ newsDetail.content_person }}
  139. </span>
  140. </div>
  141. <div class="index_2_li clearfix">
  142. <label class="index_2_li_label">联系电话</label>
  143. <span class="index_2_li_text ">{{ newsDetail.telephone }}</span>
  144. </div>
  145. <div class="index_2_li clearfix">
  146. <label class="index_2_li_label">手 &nbsp;&nbsp;&nbsp;&nbsp; 机</label>
  147. <span class="index_2_li_text ">{{ newsDetail.mobile }}</span>
  148. </div>
  149. <div class="index_2_li clearfix">
  150. <label class="index_2_li_label">联系QQ</label>
  151. <span class="index_2_li_text ">{{ newsDetail.QQ }}</span>
  152. </div>
  153. <div class="index_2_li clearfix">
  154. <label class="index_2_li_label">传 &nbsp;&nbsp;&nbsp;&nbsp; 真</label>
  155. <span class="index_2_li_text ">{{ newsDetail.fax }}</span>
  156. </div>
  157. <div class="index_2_li clearfix">
  158. <label class="index_2_li_label">邮政编码</label>
  159. <span class="index_2_li_text ">{{ newsDetail.post_code }}</span>
  160. </div>
  161. <div class="index_2_li clearfix">
  162. <label class="index_2_li_label">网 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  163. <span class="index_2_li_text ">{{ newsDetail.company_url }}</span>
  164. </div>
  165. <div class="index_2_li clearfix">
  166. <label class="index_2_li_label">地 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  167. <span class="index_2_li_text ">{{ newsDetail.adress }}</span>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </section>
  173. <section class="index_3 clearfix">
  174. <div class="info_2_head_box clearfix phone_none">
  175. <div class="info_2_head_left">
  176. <a class="info_2_head_a info_2_head_only" title="">详情信息</a>
  177. </div>
  178. </div>
  179. <div class="phone_box_1 pc_none" >
  180. <div class="phone_box_head">
  181. <a class="" >详情信息</a>
  182. </div>
  183. </div>
  184. <div class="info_article" v-html="newsDetail.content"></div>
  185. </section>
  186. </section>
  187. <!-- 列表页广告二 -->
  188. <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
  189. <!-- 页面底部 -->
  190. <HomeFoot1></HomeFoot1>
  191. </template>
  192. <script setup>
  193. import { ref } from 'vue'
  194. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  195. import { ArrowRight } from '@element-plus/icons-vue'
  196. //2.页面路径 start ---------------------------------------->
  197. const route = useRoute();
  198. const articleId = parseInt(route.params.id);
  199. const targetSegment = getRoutePath(1);
  200. const targetSegment1 = getRoutePath(2);
  201. const allSegment = targetSegment + '/' + targetSegment1;
  202. // 2.1 查询一级栏目的id
  203. //通过导航路径反向查询导航id
  204. let routeId;
  205. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  206. method: 'GET',
  207. query: {
  208. 'pinyin': allSegment,
  209. },
  210. });
  211. if (getRouteId.code == 200) {
  212. routeId = getRouteId.data.category_id
  213. } else {
  214. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  215. console.log("错误位置:通过url路径查询导航池id")
  216. console.log("后端错误反馈:", getRouteId.message)
  217. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  218. }
  219. // 2.2查询二级栏目的id及名称
  220. let routeName = ref('');
  221. let routeId1 = ref('');
  222. const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
  223. method: 'GET',
  224. query: {
  225. 'pinyin': targetSegment,
  226. },
  227. });
  228. if (getRoutePName.code == 200) {
  229. routeId1.value = getRoutePName.data.category_id;
  230. routeName.value = getRoutePName.data.alias;
  231. } else {
  232. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  233. console.log("错误位置:通过url路径查询导航池id")
  234. console.log("后端错误反馈:", getRouteId.message)
  235. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  236. }
  237. //2.页面路径 end ---------------------------------------->
  238. //3.面包屑 start ---------------------------------------->
  239. const parent_name = ref("");
  240. const parent_id = ref("");
  241. const parent_pinyin = ref("");
  242. let getParentNav = async () => {
  243. const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
  244. method: 'GET',
  245. query: {
  246. 'catid': routeId
  247. },
  248. });
  249. if (listData.code == 200) {
  250. parent_name.value = listData.data.alias;
  251. parent_id.value = listData.data.parent_id;
  252. parent_pinyin.value = listData.data.aLIas_pinyin;
  253. } else {
  254. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  255. console.log("错误位置:获取面包屑导航")
  256. console.log("后端错误反馈:", listData.message)
  257. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  258. }
  259. }
  260. //获得父级栏目详情
  261. getParentNav();
  262. //3.面包屑 end ------------------------------------------->
  263. //4.新闻详情 start ---------------------------------------->
  264. //4.1 资讯详情
  265. const newsDetail = ref({})
  266. const routeNewsTtitle = ref("");
  267. //4.2 发布日期
  268. const time = ref("");
  269. //4.3 路径
  270. const routLevelTitle = ref("");
  271. const routLevelId = ref("");
  272. //4.4 是否展示投票
  273. const articleChoice = ref(false);
  274. let detailImg = ref('');
  275. let seoTitle;
  276. let seoDescription;
  277. let seoKeywords;
  278. //4.5 获取详情
  279. const mkdata = await requestDataPromise('/web/getWebsiteCompanyInfo', {
  280. method: 'GET',
  281. query: {
  282. 'id': articleId
  283. },
  284. });
  285. if (mkdata.code == 200) {
  286. //获取内容
  287. newsDetail.value = mkdata.data;
  288. detailImg.value = JSON.parse(mkdata.data.imgurl);
  289. //修正标题长度
  290. if (newsDetail.value.title.length >= 20) {
  291. routeNewsTtitle.value = newsDetail.value.title.substr(0, 20) + "...";
  292. } else {
  293. routeNewsTtitle.value = newsDetail.value.title
  294. }
  295. //获取发布时间
  296. if (newsDetail.value.data) {
  297. time.value = newsDetail.value.data.split(' ')[0];
  298. }
  299. seoTitle = newsDetail.value.title;
  300. seoDescription = newsDetail.value.description;
  301. seoKeywords = newsDetail.value.keyword;
  302. } else {
  303. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  304. console.log("错误位置:获取详情内容")
  305. console.log("后端错误反馈:", mkdata.message)
  306. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  307. }
  308. //4.新闻详情 end ---------------------------------------->
  309. //5.设置seo信息 start---------------------------------------->
  310. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  311. method: 'GET',
  312. query: {
  313. 'catid': routeId1.value
  314. },
  315. });
  316. if (setData.code == 200) {
  317. let seoSuffix = setData.data.suffix;
  318. let seoName = setData.data.website_name;
  319. useSeoMeta({
  320. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  321. meta: [
  322. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  323. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  324. { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
  325. ]
  326. });
  327. } else {
  328. console.log("设置频道页SEO出错!", setData.message)
  329. }
  330. //5.设置seo信息 end---------------------------------------->
  331. //6.广告 start ---------------------------------------->
  332. let adImg1 = ref([]);
  333. let adImg2 = ref([]);
  334. onMounted(async () => {
  335. const { $webUrl, $CwebUrl } = useNuxtApp();
  336. //广告1
  337. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_detail_0001`
  338. const responseAd1 = await fetch(url, {
  339. headers: {
  340. 'Content-Type': 'application/json',
  341. 'Userurl': $CwebUrl,
  342. 'Origin': $CwebUrl
  343. }
  344. });
  345. const resultAd1 = await responseAd1.json();
  346. adImg1.value = resultAd1.data[0];
  347. //广告2
  348. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_detail_0002`
  349. const responseAd2 = await fetch(url2, {
  350. headers: {
  351. 'Content-Type': 'application/json',
  352. 'Userurl': $CwebUrl,
  353. 'Origin': $CwebUrl
  354. }
  355. });
  356. const resultAd2 = await responseAd2.json();
  357. adImg2.value = resultAd2.data[0];
  358. })
  359. //6.广告 end ---------------------------------------->
  360. </script>
  361. <style lang="less" scoped>
  362. @import url(@/assets/css/company/detail.less);
  363. </style>
  364. <style lang="less" scoped>
  365. @media screen and (min-width:801px){/*pc*/
  366. .page_pc_none {
  367. display: none !important;
  368. }
  369. .pc_none{display:none;}
  370. }
  371. @media screen and (max-width:800px){/*ipad_phone*/
  372. .index_main{width:100%;margin:0px auto 30px;}
  373. .breadcrumb_box {
  374. height: 22px;
  375. width: 92%;
  376. margin: 10px auto;
  377. word-break: keep-all;
  378. white-space: nowrap;
  379. overflow: hidden;
  380. text-overflow: ellipsis;
  381. font-size: 14px;
  382. color: #666;
  383. * {
  384. font-size: 14px;
  385. display: inline;
  386. color: #666;
  387. line-height: 22px;
  388. height: 22px;
  389. margin-right: 5px;
  390. }
  391. }
  392. .phone_box_1{
  393. width:92%;margin:0px auto 0px;
  394. .phone_box_head{
  395. height:50px;line-height:50px;
  396. background:#fff;border-bottom:1px solid #E6E6E6;
  397. width:100%;
  398. a{
  399. float:left;height:50px;line-height:50px;margin:0;position:relative;
  400. color:#a91b33;font-size:18px; font-weight:bold;box-sizing:border-box;
  401. position:relative;padding-left:8px;
  402. }
  403. a::before{
  404. content: '';display: block;
  405. position:absolute;left:0px;top:15px;
  406. background:#a91b33;
  407. width:3px;height:20px;
  408. }
  409. }
  410. }
  411. .phone_box_2{
  412. width:92%;margin:0px auto 0px;
  413. .phone_box_head{
  414. height:50px;line-height:50px;
  415. background:#fff;border-bottom:1px solid #E6E6E6;
  416. width:100%;
  417. a{
  418. float:left;height:50px;line-height:50px;margin:0;position:relative;
  419. color:#a91b33;font-size:18px; font-weight:bold;box-sizing:border-box;
  420. position:relative;padding-left:8px;
  421. }
  422. a::before{
  423. content: '';display: block;
  424. position:absolute;left:0px;top:15px;
  425. background:#a91b33;
  426. width:3px;height:20px;
  427. }
  428. }
  429. }
  430. .index_2{width:100%;margin:10px auto 0px;}
  431. .index_2_img{max-width:92%;height:302px;width:auto;
  432. margin:0px auto 0px;float:none;display:block;border-radius:8px;}
  433. .index_2_right{width:92%;float:none;margin:0px auto;}
  434. .index_2_h4{font-size:16px;color:#333;line-height:26px; padding:0;border:0px;
  435. white-space:unset;word-break:unset;margin-top:11px;
  436. }
  437. .index_2_title{font-size:14px;margin-right:10px;}
  438. .index_2_ul{ height:auto;}
  439. .index_2_li{margin-bottom:20px;width:49%;}
  440. .index_2_li:nth-of-type(odd){float:left;}
  441. .index_2_li:nth-of-type(even){float:right;}
  442. .index_2_li:nth-last-of-type(1){width:100%; }
  443. .index_2_li:nth-last-of-type(2){width:100%; }
  444. .index_2_li:nth-of-type(1){width:100%; }
  445. .index_2_li:nth-of-type(2){width:100%; }
  446. .index_2_li .index_2_li_label{line-height:18px;height:18px;font-size:14px;min-width:auto;margin-right:8px;}
  447. .index_2_li .index_2_li_text{
  448. line-height:18px;font-size:14px;flex:1;
  449. word-wrap: break-word;
  450. overflow-wrap: break-word;
  451. white-space: pre-wrap;
  452. word-break: break-all;
  453. }
  454. .index_2_ul .index_2_ul_left{width:100%;overflow:hidden;float:none;}
  455. .info_article{ font-size:16px!important;line-height:26px!important;margin:15px auto 0!important;width:92%!important;}
  456. .info_article::v-deep *{ font-size:16px!important;line-height:26px!important; }
  457. .page_phone_none {
  458. display: none !important;
  459. }
  460. .phone_none{display:none;}
  461. }
  462. </style>