Browse Source

Merge remote-tracking branch 'remotes/origin/developer' into developerC

# Conflicts:
#	src/main/resources/static/js/common/serviceapi/utils.service.js
#	src/main/resources/templates/flea-market/list.html
#	src/main/resources/templates/index.html
#	target/www-0.0.1-SNAPSHOT.jar
chao 4 years ago
parent
commit
935144a6f6
37 changed files with 988 additions and 304 deletions
  1. 8 1
      pom.xml
  2. 30 0
      src/main/java/com/caimei/www/config/MyCommandLineRunner.java
  3. 37 0
      src/main/java/com/caimei/www/controller/GenerateApi.java
  4. 8 7
      src/main/java/com/caimei/www/controller/unlimited/HomeController.java
  5. 5 0
      src/main/java/com/caimei/www/mapper/BaseDao.java
  6. 17 1
      src/main/java/com/caimei/www/pojo/page/TopMenu.java
  7. 26 0
      src/main/java/com/caimei/www/service/generate/GenerateHtml.java
  8. 227 0
      src/main/java/com/caimei/www/service/generate/impl/GenerateHtmlImpl.java
  9. 5 0
      src/main/java/com/caimei/www/service/page/BaseService.java
  10. 28 9
      src/main/java/com/caimei/www/service/page/impl/BaseServiceImpl.java
  11. 238 0
      src/main/java/com/caimei/www/utils/AppletsLinkUtil.java
  12. 116 0
      src/main/java/com/caimei/www/utils/RequestUtil.java
  13. 4 3
      src/main/resources/application.yml
  14. 1 0
      src/main/resources/config/beta/application-beta.yml
  15. 2 4
      src/main/resources/config/dev/application-dev.yml
  16. 1 0
      src/main/resources/config/prod/application-prod.yml
  17. 9 2
      src/main/resources/mapper/BaseMapper.xml
  18. 1 0
      src/main/resources/static/css/base/base.h5.css
  19. 1 0
      src/main/resources/static/css/base/base.pc.css
  20. 5 0
      src/main/resources/static/js/account/register-supplier.js
  21. 19 15
      src/main/resources/static/js/base.js
  22. 4 0
      src/main/resources/static/js/common/serviceapi/utils.service.js
  23. 3 0
      src/main/resources/static/js/flea-market/list.js
  24. 6 4
      src/main/resources/static/js/flea-market/secondDetail.js
  25. 87 75
      src/main/resources/static/js/index.js
  26. 44 20
      src/main/resources/static/js/pay/caimei-weisapay.js
  27. 15 15
      src/main/resources/static/js/supplier-center/setting/information.js
  28. 7 5
      src/main/resources/templates/account/register-supplier.html
  29. 1 2
      src/main/resources/templates/account/supplier-information.html
  30. 2 2
      src/main/resources/templates/components/header.html
  31. 7 7
      src/main/resources/templates/flea-market/detail.html
  32. 2 2
      src/main/resources/templates/flea-market/list.html
  33. 13 9
      src/main/resources/templates/index.html
  34. 1 1
      src/main/resources/templates/shopping/cart.html
  35. 5 6
      src/main/resources/templates/supplier-center/setting/information.html
  36. 3 1
      src/main/resources/templates/user-center/setting/upgrade.html
  37. 0 113
      src/test/java/com/caimei/www/WwwApplicationTests.java

+ 8 - 1
pom.xml

@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.3.4.RELEASE</version>
+        <version>2.4.3</version>
         <relativePath/> <!-- lookup parent from repository -->
     </parent>
     <groupId>com.caimei</groupId>
@@ -126,6 +126,13 @@
             <version>3.10.2</version>
         </dependency>
 
+        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.8.0</version>
+        </dependency>
+
     </dependencies>
 
 

+ 30 - 0
src/main/java/com/caimei/www/config/MyCommandLineRunner.java

@@ -0,0 +1,30 @@
+package com.caimei.www.config;
+
+import com.caimei.www.service.generate.GenerateHtml;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/5/11
+ */
+@Slf4j
+@Component
+@Order(value = 10)
+public class MyCommandLineRunner implements CommandLineRunner {
+    @Resource
+    private GenerateHtml generateHtml;
+
+	@Override
+	public void run(String... args) throws Exception {
+		log.info("执行MyCommandLineRunner:拷贝静态文件!");
+		// 拷贝静态资源文件
+        generateHtml.generateStaticFiles();
+    }
+}

+ 37 - 0
src/main/java/com/caimei/www/controller/GenerateApi.java

@@ -0,0 +1,37 @@
+package com.caimei.www.controller;
+
+import com.caimei.www.service.generate.GenerateHtml;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.server.ServerWebExchange;
+
+import javax.annotation.Resource;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/5/7
+ */
+@RestController
+public class GenerateApi {
+    @Resource
+    private GenerateHtml generateHtml;
+
+    /**
+     * 生成静态首页
+     */
+    @PostMapping("/generate/home")
+    public  String generateStaticHome(ServerWebExchange exchange) {
+        return generateHtml.generateStaticHome(exchange);
+    }
+
+    /**
+     * 拷贝静态资源文件
+     */
+    @PostMapping("/generate/static")
+    public  String generateStaticFiles() {
+        return generateHtml.generateStaticFiles();
+    }
+
+}

+ 8 - 7
src/main/java/com/caimei/www/controller/unlimited/HomeController.java

@@ -4,14 +4,14 @@ import com.caimei.www.controller.BaseController;
 import com.caimei.www.pojo.page.ImageLink;
 import com.caimei.www.pojo.JsonModel;
 import com.caimei.www.pojo.page.PageFloor;
-import com.caimei.www.pojo.page.ProductList;
+import com.caimei.www.service.page.BaseService;
 import com.caimei.www.service.page.HomeService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import javax.annotation.Resource;
 import java.util.List;
 
 /**
@@ -28,12 +28,10 @@ public class HomeController extends BaseController {
 	private static final String ERROR_PATH = "error/404";
 	private static final String SEARCH_CHILDREN = "error/search_children";
 
-
+    @Resource
+    private BaseService baseService;
+    @Resource
     private HomeService homeService;
-    @Autowired
-    public void setHomeService(HomeService homeService) {
-        this.homeService = homeService;
-    }
 
     /**
      * 首页页面路径
@@ -42,6 +40,9 @@ public class HomeController extends BaseController {
      */
     @GetMapping("/index.html")
     public String home(final Model model) {
+		// 获取banner图
+		List<ImageLink> bannerList = baseService.getHomeBanners();
+		model.addAttribute("bannerList", bannerList);
         model.addAttribute("msg", "首页");
         return HOME_PATH;
     }

+ 5 - 0
src/main/java/com/caimei/www/mapper/BaseDao.java

@@ -41,4 +41,9 @@ public interface BaseDao {
      * 获取友情链接
      */
     List<BaseLink> getFriendLinks();
+
+    /**
+     * 首页轮播
+     */
+    List<ImageLink> getHomeBanners();
 }

+ 17 - 1
src/main/java/com/caimei/www/pojo/page/TopMenu.java

@@ -4,6 +4,7 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 一级导航栏
@@ -20,10 +21,25 @@ public class TopMenu implements Serializable {
 	private String type;
 	/** 一级导航链接 */
 	private String link;
+    /**
+     * 图标
+     */
+    private String icon;
 	/** 排序 */
 	private String sort;
 	/** 二级导航列表 */
-	private List<SubMenu> subMenus;
+	// private List<SubMenu> subMenus;
+    /**
+     * 链接类型 -1未知类型 1二级页面 2项目仪器 3直播页面 4自由页面 5商品详情 6项目仪器详情
+     * 7供应商主页 8专题活动页 9二手市场介绍 10二手商品列表 11二手商品发布 12商品搜索 13信息详情
+     * 14品牌招商介绍页 15维修保养介绍页 16首页 17注册页 18信息中心 19供应商列表
+     */
+    private Integer linkType;
+
+    /**
+     * 链接包含的参数
+     */
+    private Map<String, Object> linkParam;
 
 	private static final long serialVersionUID = 1L;
 }

+ 26 - 0
src/main/java/com/caimei/www/service/generate/GenerateHtml.java

@@ -0,0 +1,26 @@
+package com.caimei.www.service.generate;
+
+import org.springframework.web.server.ServerWebExchange;
+
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/5/7
+ */
+public interface GenerateHtml {
+    /**
+     * 生成静态首页
+     */
+    String generateStaticHome(ServerWebExchange exchange);
+
+    /**
+     * 删除静态首页
+     */
+    String deleteStaticHome(String pageName);
+    /**
+     * 拷贝静态资源文件
+     */
+    String generateStaticFiles();
+}

+ 227 - 0
src/main/java/com/caimei/www/service/generate/impl/GenerateHtmlImpl.java

