Skip to content

Commit fd439cb

Browse files
committed
第一次更新
1 parent 71e3eb4 commit fd439cb

File tree

7 files changed

+82
-541
lines changed

7 files changed

+82
-541
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# ordersystem
2+
### 别问,问就是瞎写的

src/main/java/com/orderSystem/provider/productMapperProvider.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public String innitProductListBox(Page<Product> page, Product product) {
1919
LEFT_OUTER_JOIN("t_product_tag c ON a.productTagId = c.productTagId");
2020
if (Optional.ofNullable(product.getCategoryId()).isPresent()) {
2121
if (product.getCategoryId() > 0) {
22-
WHERE("a.categoryId = #{categoryId}");
22+
WHERE("a.categoryId = #{product.categoryId}");
2323
}
2424
}
2525
if (Optional.ofNullable(product.getSubCategoryId()).isPresent()) {
2626
if (product.getSubCategoryId() > 0) {
27-
WHERE("subCategoryId = #{subCategoryId}");
27+
WHERE("subCategoryId = #{product.subCategoryId}");
2828
}
2929
}
3030
ORDER_BY("createTime desc");
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
spring.profiles.active=dev
1+
spring.profiles.active=prod

src/main/resources/templates/buyMore/about.ftl

-504
This file was deleted.

src/main/resources/templates/buyMore/about.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
</ul>
9999
</li>
100100
<li><a href="faq.html">FAQ</a></li>
101-
<li class="active"><a href="about.html">About</a></li>
101+
<li class="active"><a href="about.ftl">About</a></li>
102102
<li><a href="contact.html">Contact</a></li>
103103
</ul>
104104
<div class="nav-search">

src/main/resources/templates/buyMore/product-grid.html

+69-30
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,21 @@ <h3 class="panel-title">分类</h3>
8989
<!-- </ul> -->
9090
<!-- 6y </div>-->
9191
<!-- </div>-->
92-
<!-- &lt;!&ndash; Manufatues widget &ndash;&gt;-->
93-
<!-- <div class="panel manufatue widget panel-default">-->
94-
<!-- <div class="panel-heading">-->
95-
<!-- <h3 class="panel-title">品牌</h3>-->
96-
<!-- </div>-->
97-
<!-- <div class="panel-body">-->
98-
<!-- <ul class="category-list">-->
99-
<!-- <li><i class="side-icon pull-right active">15</i>Gucci</li>-->
100-
<!-- <li><i class="side-icon pull-right active">37</i>Asos</li>-->
101-
<!-- <li><i class="side-icon pull-right active">50</i>Blubery</li>-->
102-
<!-- <li><i class="side-icon pull-right active">78</i>H&M</li>-->
103-
<!-- <li><i class="side-icon pull-right active">94</i>Tesco</li>-->
104-
<!-- </ul>-->
105-
<!-- </div>-->
106-
<!-- </div>-->
92+
<!-- &lt;!&ndash; Manufatues widget &ndash;&gt;-->
93+
<!-- <div class="panel manufatue widget panel-default">-->
94+
<!-- <div class="panel-heading">-->
95+
<!-- <h3 class="panel-title">品牌</h3>-->
96+
<!-- </div>-->
97+
<!-- <div class="panel-body">-->
98+
<!-- <ul class="category-list">-->
99+
<!-- <li><i class="side-icon pull-right active">15</i>Gucci</li>-->
100+
<!-- <li><i class="side-icon pull-right active">37</i>Asos</li>-->
101+
<!-- <li><i class="side-icon pull-right active">50</i>Blubery</li>-->
102+
<!-- <li><i class="side-icon pull-right active">78</i>H&M</li>-->
103+
<!-- <li><i class="side-icon pull-right active">94</i>Tesco</li>-->
104+
<!-- </ul>-->
105+
<!-- </div>-->
106+
<!-- </div>-->
107107
<!-- On Sale widget -->
108108
<div class="panel widget panel-default">
109109
<div class="panel-heading">
@@ -133,15 +133,18 @@ <h3 class="panel-title">限时折扣</h3>
133133
<div class="row">
134134
<div class="ad-3">
135135
<div class="col-md-12 col-sm-12 col-xs-12">
136-
<div><img class="img-responsive ad-3" src="/res/buy_more/images/banner2.jpg" alt=""/></div>
136+
<div><img class="img-responsive ad-3" src="/res/buy_more/images/banner2.jpg" alt=""/>
137+
</div>
137138
</div>
138139
</div>
139140
</div>
140141

141142
<!-- subcategory -->
142143
<div class="row">
143144
<div class="col-md-12 col-sm-12 col-xs-12">
144-
<h3 class="women">Women <small class="pull-right">There Are 120 Products</small></h3>
145+
<h3 class="women">Women
146+
<small class="pull-right">There Are 120 Products</small>
147+
</h3>
145148
<h4 class="subcategory">二级类目</h4>
146149
<div id="subcategoryBox" class="row">
147150

@@ -161,9 +164,14 @@ <h4 class="subcategory">二级类目</h4>
161164
</div>
162165
</div>
163166
<!-- 商品列表 -->
167+
<div id="searchCondition">
168+
<input id="pBoxCId" type="hidden" name="categoryId" value="0">
169+
<input id="pBoxSubCId" type="hidden" name="subCategoryId" value="0">
170+
</div>
164171
<div id="productListBox" class="row m-30" tabindex="0" hidefocus="true">
165172

166173
</div>
174+
167175
<div id="page"></div>
168176

169177
<!-- <nav>-->
@@ -174,6 +182,7 @@ <h4 class="subcategory">二级类目</h4>
174182
</div>
175183
</div>
176184
</div>
185+
</div>
177186
</section>
178187

179188
<!-- 通用footer -->
@@ -190,6 +199,7 @@ <h4 class="subcategory">二级类目</h4>
190199
<script>
191200
$(function () {
192201
innit();
202+
193203
});
194204

195205
// 初始化方法
@@ -198,7 +208,6 @@ <h4 class="subcategory">二级类目</h4>
198208
innitMinPriceGoodsBoxBody();
199209
innitOfferBox();
200210
innitFooterBox();
201-
innitProductListBox();
202211
}
203212

