22-08-11 진행상황

(。◠ ◠。)·2022년 8월 11일
0

찜기능을 넣었다

사진 수정 전에 찜먼저 넣을줄은..음..

찜을 클릭하면 confirm 창이 뜬다
최종적으로 pick DB에 저장된다.

마이페이지에서 작게 메모를 할수있도록 컬럼을 추가했다.

//찜 누를때
		$("#heart").click(
				function() {
					if ($("#heart").is(":checked")) {
						if (confirm('찜 할까요?') == true) {

							$.ajax({
								url : "InsertPickServlert",
								type : "get",
								dataType : "text",
								data : {
									flag : '1',
									productName : '${product.productName }'
								},
								success : function() {
									$(".heart").attr('style',
											'text-shadow: 0 0 0 #DC143C');
								}
							});

						} else {
							return false;
						}
					} else if (!$("#heart").is(":checked")) {
						if (confirm('찜 에서 뺄까요?') == true) {

							$.ajax({
								url : "InsertPickServlert",
								type : "get",
								dataType : "text",
								data : {
									flag : '2',
									productName : '${product.productName }'
								},
								success : function() {
									$(".heart").attr('style',
											'text-shadow: 0 0 0 #f0f0f0');
								}
							});

						} else {
							return false;
						}
					}
				});

회원일 경우 해당 상품이 찜해져 있는지 확인한다.

찜이면 찜 표시 해줌.

if (nickname != "null") {
			
			//회원일경우만 찜확인
			$.ajax({
						url : "InsertPickServlert",
						type : "get",
						dataType : "text",
						data : {
							flag : '3',
							productName : '${product.productName }'
						},
						success : function(data) {
							if (data != 0) {
								$("#heart").attr('checked', true);
								$(".heart").attr('style',
										'text-shadow: 0 0 0 #DC143C');
							}
						}
					});
		}
profile
화이탱!

0개의 댓글