@@ -0,0 +1,227 @@
+package com.caimei.www.service.generate.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.caimei.www.pojo.page.BaseLink;
+import com.caimei.www.pojo.page.ImageLink;
+import com.caimei.www.pojo.page.TopMenu;
+import com.caimei.www.service.generate.GenerateHtml;
+import com.caimei.www.service.page.BaseService;
+import com.caimei.www.utils.RequestUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.FileUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.core.io.support.ResourcePatternResolver;
+import org.springframework.stereotype.Service;
+import org.springframework.web.server.ServerWebExchange;
+import org.thymeleaf.TemplateEngine;
+import org.thymeleaf.spring5.context.webflux.SpringWebFluxContext;
+import org.thymeleaf.util.StringUtils;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2021/5/7
+ */
+@Slf4j
+@Service
+public class GenerateHtmlImpl implements GenerateHtml {
+    @Value("${caimei.destPath}")
+    private String destPath;
+	@Value("${caimei.coreServer}")
+	private String coreServer;
+	@Value("${caimei.spiServer}")
+    private String spiServer;
+    /** 打包时间 */
+    @Value("${caimei.siteEnv}")
+    private String siteEnv;
+    /** 打包时间 */
+    @Value("${spring.application.build-time}")
+    private String buildTime;
+
+    @Resource
+    private TemplateEngine templateEngine;
+    @Resource
+    private BaseService baseService;
+
+    /**
+     * 生成静态首页
+     */
+    @Override
+    public String generateStaticHome(ServerWebExchange exchange) {
+        // 上下文
+        SpringWebFluxContext context = new SpringWebFluxContext(exchange);
+        // 设置页面数据
+        context.setVariables(setStaticHomeData());
+        // 输出流
+        File dest = new File(destPath, "index.html");
+        if (dest.exists()) {
+            boolean delete = dest.delete();
+        }
+        try (PrintWriter writer = new PrintWriter(dest, "UTF-8")) {
+            // 生成html
+            templateEngine.process("index", context, writer);
+            log.info("[静态页服务]:生成静态首页成功! ^_^");
+            return "[静态页服务]:生成静态首页成功! ^_^";
+        } catch (Exception e) {
+            log.error("[静态页服务]:生成静态首页异常!", e);
+            return "[静态页服务]:生成静态首页异常!"+e.toString();
+        }
+    }
+
+    /**
+     * 删除静态页
+     */
+    @Override
+    public String deleteStaticHome(String pageName) {
+        // 输出流
+        File dest = new File(destPath, pageName + ".html");
+        if (dest.exists()) {
+            boolean delete = dest.delete();
+            if (delete) {
+                return "[静态页服务]:删除静态页成功! ^_^";
+            }
+        }
+        return "[静态页服务]:删除静态页失败!";
+    }
+
+    /**
+     * 拷贝静态资源文件
+     */
+    @Override
+    public String generateStaticFiles() {
+        // 拷贝静态资源文件
+        try {
+            copyResourceToFile();
+            log.info("[静态页服务]:拷贝静态资源文件成功! ^_^");
+            return "[静态页服务]:拷贝静态资源文件成功! ^_^";
+        } catch (Exception e) {
+            log.error("[静态页服务]:拷贝静态资源文件异常!", e);
+            return "[静态页服务]:拷贝静态资源文件异常!"+e.toString();
+        }
+    }
+
+    /**
+     * 设置静态首页数据
+     */
+    private Map<String, Object> setStaticHomeData() {
+        // 这里加载的数据是从数据库查询出来的,demo就写固定了
+        Map<String, Object> map = new HashMap<>();
+
+		// 环境变量,(2:正式环境,1:测试环境,0:开发环境)
+	    map.put("siteEnv", siteEnv);
+		map.put("agent", "");
+	    // 静态文件版本号
+	    map.put("version", buildTime);
+		// spi服务器地址
+		map.put("coreServer", coreServer);
+		map.put("spiServer", spiServer);
+		// 搜索热门关键字
+		List<String> searchHotWord = baseService.getSearchHotWord();
+		map.put("searchHotWord", searchHotWord);
+		// 头部菜单
+		List<TopMenu> menuList = baseService.getNavMenu();
+		map.put("topMenuList", menuList);
+		// 获取banner图
+		List<ImageLink> bannerList = baseService.getHomeBanners();
+		map.put("bannerList", bannerList);
+        // 获取首页楼层
+        String floor = null;
+        try {
+            String floorResult = RequestUtil.sendGet(coreServer+"/commodity/home/floor?userId=0&source=1");
+            log.debug(floorResult);
+            Map<String, Object> floorMap = JSONObject.parseObject(floorResult, Map.class);
+            floor = floorMap.get("data").toString();
+        } catch (Exception e) {
+            log.error("try-catch:",e);
+        }
+        map.put("floorJson", floor);
+		// 底部帮助页
+		List<BaseLink> helpPages = baseService.getHelpPages();
+		map.put("helpPages", helpPages);
+		// 友情链接
+		List<BaseLink> friendLinks = baseService.getFriendLinks();
+		map.put("friendLinks", friendLinks);
+
+        log.debug(map.toString());
+
+        return map;
+    }
+
+    /**
+     * 资源清单获取并拷贝
+     */
+    private void copyResourceToFile() throws IOException {
+        // 资源清单获取
+        ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
+        org.springframework.core.io.Resource[] resources = resolver.getResources("static/**");
+        for (org.springframework.core.io.Resource resource : resources) {
+            String fileName = resource.getFilename();
+            assert fileName != null;
+            if (fileName.indexOf(".") > 0) {
+                InputStream inputStream = null;
+                try {
+                    inputStream = resource.getInputStream();
+                } catch (Exception e) {
+                    log.warn(String.format("[%s]获取输入流发生异常!", resource.getURL()));
+                    throw new RuntimeException(String.format("[%s]获取输入流发生异常!", resource.getURL()));
+                }
+                //分析相对目录
+                String tempPath = "";
+                String[] urls = resource.getURL().toString().split("/static/");
+                if (urls.length >= 2 ){
+                    tempPath = urls[urls.length-1];
+                } else {
+                    throw new RuntimeException("relativeRootPath有误:无法分析相对目录");
+                }
+                tempPath = tempPath.substring(0, tempPath.length() - fileName.length());
+                if (StringUtils.isEmpty(tempPath)) {
+                    tempPath = File.separator;
+                }
+                String filePath = destPath + File.separator + tempPath;
+                if (createDir(filePath)) {
+                    String destName = filePath + fileName;
+                    // 输出流
+                    File dest = new File(destName);
+                    if (dest.exists()) {
+                        boolean delete = dest.delete();
+                    }
+                    FileUtils.copyInputStreamToFile(inputStream, dest);
+                } else {
+                    throw new RuntimeException(String.format("创建本地目录[%s]失败!", resource.getURL()));
+                }
+            }
+        }
+    }
+
+    /**
+     * 创建目录
+     */
+    private static boolean createDir(String dirName) {
+        File dir = new File(dirName);
+        if (dir.exists()) {
+            return true;
+        }
+        if (!dirName.endsWith(File.separator)) {
+            dirName = dirName + File.separator;
+        }
+        if (dir.mkdirs()) {
+            log.warn("创建目录" + dirName + "成功!");
+            return true;
+        } else {
+            log.warn("创建目录" + dirName + "失败!");
+            return false;
+        }
+    }
+
+}

+ 5 - 0
src/main/java/com/caimei/www/service/page/BaseService.java

@@ -1,6 +1,7 @@
 package com.caimei.www.service.page;
 
 import com.caimei.www.pojo.page.BaseLink;
+import com.caimei.www.pojo.page.ImageLink;
 import com.caimei.www.pojo.page.TopMenu;
 
 import java.util.List;
@@ -33,4 +34,8 @@ public interface BaseService {
      */
     List<BaseLink> getFriendLinks();
 
+    /**
+     * 首页轮播
+     */
+    List<ImageLink> getHomeBanners();
 }

+ 28 - 9
src/main/java/com/caimei/www/service/page/impl/BaseServiceImpl.java

@@ -4,13 +4,13 @@ package com.caimei.www.service.page.impl;
 import com.caimei.www.mapper.BaseDao;
 import com.caimei.www.pojo.page.*;
 import com.caimei.www.service.page.BaseService;