204213
function innitCategory() {
@@ -212,14 +221,19 @@ <h4 class="subcategory">二级类目</h4>
212221
success: function (data) {
213222
console.log(data);
214223
data.forEach(function (item, index) {
215-
str = " <li id='categoryLi" + index + "' onclick=\" categoryClick(this.id);\"> <i class=\"fa fa-eye side-icon pull-left categoryHref ";
224+
if(index == 1){
225+
$("#pBoxCId").val(""+item.categoryId+"");
226+
}
227+
str = " <li id='categoryLi" + index + "' onclick=\" categoryClick(this.id," + item.categoryId + ");\"> <i class=\"fa fa-eye side-icon pull-left categoryHref ";
216228
if (index == 0) {
217229
str += "active";
218230
}
219231
str += "\"></i>" + item.categoryName + " <i class=\"fa fa-angle-right pull-right\"></i></li>";
220232
categoryBox.append(str)
221233
})
222234
innitSubCategory(data[0].categoryId);
235+
// console.log($("#categoryLi0"))
236+
// $("#categoryLi0").click();
223237
},
224238
error: function () {
225239
bs4pop.notice('初始化异常,请稍后重试!', {position: 'topcenter'});
@@ -228,10 +242,13 @@ <h4 class="subcategory">二级类目</h4>
228242
}
229243

230244
// 设置选中样式
231-
function categoryClick(id) {
245+
function categoryClick(id, categoryId) {
232246
// console.log($(".categoryHref"));
233247
$(".categoryHref").removeClass("active");
234248
$("#" + id + " i:eq(0)").addClass("active");
249+
$("#pBoxCId").val(""+categoryId+"");
250+
innitSubCategory(categoryId);
251+
$(".subcategoryHref:eq(0)").click();
235252
}
236253

237254
//初始化子分类
@@ -254,14 +271,19 @@ <h4 class="subcategory">二级类目</h4>
254271
if (data.records.length >= 1) {
255272
subCategory.empty();
256273
data.records.forEach(function (item, index) {
274+
if(index == 1){
275+
$("#pBoxSubCId").val(""+item.subCategoryId+"");
276+
innitProductListBox();
277+
}
257278
str = " <div class=\"col-md-2 col-sm-4 col-xs-6\">\n" +
258279
" <div class=\"subcategory-img\">\n" +
259280
" <img class=\"img-responsive\" src=\"" + item.image + "\" alt=\"\"/>\n" +
260-
" <div class=\"subcategory-overlay\">" + item.subCategoryName + "</div>\n" +
281+
" <div id='sunCategoryHref" + item.subCategoryId + "' class=\"subcategoryHref subcategory-overlay\" onclick='subCategoryActive(" + item.subCategoryId + ");'>" + item.subCategoryName + "</div>\n" +
261282
" </div>\n" +
262283
" </div>";
263284
subCategory.append(str);
264285
});
286+
$(".subcategoryHref:eq(0)").addClass("subcategory-active");
265287
}
266288
},
267289
error: function () {
@@ -270,6 +292,14 @@ <h4 class="subcategory">二级类目</h4>
270292
})
271293
}
272294

