Sfoglia il codice sorgente

commit - m首页优化

zhengjinyi 4 anni fa
parent
commit
aec13aeb73

+ 9 - 1
src/main/resources/static/css/index/index_new.pc.css

@@ -68,9 +68,17 @@ li{list-style:none;}
     overflow: hidden;
     transition: all 0.6s;
 }
+.section_page .floorCon{
+    width: 100%;
+}
+.section_page .swiper-wrapper-floor{
+    width: 100%;
+    height: 268px;
+}
 .section_page .section_page_main.type_08{
-    height: auto;
+    height: 268px;
 }
+
 .section_page .section_page_main.type_03{
     height: 704px;
 }

+ 16 - 19
src/main/resources/static/js/index.js

@@ -53,25 +53,25 @@ var homeData = new Vue({
             PublicApi.GetHomeBanner({},function(response){
                 if(response.code == 0){
                     _self.images = response.data;
-                    _self.SwiperNanner();
+                    _self.SwiperBanner();
                 }else{
                     CAIMEI.Alert(response.msg, '确定');
                 }
             });
         },
-        SwiperNanner: function(){
+        SwiperBanner: function(){
             setTimeout(function(){
                 if (isPC) {
                     $('#swiper-container').slide({
-                        mainCell:".swiper-wrapper-floor"
-                        ,titCell:".swiper-pagination span"
-                        ,effect: "leftLoop"
-                        ,prevCell:".swiper-button-prev"
-                        ,nextCell:".swiper-button-next"
-                        ,interTime: 3000
-                        ,autoPlay: true
-                        ,autoPage: false
-                        ,trigger: "mouseover"
+                        mainCell:".swiper-wrapper-banner",
+                        titCell:".swiper-pagination-banner span",
+                        effect: "leftLoop",
+                        prevCell:".swiper-button-prev",
+                        nextCell:".swiper-button-next",
+                        interTime: 3000,
+                        autoPlay: true,
+                        autoPage: false,
+                        trigger: "mouseover"
                     });
                 } else {
                     var swiper = new Swiper('#swiper-container', {
@@ -106,7 +106,7 @@ var homeData = new Vue({
                     setTimeout(function() {
                         // 设置侧边导航数据
                         _self.SetAsideNav();
-                        _self.SwiperNanner();
+                        _self.SwiperFloor();
                     },500);
                 }else{
                     CAIMEI.Alert(response.msg, '确定');
@@ -167,19 +167,16 @@ var homeData = new Vue({
                 })
             }
         },
-        SwiperNanner: function(){
-            setTimeout(function(){
-                // 图片懒加载
+        SwiperFloor: function(){
+            setTimeout(function(){  // 图片懒加载
                 $("img[data-original]").lazyload();
             },500);
             setTimeout(function(){
                 if (isPC) {
                     $('#recommendBox').slide({
-                        mainCell:".swiper-wrapper",
-                        titCell:".swiper-pagination span",
+                        mainCell:".recommendBox-wrapper",
+                        titCell:".swiper-pagination-floor span",
                         effect: "leftLoop",
-                        interTime: 3000,
-                        // loop:true,
                         autoPlay: true,
                         scroll:5,
                         vis:5

+ 6 - 6
src/main/resources/templates/index.html

@@ -20,12 +20,12 @@
     <template v-else>
         <!--首页图片轮播-->
         <div id="swiper-container" class="swiper-container">
-            <ul class="swiper-wrapper">
+            <ul class="swiper-wrapper swiper-wrapper-banner">
                 <li class="swiper-slide mfc" v-for="img in images">
                     <a :href="img.link"><img :src="img.image" :alt="img.title"></a>
                 </li>
             </ul>
-            <div class="swiper-pagination mfc"><span v-if="isPC" v-for="i in images.length"></span></div>
+            <div class="swiper-pagination swiper-pagination-banner mfc"><span v-if="isPC" v-for="i in images.length"></span></div>
             <a class="swiper-button-prev" href="javascript:void(0)"></a>
             <a class="swiper-button-next" href="javascript:void(0)"></a>
         </div>
@@ -39,7 +39,7 @@
         <!--首页楼层主体数据-->
         <div class="section_container">
             <div class="inner">
-                <div class="section_right swiper-container">
+                <div class="section_right">
                     <div class="box swiper-wrapper" >
                         <div class="section_right_item">
                             <div class="right_item_title">
@@ -671,8 +671,8 @@
                         </template>
                         <template v-if="page.floorContent.templateType == '8'">
                             <div class="floorCon">
-                                <div class="hotList swiper-wrapper-floor" id="recommendBox">
-                                    <div class="section_page_main type_08 clear mfw swiper-wrapper" :class="page.isPageMore ? 'max' : ''">
+                                <div class="hotList swiper-container-floor" id="recommendBox">
+                                    <div class="section_page_main type_08 clear mfw swiper-wrapper recommendBox-wrapper" :class="page.isPageMore ? 'max' : ''">
                                         <a class="page_main_item swiper-slide" :href="pros.link"  v-for="(pros,index) in page.floorImageList">
                                             <img class="page_main_image" src="/img/base/placeholder.png" :data-original="pros.image" :alt="pros.name">
                                             <div class="page_main_tag" v-if="pros.listType == 2">{{ pros.label }}</div>
@@ -734,7 +734,7 @@
                                             </div>
                                         </a>
                                     </div>
-                                    <div class="swiper-pagination mfc"> <span v-if="isPC" v-for="i in page.floorImageList.length/5"></span></div>
+                                    <div class="swiper-pagination swiper-pagination-floor mfc"><span v-if="isPC" v-for="i in  Math.ceil(page.floorImageList.length / 5)"></span></div>
                                 </div>
                             </div>
                         </template>

+ 5 - 0
src/main/resources/templates/product/detail.html

@@ -40,6 +40,11 @@
             <div class="detailBox" th:object="${product}">
                 <div class="crumbs">
                     <span>所属分类:{{ productTypeName }}</span>
+<!--                    <a href="javascript:void(0);" th:text="*{bigTypeText}"></a>-->
+<!--                    <span>&gt;</span>-->
+<!--                    <a th:href="@{'/product/list.html?category=' + *{bigTypeId} + '-' + *{smallTypeId} + '-0'}" th:text="*{smallTypeText}"></a>-->
+<!--                    <span>&gt;</span>-->
+<!--                    <a th:href="@{'/product/list.html?category=' + *{bigTypeId} + '-' + *{smallTypeId} + '-' + *{tinyTypeId}}" th:text="*{tinyTypeText}"></a>-->
                 </div>
                 <h1 class="title" th:text="*{name}">商品名称</h1>
                 <p class="tags">