chao 4 tahun lalu
induk
melakukan
5e7269c1d1

+ 5 - 2
src/main/java/com/caimei/www/service/page/impl/SupplierServiceImpl.java

@@ -6,6 +6,7 @@ import com.caimei.www.service.page.SupplierService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import javax.annotation.Resource;
 
@@ -32,8 +33,10 @@ public class SupplierServiceImpl implements SupplierService {
     @Override
     public SupplierDetail getSupplierById(Integer supplierId) {
         SupplierDetail supplier = supplierDao.getSupplierById(supplierId);
-        String[] businessScope = supplier.getBusinessScope().split("/");
-        supplier.setBusinessScopeArr(businessScope);
+        if (!StringUtils.isEmpty(supplier.getBusinessScope())) {
+            String[] businessScope = supplier.getBusinessScope().split("/");
+            supplier.setBusinessScopeArr(businessScope);
+        }
         return supplier;
     }
 

+ 8 - 2
src/main/resources/templates/supplier/index.html

@@ -43,7 +43,7 @@
         </div>
         <div class="tabCon">
             <div class="item productBox">
-                <div class="part">
+                <div v-if="mainProducts.length>0" class="part">
                     <div class="title">主推商品</div>
                     <!--主推商品列表-->
                     <ul class="productList clear mfw">
@@ -96,7 +96,7 @@
                 <div class="part">
                     <div class="title" id="supProduct">供应商产品</div>
                     <!--主推商品列表-->
-                    <ul class="productList clear mfw">
+                    <ul v-if="productLists.length>0" class="productList clear mfw">
                         <li class="productItem mfc" v-for="p in productLists">
                             <div class="item">
                                 <a class="image" :href="'/product-'+p.id+'.html'">
@@ -142,6 +142,12 @@
                             </div>
                         </li>
                     </ul>
+                    <div v-else class="empty">
+                        <img src="/img/common/empty.png">
+                        <div class="msg">
+                            <p>该供应商暂未发布商品,去<a href="/">商城</a>,逛逛吧~</p>
+                        </div>
+                    </div>
                 </div>
             </div>
             <div class="item infoBox">