Forráskód Böngészése

commit - m首页优化

zhengjinyi 4 éve
szülő
commit
082e667db5

+ 101 - 47
src/main/resources/static/css/single-page/topic.css

@@ -4,63 +4,117 @@ li{list-style:none}
  * PC端
  */
 @media screen and (min-width:768px){
-.pageTop{width:1184px;margin:0 auto;background:#FFF}
-.pageTop img{width:100%;height:auto}
-.pageTop p{padding:16px;color:#93979F;font-size:16px;line-height:26px}
-
-.pageFloor .title{height:24px;line-height:24px;padding-left:10px;border-left:4px solid #E15616;margin:32px 0 16px 0;font-size:24px;color:#4A4F58;font-weight:bold;text-align:left;position: relative;}
-.pageFloor .title .more {float:right;color:#627386;font-size:18px;font-weight:normal;}
-.pageFloor .title .more:hover{color:#E15616}
-.pageFloor .title .talk_link{display: block;width: 120px;height: 40px;border-radius: 2px;border: 1px solid #E15616;background-color: #ffe6dc;line-height: 40px;text-align: center;font-size: 14px;color: #E15616;position: absolute;right: 0;top: -16px;}
-.pageFloor .content{width:1202px}
-.pageFloor .content li{float:left;width:284px;height:334px;margin:0 16px 16px 0;background:#FFF}
-.pageFloor .content li img{display:block;width:284px;height:284px}
-.pageFloor .content li span{display:block;height:50px;line-height:50px;padding:0 10px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#93979F;font-size:16px}
-.pageFloor .content li:hover{box-shadow:0 2px 6px #dedede;transition:all 0.5s;-webkit-transition:all 0.5s}
-.pageFloor .content li:hover span{color:#E15616}
-
-.contactBox{width:100%;background:#FFF;margin-bottom:-29px;padding-bottom:15px}
-.contactBox .tit{position:relative;width:1184px;margin:0 auto;height:80px}
-.contactBox .tit:before{content:'';position:absolute;left:0;top:39px;width:100%;border-top:1px solid #FFE6DC}
-.contactBox .tit span{width:188px;height:80px;line-height:80px;background:#FFF;position:absolute;top:0;left:50%;margin-left:-94px;font-weight:bold;font-size:28px;color:#2D3036;text-align:center}
-.contactBox .cont{width:1184px;margin:0 auto;text-align:center;line-height:48px}
-.contactBox .cont span{display:inline-block;padding-left:84px;height:96px;text-align:left;font-size:24px;color:#2D3036;position:relative}
-.contactBox .cont .call{margin-right:160px}
-.contactBox .cont span:before{width:70px;height:70px;position:absolute;left:0;top:10px}
-.contactBox .cont .call:before{background-position:-82px -370px}
-.contactBox .cont .phone:before{background-position:0 -370px}
+    .pageTop{width:1184px;margin:0 auto;background:#FFF}
+    .pageTop img{width:100%;height:auto}
+    .pageTop p{padding:16px;color:#93979F;font-size:16px;line-height:26px}
 
+    .pageFloor .title{height:24px;line-height:24px;padding-left:10px;border-left:4px solid #E15616;margin:32px 0 16px 0;font-size:24px;color:#4A4F58;font-weight:bold;text-align:left;position: relative;}
+    .pageFloor .title .more {float:right;color:#627386;font-size:18px;font-weight:normal;}
+    .pageFloor .title .more:hover{color:#E15616}
+    .pageFloor .title .talk_link{display: block;width: 120px;height: 40px;border-radius: 2px;border: 1px solid #E15616;background-color: #ffe6dc;line-height: 40px;text-align: center;font-size: 14px;color: #E15616;position: absolute;right: 0;top: -16px;}
+    .pageFloor .content{width:1202px;}
+    .pageFloor .content li{float:left;width:284px;height:334px;margin:0 16px 16px 0;background:#FFF}
+    .pageFloor .content li img{display:block;width:284px;height:284px}
+    .pageFloor .content li span{display:block;height:50px;line-height:50px;padding:0 10px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#93979F;font-size:16px}
+    .pageFloor .content li:hover{box-shadow:0 2px 6px #dedede;transition:all 0.5s;-webkit-transition:all 0.5s}
+    .pageFloor .content li:hover span{color:#E15616}
 
+    .contactBox{width:100%;background:#FFF;margin-bottom:-29px;padding-bottom:15px}
+    .contactBox .tit{position:relative;width:1184px;margin:0 auto;height:80px}
+    .contactBox .tit:before{content:'';position:absolute;left:0;top:39px;width:100%;border-top:1px solid #FFE6DC}
+    .contactBox .tit span{width:188px;height:80px;line-height:80px;background:#FFF;position:absolute;top:0;left:50%;margin-left:-94px;font-weight:bold;font-size:28px;color:#2D3036;text-align:center}
+    .contactBox .cont{width:1184px;margin:0 auto;text-align:center;line-height:48px}
+    .contactBox .cont span{display:inline-block;padding-left:84px;height:96px;text-align:left;font-size:24px;color:#2D3036;position:relative}
+    .contactBox .cont .call{margin-right:160px}
+    .contactBox .cont span:before{width:70px;height:70px;position:absolute;left:0;top:10px}
+    .contactBox .cont .call:before{background-position:-82px -370px}
+    .contactBox .cont .phone:before{background-position:0 -370px}
+    .section_page_more{
+        width: 100%;
+        height: 32px;
+        margin-top: 16px;
+        margin-bottom: 30px;
+    }
+    .section_page_more .more{
+        width: 98px;
+        height: 32px;
+        line-height: 32px;
+        font-size: 14px;
+        margin:  0 auto;
+        border-radius: 2px;
+        border: 1px solid #cccccc;
+        color: #909090;
+        text-align: left;
+        transition: all 0.2s;
+        cursor: pointer;
+        padding-left: 15px;
+        box-sizing: border-box;
+        position: relative;
+        display: block;
+    }
+    .section_page_more .more .icon:before{
+        background-position: -93px 7px;
+        width: 20px;
+        height: 32px;
+        right: 0;
+        position: absolute;
+    }
+    .section_page_more .more:hover{
+        color: #E15616;
+        border-color: #E15616;
+    }
+    .section_page_more .more:hover .icon:before{
+        background-position: -153px 7px;
+    }
 }
 
 /**
 * 移动端
 */
 @media screen and (max-width:768px){
-.pageTop{width:100%;background:#FFF}
-.pageTop img{display:block;width:93.4vw;height:auto;margin:0 auto;}
-.pageTop p{width:93.4vw;margin:0 auto;padding:4vw 0 1vw 0;color:#4a4f58;font-size:3vw;line-height:5.8vw;text-align:justify;}
-
-.pageFloor{width:100%;overflow:hidden;margin:0 auto;}
-.pageFloor .title{height:10vw;line-height:10vw;font-size:3.7vw;color:#4A4F58;font-weight:bold;text-align: left;}
-.pageFloor .content{width:100vw;margin-left: 3.2vw}
-.pageFloor .content li{float:left;width:45.4vw;height:55.2vw;margin:0 2.6vw 2.6vw 0;background:#FFF}
-.pageFloor .content li img{display:block;width:45.4vw;height:45.4vw}
-.pageFloor .content li span{display:block;height:9.8vw;line-height:9.8vw;padding:0 1vw;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#4a4f58;font-size:3.4vw;text-align: center}
+    .pageTop{width:100%;background:#FFF}
+    .pageTop img{display:block;width:93.4vw;height:auto;margin:0 auto;}
+    .pageTop p{width:93.4vw;margin:0 auto;padding:4vw 0 1vw 0;color:#4a4f58;font-size:3vw;line-height:5.8vw;text-align:justify;}
 
-.contactBox{width:100%;background:#FFF;margin: 0 auto 2.6vw;}
-.contactBox .tit{position:relative;width:100%;margin:0 auto;height:11.8vw}
-.contactBox .tit:before{content:'';position:absolute;left:0;top:5.9vw;width:100%;border-top:1px solid #FFE6DC}
-.contactBox .tit span{width:27.6vw;height:11.8vw;line-height:11.8vw;background:#FFF;position:absolute;top:0;left:50%;margin-left:-13.8vw;font-weight:bold;font-size:3.7vw;color:#2D3036;text-align:center}
-.contactBox .cont{width:100%;margin:0 auto;text-align:center}
-.contactBox .cont span{display:inline-block;width:100%;height:14vw;line-height:7vw;font-size:3.1vw;color:#2D3036;position:relative;text-align:left;padding-left:40vw;box-sizing:border-box;margin-bottom:2.6vw}
-.contactBox .cont span:before{width:9.4vw;height:9.4vw;position:absolute;left:28vw;top:2vw}
-.contactBox .cont .call:before{background-position:-61vw -17vw}
-.contactBox .cont .phone:before{background-position:-73vw -17vw}
-.pageFloor .title span{padding-left: 3.2vw}
-.pageFloor .talk_link{position: fixed;bottom: 0;display: block;background: #e15616;width: 100%;color: #fff;height: 11.8vw;line-height: 11.8vw;text-align: center;z-index: 1;}
-.pageFloor .title .more{float: right;margin-right: 3.2vw;color: #999999;font-weight: normal;}
+    .pageFloor{width:100%;overflow:hidden;margin:0 auto;}
+    .pageFloor .title{height:10vw;line-height:10vw;font-size:3.7vw;color:#4A4F58;font-weight:bold;text-align: left;}
+    .pageFloor .content{width:100vw;margin-left: 3.2vw}
+    .pageFloor .content li{float:left;width:45.4vw;height:55.2vw;margin:0 2.6vw 2.6vw 0;background:#FFF}
+    .pageFloor .content li img{display:block;width:45.4vw;height:45.4vw}
+    .pageFloor .content li span{display:block;height:9.8vw;line-height:9.8vw;padding:0 1vw;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#4a4f58;font-size:3.4vw;text-align: center}
 
+    .contactBox{width:100%;background:#FFF;margin: 0 auto 2.6vw;}
+    .contactBox .tit{position:relative;width:100%;margin:0 auto;height:11.8vw}
+    .contactBox .tit:before{content:'';position:absolute;left:0;top:5.9vw;width:100%;border-top:1px solid #FFE6DC}
+    .contactBox .tit span{width:27.6vw;height:11.8vw;line-height:11.8vw;background:#FFF;position:absolute;top:0;left:50%;margin-left:-13.8vw;font-weight:bold;font-size:3.7vw;color:#2D3036;text-align:center}
+    .contactBox .cont{width:100%;margin:0 auto;text-align:center}
+    .contactBox .cont span{display:inline-block;width:100%;height:14vw;line-height:7vw;font-size:3.1vw;color:#2D3036;position:relative;text-align:left;padding-left:40vw;box-sizing:border-box;margin-bottom:2.6vw}
+    .contactBox .cont span:before{width:9.4vw;height:9.4vw;position:absolute;left:28vw;top:2vw}
+    .contactBox .cont .call:before{background-position:-61vw -17vw}
+    .contactBox .cont .phone:before{background-position:-73vw -17vw}
+    .pageFloor .title span{padding-left: 3.2vw}
+    .pageFloor .talk_link{position: fixed;bottom: 0;display: block;background: #e15616;width: 100%;color: #fff;height: 11.8vw;line-height: 11.8vw;text-align: center;z-index: 1;}
+    .pageFloor .title .more{float: right;margin-right: 3.2vw;color: #999999;font-weight: normal;}
+    .section_page_more .more{
+        width: 20vw;
+        height: 6.4vw;
+        margin: 5vw auto;
+        border: .27vw solid #cccccc;
+        color: #909090;
+        font-size: 3vw;
+        line-height: 6.4vw;
+        border-radius: .54vw;
+        position: relative;
+        text-indent: 2vw;
+        display: block;
+    }
+    .section_page_more .more .icon:before {
+        background-position: -51.5vw 0px;
+        width:5.4vw;
+        height: 6.7vw;
+        right: 0;
+        position: absolute;
+    }
 
 }
 

+ 7 - 10
src/main/resources/static/js/center.js

@@ -2,16 +2,13 @@ $(function(){
     jqMultipleShow("click", ".navList", ".tab", ".con");
     //GLOBAL_USER_IDENTITY: 2-会员机构;3-供应商;4-普通机构
     var pageFlag = window.location.pathname.split("/")[1];
-    // if (GLOBAL_USER_IDENTITY===2 || GLOBAL_USER_IDENTITY===4 ) {
-    //     console.log('跳机构个人中心=======>',GLOBAL_USER_IDENTITY);
-    //     window.location.href = "/user/dashboard.html";
-    // }else if (GLOBAL_USER_IDENTITY === 1 || GLOBAL_USER_IDENTITY===3) {
-    //     console.log('跳供应商个人中心=======>',GLOBAL_USER_IDENTITY);
-    //     window.location.href = "/supplier/dashboard.html";
-    // }else{
-    //     console.log('跳供应商个人中心=======>',GLOBAL_USER_IDENTITY);
-    //     window.location.href = "/index.html";
-    // }
+    if (pageFlag == "supplier" && (GLOBAL_USER_IDENTITY=== 2 || GLOBAL_USER_IDENTITY===4)) {
+        window.location.href = "/user/dashboard.html";
+    }else if (pageFlag == "user" && (GLOBAL_USER_IDENTITY === 1 || GLOBAL_USER_IDENTITY===3)) {
+        window.location.href = "/supplier/dashboard.html";
+    }else{
+        return;
+    }
 });
 
 

+ 6 - 0
src/main/resources/static/js/common/serviceapi/pages.service.js

@@ -11,6 +11,12 @@ var PagesApi = {
                 callback(res);
             });
         },
+        GetPageTopicInfoData: function (params, callback) {
+            Http.AjaxService({ url:'/page/topic/info', type:'GET', data:params, json:false})
+            .then(function(res){
+                callback(res);
+            });
+        },
         /* 活动商品专题列表 */
         GetPromotionsListData: function (params, callback) {
             Http.AjaxService({ url:'/promotions/list', type:'GET', data:params, json:false})

+ 0 - 1
src/main/resources/static/js/product/list.js

@@ -148,7 +148,6 @@ var productList = new Vue({
                 if (r.code === 0 && r.data) {
                     var result = JSON.parse(r.data);
                     _self.listRecord = result.total;
-                    console.log(_self.userId)
                     var resultData = setSearchProductList(result.items, _self.userId, function(){
                         _self.$forceUpdate();
                         setTimeout(function(){

+ 15 - 1
src/main/resources/static/js/single-page/topic.js

@@ -2,7 +2,9 @@ var topicPage = new Vue({
     el: "#topicPage",
     data: {
         pageType: 0,
-        floorDatas: []
+        floorDatas: [],
+        buttonName:'',
+        buttonLink:''
     },
     computed: {
 
@@ -18,12 +20,24 @@ var topicPage = new Vue({
                     CAIMEI.Alert(response.msg, '确定', false);
                 }
             });
+        },
+        GetPageTopicBanner:function(){
+            var _self = this;
+            PagesApi.GetPageTopicInfoData({type: _self.pageType},function(response){
+                if(response.code === 0){
+                    _self.buttonLink = response.data.buttonLink;
+                    _self.buttonName = response.data.buttonName;
+                }else{
+                    CAIMEI.Alert(response.msg, '确定', false);
+                }
+            });
         }
     },
     created: function () {
         this.pageType = getUrlParam("type") ? getUrlParam("type")*1 : 0;
         // 获取列表数据
         this.getFloorDatas();
+        this.GetPageTopicBanner();
     },
     mounted: function () {
         var _self = this;

+ 4 - 3
src/main/resources/templates/single-page/topic.html

@@ -22,9 +22,7 @@
         <div class="pageFloor" v-for="floor in floorDatas">
             <div class="title">
                 <span v-text="floor.title"></span>
-                <a v-if="floor.link && isPC" :href="floor.link" class="more">查看更多>>></a>
-                 <a v-if="!isPC" :href="floor.link" class="more">更多></a>
-                <a v-if="pageType==6" class="talk_link" href="https://www.caimei365.com/info/detail-5856-1.html" target="_blank">超皮秒防伪查询</a>
+                <a class="talk_link" :href="buttonLink" target="_blank">{{ buttonName }}</a>
             </div>
             <ul class="content clear">
                 <li v-for="item in floor.floorData">
@@ -34,6 +32,9 @@
                     </a>
                 </li>
             </ul>
+            <div class="section_page_more" v-if="floor.link">
+                <a class="more" :href="floor.link"> <i class="icon mIcon"></i>查看更多</a>
+            </div>
         </div>
     </div>
     <div v-if="pageType==6" class="contactBox">