Explorar el Código

二手权限查看修改

zhengjinyi hace 3 años
padre
commit
3924088be6
Se han modificado 1 ficheros con 69 adiciones y 67 borrados
  1. 69 67
      src/main/resources/static/js/flea-market/secondDetail.js

+ 69 - 67
src/main/resources/static/js/flea-market/secondDetail.js

@@ -32,79 +32,81 @@ var fleaMarket = new Vue({
     methods: {
         InfoData: function(){
           var  _this = this;
-          SecondApi.ProductDetail({productId:_this.productId},function (res) {
-           if(res.code==0){
-                _this.isRequest =true;
-                    setTimeout(function(){
+          SecondApi.ProductDetail({productId:_this.productId,userId: _this.userID},function (res) {
+               if(res.code==0){
+                    _this.isRequest =true;
+                   _this.detail = res.data;
+                   _this.previewThumb =  res.data.imageList;
+                   _this.previewBigimage =res.data.imageList[0];
+                   setTimeout(function(){  // 图片懒加载
+                       $("img[data-original]").lazyload();
+                   },500);
+                   if(_this.userID!=null){
+                       if(res.data.secondHandType ==2){ //临期产品显示
+                           _this.HandType =true;
+                       }else {
+                           _this.HandType =false;
+                       }
+                   }
+                   if(res.data.showContactFlag!=2){
+                       _this.ShowImage=true;
+                   }else {
+                       _this.ShowImage=false;
+                   }
+                   if(res.data.sold == 1){//sold是否出售 0未出售,1已出售
+                       _this.soldImage = true;
+                   }else {
+                       _this.soldImage = false;
+                   }
+                   if(res.data.brandName !=''&& res.data.brandName!=null){
+                       _this.bnameShow = true;
+                       if(res.data.brandID ==161){
+                           _this.vShow_brand = true;
+                       }else {
+                           _this.vShow_brand = false;
+                       }
+                   }else {
+                       _this.bnameShow = false;
+                   }
+                   if (res.data.detailTalkFlag ==1){ //是否详聊  1不开启,2开启
+                       _this.FlagTwo==true;
+                   }else {
+                       _this.FlagTwo==false;
+                   }
+                   if(res.data.brandInfo==null||res.data.brandInfo==""){
+                       _this.Showlogo = false;
+                   }else {
+                       _this.Showlogo = true;
+                   }
+                   setTimeout(function(){
                         if (isPC) {
                             var magnifier = new ImageMagnifier(
-                                '#imgShown #CM____pic_thumb li'
-                                ,'#imgShown .bigImage'
-                                ,'#imgShown .preview-box'
-                                ,'#imgShown .mask'
-                                ,'#imgShown .bigitem'
-                                ,"on"
+                                '#imgShown #CM____pic_thumb li',
+                                '#imgShown .bigImage',
+                                '#imgShown .preview-box',
+                                '#imgShown .mask',
+                                '#imgShown .bigitem',
+                                "on"
                             ).init();
                         } else {
                             var swiper = new Swiper('#swiperImage', {
-                                loop : true,
-                                autoplay: {
-                                    delay: 2000,
-                                    disableOnInteraction: false
-                                },
-                                pagination: {
-                                    el: '.swiper-pagination',
-                                    type: 'fraction'
-                                }
-                            });
+                                    loop : true,
+                                    autoplay: {
+                                        delay: 2000,
+                                        disableOnInteraction: false
+                                    },
+                                    pagination: {
+                                        el: '.swiper-pagination',
+                                        type: 'fraction'
+                                    }
+                                });
                         }
-                    },500);
-           }else {
-                _this.isRequest =false;
-           }
-                _this.detail = res.data;
-                _this.previewThumb =  res.data.imageList;
-                _this.previewBigimage =res.data.imageList[0];
-                setTimeout(function(){  // 图片懒加载
-                      $("img[data-original]").lazyload();
-                },500);
-              if(_this.userID!=null){
-                if(res.data.secondHandType ==2){ //临期产品显示
-                   _this.HandType =true;
-                }else {
-                  _this.HandType =false;
-                }
-              }
-              if(res.data.showContactFlag!=2){
-                    _this.ShowImage=true;
-              }else {
-                    _this.ShowImage=false;
-              }
-              if(res.data.sold == 1){//sold是否出售 0未出售,1已出售
-                    _this.soldImage = true;
-                  }else {
-                    _this.soldImage = false;
-                  }
-             if(res.data.brandName !=''&& res.data.brandName!=null){
-                    _this.bnameShow = true;
-                if(res.data.brandID ==161){
-                    _this.vShow_brand = true;
-                }else {
-                    _this.vShow_brand = false;
-                }
-             }else {
-              _this.bnameShow = false;
-             }
-             if (res.data.detailTalkFlag ==1){ //是否详聊  1不开启,2开启
-                _this.FlagTwo==true;
-              }else {
-                _this.FlagTwo==false;
-             }
-             if(res.data.brandInfo==null||res.data.brandInfo==""){
-                _this.Showlogo = false;
-             }else {
-               _this.Showlogo = true;
-             }
+                     },500);
+               }else {
+                    _this.isRequest =false;
+                   window.location.href = "/404.html?error=未查询到该商品";
+               }
+
          })
         },
         changeActive:function(){