index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="website-home">
  3. <div class="banner">
  4. <el-carousel :interval="5000" arrow="hover" height="100%">
  5. <el-carousel-item>
  6. <img class="banner-img"
  7. src="https://file-node.oss-cn-shanghai.aliyuncs.com/youji/1eeba102483945589db9fa134581c19c"
  8. alt="" />
  9. </el-carousel-item>
  10. <el-carousel-item>
  11. <img class="banner-img"
  12. src="https://file-node.oss-cn-shanghai.aliyuncs.com/youji/e5a861ad85284564ad3fca7783dfbdfd"
  13. alt="" />
  14. </el-carousel-item>
  15. <el-carousel-item>
  16. <img class="banner-img"
  17. src="https://file-node.oss-cn-shanghai.aliyuncs.com/youji/fbcd3f73ece94cde94f768428d164a9f"
  18. alt="" />
  19. </el-carousel-item>
  20. <el-carousel-item>
  21. <img class="banner-img"
  22. src="https://file-node.oss-cn-shanghai.aliyuncs.com/youji/29a9a76dd14942198a28851cfe920061"
  23. alt="" />
  24. </el-carousel-item>
  25. </el-carousel>
  26. </div>
  27. <!-- <div class="website-home-bg"></div> -->
  28. <div class="container">
  29. <!-- <div class="main-container">
  30. <div class="main-title">WORKARK-寻找合适的服务</div>
  31. <div class="main-sub-title">方便、快捷、精准</div>
  32. </div> -->
  33. <div class="product-box">
  34. <div class="product-iview" id="list-1">
  35. <div class="title">产品介绍</div>
  36. <div class="product-banner" style="height: 400px;">
  37. <el-carousel :interval="5000" arrow="never" height="100%">
  38. <el-carousel-item>
  39. <div class="project-content">
  40. <div class="project-img"></div>
  41. <div class="project-article">
  42. <div class="article-title">产品介绍</div>
  43. <div class="article-content">
  44. <div>在复杂多变的商业环境中,精准找到可靠服务商与高效管理服务过程是企业面临的普遍痛点。</div>
  45. <div>WorkArk应运而生,突破传统服务模式,打造一个开放、透明、高效的企业级服务平台。</div>
  46. <div>在这里,有需求的企业可以便捷发布任务、筛选优质服务商、全程跟踪进度、安全验收成果;专业服务商可以展示实力、精准获客、在线协作、高效交付。
  47. </div>
  48. <div>我们聚焦知识产权、项目申报、技术开发、营销推广、财税审计、企业标准等核心企业服务领域,赋能整个服务价值链!</div>
  49. </div>
  50. </div>
  51. </div>
  52. </el-carousel-item>
  53. </el-carousel>
  54. </div>
  55. </div>
  56. <div class="product-iview" v-for="item in list" :key="item.id" :id="`list${item.id}`">
  57. <div class="title">{{item.name}}</div>
  58. <div class="product-list">
  59. <product-item v-for="(node,index) in item.children" :key="index" :item="node" :parent="item">
  60. </product-item>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. const productItem = () => import('@/components/website/productItem');
  69. import {
  70. getServeProductList
  71. } from '@/api/system'
  72. export default {
  73. name: 'index',
  74. data() {
  75. return {
  76. list: [],
  77. scrollPosition: 0 // 保存滚动条位置
  78. }
  79. },
  80. mounted() {
  81. this.init();
  82. },
  83. activated() {
  84. // 组件被激活时调用
  85. if (document.getElementsByClassName('website-layout')) {
  86. document.getElementsByClassName('website-layout')[0].scrollTo(0, this.scrollPosition);
  87. }
  88. },
  89. beforeRouteLeave(to, from, next) {
  90. if (document.getElementsByClassName('website-layout')) {
  91. this.scrollPosition = document.getElementsByClassName('website-layout')[0].scrollTop;
  92. }
  93. next();
  94. },
  95. deactivated() {
  96. // 组件被停用时调用
  97. },
  98. methods: {
  99. init() {
  100. getServeProductList(-1).then(res => {
  101. if (res.state) {
  102. this.list = res.data;
  103. let navList = JSON.parse(JSON.stringify(res.data));
  104. navList.unshift({
  105. name: '产品介绍',
  106. id: -1
  107. })
  108. this.$emit('navFunc', navList);
  109. }
  110. })
  111. },
  112. screenTo(item) {
  113. if (!document.getElementById('list' + item.id)) return;
  114. let top = document.getElementById('list' + item.id).offsetTop;
  115. if (document.getElementsByClassName('website-layout')) {
  116. document.getElementsByClassName('website-layout')[0].scrollTo({
  117. top: top - 40, // 纵坐标位置
  118. left: 0, // 横坐标位置
  119. behavior: 'smooth' // 平滑滚动效果
  120. });
  121. }
  122. }
  123. },
  124. components: {
  125. productItem
  126. }
  127. }
  128. </script>
  129. <style lang="scss">
  130. .website-home {
  131. position: relative;
  132. .container {
  133. width: 1200px;
  134. margin: 0 auto;
  135. }
  136. .website-home-bg {
  137. width: 100%;
  138. min-width: 1200px;
  139. height: 600px;
  140. background: url(https://file-node.oss-cn-shanghai.aliyuncs.com/youji/5ea8dc9317c643d0b0254d8d13a154f3);
  141. background-repeat: no-repeat;
  142. background-size: 100% 100%;
  143. position: absolute;
  144. top: 0;
  145. left: 0;
  146. }
  147. .el-carousel {
  148. height: 100%;
  149. }
  150. .banner {
  151. width: 100%;
  152. height: 600px;
  153. background: #eee;
  154. }
  155. .banner-img {
  156. object-fit: cover;
  157. width: 100%;
  158. height: 100%;
  159. }
  160. .main-container {
  161. height: 600px;
  162. color: #fff;
  163. padding-top: 80px;
  164. box-sizing: border-box;
  165. display: flex;
  166. flex-direction: column;
  167. justify-content: center;
  168. position: relative;
  169. z-index: 8;
  170. .main-title {
  171. font-weight: 500;
  172. font-size: 30px;
  173. line-height: 50px;
  174. margin-bottom: 12px;
  175. }
  176. .main-sub-title {
  177. font-weight: 300;
  178. font-size: 20px;
  179. line-height: 28px;
  180. opacity: .7;
  181. margin-bottom: 50px;
  182. }
  183. }
  184. .product-box {
  185. margin-top: 80px;
  186. padding-bottom: 50px;
  187. .title {
  188. font-size: 36px;
  189. line-height: 50px;
  190. font-weight: 600;
  191. margin-bottom: 30px;
  192. }
  193. }
  194. .product-list {
  195. display: flex;
  196. flex-wrap: wrap;
  197. }
  198. .product-iview {
  199. margin-bottom: 30px;
  200. }
  201. .project-content {
  202. width: 100%;
  203. height: 100%;
  204. display: flex;
  205. .project-img {
  206. width: 746px;
  207. height: 100%;
  208. border-radius: 16px;
  209. overflow: hidden;
  210. margin-right: 30px;
  211. background-image: url('https://file-node.oss-cn-shanghai.aliyuncs.com/youji/441be5f8bde647ed8acf12651ca91354');
  212. background-repeat: no-repeat;
  213. background-size: cover;
  214. background-position: center center;
  215. }
  216. .project-article {
  217. flex: 1;
  218. width: 0;
  219. }
  220. .article-title {
  221. font-weight: 600;
  222. font-size: 28px;
  223. color: #1f2329;
  224. line-height: 40px;
  225. padding: 15px 0;
  226. }
  227. .article-content {
  228. font-size: 16px;
  229. color: #5d6c82;
  230. line-height: 30px;
  231. opacity: .9;
  232. div {
  233. text-indent: 32px;
  234. margin-bottom: 10px;
  235. }
  236. }
  237. }
  238. }
  239. </style>