foot.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <footer class="index_foot">
  3. <div class="foot_img_box">
  4. <a :href="item.url" v-for="(item, index) in bottomLink" :title="item.title" target="_blank">
  5. <img :src="item.logo_url" :alt="item.title">
  6. </a>
  7. </div>
  8. <div class="foot_frind_box">
  9. <span>友情链接</span>
  10. <div>
  11. <a :href="item.url" v-for="(item, index) in bottomText" :key="index" :title="item.title" target="_blank">{{ item.title }}</a>
  12. </div>
  13. </div>
  14. <div class="call_us_box">
  15. <span v-for="(item, index) in bottomMenu" :key="index">
  16. <NuxtLink :to="{ path: `/specialList/${item.id}` }" v-if="item.type == 1" :title="item.name">
  17. {{ item.name }}
  18. </NuxtLink>
  19. <NuxtLink :to="{ path: `/speciaArticle/${item.id}` }" v-if="item.type == 0" :title="item.name">
  20. {{ item.name }}
  21. </NuxtLink>
  22. </span>
  23. </div>
  24. <div class="foot_text_box" v-if="bottomBase">
  25. <p>{{ bottomBase.statistics_onetext }} <a :href="bottomBase.record_number_url" :title="中农兴业">中农兴业</a> {{ bottomBase.statistics_twotext }}</p>
  26. <p>{{ bottomBase.organizer }} <a :href="currentDomain" :title="webSiteName">{{ webSiteName }}</a> {{ webSiteUrl }} 版权所有。</p>
  27. <p><a :href="bottomBase.record_number_url" title="ICP备案号">{{ bottomBase.record_number }}</a> &nbsp;&nbsp; <img :src="bottomBase.icp_number_img"><a :href="bottomBase.icp_number_url" title="京公网安备案号">{{ bottomBase.icp_number }}</a> </p>
  28. <p>{{ bottomBase.email }}</p>
  29. <p>{{ bottomBase.company_address }}</p>
  30. <p>{{ bottomBase.contact_number }}</p>
  31. </div>
  32. <div class="foot_logo_out" v-if="bottomBase">
  33. <a :href="'http://' + bottomBase.company_url" :title="bottomBase.company_name">
  34. <img :src="bottomBase.project_logo" class="floatLogoLeft" :alt="bottomBase.company_name">
  35. </a>
  36. <a :href="'http://' + bottomBase.project_url" :title="bottomBase.project_name">
  37. <img :src="bottomBase.company_logo" class="floatLogoRight" :alt="bottomBase.project_name">
  38. </a>
  39. </div>
  40. <div class="foot_last_img_box">
  41. <a :href="item.url" v-for="(item, index) in bottomphoto" :title="item.title">
  42. <img :src="item.logo_url" :alt="item.title">
  43. </a>
  44. </div>
  45. </footer>
  46. </template>
  47. <script setup>
  48. //获得底部基本信息 start---------------------------------------->
  49. //1.获得友情链接图片
  50. const bottomLink = ref([])
  51. async function getModelData1() {
  52. const mkdata = await requestDataPromise('/web/selectWebsiteLinks', {
  53. method: 'GET',
  54. query: {
  55. 'type':1,
  56. 'num':12,
  57. },
  58. });
  59. if(mkdata.code == 200){
  60. bottomLink.value = mkdata.data;
  61. }else{
  62. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  63. console.log("错误位置:获取友情链接图片")
  64. console.log("后端错误反馈:",mkdata.message)
  65. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  66. }
  67. }
  68. getModelData1();
  69. //2.获得友情链接文字
  70. const bottomText = ref([])
  71. async function getModelData2() {
  72. const mkdata = await requestDataPromise('/web/selectWebsiteLinks', {
  73. method: 'GET',
  74. query: {
  75. 'type':2,
  76. 'num':8,
  77. },
  78. });
  79. if(mkdata.code == 200){
  80. bottomText.value = mkdata.data;
  81. }else{
  82. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  83. console.log("错误位置:获取友情链接文字")
  84. console.log("后端错误反馈:",mkdata.message)
  85. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  86. }
  87. }
  88. getModelData2();
  89. //3.获得底部图片
  90. const bottomphoto = ref([])
  91. async function getModelData3() {
  92. const mkdata = await requestDataPromise('/web/selectWebsiteLinks', {
  93. method: 'GET',
  94. query: {
  95. 'type':3,
  96. 'num':4,
  97. },
  98. });
  99. if(mkdata.code == 200){
  100. bottomphoto.value = mkdata.data;
  101. }else{
  102. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  103. console.log("错误位置:获取底部图片")
  104. console.log("后端错误反馈:",mkdata.message)
  105. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  106. }
  107. }
  108. getModelData3();
  109. //4.获得底部导航
  110. const bottomMenu = ref([])
  111. async function getModelData4() {
  112. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  113. method: 'GET',
  114. query: {
  115. },
  116. });
  117. if(mkdata.code == 200){
  118. bottomMenu.value = mkdata.data;
  119. }else{
  120. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  121. console.log("错误位置:获取底部导航")
  122. console.log("后端错误反馈:",mkdata.message)
  123. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  124. }
  125. }
  126. getModelData4();
  127. //5.获得底部基本信息
  128. const bottomBase = ref({})
  129. const webSiteName = ref("")
  130. const webSiteUrl = ref("")
  131. async function getModelData5() {
  132. const mkdata = await requestDataPromise('/web/getWebsiteFootInfo', {
  133. method: 'GET',
  134. query: {
  135. },
  136. });
  137. if(mkdata.code == 200){
  138. bottomBase.value = mkdata.data.website_foot;
  139. webSiteName.value = mkdata.data.website_head.title;
  140. //获得最后一个域名
  141. webSiteUrl.value = mkdata.data.website_head.website_url[mkdata.data.website_head.website_url.length - 1];
  142. }else{
  143. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  144. console.log("错误位置:获取底部基本信息")
  145. console.log("后端错误反馈:",mkdata.message)
  146. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  147. }
  148. }
  149. getModelData5();
  150. //6.获取当前域名
  151. // const currentDomain = ref('')
  152. // const currentDomainUrl = ref('')
  153. // const getDomain = () => {
  154. // if (process.client) {
  155. // const url = new URL(window.location.href)
  156. // currentDomainUrl.value = url.hostname // 获取域名
  157. // currentDomain.value = url.origin //协议和域名
  158. // }
  159. // }
  160. // getDomain();
  161. //获得底部基本信息 end---------------------------------------->
  162. </script>
  163. <style lang="less" scoped>
  164. @import '@/assets/css/foot.less';
  165. </style>