foot.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <div class="foot">
  3. <div class="foot-head">
  4. <div class="head-bos">
  5. <div class="head-left">
  6. <img class="head-img" src="@/assets/images/head.png" alt="" />
  7. <div class="flex-row-start">
  8. <div class="head-code flex-column-center">
  9. <img :src="wechatLink" alt="" />
  10. <div>关注公众号</div>
  11. </div>
  12. <div class="head-code flex-column-center" style="margin-left: 16px">
  13. <img :src="weiboLink" alt="" />
  14. <div>关注微博</div>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="head-right">
  19. <div class="info-bos flex-row-start">
  20. <div v-for="(navItem, index) in bottomNavList" :key="index" :style="{ marginRight: index < bottomNavList.length - 1 ? '140px' : '0' }">
  21. <div class="info-title">{{ navItem.navigationName }}</div>
  22. <div
  23. v-for="(link, linkIndex) in navItem.children"
  24. :key="linkIndex"
  25. class="info-text"
  26. :style="{ marginTop: linkIndex === 0 ? '0' : '12px' }"
  27. @click="handleNavClick(link)"
  28. >
  29. {{ link.navigationName }}
  30. </div>
  31. </div>
  32. </div>
  33. <div class="contact">
  34. <span>联系我们</span>
  35. <span>{{ servicePhone }}</span>
  36. <span>(周一至周五 8:30-17:30)</span>
  37. </div>
  38. <div class="logistics">
  39. <div class="logistics-box flex-row-start">
  40. <img src="@/assets/images/layout/layout3.png" alt="" />
  41. <div>无忧退换货</div>
  42. </div>
  43. <div class="logistics-box flex-row-start">
  44. <img src="@/assets/images/layout/layout3.png" alt="" />
  45. <div>满百包邮</div>
  46. </div>
  47. <div class="logistics-box flex-row-start">
  48. <img src="@/assets/images/layout/layout3.png" alt="" />
  49. <div>品质保证</div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="foot-foot">{{ icpNo }}增值电信业务经营许可证编号:{{ license }}</div>
  56. </div>
  57. </template>
  58. <script setup lang="ts">
  59. import { getPlatformConfigList } from '@/api/breg/index';
  60. import { getBottomNav } from '@/api/home/index';
  61. import { handleTree } from '@/utils/ruoyi';
  62. const icpNo = ref<any>('');
  63. const license = ref<any>('');
  64. const wechatLink = ref<any>('');
  65. const weiboLink = ref<any>('');
  66. const servicePhone = ref<any>('');
  67. const bottomNavList = ref<any[]>([]);
  68. // 获取底部导航数据
  69. const fetchBottomNav = async () => {
  70. try {
  71. const res = await getBottomNav('footer'); // 使用 footer 作为页面类型参数
  72. if (res.code == 200 && res.data) {
  73. // 后端返回的是扁平列表,使用 handleTree 转换为树形结构
  74. // parentId 为 0、null 或 undefined 的是父级节点
  75. bottomNavList.value = handleTree(res.data, 'id', 'parentId', 'children');
  76. }
  77. } catch (error) {
  78. console.error('获取底部导航失败:', error);
  79. }
  80. };
  81. // 处理导航点击事件
  82. const handleNavClick = (link: any) => {
  83. if (link.url) {
  84. window.open(link.url, '_blank');
  85. } else if (link.link) {
  86. window.open(link.link, '_blank');
  87. }
  88. };
  89. getPlatformConfigList({ configKey: 'icpNo' }).then((res) => {
  90. if (res.code == 200) {
  91. if (res.rows && res.rows.length > 0) {
  92. icpNo.value = res.rows[0].value;
  93. }
  94. }
  95. });
  96. getPlatformConfigList({ configKey: 'license' }).then((res) => {
  97. if (res.code == 200) {
  98. if (res.rows && res.rows.length > 0) {
  99. license.value = res.rows[0].value;
  100. }
  101. }
  102. });
  103. getPlatformConfigList({ configKey: 'wechatLink' }).then((res) => {
  104. if (res.code == 200) {
  105. if (res.rows && res.rows.length > 0) {
  106. wechatLink.value = res.rows[0].value;
  107. }
  108. }
  109. });
  110. getPlatformConfigList({ configKey: 'weiboLink' }).then((res) => {
  111. if (res.code == 200) {
  112. if (res.rows && res.rows.length > 0) {
  113. weiboLink.value = res.rows[0].value;
  114. }
  115. }
  116. });
  117. getPlatformConfigList({ configKey: 'servicePhone' }).then((res) => {
  118. if (res.code == 200) {
  119. if (res.rows && res.rows.length > 0) {
  120. servicePhone.value = res.rows[0].value;
  121. }
  122. }
  123. });
  124. // 组件挂载时获取底部导航数据
  125. onMounted(() => {
  126. fetchBottomNav();
  127. });
  128. </script>
  129. <style lang="scss" scoped>
  130. .foot {
  131. width: 100%;
  132. .foot-head {
  133. width: 100%;
  134. background: #e7e7e7;
  135. padding-bottom: 32px;
  136. .head-bos {
  137. max-width: 1500px;
  138. min-width: 1200px;
  139. width: 100%;
  140. margin: 0 auto;
  141. display: flex;
  142. justify-content: center;
  143. .head-left {
  144. padding-right: 116px;
  145. .head-img {
  146. margin-top: 32px;
  147. width: 160px;
  148. height: 78px;
  149. margin-bottom: 50px;
  150. }
  151. .head-code {
  152. font-size: 12px;
  153. color: #364153;
  154. img {
  155. width: 86px;
  156. height: 86px;
  157. margin-bottom: 8px;
  158. }
  159. }
  160. }
  161. .head-right {
  162. // flex: 1;
  163. padding-top: 44px;
  164. .info-bos {
  165. .info-title {
  166. font-weight: 600;
  167. font-size: 14px;
  168. color: #101828;
  169. margin-bottom: 20px;
  170. }
  171. .info-text {
  172. font-size: 14px;
  173. color: #101828;
  174. margin-top: 12px;
  175. cursor: pointer;
  176. &:hover {
  177. color: #e7000b;
  178. }
  179. }
  180. }
  181. .contact {
  182. width: 100%;
  183. border-top: 1px solid #dddddd;
  184. border-bottom: 1px solid #dddddd;
  185. padding: 16px 0;
  186. margin-top: 20px;
  187. font-size: 14px;
  188. color: #101828;
  189. span:nth-of-type(2) {
  190. padding-left: 10px;
  191. }
  192. span:nth-of-type(3) {
  193. padding-left: 10px;
  194. font-size: 12px;
  195. color: #6a7282;
  196. }
  197. }
  198. .logistics {
  199. padding-top: 20px;
  200. display: flex;
  201. .logistics-box {
  202. font-size: 16px;
  203. color: #101828;
  204. margin-right: 70px;
  205. img {
  206. width: 33px;
  207. height: 33px;
  208. margin-right: 11px;
  209. }
  210. // .logistics-icon {
  211. // width: 33px;
  212. // height: 33px;
  213. // border-radius: 33px;
  214. // border: 1px solid #101828;
  215. // margin-right: 11px;
  216. // img {
  217. // height: 16px;
  218. // width: 16px;
  219. // }
  220. // }
  221. }
  222. }
  223. }
  224. }
  225. }
  226. .foot-foot {
  227. width: 100%;
  228. height: 52px;
  229. background: #000000;
  230. line-height: 52px;
  231. text-align: center;
  232. font-size: 14px;
  233. color: #ffffff;
  234. }
  235. }
  236. </style>