Browse Source

Merge remote-tracking branch 'origin/developerB' into developerB

zhengjinyi 4 năm trước cách đây
mục cha
commit
0b7e9c1031

+ 14 - 2
src/main/java/com/caimei/www/controller/RedirectController.java

@@ -104,7 +104,6 @@ public class RedirectController {
     public String toFleaMarketForm() {
         return "redirect:/flea-market/form.html";
     }
-
     /**
      * 商品搜索列表
      */
@@ -116,6 +115,19 @@ public class RedirectController {
     public String toSearchProduct2(@RequestParam("keyword") String keyword) {
         return "redirect:/product/list.html?keyword=" + keyword;
     }
-
+	/**
+	 * 旧首页
+	 */
+	@GetMapping("/index.action")
+    public String toIndex() {
+        return "redirect:/index.html";
+    }
+	/**
+	 * 旧注册页
+	 */
+	@GetMapping("/web/login/view/register_new_vip.jsp")
+    public String toRegister() {
+        return "redirect:/register.html";
+    }
 
 }

+ 9 - 0
src/main/java/com/caimei/www/controller/unlimited/ArticleController.java

@@ -154,4 +154,13 @@ public class ArticleController extends BaseController {
         return articleService.articleLike(id, serverWebExchange);
     }
 
+    /**
+     * 文章浏览量增加
+     */
+    @GetMapping("/article/pv")
+    @ResponseBody
+    public JsonModel articlePv(Integer id) {
+        return articleService.articlePv(id);
+    }
+
 }

+ 6 - 0
src/main/java/com/caimei/www/mapper/ArticleDao.java

@@ -91,4 +91,10 @@ public interface ArticleDao {
      * @return
      */
     List<Integer> findLabelIdsByName(@Param("labelTexts") String[] labelTexts);
+
+    /**
+     * 文章浏览量增加
+     * @param infoId
+     */
+    void articlePv(Integer infoId);
 }

+ 7 - 0
src/main/java/com/caimei/www/service/page/ArticleService.java

@@ -65,4 +65,11 @@ public interface ArticleService {
      * @return
      */
     JsonModel articleLike(Integer id, ServerWebExchange serverWebExchange);
+
+    /**
+     * 文章浏览量增加
+     * @param id
+     * @return
+     */
+    JsonModel articlePv(Integer id);
 }

+ 12 - 0
src/main/java/com/caimei/www/service/page/impl/ArticleServiceImpl.java

@@ -164,6 +164,18 @@ public class ArticleServiceImpl implements ArticleService {
         }
     }
 
