diff --git a/common/common-framework/src/main/java/cn/iocoder/common/framework/util/DateUtil.java b/common/common-framework/src/main/java/cn/iocoder/common/framework/util/DateUtil.java index 3219252f0..67f06e5ad 100644 --- a/common/common-framework/src/main/java/cn/iocoder/common/framework/util/DateUtil.java +++ b/common/common-framework/src/main/java/cn/iocoder/common/framework/util/DateUtil.java @@ -1,5 +1,7 @@ package cn.iocoder.common.framework.util; +import org.springframework.util.Assert; + import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; @@ -116,4 +118,19 @@ public class DateUtil { calendar.set(Calendar.MILLISECOND, milliSecond); } + /** + * 判断当前时间,是否在该时间范围内 + * + * @param beginTime 开始时间 + * @param endTime 结束时间 + * @return 是否在 + */ + public static boolean isBetween(Date beginTime, Date endTime) { + Assert.notNull(beginTime, "开始时间不能为空"); + Assert.notNull(endTime, "结束时间不能为空"); + Date now = new Date(); + return beginTime.getTime() <= now.getTime() + && now.getTime() <= endTime.getTime(); + } + } diff --git a/mobile-web/src/api/search.js b/mobile-web/src/api/search.js index 34633bb75..0b00eb19c 100644 --- a/mobile-web/src/api/search.js +++ b/mobile-web/src/api/search.js @@ -14,3 +14,13 @@ export function getProductPage({cid, keyword, pageNo, pageSize, sortField, sortO } }); } + +export function getProductCondition({keyword}) { + return request({ + url: '/search-api/users/product/condition', + method: 'get', + params: { + keyword, + } + }); +} diff --git a/mobile-web/src/components/common/productcard.vue b/mobile-web/src/components/common/productcard.vue index e5e9444f1..d9a006b33 100644 --- a/mobile-web/src/components/common/productcard.vue +++ b/mobile-web/src/components/common/productcard.vue @@ -9,16 +9,10 @@ >