zhengjinyi 4 роки тому
батько
коміт
82d53764d1

+ 7 - 3
src/main/resources/static/css/flea-market/list.css

@@ -49,6 +49,7 @@
 /* 移动端*/
 @media screen and (max-width:768px){
 #fleaMarketList{width: 100%;overflow: hidden}
+    .footTop,.footMain{display: none;}
     .shopList{background: #fff}
     .Listitem{height:33vw;padding: 2.7vw;border-bottom: .24vw solid #F0F2F4}
     .ListImg{width: 100%;height: 35.3vw}
@@ -81,11 +82,14 @@
     .mIcon.liulanliang:before {background-position: -28.8vw -15.5vw;width: 5.3vw;height: 5.3vw;}
     .mIcon.shijian:before {background-position: -36.8vw -15.8vw;width: 4.9vw;height: 6vw;position: absolute;right: .24vw;top: -1.7vw;}
     .mIcon.dizhi:before {background-position: -87.7vw -38.4vw;width: 5.3vw;height: 5.3vw;position: absolute;right: -6vw;top: -1.3vw}
-    .mIcon.off:before{background-position: -68vw .53vw;width: 5.3vw;height: 5.3vw;position: absolute;right: 4vw;top: 1.7vw;}
+    .mIcon.off:before{background-position: -68vw .53vw;width: 5.3vw;height: 5.3vw;position: absolute;right: 2vw;top: 1.7vw;}
     .mIcon.open:before{background-position: -60.3vw .53vw;width: 5.3vw;height: 5.3vw;position: absolute;right: 5vw;top: 1.7vw;}
     .no-content{padding:26.6vw 5.3vw;background-color: #fff;margin: auto;}
     .no-content img{width: 50%;display: block;margin: 0 auto;padding: 0.5rem 0;}
     .error-message{text-align: center;margin-top: 5.3vw;font-size: 3.7vw;color: #53504D}
-    .fabu{text-align: center;font-size: 3.7vw;padding: 3.3vw;background: #fff}
-    .fabu a{color: #fff;display: block;background: #e15616;height: 11.3vw;width: 100%;margin: auto;line-height: 11.3vw}
+    .fabu{width: 12vw;height: 12vw;text-align: center;font-size: 2.5vw;background: #fff;position: fixed;bottom: 38.5vw;right: 0;}
+    .fabu a{ color: #fff;display: block;background: #e15616;height: 12vw;width:12vw;box-sizing: border-box;padding: 1.2vw 0;}
+    .fabu a .mIcon{width: 4.2vw;height: 4.2vw;display: block;margin: 0 auto;}
+    .fabu a .mIcon:before{width: 4.2vw;height: 4.2vw;display: block;background-position: -93vw -53vw;}
+    .fabu a p{line-height: 4.2vw;text-align: center;margin-top: 1vw;}
 }

BIN
src/main/resources/static/img/base/icon_m.png


+ 58 - 47
src/main/resources/static/js/flea-market/list.js

@@ -2,36 +2,37 @@ var isPC = ($(window).width()>768);
 var fleaMarketList = new Vue({
      el: "#fleaMarketList",
      data:{
-     currentId:1,
-     currentID2:0,
-     isShow:false,
-     showflag:false,
-     mainflag:false,
-     userID:JSON.parse(localStorage.getItem('userInfo')),
-     tabTitleName:'二手仪器',
-     tabTitle: [
-                {value:'1',name:'二手仪器'},
-                {value:'2',name:'临期产品'},
-                {value:'3',name:'其他'}
+         currentId:1,
+         currentID2:0,
+         isShow:false,
+         requestFlag: true,
+         showflag:false,
+         mainflag:false,
+         userID:JSON.parse(localStorage.getItem('userInfo')),
+         tabTitleName:'二手仪器',
+         tabTitle: [
+                    {value:'1',name:'二手仪器'},
+                    {value:'2',name:'临期产品'},
+                    {value:'3',name:'其他'}
+                   ],
+          tabList : [
+                    {value:'0',name:'全部'},
+                    {value:'1',name:'轻光电'},
+                    {value:'2',name:'重光电'},
+                    {value:'3',name:'耗材配件'},
                ],
-      tabList : [
-                {value:'0',name:'全部'},
-                {value:'1',name:'轻光电'},
-                {value:'2',name:'重光电'},
-                {value:'3',name:'耗材配件'},
-           ],
-      listQuery:{
-                pageNum:1,
-                pageSize:12,
-            },
-      tabchildList:[],
-      productsList:[],
-      tabchild:{},
-      listRecord: 0,
-      pageInput: '1',
-      params:{},
-      noMore:false,
-
+          listQuery:{
+                    pageNum:1,
+                    pageSize:12,
+                },
+          tabchildList:[],
+          productsList:[],
+          tabchild:{},
+          listRecord: 0,
+          pageInput: '1',
+          params:{},
+          noMore:false,
+          hasNextPage:false
      },
      computed: {
           pageTotal: function () {
@@ -80,6 +81,7 @@ var fleaMarketList = new Vue({
                     _this.mainflag=false;
                     _this.currentID2 = 0;
                }
+               _this.listQuery.pageNum = 1;
                _this.gettabList();
           },
          handleChild:function(item){ //二级分类
@@ -91,27 +93,39 @@ var fleaMarketList = new Vue({
                        _this.mainflag=false;
                    }
                }
+               _this.listQuery.pageNum = 1;
                _this.gettabList();
           },
-           gettabList:function () {
+           gettabList:function (more) {
                 var _this = this;
                 _this.returnedTarget();
                 var params = Object.assign({secondHandType: _this.currentId,instrumentType:_this.currentID2}, _this.listQuery);
                 SecondApi.SeconHandProductList(params,function (res) {
                      if (res.code == 0) {
-                        console.log(res);
-                       if(res.data.results.length == 0){
-                            _this.tabchildList = [];
-                            _this.showflag = true;
-                             _this.listRecord = res.data.totalRecord;
-                       }else {
-                            _this.showflag = false;
-                            _this.isShow = true;
-                            _this.tabchildList = res.data.results;
-                            _this.listRecord = res.data.totalRecord;
-                       }
-                     }else{
-                     }
+                           var data = res.data;
+                           if(data.results.length == 0){
+                               _this.tabchildList = [];
+                               _this.showflag = true;
+                               _this.listRecord = data.totalRecord;
+                           }else {
+                               _this.showflag = false;
+                               _this.isShow = true;
+                               _this.hasNextPage = data.hasNextPage;
+                               _this.listRecord = data.totalRecord;
+                               if(isPC){
+                                   _this.tabchildList = data.results;
+                               }else{
+                                   if(more){
+                                       _this.tabchildList = _this.tabchildList.concat(data.results);
+                                   }else{
+                                       _this.tabchildList = data.results;
+                                   }
+                               }
+                           }
+                         }else{
+                             CAIMEI.Alert(response.msg, '确定', false);
+                         }
+                    _this.requestFlag = true;
                 })
           },
            returnedTarget:function(){//对象合并 IE 兼容方法
@@ -153,10 +167,7 @@ var fleaMarketList = new Vue({
                     if(next <= totalPage){
                         if (_this.requestFlag){
                             _this.listQuery.pageNum = next;
-                            if (_this.isRequset) {
-                                // 获取列表数据
-                                _this.GetMyproductDataInfo();
-                            }
+                            _this.gettabList(true);
                         }
                         _this.requestFlag = false;
                     }else{

+ 10 - 7
src/main/resources/templates/flea-market/list.html

@@ -32,15 +32,15 @@
                 <li/>
             </ul>
             <ul class="secondTitle" v-else>
-                <li class="ClassA mIcon" @click="handle('1')" :class="[currentId == '1' ? 'active':'',currentId == '1' ? 'off':'']">
+                <li class="ClassA mIcon off" @click="handle('1')" :class="currentId == '1' ? 'active':''">
                     {{ tabTitleName }}
                     <span class="line" v-if="currentId == '1'"></span>
                 </li>
-                <li class="ClassA mIcon" @click="handle('2')" :class="[currentId == '2' ? 'active':'',currentId == '2' ? 'off':'']">
+                <li class="ClassA" @click="handle('2')" :class="[currentId == '2' ? 'active':'',currentId == '2' ? 'off':'']">
                     临期产品
                     <span class="line" v-if="currentId == '2'"></span>
                 </li>
-                <li class="ClassA mIcon" @click="handle('3')" :class="[currentId == '3' ? 'active':'',currentId == '3' ? 'off':'']">
+                <li class="ClassA" @click="handle('3')" :class="[currentId == '3' ? 'active':'',currentId == '3' ? 'off':'']">
                     其他
                     <span class="line" v-if="currentId == '3'"></span>
                 </li>
@@ -92,11 +92,14 @@
                 </div>
             </div>
         </div>
-            <div class="fabu" v-if="!isPC">
-                 <a href="/flea-market/form.html">我要发布</a>
-            </div>
+        <div class="fabu" v-if="!isPC">
+             <a href="/flea-market/form.html">
+                 <i class="icon mIcon"></i>
+                 <p>我要发布</p>
+             </a>
+        </div>
+        <div v-if="(!isPC) && noMore" class="noMore">----  没有更多了 ----</div>
     </div>
-    <div v-if="(!isPC) && noMore" class="noMore">---- 没有更多了 ----</div>
     <div class="pageWrap clear" v-if="isPC">
         <a v-if="listQuery.pageNum>1" class="prev" @click="toPagination(listQuery.pageNum*1-1)" href="javascript:void(0);"></a>
         <template v-for="n in showPageBtn">