295+
//子分类样式
296+
function subCategoryActive(subCategoryId) {
297+
$(".subcategoryHref").removeClass("subcategory-active");
298+
$("#sunCategoryHref" + subCategoryId + "").addClass("subcategory-active");
299+
$("#pBoxSubCId").val(""+subCategoryId+"");
300+
innitProductListBox();
301+
}
302+
273303
// 初始化特价商品
274304
function innitMinPriceGoodsBoxBody() {
275305
var minPriceGoodsBoxBody = $("#minPriceGoodsBoxBody");
@@ -346,13 +376,19 @@ <h4 class="subcategory">二级类目</h4>
346376
if (current == null || current <= 0) {
347377
current = 1;
348378
}
379+
console.log("分类id的值---------------------------->"+ $("#pBoxCId").val())
380+
console.log("子分类id的值---------------------------->"+ $("#pBoxSubCId").val())
381+
const categoryId = $("#pBoxCId").val() == 0 ? null: $("#pBoxCId").val();
382+
const subCategoryId = $("#pBoxSubCId").val() == 0 ? null : $("#pBoxSubCId").val();
349383
$.ajax({
350384
url: "innit_productListBox",
351385
dataType: "json",
352386
type: "post",
353387
data: {
354388
"current": current,
355-
"size": 6
389+
"size": 6,
390+
"categoryId":categoryId,
391+
"subCategoryId":subCategoryId
356392
},
357393
success: function (data) {
358394
console.log("初始化商品列表------------------------------------->")
@@ -362,8 +398,8 @@ <h4 class="subcategory">二级类目</h4>
362398
let tagStr = " ";
363399
let activityStr = " ";
364400
let isNewStr = " ";
401+
productListBox.empty();
365402
if (data.records.length >= 1) {
366-
productListBox.empty();
367403
data.records.forEach(function (item, index) {
368404
if (item.productTagId > 0) {
369405
tagStr = " <strong>" + item.productTagStr + "</strong>";
@@ -379,10 +415,10 @@ <h4 class="subcategory">二级类目</h4>
379415
" <div class=\"grid-img\">\n" +
380416
" <img class=\"img-resposive\" src=\"" + item.image + "\" alt=\"women\"/>\n" +
381417
tagStr + isNewStr + activityStr +
382-
" <div class=\"grid-overlay\" onclick='showDetail("+item.productId+")' >\n" +
418+
" <div class=\"grid-overlay\" onclick='showDetail(" + item.productId + ")' >\n" +
383419
" <ul>\n" +
384-
" <li onclick='likeThis("+item.productId+")'><i class=\"lnr lnr-heart\"></i></li>\n" +
385-
" <li onclick='carThis("+item.productId+")'><i class=\"lnr lnr-cart\"></i></li>\n" +
420+
" <li onclick='likeThis(" + item.productId + ")'><i class=\"lnr lnr-heart\"></i></li>\n" +
421+
" <li onclick='carThis(" + item.productId + ")'><i class=\"lnr lnr-cart\"></i></li>\n" +
386422
" </ul>\n" +
387423
" </div>\n" +
388424
" </div>\n" +
@@ -396,23 +432,26 @@ <h4 class="subcategory">二级类目</h4>
396432
// 翻页插件
397433
boxFooter2(data.total, data.size, data.current, data.pages);
398434
}
435+
else{
436+
$("#page").empty();
437+
}
399438
},
400439
error: function () {
401440
bs4pop.notice('初始化异常,请稍后重试!', {position: 'topcenter'});
402441
}
403442
})
404443
}
405444

406-
function showDetail(productId) {
407-
$(location).prop('href',"/AWyOfhUI/buyMore/single-product.html?productId="+productId);
445+
function showDetail(productId) {
446+
$(location).prop('href', "/AWyOfhUI/buyMore/single-product.html?productId=" + productId);
408447
}
409448

410-
function likeThis(productId){
449+
function likeThis(productId) {
411450
window.event.cancelBubble = true;
412451
alert("大幅度")
413452
}
414453

415-
function carThis(productId){
454+
function carThis(productId) {
416455
window.event.cancelBubble = true;
417456
alert("大幅度2")
418457
}

src/main/resources/templates/buyMore/product-list.html

+8-3
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ <h4 class="subcategory">二级类目</h4>
141141
</div>
142142

143143
<!-- 商品列表 -->
144+
<div id="searchCondition">
145+
<input id="pBoxCId" type="hidden" name="categoryId" value="0">
146+
<input id="pBoxSubCId" type="hidden" name="subCategoryId" value="0">
147+
</div>
144148
<div id="productListBox" tabindex="0" hidefocus="true">
145149

146150
</div>
@@ -238,7 +242,7 @@ <h4 class="subcategory">二级类目</h4>
238242
str = " <div class=\"col-md-2 col-sm-4 col-xs-6\">\n" +
239243
" <div class=\"subcategory-img\">\n" +
240244
" <img class=\"img-responsive\" src=\"" + item.image + "\" alt=\"\"/>\n" +
241-
" <div id='sunCategoryHref"+index+"' class=\"subcategoryHref subcategory-overlay\" onclick='subCategoryActive("+index+");'>" + item.subCategoryName + "</div>\n" +
245+
" <div id='sunCategoryHref"+item.subCategoryId+"' class=\"subcategoryHref subcategory-overlay\" onclick='subCategoryActive("+item.subCategoryId+");'>" + item.subCategoryName + "</div>\n" +
242246
" </div>\n" +
243247
" </div>";
244248
subCategory.append(str);
@@ -253,9 +257,10 @@ <h4 class="subcategory">二级类目</h4>
253257
}
254258

255259
//子分类样式
256-
function subCategoryActive(index){
260+
function subCategoryActive(subCategoryId){
257261
$(".subcategoryHref").removeClass("subcategory-active");
258-
$("#sunCategoryHref"+index+"").addClass("subcategory-active");
262+
$("#sunCategoryHref"+subCategoryId+"").addClass("subcategory-active");
263+
innitProductListBox();
259264
}
260265

261266
// 初始化特价商品

0 commit comments

Comments
 (0)