Explorar el Código

리뷰 별점 수정

sowon4187 hace 5 años
padre
commit
62bda1f323

+ 4 - 4
src/main/webapp/WEB-INF/views/mob/mypage/MypageReviewCreateFormMob.html

@@ -303,7 +303,7 @@ let reviewAttach = [[${alreadyReviewAttach}]];
 
 //별점 class="on"
 var $starEls = $('#star_grade button#starBtn');
-var rate = 0;
+var rate = 1;
 
 $starEls.each(function (index, el) {
     $(el).on('click', function () {
@@ -322,7 +322,7 @@ function rating(score) {
         }
     });
 
-    rate = score + 1;
+    rate = score;
 }
 
 // 리뷰  취소
@@ -492,9 +492,9 @@ $(function(){
 	}
 	
 	 if(reviewStat=='u'){
-		 var reviewScore = reviewList.score-1;
+		 var reviewScore = reviewList.score;
 		 $("#score").val(reviewScore);
-		 rating(reviewScore);
+		 rating(reviewScore-1);
 		$("#reviewForm input[name=height]").val(reviewList.height);
 		$("#reviewForm input[name=weight]").val(reviewList.weight);
 		$("#reviewForm textarea[name=reviewContent]").val(reviewList.reviewContent.escapeHtml());

+ 4 - 4
src/main/webapp/WEB-INF/views/web/mypage/MypageReviewCreateFormWeb.html

@@ -385,7 +385,7 @@ let reviewAttach = [[${alreadyReviewAttach}]];
 
 // 별점 class="on"
 var $starEls = $('#star button#starBtn');
-var rate = 0;
+var rate = 1;
 
 $starEls.each(function (index, el) {
     $(el).on('click', function () {
@@ -403,7 +403,7 @@ function rating(score) {
         }
     });
 
-    rate = score + 1;
+    rate = score;
 }
 
 // 리뷰  취소
@@ -637,9 +637,9 @@ $(document).ready(function() {
 	}
 	
 	 if(reviewStat=='u'){
-		 var reviewScore = reviewList.score-1;
+		 var reviewScore = reviewList.score;
 		 $("#score").val(reviewScore);
-		 rating(reviewScore);
+		 rating(reviewScore-1);
 		$("#reviewForm input[name=height]").val(reviewList.height);
 		$("#reviewForm input[name=weight]").val(reviewList.weight);
 		$("#reviewForm textarea[name=reviewContent]").val(reviewList.reviewContent.escapeHtml());