NsFooter.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <div class="footer">
  3. <el-tabs v-model="activeName" class="friendly-link" v-if="linkList.length > 0">
  4. <el-tab-pane label="友情链接" name="first">
  5. <div class="link-item" v-for="(link_item, link_index) in linkList" :key="link_index"
  6. :title="link_item.link_title">
  7. <img @click="linkUrl(link_item.link_url, link_item.is_blank)" :src="$img(link_item.link_pic)" />
  8. </div>
  9. </el-tab-pane>
  10. </el-tabs>
  11. <div class="footer-top" v-if="shopServiceList.length > 0">
  12. <ul class="service">
  13. <li v-for="(item, index) in shopServiceList" :key="index">
  14. <div class="item-head">
  15. <img :src="$img(item.icon.imageUrl)" alt="" v-if="item.icon.iconType == 'img'">
  16. <span v-else :class="item.icon.icon"></span>
  17. </div>
  18. <div class="item-content">
  19. <p class="name">{{ item.service_name }}</p>
  20. <p class="desc">{{ item.desc }}</p>
  21. </div>
  22. </li>
  23. </ul>
  24. </div>
  25. <div class="footer-bot">
  26. <copy-right />
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import {
  32. copyRight,
  33. shopServiceLists,
  34. friendlyLink,
  35. weQrcode,
  36. } from "@/api/website"
  37. import CopyRight from "./CopyRight"
  38. import {
  39. mapGetters
  40. } from "vuex"
  41. import {
  42. helpList
  43. } from "@/api/cms/help"
  44. export default {
  45. props: {},
  46. data() {
  47. return {
  48. shopServiceList: [],
  49. linkList: [],
  50. helpList: [],
  51. ishide: false,
  52. activeName: "first",
  53. qrcode: "",
  54. }
  55. },
  56. computed: {},
  57. created() {
  58. this.getShopServiceLists();
  59. this.link();
  60. this.getHelpList();
  61. this.getqrcodeimg();
  62. },
  63. mounted() {},
  64. watch: {},
  65. methods: {
  66. getqrcodeimg() {
  67. weQrcode({}).then(res => {
  68. if (res.code == 0 && res.data) {
  69. this.qrcode = res.data
  70. }
  71. })
  72. .catch(err => {
  73. this.$message.error(err.message)
  74. })
  75. },
  76. getShopServiceLists() {
  77. shopServiceLists({}).then(res => {
  78. if (res.code == 0 && res.data) {
  79. this.shopServiceList = res.data
  80. }
  81. })
  82. .catch(err => {
  83. this.shopServiceList = []
  84. })
  85. },
  86. link() {
  87. friendlyLink({})
  88. .then(res => {
  89. if (res.code == 0 && res.data) {
  90. this.linkList = res.data
  91. }
  92. })
  93. .catch(err => {
  94. this.$message.error(err.message)
  95. })
  96. },
  97. linkUrl(url, target) {
  98. if (!url) return
  99. if (url.indexOf("http") == -1 && url.indexOf("https") == -1) {
  100. if (target) this.$util.pushToTab({
  101. path: url
  102. })
  103. else this.$router.push({
  104. path: url
  105. })
  106. } else {
  107. if (target) window.open(url)
  108. else window.location.href = url
  109. }
  110. },
  111. /**
  112. * 获取帮助列表
  113. */
  114. getHelpList() {
  115. helpList()
  116. .then(res => {
  117. if (res.code == 0 && res.data) {
  118. var arr = [];
  119. arr = res.data.slice(0, 4)
  120. for (let i = 0; i < arr.length; i++) {
  121. arr[i].child_list = arr[i].child_list.slice(0, 4);
  122. }
  123. this.helpList = arr
  124. }
  125. })
  126. .catch(err => {})
  127. },
  128. /**
  129. * 跳转到帮助列表
  130. */
  131. clickToHelp(id) {
  132. this.$router.push("/cms/help/listother-" + id)
  133. },
  134. /**
  135. * 跳转到帮助详情
  136. */
  137. clickToHelpDetail(id) {
  138. this.$router.push("/cms/help-" + id)
  139. },
  140. /**
  141. * 跳转到帮助详情
  142. */
  143. clickJump(address) {
  144. location.href = address;
  145. }
  146. },
  147. components: {
  148. CopyRight
  149. }
  150. }
  151. </script>
  152. <style scoped lang="scss">
  153. .footer {
  154. .footer-top {
  155. background-color: #f2f2f2;
  156. border-bottom: 1px solid #e2e2e2;
  157. .service {
  158. margin: 0;
  159. padding: 0;
  160. width: $width;
  161. margin: 0 auto;
  162. padding: 20px 0 40px;
  163. box-sizing: border-box;
  164. border-bottom: 1px solid #F5F5F5;
  165. display: flex;
  166. flex-wrap: wrap;
  167. align-items: center;
  168. li {
  169. margin-top: 30px;
  170. display: flex;
  171. align-items: center;
  172. width: 25%;
  173. list-style: none;
  174. padding-right: 30px;
  175. box-sizing: border-box;
  176. &:nth-child(4n){
  177. padding-right: 0;
  178. }
  179. .item-head {
  180. width: 58px;
  181. height: 58px;
  182. display: flex;
  183. align-items: center;
  184. justify-content: center;
  185. margin-right: 15px;
  186. img {
  187. max-width: 100%;
  188. max-height: 100%;
  189. }
  190. span{
  191. font-size: 58px
  192. }
  193. }
  194. .item-content{
  195. flex: 1;
  196. display: flex;
  197. flex-direction: column;
  198. .name{
  199. font-size: 19px;
  200. font-weight: bold;
  201. color: #444;
  202. line-height: 1;
  203. margin-bottom: 8px;
  204. @extend .using-hidden;
  205. }
  206. .desc{
  207. font-size: 15px;
  208. color: #444;
  209. line-height: 1;
  210. @extend .using-hidden;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. .footer-bot {
  217. background: #f2f2f2;
  218. color: #444;
  219. }
  220. .friendly-link {
  221. width: $width;
  222. margin: 0 auto;
  223. padding-bottom: 48px;
  224. .link-title {
  225. line-height: 30px;
  226. padding: 10px 0 5px;
  227. margin: 0px 0 15px;
  228. border-bottom: 1px solid #e8e8e8;
  229. }
  230. .link-item {
  231. width: 192px;
  232. height: 80px;
  233. line-height: 80px;
  234. text-align: center;
  235. margin: 14px 12px 4px 0;
  236. cursor: pointer;
  237. background-color: #fff;
  238. img{
  239. max-width: 100%;
  240. max-height: 100%;
  241. }
  242. }
  243. .link-item:hover {
  244. width: 192px;
  245. position: relative;
  246. opacity: 1;
  247. box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  248. }
  249. }
  250. }
  251. </style>
  252. <style lang="scss">
  253. .friendly-link {
  254. .el-tabs__nav-scroll {
  255. border-left: 1px solid #d8d8d8;
  256. }
  257. .el-tabs__header{
  258. margin-bottom: 14px;
  259. }
  260. .el-tabs__content {
  261. .el-tab-pane{
  262. display: flex;
  263. flex-wrap: wrap;
  264. }
  265. }
  266. .el-tabs__nav-wrap::after {
  267. height: 1px;
  268. }
  269. .el-tabs__item{
  270. padding: 0 10px !important;
  271. height: 52px;
  272. line-height: 52px;
  273. width: 168px;
  274. text-align: center;
  275. box-sizing: border-box;
  276. border-top: 1px solid #d8d8d8;
  277. border-right: 1px solid #d8d8d8;
  278. font-size: 18px;
  279. &.is-active{
  280. color: $base-color;
  281. }
  282. }
  283. .el-tabs__active-bar {
  284. margin-left: -10px;
  285. width: 168px !important;
  286. bottom: 50px;
  287. background-color: $base-color;
  288. &::after{
  289. content: "";
  290. position: absolute;
  291. bottom: -50px;
  292. left: 0;
  293. height: 1px;
  294. width: 100%;
  295. background-color: #f9f9f9;
  296. }
  297. }
  298. }
  299. </style>