-import com.caimei.www.utils.ImageUtil;
+import com.caimei.www.utils.AppletsLinkUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
+import org.thymeleaf.util.StringUtils;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -53,14 +53,25 @@ public class BaseServiceImpl implements BaseService {
     public List<TopMenu> getNavMenu() {
         List<TopMenu> menuList = baseDao.getTopMenus();
         menuList.forEach(item -> {
-            List<SubMenu> subList = baseDao.getSubMenus(item.getId());
-            if (subList.size() > 0) {
-                // 设置老图片路径
-                subList.forEach(sub -> {
-                     sub.setImage(ImageUtil.getImageURL("", sub.getImage(), 0, domain));
-                });
+            String link = item.getLink();
+            if (!StringUtils.isEmpty(link)) {
+                if (link.contains("?")) {
+                    link = link + "&name=" + item.getName();
+                } else {
+                    link = link + "?name=" + item.getName();
+                }
+                item.setLinkType(AppletsLinkUtil.getLinkType(link));
+                item.setLinkParam(AppletsLinkUtil.getLinkParam(item.getLinkType(), link));
+                item.setLink(link);
             }
-            item.setSubMenus(subList);
+//            List<SubMenu> subList = baseDao.getSubMenus(item.getId());
+//            if (subList.size() > 0) {
+//                // 设置老图片路径
+//                subList.forEach(sub -> {
+//                     sub.setImage(ImageUtil.getImageURL("", sub.getImage(), 0, domain));
+//                });
+//            }
+//            item.setSubMenus(subList);
         });
         return menuList;
     }
@@ -88,4 +99,12 @@ public class BaseServiceImpl implements BaseService {
         return baseDao.getFriendLinks();
     }
 
+    /**
+     * 首页轮播
+     */
+    @Override
+    public List<ImageLink> getHomeBanners() {
+        return baseDao.getHomeBanners();
+    }
+
 }

+ 238 - 0
src/main/java/com/caimei/www/utils/AppletsLinkUtil.java

@@ -0,0 +1,238 @@
+package com.caimei.www.utils;
+
+import lombok.extern.slf4j.Slf4j;
+import org.thymeleaf.util.StringUtils;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * 小程序链接工具类
+ *
+ * @author : Charles
+ * @date : 2021/4/9
+ */
+@Slf4j
+public class AppletsLinkUtil {
+    /**
+     * 1二级页面
+     */
+    public static final Pattern pattern1 = Pattern.compile("/cmpage/info-1");
+    public static final Pattern pattern34 = Pattern.compile("/topic.html");
+    /**
+     * 2项目仪器详情
+     */
+    public static final Pattern pattern2 = Pattern.compile("/cmpage/info-2");
+    public static final Pattern pattern6 = Pattern.compile("equipment/detail");
+    /**
+     * 3直播页面
+     */
+    public static final Pattern pattern3 = Pattern.compile("/cmpage/info-3");
+    public static final Pattern pattern36 = Pattern.compile("wx.vzan.com");
+    /**
+     * 4自由页面
+     */
+    public static final Pattern pattern4 = Pattern.compile("/cmpage/info-4");
+    public static final Pattern pattern33 = Pattern.compile("page.html");
+    /**
+     * 5商品详情
+     */
+    public static final Pattern pattern5 = Pattern.compile("/product-");
+
+    /**
+     * 7供应商主页
+     */
+    public static final Pattern pattern7 = Pattern.compile("supplier/prolist");
+    public static final Pattern pattern8 = Pattern.compile("supplier/index.html");
+    public static final Pattern pattern9 = Pattern.compile("view/supplierHomePage.jsp");
+    public static final Pattern pattern10 = Pattern.compile("supplier/productlist-");
+    /**
+     * 8专题活动页
+     */
+    public static final Pattern pattern11 = Pattern.compile("promotions.html");
+    public static final Pattern pattern12 = Pattern.compile("cmpage/area.html");
+    /**
+     * 9二手市场介绍
+     */
+    public static final Pattern pattern13 = Pattern.compile("html/secondHand/introduction.jsp");
+    public static final Pattern pattern14 = Pattern.compile("flea-market/intro.html");
+    /**
+     * 10二手商品列表
+     */
+    public static final Pattern pattern15 = Pattern.compile("html/secondHand/secondList.jsp");
+    public static final Pattern pattern16 = Pattern.compile("flea-market/list.html");
+    /**
+     * 11二手商品发布
+     */
+    public static final Pattern pattern17 = Pattern.compile("html/maintenance/view/secondtransactions.jsp");
+    public static final Pattern pattern18 = Pattern.compile("flea-market/form.html");
+    /**
+     * 12商品搜索
+     */
+    public static final Pattern pattern19 = Pattern.compile("product/search.shtml");
+    public static final Pattern pattern20 = Pattern.compile("product/search/list");
+    public static final Pattern pattern21 = Pattern.compile("product/list.html");
+    /**
+     * 13信息详情
+     */
+    public static final Pattern pattern22 = Pattern.compile("info/detail");
+    /**
+     * 14品牌招商介绍页
+     */
+    public static final Pattern pattern23 = Pattern.compile("html/InvestmentCaiMei/investmentpage.jsp");
+    public static final Pattern pattern24 = Pattern.compile("investment.html");
+    /**
+     * 15维修保养介绍页
+     */
+    public static final Pattern pattern25 = Pattern.compile("html/maintenance/view/mt-entry-index.jsp");
+    public static final Pattern pattern26 = Pattern.compile("repair.html");
+    /**
+     * 16首页
+     */
+    public static final Pattern pattern27 = Pattern.compile("index.action");
+    public static final Pattern pattern28 = Pattern.compile("index.html");
+    /**
+     * 17注册页
+     */
+    public static final Pattern pattern29 = Pattern.compile("web/login/view/register_new_vip.jsp");
+    public static final Pattern pattern30 = Pattern.compile("register.html");
+    /**
+     * 18信息中心
+     */
+    public static final Pattern pattern31 = Pattern.compile("info/center");
+    /**
+     * 19供应商列表
+     */
+    public static final Pattern pattern32 = Pattern.compile("supplier/list.html");
+    /**
+     * 20分类详情
+     */
+    public static final Pattern pattern35 = Pattern.compile("/cmpage/info-5");
+    /**
+     * 21美博会专题页
+     */
+    public static final Pattern pattern37 = Pattern.compile("/beautytopic");
+    /**
+     * 22美体会专题页
+     */
+    public static final Pattern pattern38 = Pattern.compile("/cmpage/info-5-301");
+
+    /**
+     * 根据链接判断链接类型
+     *
+     * @param link
+     * @return
+     */
+    public static Integer getLinkType(String link) {
+        if (!StringUtils.isEmpty(link)) {
+            if (pattern1.matcher(link).find() || pattern34.matcher(link).find()) {
+                return 1;
+            } else if (pattern2.matcher(link).find() || pattern6.matcher(link).find()) {
+                return 2;
+            } else if (pattern3.matcher(link).find() || pattern36.matcher(link).find()) {
+                return 3;
+            } else if (pattern4.matcher(link).find() || pattern33.matcher(link).find()) {
+                return 4;
+            } else if (pattern5.matcher(link).find()) {
+                return 5;
+            } else if (pattern7.matcher(link).find() || pattern8.matcher(link).find() || pattern9.matcher(link).find() || pattern10.matcher(link).find()) {
+                return 7;
+            } else if (pattern11.matcher(link).find() || pattern12.matcher(link).find()) {
+                return 8;
+            } else if (pattern13.matcher(link).find() || pattern14.matcher(link).find()) {
+                return 9;
+            } else if (pattern15.matcher(link).find() || pattern16.matcher(link).find()) {
+                return 10;
+            } else if (pattern17.matcher(link).find() || pattern18.matcher(link).find()) {
+                return 11;
+            } else if (pattern19.matcher(link).find() || pattern20.matcher(link).find() || pattern21.matcher(link).find()) {
+                return 12;
+            } else if (pattern22.matcher(link).find()) {
+                return 13;
+            } else if (pattern23.matcher(link).find() || pattern24.matcher(link).find()) {
+                return 14;
+            } else if (pattern25.matcher(link).find() || pattern26.matcher(link).find()) {
+                return 15;
+            } else if (pattern27.matcher(link).find() || pattern28.matcher(link).find()) {
+                return 16;
+            } else if (pattern29.matcher(link).find() || pattern30.matcher(link).find()) {
+                return 17;
+            } else if (pattern31.matcher(link).find()) {
+                return 18;
+            } else if (pattern32.matcher(link).find()) {
+                return 19;
+            } else if (pattern35.matcher(link).find()) {
+                if (pattern38.matcher(link).find()) {
+                    return 22;
+                }
+                return 20;
+            } else if (pattern37.matcher(link).find()) {
+                return 21;
+            } else {
+                return -1;
+            }
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * 根据链接获取链接中携带的参数
+     *
+     * @param linkType
+     * @param link
+     * @return
+     */
+    public static Map<String, Object> getLinkParam(Integer linkType, String link) {
+        HashMap<String, Object> map = new HashMap<>();
+        String[] idArr = link.split("/");
+        String[] split1 = null;
+        String[] split2 = null;
+        String[] split3 = null;
+        if (idArr.length > 0) {
+            split1 = idArr[idArr.length - 1].split("-");
+            split2 = idArr[idArr.length - 1].split("=");
+            if (split1.length > 0) {
+                split3 = split1[split1.length - 1].split("\\.");
+            }
+        }
+        if (linkType == 3 || linkType == 5 || linkType == 20 || linkType == 22) {
+            //-{id}.html
+            if (split3 != null && split3.length == 2) {
+                map.put("id", split3[0]);
+            }
+        } else if (linkType == 1 || linkType == 2 || linkType == 4 || linkType == 7) {
+            if (pattern1.matcher(link).find() || pattern2.matcher(link).find() || pattern4.matcher(link).find() || pattern7.matcher(link).find() || pattern10.matcher(link).find()) {
+                //-{id}.html
+                if (split3 != null && split3.length == 2) {
+                    map.put("id", split3[0]);
+                }
+            } else if (pattern6.matcher(link).find() || pattern33.matcher(link).find() || pattern8.matcher(link).find() || pattern9.matcher(link).find() || pattern34.matcher(link).find()) {
+                //id={id}
+                if (split2 != null && split2.length == 2) {
+                    map.put("id", split2[1]);
+                }
+            }
+        } else if (linkType == 13 || linkType == 18) {
+            //a-{id}-b
+            if (split1 != null && split1.length == 3) {
+                map.put("id", split1[1]);
+            }
+        } else if (linkType == 12 || linkType == 19) {
+            //keyword=
+            if (split2 != null && split2.length == 2) {
+                String keyword = split2[1];
+                try {
+                    keyword = URLDecoder.decode(keyword, "UTF-8");
+                } catch (UnsupportedEncodingException e) {
+                    log.error("try-catch:",e);
+                }
+                map.put("keyword", keyword);
+            }
+        }
+        return map;
+    }
+}

+ 116 - 0
src/main/java/com/caimei/www/utils/RequestUtil.java

@@ -0,0 +1,116 @@
+package com.caimei.www.utils;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.nio.charset.StandardCharsets;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 请求工具类
+ *
+ * @author : Charles
+ * @date : 2021/3/8
+ */
+public class RequestUtil {
+
+    /**
+     * 向指定URL发送GET方法的请求
+     *
+     * @param url   发送请求的URL,请求参数应该是 name1=value1&name2=value2 的形式。
+     * @return 远程资源的响应结果
+     */
+    public static String sendGet(String url) throws Exception {
+        StringBuilder result = new StringBuilder();
+        BufferedReader in = null;
+        try {
+
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            URLConnection connection = realUrl.openConnection();
+            // 设置通用的请求属性
+            connection.setRequestProperty("accept", "*/*");
+            connection.setRequestProperty("connection", "Keep-Alive");
+            connection.setRequestProperty("Accept-Charset", "utf-8");
+            connection.setRequestProperty("contentType", "utf-8");
+            connection.setConnectTimeout(5000);
+            // 建立实际的连接
+            connection.connect();
+            // 获取所有响应头字段
+            Map<String, List<String>> map = connection.getHeaderFields();
+            // 定义 BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(
+                    connection.getInputStream()));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result.append(line);
+            }
+        }
+        // 使用finally块来关闭输入流
+        finally {
+            if (in != null) {
+                in.close();
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * 向指定 URL 发送POST方法的请求
+     *
+     * @param url 发送请求的 URL
+     * @param paramMap 请求参数
+     * @return 所代表远程资源的响应结果
+     */
+    public static String sendPost(String url, Map<String, ?> paramMap) throws Exception{
+        PrintWriter out = null;
+        BufferedReader in = null;
+        StringBuilder result = new StringBuilder();
+
+        StringBuilder param = new StringBuilder();
+
+        for (String key : paramMap.keySet()) {
+            param.append(key).append("=").append(paramMap.get(key)).append("&");
+        }
+
+        try {
+            URL realUrl = new URL(url);
+            // 打开和URL之间的连接
+            URLConnection conn = realUrl.openConnection();
+            // 设置通用的请求属性
+            conn.setRequestProperty("accept", "*/*");
+            conn.setRequestProperty("connection", "Keep-Alive");
+            conn.setRequestProperty("Accept-Charset", "utf-8");
+            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
+            // 发送POST请求必须设置如下两行
+            conn.setDoOutput(true);
+            conn.setDoInput(true);
+            // 获取URLConnection对象对应的输出流
+            out = new PrintWriter(conn.getOutputStream());
+            // 发送请求参数
+            out.print(param);
+            // flush输出流的缓冲
+            out.flush();
+            // 定义BufferedReader输入流来读取URL的响应
+            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
+            String line;
+            while ((line = in.readLine()) != null) {
+                result.append(line);
+            }
+        }
+        //使用finally块来关闭输出流、输入流
+        finally{
+            if(out!=null){
+                out.close();
+            }
+            if(in!=null){
+                in.close();
+            }
+        }
+        return result.toString();
+    }
+
+}

+ 4 - 3
src/main/resources/application.yml

@@ -1,5 +1,9 @@
 server:
   port: 8009
+  compression:
+    enabled: true
+    mime-types: application/json,application/xml,text/xml,text/plain,text/html,text/javascript,text/css
+
 spring:
   application:
     # 指定服务名
@@ -22,6 +26,3 @@ mybatis:
   mapper-locations:
     - classpath:mapper/*.xml
     - classpath:com-caimei-module-product/*Mapper.xml
-
-
-

+ 1 - 0
src/main/resources/config/beta/application-beta.yml

@@ -53,6 +53,7 @@ caimei:
   coreServer: https://core-b.caimei365.com
   imageDomain: https://img-b.caimei365.com
   wwwDomain: https://www-b.caimei365.com
+  destPath: /mnt/newdatadrive/data/runtime/h5-instance/static/www
 
 #DFS配置
 fdfs:

+ 2 - 4
src/main/resources/config/dev/application-dev.yml

@@ -58,11 +58,9 @@ caimei:
   coreServer: https://core-b.caimei365.com
 #  coreServer: http://192.168.2.75:18002
   imageDomain: https://img-b.caimei365.com
-  wwwDomain: https://www-b.caimei365.com
+  wwwDomain: http:localhost:8009
+  destPath: D:/_PLAN_WORKSPACE/test/static
 
-#    spiServer: https://spi.caimei365.com
-#    imageDomain: https://img.caimei365.com
-#    wwwDomain: https://www.caimei365.com
 
 #DFS配置
 fdfs:

+ 1 - 0
src/main/resources/config/prod/application-prod.yml

@@ -53,6 +53,7 @@ caimei:
   coreServer: https://core.caimei365.com
   imageDomain: https://img.caimei365.com
   wwwDomain: https://www.caimei365.com
+  destPath: /mnt/newdatadrive/data/runtime/h5-instance/static/www
 
 
 #DFS配置

+ 9 - 2
src/main/resources/mapper/BaseMapper.xml

@@ -12,11 +12,12 @@
             navigationName as name,
             type,
             link,
+            icon,
             sort
 		from new_page_first_navigation
 		where wwwEnabledStatus='1' and delFlag = 0
-		order by sort desc,createDate desc
-		limit 7
+		order by sort asc,createDate desc
+		limit 8
     </select>
     <select id="getSubMenus" resultType="com.caimei.www.pojo.page.SubMenu">
 		select
@@ -52,4 +53,10 @@
 		from new_page_friendship_link
 		where delFlag = 0 order by id
     </select>
+    <select id="getHomeBanners" resultType="com.caimei.www.pojo.page.ImageLink">
+		select id, title, link, image
+		from new_page_homeimage
+		where wwwEnabledStatus = 1
+		order by sort desc, createDate desc
+    </select>
 </mapper>

+ 1 - 0
src/main/resources/static/css/base/base.h5.css

@@ -217,6 +217,7 @@
 .priceTag .promotion .more{color:#f55c5c;text-decoration:underline;float:right;}
 /* loading */
 .loading{box-sizing:border-box;padding:20vw 0;text-align:center;}
+.loading.home{position:fixed;z-index:9999;width:100%;height:100%;background:#FFF;}
 .empty{box-sizing:border-box;padding:15vw 0;text-align:center;color:#4A4F58;line-height:8vw;font-size:3.4vw;}
 .empty img{width:40vw;height:40vw;}
 .empty a{color:#E15616;}

+ 1 - 0
src/main/resources/static/css/base/base.pc.css

@@ -343,6 +343,7 @@ iframe{width:320px !important;height: 280px !important}
 .priceTag .promotion .more{color:#f55c5c;text-decoration:underline;float:right;}
 /* 加载  */
 .loading{box-sizing:border-box;padding:200px 0;text-align:center;}
+.loading.home{position:fixed;z-index:9999;width:100%;height:100%;background:#FFF;}
 .empty{box-sizing:border-box;padding:100px 0;text-align:center;color:#4A4F58;line-height:30px;font-size:16px;}
 .empty img{width:180px;height:180px;}
 .empty a{color:#E15616;}

+ 5 - 0
src/main/resources/static/js/account/register-supplier.js

@@ -81,6 +81,11 @@ var registerPage = new Vue({
                     CAIMEI.dialog('两次密码输入不一致',false,function () {});
                     return;
                 }
+                if(_self.supplierUser.townId == ''){
+                    $('#cProvince').parent().addClass("error");
+                    $('#cProvince').siblings('.errTips').text('请选择省市区').addClass("show");
+                    return;
+                }
                 if(!_self.supplierUser.businessLicense){
                     $('#formbusinessLicenseImage').parent().addClass("error").find('.checked').removeClass("show");
                     $('#formbusinessLicenseImage').siblings('.errTips').text('请上传营业执照图片').addClass("show");

+ 19 - 15
src/main/resources/static/js/base.js

@@ -49,7 +49,7 @@ var globalHead = new Vue({
         shopId:'',
         userIdentity:'',
         articleType: '',
-        topMenuList:[],
+        // topMenuList:[],
         isFiexd:false,
         TabList:[
             {name:'产品',link:'/product/instrument.html',value:'1'},
@@ -63,16 +63,16 @@ var globalHead = new Vue({
         changeline:function(tab){
             this.currenIndex=tab.value;
         },
-        GetNavigationMenu :function(){//获取顶部导航分类
-            var _self = this;
-            PublicApi.GetNavigationMenu({source:1},function(response){
-                if(response.code == 0){
-                    _self.topMenuList = response.data.topMenuList;
-                }else{
-                    CAIMEI.Alert(response.msg, '确定');
-                }
-            });
-        },
+        // GetNavigationMenu :function(){//获取顶部导航分类
+        //     var _self = this;
+        //     PublicApi.GetNavigationMenu({source:1},function(response){
+        //         if(response.code == 0){
+        //             _self.topMenuList = response.data.topMenuList;
+        //         }else{
+        //             CAIMEI.Alert(response.msg, '确定');
+        //         }
+        //     });
+        // },
         GetProductClassify: function(index) { // 导航分类菜单
             var _self = this;
             PublicApi.GetProductClassify({typeSort:index,source :'www'},function(response){
@@ -191,14 +191,18 @@ var globalHead = new Vue({
         // 导航分类数据
         this.GetProductClassify(1);
         this.GetProductClassify(2);
-        this.GetNavigationMenu();
+        // this.GetNavigationMenu();
         // 判断登录状态
         if (globalUserData.token) {
             this.loginStatus = true;
             this.userData = globalUserData;
-            if(this.userData.userId){
+            var userId = this.userData.userId;
+            if(userId){
+                var _self = this;
                 // 获取头部购物车数据
-                this.getHeadCart(this.userData.userId);
+                setTimeout(function(){
+                    _self.getHeadCart(userId);
+                }, 1000);
             }
         }
         // 信息中心
@@ -207,7 +211,7 @@ var globalHead = new Vue({
     mounted:function(){
         var _self = this;
         var userData = JSON.parse(window.localStorage.getItem('userInfo'));
-        if(userData!=null){
+        if(userData!=null) {
             this.userIdentity = userData.userIdentity;
             this.shopId = userData.shopId;
         }

+ 4 - 0
src/main/resources/static/js/common/serviceapi/utils.service.js

@@ -8,6 +8,10 @@ var PublicApi = {
             Http.uploadImage({ url:'/formData/MultiPictareaddData',data:params},callback)
         },
         GetHomeData:function(params,callback){ //首页数据
+            // Http.AjaxService({ url:'/home/data', type:'get', data:params, json:false})
+            //     .then(function(res){
+            //         callback(res)
+            //     });
             Http.AjaxService({
                 url:'/commodity/home/floor',
                 type:'get',

+ 3 - 0
src/main/resources/static/js/flea-market/list.js

@@ -160,6 +160,9 @@ var fleaMarketList = new Vue({
      mounted:function () {
           var _this = this;
           _this.gettabList();
+         setTimeout(function(){  // 图片懒加载
+             $("img[data-original]").lazyload();
+         },500);
           if(!isPC){
             $('footer').addClass("noneImportant");
             //移动端上垃加载更多

+ 6 - 4
src/main/resources/static/js/flea-market/secondDetail.js

@@ -63,10 +63,12 @@ var fleaMarket = new Vue({
            }else {
                 _this.isRequest =false;
            }
-             _this.detail = res.data;
-             _this.previewThumb =  res.data.imageList;
-             _this.previewBigimage =res.data.imageList[0];
-
+                _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;

+ 87 - 75
src/main/resources/static/js/index.js

@@ -14,7 +14,7 @@ var homeData = new Vue({
         supplierImage:'',//供应商banner
         supplierWwwLink:'',//供应商banner 链接
         supplierList:[],//供应商列表
-        topMenuList:[],
+        // topMenuList:[],
         showflag:false,
     },
     filters: {
@@ -49,7 +49,6 @@ var homeData = new Vue({
         },
     },
     methods: {
-
         zhuanti:function(){
             this.showflag=false;
             window.location.href='/activity/activityTopic.html?id=306&name=美博会';
@@ -62,18 +61,18 @@ var homeData = new Vue({
               localStorage.setItem('lockTime',Date.now());
               localStorage.setItem('isActivityStatus',true);
         },
-        GetBanners: function(){
-            var _self = this;
-            PublicApi.GetHomeBanner({},function(response){
-                if(response.code == 0){
-                    _self.images = response.data;
-                    _self.listLoading =false;
-                    _self.SwiperBanner();
-                }else{
-                    CAIMEI.Alert(response.msg, '确定');
-                }
-            });
-        },
+        // GetBanners: function(){
+        //     var _self = this;
+        //     PublicApi.GetHomeBanner({},function(response){
+        //         if(response.code == 0){
+        //             _self.images = response.data;
+        //             _self.listLoading =false;
+        //             _self.SwiperBanner();
+        //         }else{
+        //             CAIMEI.Alert(response.msg, '确定');
+        //         }
+        //     });
+        // },
         SwiperBanner: function(){
             setTimeout(function(){
                 if (isPC) {
@@ -107,72 +106,84 @@ var homeData = new Vue({
                 }
             },300);
         },
-        GetNavigationMenu :function(){//获取顶部导航分类
+        // GetNavigationMenu :function(){//获取顶部导航分类
+        //     var _self = this;
+        //     PublicApi.GetNavigationMenu({source:1},function(response){
+        //         if(response.code == 0){
+        //             _self.topMenuList = response.data.topMenuList;
+        //         }else{
+        //             CAIMEI.Alert(response.msg, '确定');
+        //         }
+        //     });
+        // },
+        GetHomeFloorData: function(){
             var _self = this;
-            PublicApi.GetNavigationMenu({source:1},function(response){
-                if(response.code == 0){
-                    _self.topMenuList = response.data.topMenuList;
-                }else{
-                    CAIMEI.Alert(response.msg, '确定');
-                }
-            });
+            // 预设静态数据
+            var staticJson = $("#floorJson").val();
+            if (staticJson) {
+                var staticData = JSON.parse(staticJson);
+                _self.setFloorData(staticData);
+            }
+            // 如果没有静态数据(重新请求) 或 用户登录(重新请求获取价格)
+            if (!staticJson || GLOBAL_USER_ID>0){
+                PublicApi.GetHomeData({userId:GLOBAL_USER_ID,source:1},function(response){
+                    if(response.code == 0){
+                        var data = response.data;
+                        _self.setFloorData(data);
+                    }else{
+                        CAIMEI.Alert(response.msg, '确定');
+                    }
+                });
+            }
         },
-        GetHomeFloorData: function(){
+        setFloorData: function(data){
             var _self = this;
-            PublicApi.GetHomeData({userId:GLOBAL_USER_ID,source:1},function(response){
-                if(response.code == 0){
-                    var data = response.data;
-                    // var floorList = [];
-                    _self.pageList = data.homePageFloor;
-                    _self.liveList = data.liveList;
-                    _self.supplierList = data.supplierImage.qualitySupplierList;
-                    _self.supplierImage = data.supplierImage.wwwImage;
-                    _self.supplierWwwLink = data.supplierImage.wwwLink;
-                    _self.pageList.forEach(function(page){
-                        if(page.floorContent){
-                            if(isPC){
-
-                                if(page.floorContent.templateType == '1' || page.floorContent.templateType == '3'){
-                                    if (page.floorImageList.length>7){
-                                        page.isPageMore = true;
-                                    }
-                                }else if(page.floorContent.templateType == '2' || page.floorContent.templateType == '4' || page.floorContent.templateType == '7'){
-                                    if (page.floorImageList.length>5){
-                                        page.isPageMore = true;
-                                    }
-                                }else if(page.floorContent.templateType == '5'){
-                                    if (page.floorImageList.length>10){
-                                        page.isPageMore = true;
-                                    }
-                                }
-                            }else{
-                                if(page.floorContent.templateType == '1' || page.floorContent.templateType == '3'){
-                                    if (page.floorImageList.length>3){
-                                        page.isPageMore = true;
-                                    }
-                                }else if(page.floorContent.templateType == '2' || page.floorContent.templateType == '4'){
-                                    if (page.floorImageList.length>2){
-                                        page.isPageMore = true;
-                                    }
-                                }else if(page.floorContent.templateType == '5'){
-                                    if (page.floorImageList.length>4){
-                                        page.isPageMore = true;
-                                    }
-                                }
+            _self.listLoading = false;
+            _self.pageList = data.homePageFloor;
+            // _self.liveList = data.liveList;
+            _self.supplierList = data.supplierImage.qualitySupplierList;
+            _self.supplierImage = data.supplierImage.wwwImage;
+            _self.supplierWwwLink = data.supplierImage.wwwLink;
+            _self.pageList.forEach(function(page){
+                if(page.floorContent){
+                    if(isPC){
+                        if(page.floorContent.templateType == '1' || page.floorContent.templateType == '3'){
+                            if (page.floorImageList.length>7){
+                                page.isPageMore = true;
+                            }
+                        }else if(page.floorContent.templateType == '2' || page.floorContent.templateType == '4' || page.floorContent.templateType == '7'){
+                            if (page.floorImageList.length>5){
+                                page.isPageMore = true;
+                            }
+                        }else if(page.floorContent.templateType == '5'){
+                            if (page.floorImageList.length>10){
+                                page.isPageMore = true;
                             }
                         }
-                    });
-                    console.log(_self.pageList)
-                    _self.GetHomeRightData();
-                    setTimeout(function() {
-                        // 设置侧边导航数据
-                        _self.SetAsideNav();
-                        _self.SwiperFloor();
-                    },500);
-                }else{
-                    CAIMEI.Alert(response.msg, '确定');
+                    }else{
+                        if(page.floorContent.templateType == '1' || page.floorContent.templateType == '3'){
+                            if (page.floorImageList.length>3){
+                                page.isPageMore = true;
+                            }
+                        }else if(page.floorContent.templateType == '2' || page.floorContent.templateType == '4'){
+                            if (page.floorImageList.length>2){
+                                page.isPageMore = true;
+                            }
+                        }else if(page.floorContent.templateType == '5'){
+                            if (page.floorImageList.length>4){
+                                page.isPageMore = true;
+                            }
+                        }
+                    }
                 }
             });
+            _self.GetHomeRightData();
+            setTimeout(function() {
+                // 设置侧边导航数据
+                _self.SetAsideNav();
+                _self.SwiperFloor();
+            },500);
+            console.log(_self.pageList)
         },
         GetHomeRightData: function(){
             var _self = this;
@@ -211,6 +222,7 @@ var homeData = new Vue({
         SetAsideNav: function(){
             var _self = this;
             var titArr = $('.section_page_title').find('h1');
+            _self.asideNav = [];
             for (var i=0; i<titArr.length; i++){
                 _self.asideNav.push({
                     id: $(titArr[i]).attr("data-id"),
@@ -280,8 +292,8 @@ var homeData = new Vue({
         if(userInfo){
             this.userId = JSON.parse(userInfo).userId;
         }
-        this.GetBanners();
-        this.GetNavigationMenu();
+        this.SwiperBanner();
+        // this.GetNavigationMenu();
         this.GetHomeFloorData();
     },
     mounted: function() {

+ 44 - 20
src/main/resources/static/js/pay/caimei-weisapay.js

@@ -1,6 +1,9 @@
 /**
  *Created by ZHJY on 2020/7/14.
  */
+// var _WS_SERVICE = 'http://192.168.2.67:8010'; //维沙网银支付本地联调
+// var _WS_SERVICE = 'https://mall2b-b.caimei365.com';//维沙网银支付测试联调
+var _WS_SERVICE = 'https://mall2b.caimei365.com';//维沙网银支付正式联调
 var payContainer = new Vue({
     el:"#payContainer",
     data: {
@@ -114,8 +117,7 @@ var payContainer = new Vue({
     methods: {
         LinkInfoOrderBank:function(linkLogo){//初始化支付订单加密数据
             var _self = this;
-            PayApi.PayOrderLinkData({linkLogo:linkLogo},function(response){
-                console.log(response);
+            $.getJSON(_WS_SERVICE+"/PayOrder/linkData",{ linkLogo: linkLogo }).done(function (response) {
                 if(response.code === 0){
                     var _data = response.data;
                     _self.payInfo.PAY_ORDERID = _data.orderPayLink.orderId;
@@ -132,18 +134,18 @@ var payContainer = new Vue({
                     }else{
                         _self.isErrorShow = true;
                         _self.isRequest = true;
-                        switch (_self.payInfo.PAY_CODE) {
-                            case '-2':
+                        switch (_data.code) {
+                            case -2:
                                 _self.iconErrorClass = 'offline';
                                 _self.iconErrorText = '订单已通过线下转账方式付款';
                                 _self.iconErrorMsgnone = '不能再使用企业网银支付';
                                 break;
-                            case '-3':
+                            case -3:
                                 _self.iconErrorClass = 'fail';
                                 _self.iconErrorText = '链接超过24小时未完成支付,已失效';
                                 _self.iconErrorMsgnone = '请重新生成支付链接,继续支付';
                                 break;
-                            case '5':
+                            case 5:
                                 _self.iconErrorClass = 'paid';
                                 _self.iconErrorText = '款项已支付完成,无需重复支付';
                                 _self.iconErrorMsgnone = '';
@@ -160,10 +162,13 @@ var payContainer = new Vue({
                     CAIMEI.Alert(response.msg,'确定',false);
                 }
             });
+            // PayApi.PayOrderLinkData({linkLogo:linkLogo},function(response){
+
+            // });
         },
         infoPayOrderCheckoutCounter:function(){//初始化订单数据
             var _self = this;
-            PayApi.PayOrderCheckoutCounter({orderId:_self.payInfo.PAY_ORDERID},function(response){
+            $.getJSON(_WS_SERVICE+"/PayOrder/checkoutCounter",{ orderId:_self.payInfo.PAY_ORDERID }).done(function (response) {
                 if(response.code === 0){
                     var data = response.data;
                     _self.discernReceiptList = data.discernReceipt;
@@ -185,7 +190,10 @@ var payContainer = new Vue({
                 }else{
                     CAIMEI.Alert(response.msg,'确定',false);
                 }
-            })
+            });
+            // PayApi.PayOrderCheckoutCounter({orderId:_self.payInfo.PAY_ORDERID},function(response){
+
+            // })
         },
         PaySubmitFn:function(){//立即支付
             var _self = this;
@@ -206,22 +214,39 @@ var payContainer = new Vue({
         PayOrderPcMallPay:function(params){//网银支付请求
             var _self = this;
             _self.isSubMitStatus=true;
-            PayApi.PayOrderPcMallPay(params,function(response){
-                if(response.code == 0){
-                    _self.isPayAlert = true;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    window.open(response.data.data.payUrl);
-                    _self.isSubMitStatus=false;
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                    _self.isSubMitStatus=false;
+            $.ajax({
+                type: 'post',
+                url: _WS_SERVICE+'/PayOrder/pcMallPay',
+                xhrFields: {
+                    withCredentials: true
+                },
+                data: JSON.stringify(params),
+                headers:{
+                    'Content-Type':'application/json;charset=UTF-8',
+                },
+                success : function (response) {
+                    if(response.code == 0){
+                        _self.isPayAlert = true;
+                        _self.mbOrderId = response.data.data.mbOrderId;
+                        window.open(response.data.data.payUrl);
+                        _self.isSubMitStatus=false;
+                    }else{
+                        CAIMEI.Alert(response.msg,'确定',false);
+                        _self.isSubMitStatus=false;
+                    }
+                },
+                error : function (res) {
+
                 }
-            })
+            });
+            // PayApi.PayOrderPcMallPay(params,function(response){
+
+            // })
         },
         RefreshBody:function(){//刷新弹窗
             var _self = this;
             _self.isPayAlert = false;
-            PayApi.PayOrderFindOrderStatus({mbOrderId:_self.mbOrderId},function(response){
+            $.getJSON(_WS_SERVICE+"/PayOrder/findOrderStatus",{ mbOrderId:_self.mbOrderId }).done(function (response) {
                 _self.isPayAlert = false;
                 var data = response.data.data;
                 if(data.status === '1'){
@@ -306,6 +331,5 @@ var payContainer = new Vue({
         var _self = this;
         _self.payInfo.PAY_LINKLOGO= CAIMEI.getUrlParam('linkLogo');
         _self.LinkInfoOrderBank(_self.payInfo.PAY_LINKLOGO);
-
     }
 });

+ 15 - 15
src/main/resources/static/js/supplier-center/setting/information.js

@@ -17,10 +17,10 @@
             linkMan:'',//联系人
             contractEmail:'',//
             contractPhone:'',//固定电话
-            fax:'',//传真
+            faxNumber:'',//传真
             legalPerson:'',//法人代表
             registeredCapital:'',//注册资本
-            nature:'',//公司性质
+            companyNature:'',//公司性质
             turnover:'',//年营业额
         },
         form:{
@@ -46,7 +46,7 @@
             socialCreditCode:'',//营业执照编号
             businessLicense:'',//营业执照
             logo:'',//公司logo
-            productionLicence:'',//生产
+            operationLicence:'',//生产
             hygienicLicense:'',//卫生
             taxLicense:'',//税务
             honorCertification:'',//荣誉
@@ -121,25 +121,25 @@
     },
          shopInfo:function(){
             var _this = this;
-            console.log()
              SupplierApi.shopInfo({userId:_this.params.userId},function(res){
                 if(res.code==0){
+                    console.log('asda-=======',res.data);
                     _this.isRequset=false;
                     var shop = res.data.shop;
                     var user = res.data.user;
                     _this.params.name = shop.name;
                     _this.params.shortName = shop.shortName;
                     _this.params.linkMan = shop.linkMan;
-                    _this.params.contractEmail = user.contractEmail;
+                    _this.params.contractEmail = shop.contractEmail;
                     _this.params.address = shop.provincialAddress;
                     _this.params.provinceId = shop.provinceId;
                     _this.params.cityId = shop.cityId;
                     _this.params.townId = shop.townId;
                     _this.params.contractPhone = shop.contractPhone;
-                    _this.params.fax = shop.fax;
+                    _this.params.faxNumber = shop.faxNumber;
                     _this.params.legalPerson = shop.legalPerson;
                     _this.params.registeredCapital = shop.registeredCapital;
-                    _this.params.nature = shop.nature;
+                    _this.params.companyNature = shop.companyNature;
                     _this.params.turnover = shop.turnover;
                     // _this.shopMainPros = _this.setNewMainpro(shop.mainpro);
                     // _this.shopScope = _this.setNewScope(shop.businessScope);
@@ -154,7 +154,7 @@
                     _this.params3.socialCreditCode = shop.socialCreditCode;
                     _this.params3.businessLicense = shop.businessLicense;
                     _this.params3.logo = shop.logo;
-                    _this.params3.productionLicence = shop.productionLicence;
+                    _this.params3.operationLicence = shop.operationLicence;
                     _this.params3.hygienicLicense = shop.hygienicLicense;
                     _this.params3.taxLicense = shop.taxLicense;
                     _this.params3.honorCertification = shop.honorCertification;
@@ -228,17 +228,17 @@
                         return false;
                     }
                 }
-              SupplierApi.modifiedData(params,function (res) {
-                     console.log(res)
-                      if(res.code === 0){
+            params = Object.assign(_self.params,_self.params2,_self.params3);
+            SupplierApi.modifiedData(params,function (res) {
+                  if(res.code === 0){
                         CAIMEI.dialog('修改成功',true,function () {
                             window.location.href='/supplier/dashboard.html';
                             _self.loginLoading = false;
                         });
-                    } else {
+                  } else {
                         CAIMEI.Alert(res.msg,'确定',false);
                         _self.loginLoading = false;
-                    }
+                  }
                 })
             })
          },
@@ -308,7 +308,7 @@
             var file = inputDOM.files;
             _this.formData.append('file', file[0]);
             PublicApi.uploadimg(_this.formData,function(response){
-                _this.params3.productionLicence = response.data;
+                _this.params3.operationLicence = response.data;
                 event.target.value = '';
             });
         },
@@ -361,7 +361,7 @@
             this.params3.hygienicLicense = '';
         },
         deleteproducImage:function(){//删除生产
-            this.params3.productionLicence = '';
+            this.params3.operationLicence = '';
         },
          deletelogoImage:function(){//删除logo图片
             this.params3.logo = '';

+ 7 - 5
src/main/resources/templates/account/register-supplier.html

@@ -100,9 +100,12 @@
                             <option value="">请选择</option>
                             <option v-for="(item ,index) in townArray" :key="index" :value="item.townID"  >{{item.name}}</option>
                         </select>
-                        <textarea placeholder="请输入您的详细联系地址"  v-model="supplierUser.address" @blur="blurHandle($event)" needverify></textarea>
+                        <span class="errTips icon mIcon"></span>
+                    </div>
+                    <div class="formLine">
+                        <textarea placeholder="请输入您的详细联系地址"  v-model="supplierUser.address" @blur="blurHandle($event)" style="margin-top: 0;" needverify></textarea>
                         <i class="checked icon mIcon"></i>
-                        <span class="errTips icon mIcon" tips="请输入正确的联系地址"></span>
+                        <span class="errTips icon mIcon" tips="请输入的联系地址"></span>
                     </div>
                     <div class="formLine">
                         <p><em>*</em>营业执照编号:</p>
@@ -153,9 +156,8 @@
                     </div>
                     <div class="formLine">
                         <p>官网地址:</p>
-                        <input type="text" v-model="supplierUser.website" placeholder="请输入网址" maxlength="100" id="website"  @blur="blurHandle($event)">
-                        <i class="checked icon mIcon"></i>
-                        <span class="errTips icon mIcon" tips="请输入正确的公司名称"></span>
+                        <input type="text" v-model="supplierUser.website" placeholder="请输入网址" maxlength="100" id="website">
+                        <span class="errTips icon mIcon"></span>
                     </div>
                     <div class="formLine">
                         <p>微信公众号:</p>

+ 1 - 2
src/main/resources/templates/account/supplier-information.html

@@ -109,8 +109,7 @@
                     </div>
                     <div class="formLine">
                         <p>官网地址:</p>
-                        <input type="text" v-model="supplierUser.website" placeholder="请输入网址" maxlength="100" id="website" @blur="blurHandle($event)">
-                        <i class="checked icon mIcon"></i>
+                        <input type="text" v-model="supplierUser.website" placeholder="请输入网址" maxlength="100" id="website">
                         <span class="errTips icon mIcon" tips="请输入网址"></span>
                     </div>
                     <div class="formLine">

+ 2 - 2
src/main/resources/templates/components/header.html

@@ -114,8 +114,8 @@
                 <div class="navBox">
                     <ul class="clear">
                         <!--导航菜单-->
-                        <li v-for="(menu,index) in topMenuList">
-                            <a class="nav" :href="menu.link" v-text="menu.name" target="_blank"></a>
+                        <li th:each="menu: ${topMenuList}">
+                            <a class="nav" th:href="${menu.link}" th:text="${menu.name}" target="_blank"></a>
                         </li>
                     </ul>
                 </div>

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

@@ -17,13 +17,13 @@
         <div class="preview-header clearfix">
             <div class="preview-banner clearfix" id="imgShown" >
                 <div class="preview-banner-big bigImage" v-if="isPC">
-                    <img class="preview-img" :src="previewBigimage" >
+                    <img class="preview-img" src="/img/base/placeholder.png" :data-original="previewBigimage" >
                     <span class="mask"></span>
                 </div>
                 <div class="preview-banner-small" id="CM____pic_thumb" v-if="isPC">
                     <ul class="preview-thumb-ul">
                         <li class="item" v-for="(item, index) in previewThumb"  :class="current==index?'addImg':''" :key="index" :data-src="item" @click="ImgList(item,index)">
-                            <img :src="item">
+                            <img src="/img/base/placeholder.png" :data-original ="item">
                         </li>
                     </ul>
                 </div>
@@ -80,11 +80,11 @@
                     </div>
                     <div class="info " v-if="HandType">
                        <span class="label" style="width: 84px">产品到期日:</span>
-                        <p>{{detail.maturityYears}}</p>
+                        <p>{{ detail.maturityYears ? detail.maturityYears : '暂无' }}</p>
                     </div>
                     <div class="info bind">
                        <span class="label">分&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类:</span>
-                        <p>{{detail.typeStr}}</p>
+                        <p>{{ detail.typeStr ? detail.typeStr : '暂无' }}</p>
                     </div>
                     <div class="info ">
                        <span class="label">所&nbsp;&nbsp;在&nbsp;&nbsp;地:</span>
@@ -96,15 +96,15 @@
                     </div>
                      <div class="info " v-if="detail.showContactFlag==2">
                        <span class="label">联&nbsp;&nbsp;系&nbsp;&nbsp;人:</span>
-                        <p>{{detail.contactName}}</p>
+                        <p>{{ detail.contactName ? detail.contactName : '暂无' }}</p>
                     </div>
                     <div class="info unit" v-if="detail.fixedYears!='' && detail.fixedYears!=null">
                         <span class="label">出厂日期:</span>
-                        <p>{{detail.fixedYears}}</p>
+                        <p>{{detail.fixedYears == 'null' ? '暂无' : detail.fixedYears }}</p>
                     </div>
                     <div class="info unit" v-if="detail.showContactFlag==2">
                         <span class="label">联系方式:</span>
-                        <p>{{detail.contactMobile}}</p>
+                        <p>{{ detail.contactMobile ? detail.contactMobile : '暂无' }}</p>
                     </div>
                     <div class="info price" style="width: 100%" v-if="HandType">
                         <span class="label">库&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存:</span>

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

@@ -64,14 +64,14 @@
                             <span class="infotag sold" v-if="item.sold==1&&item.newAdded==1||item.sold==1&&item.newAdded==0">已售</span>
                             <span class="infotag other" v-if="item.brandID==161&&item.brandName!=''&&item.brandName!=null">{{item.brandName}}</span>
                         </div>
-                        <a class="productname" :href="'/flea-market-'+item.productId+'.html'">
+                        <a class="productname" :href="'/flea-market-'+item.productID+'.html'">
                             {{item.name}}
                         </a>
                         <div class="targetprice">
                             <span v-if="item.detailTalkFlag ==2 && userID==null">价格详聊</span>
                             <span v-else-if="userID==null" class="priceparam" @click="toLogin">登录查看价格></span>
                             <span v-else-if="userID!=null && item.detailTalkFlag==2">价格详聊</span>
-                            <span v-else>¥{{ item.price }}</span>
+                            <span v-else>¥{{item.price1Str}}</span>
                         </div>
                         <div class="shijian">
                             <div>

+ 13 - 9
src/main/resources/templates/index.html

@@ -13,28 +13,32 @@
 <template th:replace="components/header"></template>
 <!-- 首页 -->
 <div id="container">
+    <!-- 首页楼层静态数据 -->
+    <input type="hidden" th:value="${floorJson}" id="floorJson">
     <!--loading-->
-    <div v-if="listLoading" class="loading">
+    <div v-if="listLoading" class="loading home">
         <img src="/img/base/loading.gif">
     </div>
-    <template v-else>
+    <template>
         <!--首页图片轮播-->
         <div id="swiper-container" class="swiper-container">
             <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 class="swiper-slide mfc" th:each="img: ${bannerList}">
+                    <a th:href="${img.link}"><img th:src="${img.image}" th:alt="${img.title}"></a>
                 </li>
             </ul>
-            <div class="swiper-pagination swiper-pagination-banner 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" th:each="img: ${bannerList}"></span></div>
             <a class="swiper-button-prev" href="javascript:void(0)"></a>
             <a class="swiper-button-next" href="javascript:void(0)"></a>
         </div>
         <div class="mNavBox h5Only clear">
             <!--导航菜单-->
-            <a class="nav" :href="menu.link" v-for="(menu,index) in topMenuList">
-                <img class="nav-icon" :src="menu.icon" :alt="menu.name">
-                <p v-text="menu.name"></p>
-            </a>
+            <template th:each="menu: ${topMenuList}">
+                <a class="nav" th:href="${menu.link}">
+                    <img class="nav-icon" th:src="${menu.icon}" th:alt="${menu.name}">
+                    <p th:text="${menu.name}"></p>
+                </a>
+            </template>
         </div>
         <!--首页楼层主体数据-->
         <div class="section_container">

+ 1 - 1
src/main/resources/templates/shopping/cart.html

@@ -97,7 +97,7 @@
                                 <del v-text="'¥'+toFloat(cart.originalPrice)"></del>
                             </template>
                             <template v-else>
-                                <em v-text="'¥'+toFloat(cart.price)"></em>
+                                <em> {{ cart.price | NumFormat }} </em>
                             </template>
                             <!-- 促销活动 -->
                             <div v-if="cart.actStatus==1 && cart.promotions" class="priceTag">

+ 5 - 6
src/main/resources/templates/supplier-center/setting/information.html

@@ -88,7 +88,7 @@
                             </div>
                             <div class="formLine rightTxt">
                                 <p>传真:</p>
-                                <input class="massageBtn"  type="text" v-model.trim="params.fax" placeholder="请输入公司传真号" onkeyup="if(isNaN(value))execCommand('undo')">
+                                <input class="massageBtn"  type="text" v-model.trim="params.faxNumber" placeholder="请输入公司传真号" onkeyup="if(isNaN(value))execCommand('undo')">
                                 <i class="checked icon mIcon"></i>
                                 <span class="errTips"></span>
                             </div>
@@ -106,7 +106,7 @@
                             </div>
                             <div class="formLine">
                                 <p><em>*</em>公司性质:</p>
-                                <input type="text" v-model.trim="params.nature" placeholder="请填写公司性质" :rule="rule.name"  @blur="blurHandle($event)" needverify>
+                                <input type="text" v-model.trim="params.companyNature" placeholder="请填写公司性质" :rule="rule.name"  @blur="blurHandle($event)" needverify>
                                 <i class="checked icon mIcon"></i>
                                 <span class="errTips icon mIcon" tips="请输入公司性质"></span>
                             </div>
@@ -178,8 +178,7 @@
                             </div>
                             <div class="formLine" >
                                 <p>网站地址:</p>
-                                <input  class="massageBtn"  type="text" v-model="params2.website" placeholder="请输入网址" id="website"  @blur="blurHandle($event)">
-                                <i class="checked icon mIcon"></i>
+                                <input  class="massageBtn"  type="text" v-model="params2.website" placeholder="请输入网址" id="website">
                                 <span class="errTips icon mIcon" tips="请输入公司名称"></span>
                             </div>
                             <div class="formLine" >
@@ -251,8 +250,8 @@
                             <div class="formLine clear">
                                 <p><em>*</em>资质认证:</p>
                                 <div class="form-upload" id="zizhiImage">
-                                    <div class="form-upload-image" v-if="params3.productionLicence!='' && params3.productionLicence!=null">
-                                        <img class="upload-img" :src="params3.productionLicence" alt="" id="productionLicence" @click="showViewerImageFn2()">
+                                    <div class="form-upload-image" v-if="params3.operationLicence!='' && params3.operationLicence!=null">
+                                        <img class="upload-img" :src="params3.operationLicence" alt="" id="productionLicence" @click="showViewerImageFn2()">
                                         <i class="icon mIcon" @click="deleteproducImage()"></i>
                                     </div>
                                     <div class="formLine-file" v-else>

+ 3 - 1
src/main/resources/templates/user-center/setting/upgrade.html

@@ -69,8 +69,10 @@
                                 <span class="errTips icon mIcon" tips="" :class="flagshow?'show':''">请输入正确的联系地址</span>
                             </div>
                             <div class="formLine">
-                                <p>营业执照:</p>
+                                <p><em>*</em>营业执照:</p>
                                 <input type="text" v-model.trim="clubUpgradeUser.socialCreditCode" placeholder="请输入统一社会信用代码" maxlength="18">
+                                <i class="checked icon mIcon"></i>
+                                <span class="errTips icon mIcon" tips="请输入统一社会信用代码"></span>
                             </div>
                             <div class="formLine clear">
                                 <div class="form-upload">

+ 0 - 113
src/test/java/com/caimei/www/WwwApplicationTests.java

@@ -1,113 +0,0 @@
-package com.caimei.www;
-
-import lombok.Data;
-import com.alibaba.fastjson.JSONObject;
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.web.client.RestTemplate;
-import reactor.core.publisher.Flux;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-@SpringBootTest
-class WwwApplicationTests {
-
-    @Test
-    void contextLoads() {
-    }
-
-    @Test
-    void test1() {
-
-//        Flux.just("Hello", "World").subscribe(System.out::println);
-//        Flux.fromArray(new Integer[] {1, 2, 3}).subscribe(System.out::println);
-//        Flux.empty().subscribe(System.out::println);
-//        Flux.range(1, 10).subscribe(System.out::println);
-//        Flux.interval(Duration.of(10, ChronoUnit.SECONDS)).subscribe(System.out::println);
-
-//        Flux.generate(sink -> {
-//            sink.next("Hello");
-//            sink.complete();
-//        }).subscribe(System.out::println);
-
-
-//        final Random random = new Random();
-//        Flux.generate(ArrayList::new, (list, sink) -> {
-//            int value = random.nextInt(100);
-//            list.add(value);
-//            sink.next(value);
-//            if (list.size() == 10) {
-//                sink.complete();
-//            }
-//            return list;
-//        }).subscribe(System.out::println);
-//
-//        Flux.create(sink -> {
-//            for (int i = 0; i < 10; i++) {
-//                sink.next(i);
-//            }
-//            sink.complete();
-//        }).subscribe(System.out::println);
-
-//        Flux.range(1, 100).buffer(20).subscribe(System.out::println);
-//        Flux.range(1, 10).bufferUntil(i -> i % 2 == 0).subscribe(System.out::println);
-//        Flux.range(1, 10).bufferWhile(i -> i % 2 == 0).subscribe(System.out::println);
-
-
-//        List<String> list = Arrays.asList("item1", "item2");
-//        list.forEach(System.out::println);
-
-    }
-
-    @Test
-    void test2(){
-//        List<String> strs = Arrays.asList("1","4","3","2");
-//        // strs.sort((s1,s2) -> s1.compareTo(s2));
-//        strs.sort(String::compareTo);
-//        strs.forEach(System.out::println);
-    }
-//    @Data
-//    private static class Student{
-//        private String name;
-//        private int age;
-//        public Student(String name, int age) {
-//            this.name = name;
-//            this.age = age;
-//        }
-//    }
-
-    @Test
-    void test3(){
-//        List<Student> students = new ArrayList<>(3);
-//        students.add(new Student("路飞", 22));
-//        students.add(new Student("红发", 40));
-//        students.add(new Student("白胡子", 50));
-//
-//        List<Student> list = students.stream()
-//            .filter(stu -> stu.getAge() < 50)
-//            .collect(Collectors.toList());
-//        System.out.println(list);
-//
-//
-//        List<String> names = students.stream().map(Student::getName)
-//                .collect(Collectors.toList());
-//        System.out.println(names);
-    }
-
-    @Test
-    void test4(){
-//        RestTemplate restTemplate = new RestTemplate();
-//        String uri = "https://spi.caimei365.com/search/query/product?keyword=采美";
-//        JSONObject forObject = restTemplate.getForObject(uri, JSONObject.class);
-//        if(forObject != null){
-//            String data = forObject.getString("data");
-//
-//            JSONObject parse = JSONObject.parseObject(data);
-//            Integer total = parse.getInteger("total");
-//
-//            System.out.println(total);
-//        }
-    }
-
-}