+    /**
+     * 文章浏览量增加
+     *
+     * @param id
+     * @return
+     */
+    @Override
+    public JsonModel articlePv(Integer id) {
+        articleDao.articlePv(id);
+        return JsonModel.success();
+    }
+
     private String getIp(ServerWebExchange serverWebExchange){
        ServerHttpRequest request = serverWebExchange.getRequest();
         return Objects.requireNonNull(request.getRemoteAddress()).getAddress().toString();

+ 6 - 2
src/main/resources/mapper/ArticleMapper.xml

@@ -89,8 +89,13 @@
 		SET num = num+1
 		WHERE infoId = #{infoId}
 	</update>
+	<update id="articlePv">
+		UPDATE info_praise
+		SET pv = pv+1
+		WHERE infoId = #{infoId}
+	</update>
 
-    <select id="getArticleInfo" resultType="com.caimei.www.pojo.page.Article">
+	<select id="getArticleInfo" resultType="com.caimei.www.pojo.page.Article">
 		SELECT
 		  a.id AS id,
 		  a.title AS title,
@@ -130,5 +135,4 @@
 		order by clickRate desc
 	</select>
 
-
 </mapper>

+ 2 - 0
src/main/resources/static/css/flea-market/form.css

@@ -49,6 +49,7 @@ body{background: #fff}
      #btn-submit {background-color: #e15616;color: #fff;float: right;}
      input[type=checkbox] {margin-right: 10px;}
      select {appearance: none;-moz-appearance: none;-webkit-appearance: none;}
+     .icon.brand:before {width: 25px;height: 25px;background-position: -87px 11px;position: absolute;right: 15px}
      .icon.selected:before {width: 25px;height: 25px;background-position: -87px 11px;position: absolute;right: 15px}
      .icon.province:before {left: 125px;}
      .icon.cCity:before {right: 195px;}
@@ -77,6 +78,7 @@ body{background: #fff}
      .close {position: absolute;right: 0;top: 0;width: 40px;height: 40px;line-height: 40px;text-align: center;cursor: pointer;font-size: 24px;}
      .bjmain .title{width: -webkit-fill-available;color: #627386;padding: 15px;display: inline-block;border: solid 1px #e2e7ef;font-size: 14px}
      .unlogin-label{height: 26px;color:#627386}
+     .release-label{color: #627386}
  }
 
 /*移动端*

+ 9 - 0
src/main/resources/static/js/article/detail.js

@@ -55,5 +55,14 @@ var articleRelated = new Vue({
             "color": "#3a3",
             "text": thisUri
         });
+        // 文章浏览量+1
+        $.get("/article/pv", {id: this.infoId}, function(res){
+            if(res.code === 0){
+                // 更新文章索引
+                $.post(spiServer + "/search/manage/update/article", {aid: _self.infoId}, function(res){
+                    console.log(res.msg);
+                });
+            }
+        });
     }
 });

+ 5 - 1
src/main/resources/static/js/flea-market/list.js

@@ -72,17 +72,21 @@ var fleaMarketList = new Vue({
          handle: function (item) {//一級分类
                var _this = this;
                _this.currentId = item.value;
-               _this.currentID2 = 0;
+               // _this.currentID2 = 0;
                if ( _this.currentId==1){
                _this.mainflag = true;
                }else {
                _this.mainflag=false;
+                _this.currentID2 = 0;
                }
                _this.gettabList();
           },
            handleChild:function(item){ //二级分类
                var _this = this;
                _this.currentID2 = item.value;
+                if (_this.currentID2==item.value){
+                    _this.mainflag=false;
+                }
                _this.gettabList();
           },
            gettabList:function () {

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

@@ -205,7 +205,9 @@ var productList = new Vue({
             } else if (this.params.bid && this.params.bid>0) {
                 this.getListByCategory("bigType", this.params.bid);
             } else {
-                alert("URL参数异常!");
+                alertInfo("URL参数异常!", function(){
+                    window.location.href = "/";
+                });
             }
             // 获取分类
             this.getCategorys();

+ 1 - 1
src/main/resources/templates/product/detail.html

@@ -206,7 +206,7 @@
         <div class="productInfo">
             <div class="tabTit">
                 <span class="on">产品介绍</span>
-                <span v-if="parameters.length>0">相关参数</span>
+                <span th:if="not${#arrays.isEmpty(parameters)}">相关参数</span>
                 <span th:if="not${#strings.isEmpty(product.serviceInfo)}" >服务项目</span>
 <!--                <span>评价</span>-->
             </div>

+ 5 - 3
src/main/resources/templates/supplier/index.html

@@ -177,9 +177,10 @@
                 <div class="part">
                     <div class="title">营业执照</div>
                     <div class="photo">
-                        <a th:href="${supplier.businessLicense}" target="_blank" >
+                        <a th:href="${supplier.businessLicense}" target="_blank" th:if="not${#strings.isEmpty(supplier.businessLicense)}">
                             <img th:src="${supplier.businessLicense}">
                         </a>
+                        <div class="cont" th:if="${#strings.isEmpty(supplier.businessLicense)}">暂无</div>
                     </div>
                 </div>
                 <div class="part" >
@@ -188,15 +189,16 @@
                         <a th:href="${supplier.taxCertificate}" target="_blank" th:if="not${#strings.isEmpty(supplier.taxCertificate)}">
                             <img th:src="${supplier.taxCertificate}">
                         </a>
-                         <div th:if="${#strings.isEmpty(supplier.taxCertificate)}">暂无</div>
+                         <div class="cont" th:if="${#strings.isEmpty(supplier.taxCertificate)}">暂无</div>
                     </div>
                 </div>
                 <div class="part" >
                     <div class="title">授权牌照</div>
                     <div class="photo">
-                        <a th:href="${supplier.license}" target="_blank">
+                        <a th:href="${supplier.license}" target="_blank" th:if="not${#strings.isEmpty(supplier.license)}">
                             <img th:src="${supplier.license}">
                         </a>
+                        <div class="cont" th:if="${#strings.isEmpty(supplier.license)}">暂无</div>
                     </div>
                 </div>
             </div>