Commit fe6683a8 by yancanhua

Merge branch 'main' into v1.3.0

# Conflicts:
#	aus-admin/src/main/resources/templates/main/index.html
#	aus-core/src/main/java/com/glsx/usedcar/module/auction/entity/dto/LightPollingBidConfigDTO.java
#	aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionOrderService.java
#	aus-core/src/main/java/com/glsx/usedcar/module/auction/service/AuctionService.java
#	aus-core/src/main/java/com/glsx/usedcar/module/auction/service/LightAuctionPoollingBidService.java
#	aus-core/src/main/java/com/glsx/usedcar/module/vehicle/service/VehicleService.java
#	aus-core/src/main/java/com/glsx/usedcar/util/RedisCacheUtil.java
#	aus-front/admin/.env.development
#	aus-front/admin/src/views/auction/auction/AuctionBaseInfo.vue
#	aus-front/admin/src/views/auction/auction/AuctionForm.vue
#	aus-front/admin/src/views/auction/auction/vehicle/ViewAuctionVehicle.vue
#	aus-front/admin/src/views/auction/control/AuctionVehiclePage.vue
#	aus-front/admin/src/views/auction/control/priceAddModal.vue
#	aus-front/app/src/components/RoundBidPopup.vue
#	aus-front/app/src/module/auction/AuctionVehiclePage.vue
#	aus-front/app/src/module/auction/BidSuccessDialog.vue
#	aus-front/app/src/module/auction/roundBidBottom.vue
#	aus-front/app/src/pages/tabbar/AuctionPage.vue
#	aus-front/app/src/pages/tabbar/ProfilePage.vue
#	aus-task/src/main/java/com/glsx/usedcar/task/LightPoollingAuctionSchedule.java
2 parents f585a61c baab6a02
Showing 38 changed files with 442 additions and 149 deletions
...@@ -139,7 +139,7 @@ public class AuctionController { ...@@ -139,7 +139,7 @@ public class AuctionController {
* @return * @return
*/ */
@PostMapping("addAuction") @PostMapping("addAuction")
public Auction addAuction(@Valid @RequestBody Auction auction, Authentication authentication) throws FieldException { public BaseResp<Boolean> addAuction(@Valid @RequestBody Auction auction, Authentication authentication) throws FieldException {
User user = (User) authentication.getPrincipal(); User user = (User) authentication.getPrincipal();
return auctionService.addAuction(auction, user); return auctionService.addAuction(auction, user);
} }
...@@ -151,7 +151,7 @@ public class AuctionController { ...@@ -151,7 +151,7 @@ public class AuctionController {
* @return * @return
*/ */
@PostMapping("updateAuction") @PostMapping("updateAuction")
public Auction updateAuction(@Valid @RequestBody Auction auction) throws FieldException { public BaseResp<Boolean> updateAuction(@Valid @RequestBody Auction auction) throws FieldException {
return auctionService.updateAuction(auction); return auctionService.updateAuction(auction);
} }
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="/admin/main/favicon/favicon.ico" type="image/x-icon"> <link rel="icon" href="/favicon/favicon.ico" type="image/x-icon">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>专电优拍</title> <title>专电优拍</title>
<script type="module" crossorigin src="https://aus.test.glsx.com.cn/assets/index-DZWhTIu2.js"></script> <script type="module" crossorigin src="https://aus.test.glsx.com.cn/assets/index-TuVIvskA.js"></script>
<link rel="stylesheet" crossorigin href="https://aus.test.glsx.com.cn/assets/index-CAAxcolk.css"> <link rel="stylesheet" crossorigin href="https://aus.test.glsx.com.cn/assets/index-CAAxcolk.css">
<!-- <script type="module" crossorigin src="https://aus.glsx.com.cn/assets/index-Brt4t3hN.js"></script> <!-- <script type="module" crossorigin src="https://aus.glsx.com.cn/assets/index-pxQEYXWe.js"></script>
<link rel="stylesheet" crossorigin href="https://aus.glsx.com.cn/assets/index-CAAxcolk.css"> --> <link rel="stylesheet" crossorigin href="https://aus.glsx.com.cn/assets/index-CAAxcolk.css"> -->
</head> </head>
<body> <body>
......
...@@ -117,6 +117,7 @@ public class AuctionController { ...@@ -117,6 +117,7 @@ public class AuctionController {
@PostMapping("pageRandomAuctionVehicle") @PostMapping("pageRandomAuctionVehicle")
public Page<AuctionVehicle> pageRandomAuctionVehicle(@RequestBody Pagination<AuctionVehicle> pagination, @RequestAttribute(value = LOGIN_ACCOUNT, required = false) Account account) { public Page<AuctionVehicle> pageRandomAuctionVehicle(@RequestBody Pagination<AuctionVehicle> pagination, @RequestAttribute(value = LOGIN_ACCOUNT, required = false) Account account) {
pagination.addFetch(root -> root.fetch(AuctionVehicle_.vehicle, JoinType.LEFT)); pagination.addFetch(root -> root.fetch(AuctionVehicle_.vehicle, JoinType.LEFT));
pagination.addFetch(root -> root.fetch(AuctionVehicle_.auction, JoinType.LEFT));
String cityCode = (String) pagination.getDataValue("cities"); String cityCode = (String) pagination.getDataValue("cities");
// 已审核的拍卖场次 // 已审核的拍卖场次
......
...@@ -11,8 +11,6 @@ import lombok.*; ...@@ -11,8 +11,6 @@ import lombok.*;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class LightPollingBidConfigDTO { public class LightPollingBidConfigDTO {
// 结束后自动延迟切换下一辆车的时间,单位秒
private Integer delay;
// 接近保留价提醒阈值 // 接近保留价提醒阈值
private Integer nearReservePriceThreshold; private Integer nearReservePriceThreshold;
// 加价重置延迟 单位 秒 // 加价重置延迟 单位 秒
...@@ -30,6 +28,6 @@ public class LightPollingBidConfigDTO { ...@@ -30,6 +28,6 @@ public class LightPollingBidConfigDTO {
} }
public boolean isValid() { public boolean isValid() {
return delay != null && nearReservePriceThreshold != null && resetDelay != null && resetDelayDuration != null && aucvehDuration != null && bidAucVehDuration != null; return nearReservePriceThreshold != null && resetDelay != null && resetDelayDuration != null && aucvehDuration != null && bidAucVehDuration != null;
} }
} }
...@@ -136,13 +136,16 @@ public class AuctionChangeService extends AbstractAuctionService { ...@@ -136,13 +136,16 @@ public class AuctionChangeService extends AbstractAuctionService {
if (approveHistory.getApproveResult() == AuditState.AUDITED && auctionVehicle.inProgress()) { if (approveHistory.getApproveResult() == AuditState.AUDITED && auctionVehicle.inProgress()) {
// 处理撤销的逻辑 // 处理撤销的逻辑
if (auctionVehicleChange.getChangeType() == AuctionBaseChange.ChangeType.CANCEL) { if (auctionVehicleChange.getChangeType() == AuctionBaseChange.ChangeType.CANCEL) {
Auction auction = auctionVehicle.getAuction();
// 中止车辆拍卖
if (auction.getAuctionType() == AuctionType.LIGHT && auction.getAuctionMode() == 2) {
lightAuctionPoollingBidService.cancelAucVeh(auctionVehicle);
}
Vehicle vehicle = auctionVehicle.getVehicle(); Vehicle vehicle = auctionVehicle.getVehicle();
auctionVehicle.setAuctionState(AuctionVehicle.AuctionState.CANCELLED); auctionVehicle.setAuctionState(AuctionVehicle.AuctionState.CANCELLED);
vehicle.setVehicleState(Vehicle.VehicleState.PRICED); vehicle.setVehicleState(Vehicle.VehicleState.PRICED);
// 退回保证金 // 退回保证金
returnDepositsByAuctionVehicle(auctionVehicle, "参拍失败,解冻保证金"); returnDepositsByAuctionVehicle(auctionVehicle, "参拍失败,解冻保证金");
Auction auction = auctionVehicle.getAuction();
auction.setVehicleCount(auction.getVehicleCount() - 1); auction.setVehicleCount(auction.getVehicleCount() - 1);
} }
// 处理延期的逻辑 // 处理延期的逻辑
......
...@@ -393,19 +393,6 @@ public class AuctionOrderService extends AbstractAuctionService { ...@@ -393,19 +393,6 @@ public class AuctionOrderService extends AbstractAuctionService {
public BaseResp<AccountBidResultResp> getAccountBidResult(Integer aucvehId, Account account) { public BaseResp<AccountBidResultResp> getAccountBidResult(Integer aucvehId, Account account) {
AuctionVehicle auctionVehicle = auctionVehicleDao.findTopByAucvehId(aucvehId); AuctionVehicle auctionVehicle = auctionVehicleDao.findTopByAucvehId(aucvehId);
if (auctionVehicle.getAuctionState() == AuctionState.AUCTIONING) {
return BaseResp.fail("该车辆竞标中.");
}
if (auctionVehicle.getAuctionState() == AuctionState.PENDING_AUCTION
|| auctionVehicle.getAuctionState() == AuctionState.WAIT_AUCTION
|| auctionVehicle.getAuctionState() == AuctionState.PREVIEW) {
return BaseResp.fail("该车辆竞标竞价还没有开始.");
}
if (auctionVehicle.getAuctionState() == AuctionState.CANCELLED) {
return BaseResp.fail("该车辆竞标竞价已取消.");
}
Vehicle vehicle = auctionVehicle.getVehicle(); Vehicle vehicle = auctionVehicle.getVehicle();
Auction auction = auctionVehicle.getAuction(); Auction auction = auctionVehicle.getAuction();
Bid bid = null; Bid bid = null;
...@@ -416,25 +403,28 @@ public class AuctionOrderService extends AbstractAuctionService { ...@@ -416,25 +403,28 @@ public class AuctionOrderService extends AbstractAuctionService {
// 暗拍取最新一条 // 暗拍取最新一条
bid = bidDao.findTopByAuctionVehicleOrderByCreateTimeDesc(auctionVehicle); bid = bidDao.findTopByAuctionVehicleOrderByCreateTimeDesc(auctionVehicle);
} }
AccountBidResultResp resp = AccountBidResultResp.builder() boolean hasBid = true;
.price(0)
.bidResult(0)
.build();
if (bid == null) { if (bid == null) {
return BaseResp.success(resp); hasBid = false;
bid = new Bid();
bid.setBidPrice(vehicle.getStartingBidPrice());
bid.setAccount(account);
bid.setCreateTime(LocalDateTime.now());
} }
int bidResult = 0; int bidResult = 0;
if (bid.getBidPrice() >= vehicle.getReservePrice() && bid.getBidType() == 0) { if (hasBid && bid.getBidPrice() >= vehicle.getReservePrice()) {
// 找到了最高价,并且最高价大于等于车辆保留价格,开始生成订单 // 找到了最高价,并且最高价大于等于车辆保留价格,开始生成订单
if (bid.getAccount().getAccountId() == account.getAccountId()) { if (bid.getAccount() != null && bid.getAccount().getAccountId() == account.getAccountId()) {
bidResult = 1; bidResult = 1;
} else { } else {
bidResult = 2; bidResult = 2;
} }
} }
double price = bid.getBidPrice() + calculateCommissionPrice(bid.getCreateTime(), bid); double price = bid.getBidPrice() + calculateCommissionPrice(bid.getCreateTime(), bid);
resp.setPrice(price); AccountBidResultResp resp = AccountBidResultResp.builder()
resp.setBidResult(bidResult); .price(price)
.bidResult(bidResult)
.build();
return BaseResp.success(resp); return BaseResp.success(resp);
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -133,18 +133,21 @@ public class AuctionService extends AbstractAuctionService { ...@@ -133,18 +133,21 @@ public class AuctionService extends AbstractAuctionService {
* @return 拍卖场次实例对象 * @return 拍卖场次实例对象
*/ */
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public synchronized Auction addAuction(Auction auction, User user) throws FieldException { public synchronized BaseResp<Boolean> addAuction(Auction auction, User user) throws FieldException {
List<AuctionVehicle> auctionVehicles = auction.getAuctionVehicles(); List<AuctionVehicle> auctionVehicles = auction.getAuctionVehicles();
if (CollectionUtils.isEmpty(auctionVehicles)) { if (CollectionUtils.isEmpty(auctionVehicles)) {
throw new FieldException("sourceNos", "拍场下没有车辆信息,请先添加车辆信息"); return BaseResp.fail("拍场下没有车辆信息,请先添加车辆信息");
} }
List<Integer> vehicleIds = auctionVehicles.stream().map(p -> p.getVehicle().getVehicleId()).toList(); List<Integer> vehicleIds = auctionVehicles.stream().map(p -> p.getVehicle().getVehicleId()).toList();
List<String> sourceNos = vehicleDao.findBySourceNoVehicleStateNot(vehicleIds, Vehicle.VehicleState.PRICED); List<String> sourceNos = vehicleDao.findBySourceNoVehicleStateNot(vehicleIds, Vehicle.VehicleState.PRICED);
if (!CollectionUtils.isEmpty(sourceNos)) { if (!CollectionUtils.isEmpty(sourceNos)) {
String join = String.join(",", sourceNos); String join = String.join(",", sourceNos);
throw new FieldException("sourceNos", sourceNos, "车源号:" + join + "的车辆状态不是待关联拍卖状态,请重新选择车辆"); return BaseResp.fail("车源号:" + join + "的车辆状态不是待关联拍卖状态,请重新选择车辆");
}
BaseResp baseResp = checkAuctionConfig(auction, auctionVehicles);
if (!baseResp.isSuccess()) {
return baseResp;
} }
checkAuctionConfig(auction, auctionVehicles);
auction.setAccessScope(CollectionUtils.isEmpty(auction.getAccountTags()) ? Auction.AccessScope.GLOBAL : Auction.AccessScope.TAGS); auction.setAccessScope(CollectionUtils.isEmpty(auction.getAccountTags()) ? Auction.AccessScope.GLOBAL : Auction.AccessScope.TAGS);
if (!CollectionUtils.isEmpty(auction.getAccountTags())) { if (!CollectionUtils.isEmpty(auction.getAccountTags())) {
auction.setAccountTags(new HashSet<>(accountTagDao.findByEntityIds(auction.getAccountTags()))); auction.setAccountTags(new HashSet<>(accountTagDao.findByEntityIds(auction.getAccountTags())));
...@@ -164,13 +167,13 @@ public class AuctionService extends AbstractAuctionService { ...@@ -164,13 +167,13 @@ public class AuctionService extends AbstractAuctionService {
// 发送通知消息 // 发送通知消息
sendNoticeMessage(NoticeTemplate.TemplateType.AUCTION_AUDIT, Map.of(NoticeField.AUCTION_NAME, auctionDb.getAuctionName(), NoticeField.AUCTION_START_TIME, DateTimeUtils.DATE_TIME_NO_SECOND_FORMATTER.format(auctionDb.getAuctionStartTime()), NoticeField.VEHICLE_COUNT, auctionDb.getVehicleCount(), NoticeField.AUCTION_USER_NAME, user.getRealName(), NoticeField.AUCTION_CREATE_TIME, DateTimeUtils.DATE_TIME_NO_SECOND_FORMATTER.format(auctionDb.getCreateTime()))); sendNoticeMessage(NoticeTemplate.TemplateType.AUCTION_AUDIT, Map.of(NoticeField.AUCTION_NAME, auctionDb.getAuctionName(), NoticeField.AUCTION_START_TIME, DateTimeUtils.DATE_TIME_NO_SECOND_FORMATTER.format(auctionDb.getAuctionStartTime()), NoticeField.VEHICLE_COUNT, auctionDb.getVehicleCount(), NoticeField.AUCTION_USER_NAME, user.getRealName(), NoticeField.AUCTION_CREATE_TIME, DateTimeUtils.DATE_TIME_NO_SECOND_FORMATTER.format(auctionDb.getCreateTime())));
return auctionDb; return BaseResp.success(true);
} }
/** /**
* 检查拍场配置 * 检查拍场配置
*/ */
private static void checkAuctionConfig(Auction auction, List<AuctionVehicle> auctionVehicles) throws FieldException { private static BaseResp<Boolean> checkAuctionConfig(Auction auction, List<AuctionVehicle> auctionVehicles) throws FieldException {
if (auction.getAuctionType() == AuctionType.LIGHT && auction.getAuctionMode() == 2) { if (auction.getAuctionType() == AuctionType.LIGHT && auction.getAuctionMode() == 2) {
// 明拍, 轮询出价 // 明拍, 轮询出价
// 获取所有拍卖车辆的最低保留价 // 获取所有拍卖车辆的最低保留价
...@@ -181,17 +184,17 @@ public class AuctionService extends AbstractAuctionService { ...@@ -181,17 +184,17 @@ public class AuctionService extends AbstractAuctionService {
} }
String extraJson = auction.getExtraJson(); String extraJson = auction.getExtraJson();
if (StringUtils.isBlank(extraJson)) { if (StringUtils.isBlank(extraJson)) {
throw new FieldException("extraJson", "请填写轮询出价参数"); return BaseResp.fail("请填写轮询出价参数");
} }
LightPollingBidConfigDTO dto = LightPollingBidConfigDTO.fromJson(extraJson); LightPollingBidConfigDTO dto = LightPollingBidConfigDTO.fromJson(extraJson);
if (!dto.isValid()) { if (!dto.isValid()) {
log.info("轮询出价配置错误{}", extraJson); log.info("轮询出价配置错误{}", extraJson);
throw new FieldException("extraJson", "明拍竞价配置错误"); return BaseResp.fail("明拍竞价配置错误");
} }
Integer nearReservePriceThreshold = dto.getNearReservePriceThreshold(); Integer nearReservePriceThreshold = dto.getNearReservePriceThreshold();
if (nearReservePriceThreshold < 0 || nearReservePriceThreshold > minReservePrice) { if (nearReservePriceThreshold < 0 || nearReservePriceThreshold > minReservePrice) {
log.info("nearReservePriceThreshold:{} < minReservePrice:{}", nearReservePriceThreshold, minReservePrice); log.info("nearReservePriceThreshold:{} < minReservePrice:{}", nearReservePriceThreshold, minReservePrice);
throw new FieldException("extraJson", "设定的保留价提醒阈值:最小0,最大不超过当前拍场中车辆的最低价保留价"); return BaseResp.fail("设定的保留价提醒阈值:最小0,最大不超过当前拍场中车辆的最低价保留价");
} }
// 重置延时:最小值为0,最大值小于等于拍卖持续时间。 // 重置延时:最小值为0,最大值小于等于拍卖持续时间。
Integer resetDelay = dto.getResetDelay(); Integer resetDelay = dto.getResetDelay();
...@@ -200,9 +203,10 @@ public class AuctionService extends AbstractAuctionService { ...@@ -200,9 +203,10 @@ public class AuctionService extends AbstractAuctionService {
long secondsDiff = duration.getSeconds(); long secondsDiff = duration.getSeconds();
if (resetDelay < 0 || resetDelay > secondsDiff) { if (resetDelay < 0 || resetDelay > secondsDiff) {
log.info("重置延时:最小0,最大小于等于拍卖持续时间 resetDelay:{} < 0 or > secondsDiff:{}", resetDelay, secondsDiff); log.info("重置延时:最小0,最大小于等于拍卖持续时间 resetDelay:{} < 0 or > secondsDiff:{}", resetDelay, secondsDiff);
throw new FieldException("extraJson", "重置延时:最小0,最大小于等于拍卖持续时间"); return BaseResp.fail("重置延时:最小0,最大小于等于拍卖持续时间");
} }
} }
return BaseResp.success(true);
} }
/** /**
...@@ -212,15 +216,18 @@ public class AuctionService extends AbstractAuctionService { ...@@ -212,15 +216,18 @@ public class AuctionService extends AbstractAuctionService {
* @return 拍卖场次实例对象 * @return 拍卖场次实例对象
*/ */
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public synchronized Auction updateAuction(Auction auction) throws FieldException { public synchronized BaseResp<Boolean> updateAuction(Auction auction) throws FieldException {
List<AuctionVehicle> auctionVehicles = auction.getAuctionVehicles(); List<AuctionVehicle> auctionVehicles = auction.getAuctionVehicles();
if (CollectionUtils.isEmpty(auctionVehicles)) { if (CollectionUtils.isEmpty(auctionVehicles)) {
throw new FieldException("sourceNos", "拍场下没有车辆信息,请先添加车辆信息"); return BaseResp.fail("拍场下没有车辆信息,请先添加车辆信息");
} }
if (auction.getAuctionMode() != 2) { if (auction.getAuctionMode() != 2) {
auction.setExtraJson(null); auction.setExtraJson(null);
} }
checkAuctionConfig(auction, auctionVehicles); BaseResp baseResp = checkAuctionConfig(auction, auctionVehicles);
if (!baseResp.isSuccess()) {
return baseResp;
}
Auction auctionDb = auctionDao.updateById(auction, Auction_.auctionName, Auction_.user, Auction_.previewStartTime, Auction_.auctionStartTime, Auction_.auctionEndTime, Auction_.deposit, Auction_.auctionType, Auction_.beforeEndMinute, Auction_.delayMinute, Auction_.cities, Auction_.remark, Auction_.extraJson, Auction_.auctionMode); Auction auctionDb = auctionDao.updateById(auction, Auction_.auctionName, Auction_.user, Auction_.previewStartTime, Auction_.auctionStartTime, Auction_.auctionEndTime, Auction_.deposit, Auction_.auctionType, Auction_.beforeEndMinute, Auction_.delayMinute, Auction_.cities, Auction_.remark, Auction_.extraJson, Auction_.auctionMode);
auctionDb.setAuctionDate(auctionDb.getAuctionStartTime().toLocalDate()); auctionDb.setAuctionDate(auctionDb.getAuctionStartTime().toLocalDate());
...@@ -240,7 +247,7 @@ public class AuctionService extends AbstractAuctionService { ...@@ -240,7 +247,7 @@ public class AuctionService extends AbstractAuctionService {
List<String> sourceNos = vehicleDao.findBySourceNoVehicleStateNot(vehicleIds, Vehicle.VehicleState.PRICED); List<String> sourceNos = vehicleDao.findBySourceNoVehicleStateNot(vehicleIds, Vehicle.VehicleState.PRICED);
if (!CollectionUtils.isEmpty(sourceNos)) { if (!CollectionUtils.isEmpty(sourceNos)) {
String join = String.join(",", sourceNos); String join = String.join(",", sourceNos);
throw new FieldException("sourceNos", sourceNos, "车源号:" + join + "的车辆状态不是待关联拍卖状态,请重新选择车辆"); return BaseResp.fail("车源号:" + join + "的车辆状态不是待关联拍卖状态,请重新选择车辆");
} }
} }
for (AuctionVehicle auctionVehicle : auctionVehicles) { for (AuctionVehicle auctionVehicle : auctionVehicles) {
...@@ -269,7 +276,7 @@ public class AuctionService extends AbstractAuctionService { ...@@ -269,7 +276,7 @@ public class AuctionService extends AbstractAuctionService {
auctionVehicleDao.deleteAll(auctionVehicleDbs); auctionVehicleDao.deleteAll(auctionVehicleDbs);
} }
auctionDb.setAuditState(AuditState.UNAUDITED); auctionDb.setAuditState(AuditState.UNAUDITED);
return auctionDb; return BaseResp.success(true);
} }
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
...@@ -306,12 +313,17 @@ public class AuctionService extends AbstractAuctionService { ...@@ -306,12 +313,17 @@ public class AuctionService extends AbstractAuctionService {
vehicle.setVehicleState(Vehicle.VehicleState.PREVIEW); vehicle.setVehicleState(Vehicle.VehicleState.PREVIEW);
} }
case AUCTIONING -> { case AUCTIONING -> {
av.setAuctionState(AuctionVehicle.AuctionState.AUCTIONING); if (auction.getAuctionMode() == 2 && auction.getAuctionType() == AuctionType.LIGHT) {
vehicle.setVehicleState(Vehicle.VehicleState.AUCTIONING); av.setAuctionState(AuctionVehicle.AuctionState.PREVIEW);
vehicle.setVehicleState(Vehicle.VehicleState.PREVIEW);
} else {
av.setAuctionState(AuctionVehicle.AuctionState.AUCTIONING);
vehicle.setVehicleState(Vehicle.VehicleState.AUCTIONING);
}
} }
} }
auctionVehicleDao.save(av); auctionVehicleDao.save(av);
if (auction.getAuctionType() == AuctionType.LIGHT && auction.getAuctionMode() == 2) { if (auction.getAuctionType() == AuctionType.LIGHT && auction.getAuctionMode() == 2 && auction.getAuctionState() == Auction.AuctionState.AUCTIONING) {
lightAuctionPoollingBidService.addVehicle(av, auction); lightAuctionPoollingBidService.addVehicle(av, auction);
} }
} }
......
...@@ -137,6 +137,11 @@ public class BidService { ...@@ -137,6 +137,11 @@ public class BidService {
if (auctionVehicle.getAuctionState() != AuctionVehicle.AuctionState.AUCTIONING) { if (auctionVehicle.getAuctionState() != AuctionVehicle.AuctionState.AUCTIONING) {
throw new FieldException("aucvehId", aucvehId, "该车辆已结束竞标"); throw new FieldException("aucvehId", aucvehId, "该车辆已结束竞标");
} }
LocalDateTime auctionEndTime = auctionVehicle.getAuctionEndTime();
// 判断是否已经结束
if (auctionEndTime.isBefore(LocalDateTime.now())) {
throw new FieldException("aucvehId", aucvehId, "该车辆已结束竞标");
}
Account account = accountDao.findById(accountId).orElseThrow(() -> new ObjectNotFoundException(accountId, Account.class.getSimpleName())); Account account = accountDao.findById(accountId).orElseThrow(() -> new ObjectNotFoundException(accountId, Account.class.getSimpleName()));
if (!account.isEnabled()) { if (!account.isEnabled()) {
throw new FieldException("accountId", accountId, "你已被禁止竞价"); throw new FieldException("accountId", accountId, "你已被禁止竞价");
......
...@@ -5,6 +5,7 @@ import com.glsx.usedcar.module.auction.dao.AuctionDao; ...@@ -5,6 +5,7 @@ import com.glsx.usedcar.module.auction.dao.AuctionDao;
import com.glsx.usedcar.module.auction.dao.AuctionVehicleDao; import com.glsx.usedcar.module.auction.dao.AuctionVehicleDao;
import com.glsx.usedcar.module.auction.entity.*; import com.glsx.usedcar.module.auction.entity.*;
import com.glsx.usedcar.module.auction.entity.Auction.AuctionType; import com.glsx.usedcar.module.auction.entity.Auction.AuctionType;
import com.glsx.usedcar.module.auction.entity.AuctionVehicle.AuctionState;
import com.glsx.usedcar.module.auction.entity.dto.LightPollingBidConfigDTO; import com.glsx.usedcar.module.auction.entity.dto.LightPollingBidConfigDTO;
import com.glsx.usedcar.module.auction.entity.vo.LightAuctionPoolingBidNextAucVehVO; import com.glsx.usedcar.module.auction.entity.vo.LightAuctionPoolingBidNextAucVehVO;
import com.glsx.usedcar.module.auction.entity.vo.LightAuctionPoolingBidTimeAndPriceVO; import com.glsx.usedcar.module.auction.entity.vo.LightAuctionPoolingBidTimeAndPriceVO;
...@@ -562,4 +563,21 @@ public class LightAuctionPoollingBidService { ...@@ -562,4 +563,21 @@ public class LightAuctionPoollingBidService {
l.add(String.valueOf(av.getAucvehId())); l.add(String.valueOf(av.getAucvehId()));
redisCacheUtil.setCacheWithExpire(String.format(AUCTION_ORDER_KEY, auction.getAuctionId()), StringUtils.join(l, ","), 24, TimeUnit.HOURS); redisCacheUtil.setCacheWithExpire(String.format(AUCTION_ORDER_KEY, auction.getAuctionId()), StringUtils.join(l, ","), 24, TimeUnit.HOURS);
} }
/**
* 取消车辆拍卖
*/
public void cancelAucVeh(AuctionVehicle auctionVehicle) {
log.info("取消车辆拍卖{} {}", auctionVehicle.getAucvehId(), auctionVehicle.getAuctionState());
if (auctionVehicle.getAuctionState() != AuctionState.AUCTIONING) {
return;
}
Auction auction = auctionVehicle.getAuction();
LightPollingBidConfigDTO lightPollingBidConfigDTO = LightPollingBidConfigDTO.fromJson(auction.getExtraJson());
int bidAucVehDuration = lightPollingBidConfigDTO.getBidAucVehDuration();
long curr = System.currentTimeMillis();
long nextAuctionVehicleStartTimeMillis = curr + bidAucVehDuration * 1000L;
redisCacheUtil.setCacheWithExpire(String.format(NEXT_AUCTION_VEHICLE_START_TIME_KEY, auction.getAuctionId()), nextAuctionVehicleStartTimeMillis, 24, TimeUnit.HOURS);
redisCacheUtil.setCacheWithExpire(String.format(END_TIME_KEY, auctionVehicle.getAucvehId()), curr, 24, TimeUnit.HOURS);
}
} }
...@@ -355,9 +355,9 @@ public class VehicleService { ...@@ -355,9 +355,9 @@ public class VehicleService {
} }
String extraJson = auction.getExtraJson(); String extraJson = auction.getExtraJson();
LightPollingBidConfigDTO lightPollingBidConfigDTO = LightPollingBidConfigDTO.fromJson(extraJson); LightPollingBidConfigDTO lightPollingBidConfigDTO = LightPollingBidConfigDTO.fromJson(extraJson);
Integer resetDelay = lightPollingBidConfigDTO.getResetDelay(); Integer resetDelay = lightPollingBidConfigDTO.getResetDelayDuration();
if (resetDelay < vehicleAutoBidVO.getAutoBidTrigger()) { if (resetDelay <= vehicleAutoBidVO.getAutoBidTrigger()) {
return BaseResp.fail("自动出价触发秒数必须小于拍卖重置秒数."); return BaseResp.fail("自动出价触发秒数必须小于" + resetDelay + "秒");
} }
vehicle.setAutoBidSwitch(vehicleAutoBidVO.getAutoBidSwitch()); vehicle.setAutoBidSwitch(vehicleAutoBidVO.getAutoBidSwitch());
vehicle.setAutoBidRange(vehicleAutoBidVO.getAutoBidRange()); vehicle.setAutoBidRange(vehicleAutoBidVO.getAutoBidRange());
......
...@@ -6,9 +6,9 @@ PUBLISH_PATH = '/' ...@@ -6,9 +6,9 @@ PUBLISH_PATH = '/'
BASE_URL = '/ BASE_URL = '/
# 开发环境 # 开发环境
# VITE_API_BASE_URL = 'http://aus.test.glsx.com.cn/admin/rest' VITE_API_BASE_URL = 'http://aus.test.glsx.com.cn/admin/rest'
VITE_API_BASE_URL = 'http://192.168.1.125:6903/admin/rest' # VITE_API_BASE_URL = 'http://192.168.1.125:6903/admin/rest'
VITE_TOKEN= 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbmlzdHJhdG9yIiwicmVhbE5hbWUiOiLotoXnuqfnrqHnkIblkZgiLCJwYXNzd29yZCI6IiQyYSQxMCRlQ21jWmxPaFltVUxrNklibjR3RVgudjNpa0dzcnBpYjh0SlBlcGJ6NVl1SXFWbUpCVER4eSIsImlzcyI6ImF1c0FwcCIsImV4cCI6MTg0NTI4NTU3NiwiaWF0IjoxNzczMjg1NTc2LCJqdGkiOiIzMCIsImF1dGhvcml0aWVzIjpbIlJPTEVfU1VQRVIiXX0.q0Ou_W9goNWUgasZTULp4IDWlZhVHWbQ0jn49qdZeSw' #VITE_TOKEN= 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbmlzdHJhdG9yIiwicmVhbE5hbWUiOiLotoXnuqfnrqHnkIblkZgiLCJwYXNzd29yZCI6IiQyYSQxMCRlQ21jWmxPaFltVUxrNklibjR3RVgudjNpa0dzcnBpYjh0SlBlcGJ6NVl1SXFWbUpCVER4eSIsImlzcyI6ImF1c0FwcCIsImV4cCI6MTg0NTI4NTU3NiwiaWF0IjoxNzczMjg1NTc2LCJqdGkiOiIzMCIsImF1dGhvcml0aWVzIjpbIlJPTEVfU1VQRVIiXX0.q0Ou_W9goNWUgasZTULp4IDWlZhVHWbQ0jn49qdZeSw'
#VITE_TOKEN= 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbmlzdHJhdG9yIiwicmVhbE5hbWUiOiJhZG1pbmlzdHJhdG9yIiwicGFzc3dvcmQiOiIkMmEkMTAkQ0ZudVRoVHgyRHBMZC9UdkVVdVZGZXhqM1plUnlLQVNwMkllUW41VHFUbU5yN1N4UFI0VG0iLCJpc3MiOiJhdXNBcHAiLCJleHAiOjE4NDExNTk5OTgsImlhdCI6MTc2OTE1OTk5OCwianRpIjoiOTYiLCJhdXRob3JpdGllcyI6WyJST0xFX1NVUEVSIl19.SCTolgZ7my8M3uK6YkV3svZas8qcdIzU_GP1XS7bhUk' VITE_TOKEN= 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbmlzdHJhdG9yIiwicmVhbE5hbWUiOiJhZG1pbmlzdHJhdG9yIiwicGFzc3dvcmQiOiIkMmEkMTAkQ0ZudVRoVHgyRHBMZC9UdkVVdVZGZXhqM1plUnlLQVNwMkllUW41VHFUbU5yN1N4UFI0VG0iLCJpc3MiOiJhdXNBcHAiLCJleHAiOjE4NDExNTk5OTgsImlhdCI6MTc2OTE1OTk5OCwianRpIjoiOTYiLCJhdXRob3JpdGllcyI6WyJST0xFX1NVUEVSIl19.SCTolgZ7my8M3uK6YkV3svZas8qcdIzU_GP1XS7bhUk'
...@@ -60,14 +60,16 @@ ...@@ -60,14 +60,16 @@
<template v-if="auction.accessScope==='GLOBAL'">所有用户</template> <template v-if="auction.accessScope==='GLOBAL'">所有用户</template>
<a-tag v-else v-for="accountTag in auction.accountTags" :key="accountTag.tagId">{{ accountTag.tagName }}</a-tag> <a-tag v-else v-for="accountTag in auction.accountTags" :key="accountTag.tagId">{{ accountTag.tagName }}</a-tag>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="明拍模式">
{{ auction.auctionMode == '2' ? '轮询出价模式' : '普通模式' }}
</a-descriptions-item>
<!-- <a-descriptions-item label="拍卖说明">{{ auction.remark }}</a-descriptions-item>--> <!-- <a-descriptions-item label="拍卖说明">{{ auction.remark }}</a-descriptions-item>-->
</a-descriptions> </a-descriptions>
<a-typography-text> 预计结束前 {{ auction.beforeEndMinute }}分钟,自动化延时{{ auction.delayMinute }}分钟</a-typography-text> <a-typography-text v-if="auction.auctionMode == '1'" > 预计结束前 {{ auction.beforeEndMinute }}分钟,自动化延时{{ auction.delayMinute }}分钟</a-typography-text>
<div v-if="auction.auctionMode == '2'" class="auctionModeBox"> <div v-if="auction.auctionMode == '2'" class="auctionModeBox">
<a-space :size="20" class="mt-8 mb-8 ml-16"> <a-space :size="20" class="mt-8 mb-8 ml-16">
<a-statistic title="结束后自动跳转延时" :value="returnExtraJsonData('delay')+'秒'" :value-style="statisticStyle"/> <a-statistic title="结束后自动跳转延时" :value="returnExtraJsonData('bidAucVehDuration')+'秒'" :value-style="statisticStyle"/>
<a-statistic title="系统&用户加价延时" :value="returnExtraJsonData('resetDelay')+'秒'" :value-style="statisticStyle"/> <a-statistic title="系统&用户加价延时" :value="returnExtraJsonData('resetDelay')+'秒'" :value-style="statisticStyle"/>
<a-statistic title="接近保留价提醒阈值" :value="'¥'+returnExtraJsonData('nearReservePriceThreshold') " :value-style="statisticStyle"/> <a-statistic title="接近保留价提醒阈值" :value="'¥'+returnExtraJsonData('nearReservePriceThreshold') " :value-style="statisticStyle"/>
<a-statistic title="分段延时规则" :value="'倒计时剩余0-'+returnExtraJsonData('resetDelayDuration')+ '秒出价,倒计时重置为'+returnExtraJsonData('resetDelay')+'秒'" :value-style="statisticStyle"/> <a-statistic title="分段延时规则" :value="'倒计时剩余0-'+returnExtraJsonData('resetDelayDuration')+ '秒出价,倒计时重置为'+returnExtraJsonData('resetDelay')+'秒'" :value-style="statisticStyle"/>
......
...@@ -125,14 +125,29 @@ export default class ViewAuctionVehicle extends Vue { ...@@ -125,14 +125,29 @@ export default class ViewAuctionVehicle extends Vue {
handleAddBid(): void { handleAddBid(): void {
const that = this; const that = this;
if (that.isDestroyed) return; if (!this.bidPrice) {
if (!that.bidPrice) {
message.error('请输入出价金额'); message.error('请输入出价金额');
return; return
} }
AuctionController.addBid(that.axios, { aucvehId: that.auctionVehicle.aucvehId, bidPrice: that.bidPrice }).then(() => { if (isNaN(Number(this.bidPrice))) {
if (that.isDestroyed) return; message.error('请输入正确的加价金额');
message.success('操作成功!'); return
}
if (Number(this.bidPrice) < 100) {
message.error('自定义加价金额不能小于100');
return
}
if (Number(this.bidPrice) % 100 != 0) {
message.error('自定义加价金额必须是100的倍数');
return
}
AuctionController.addBid(that.axios, { aucvehId: that.auctionVehicle.aucvehId, bidPrice: that.bidPrice }).then((response) => {
const data = response.data || {};
if (data && data.success) {
message.success('操作成功!');
} else {
message.error(data.message || '操作失败');
}
}); });
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</template> </template>
<a-button v-else v-sec="'control_7'" type="link" size="small" @click="cancelAuctionVehicle(record)">中止</a-button> <a-button v-else v-sec="'control_7'" type="link" size="small" @click="cancelAuctionVehicle(record)">中止</a-button>
</template> </template>
<a-button type="link" v-if="auction.auctionMode == '2' && record.auctionState == 'AUCTIONING'" size="small" @click="handlePriceAdd(record)" >加价设置</a-button> <a-button type="link" v-if="auction.auctionMode == '2' && record.auctionState!=='SOLD' && record.auctionState!=='UNSOLD'" size="small" @click="handlePriceAdd(record)" >加价设置</a-button>
</template> </template>
</template> </template>
<!--拍卖车辆列表end--> <!--拍卖车辆列表end-->
......
<template> <template>
<a-modal v-model:open="exitVisible" :title="modalTitle" width="560px" @ok="handleExit"> <a-modal v-model:open="exitVisible" :title="modalTitle" width="560px" @ok="handleSubmit">
<div> <div>
<a-form ref="formRef" :model="postData" style="width: 100%;margin-top: 24px;"> <a-form ref="formRef" :model="postData" style="width: 100%;margin-top: 24px;">
<a-form-item style="width: 100%" label="启用自动加价" name="autoBidSwitch"> <a-form-item style="width: 100%" label="启用自动加价" name="autoBidSwitch">
...@@ -7,13 +7,12 @@ ...@@ -7,13 +7,12 @@
</a-form-item> </a-form-item>
<a-form-item style="width: 100%" label="加价幅度" name="autoBidRange"> <a-form-item style="width: 100%" label="加价幅度" name="autoBidRange">
<a-input-number style="width: 96%" v-model:value="postData.autoBidRange" :min="100" :step="100" <a-input-number style="width: 96%" v-model:value="postData.autoBidRange" :min="100" :step="100"
:max="50000" :maxlength="6" addon-after="元" placeholder="请输入100的倍数" :max="50000" :maxlength="6" addon-after="元" placeholder="请输入100的倍数" />
@blur="handleAutoBidRangeChange(postData.autoBidRange)" />
</a-form-item> </a-form-item>
<a-form-item style="width: 100%" label="触发时机" name="autoBidTrigger"> <a-form-item style="width: 100%" label="触发计时" name="autoBidTrigger">
<span style="line-height: 32px;padding-right: 8px;">截止倒计时</span> <span style="line-height: 32px;padding-right: 8px;">截止倒计时</span>
<a-input-number style="width: 160px" v-model:value="postData.autoBidTrigger" :min="1" :step="1" <a-input-number style="width: 160px" v-model:value="postData.autoBidTrigger" :min="1" :step="1"
:max="999999" :maxlength="6" placeholder="请输入触发时机" /> :max="999999" :maxlength="6" placeholder="请输入触发计时" />
<span style="line-height: 32px;padding-left: 8px;">秒触发</span> <span style="line-height: 32px;padding-left: 8px;">秒触发</span>
</a-form-item> </a-form-item>
</a-form> </a-form>
...@@ -61,7 +60,30 @@ export default class PriceAddModal extends Vue { ...@@ -61,7 +60,30 @@ export default class PriceAddModal extends Vue {
this.exitVisible = true; this.exitVisible = true;
} }
handleExit(): void { handleSubmit(): void {
if (!this.postData.autoBidRange) {
message.warning('请输入加价幅度');
return;
}
// 校验自定义加价金额是否为数字
if (isNaN(Number(this.postData.autoBidRange))) {
message.warning('请输入正确的加价幅度');
return;
}
// 校验自定义加价金额是否符合规则
if (Number(this.postData.autoBidRange) < 100) {
message.warning('加价幅度不能小于100');
return;
}
//校验加价金额必须是100的倍数
if (Number(this.postData.autoBidRange) % 100 != 0) {
message.warning('加价幅度必须是100的倍数');
return;
}
if (!this.postData.autoBidTrigger) {
message.warning('请输入触发计时');
return;
}
const params = { const params = {
...this.postData, ...this.postData,
autoBidSwitch: this.postData.autoBidSwitch ? 1 : 0, autoBidSwitch: this.postData.autoBidSwitch ? 1 : 0,
......
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
竞价 {{ item.bidCount }} 次 竞价 {{ item.bidCount }} 次
</template> </template>
<template #avatar> <template #avatar>
<a-avatar v-if="index===0" src="/admin/main/assets/images/dashboard/no1.png"/> <a-avatar v-if="index===0" src="/assets/images/dashboard/no1.png"/>
<a-avatar v-else-if="index===1" src="/admin/main/assets/images/dashboard/no2.png"/> <a-avatar v-else-if="index===1" src="/assets/images/dashboard/no2.png"/>
<a-avatar v-else-if="index===2" src="/admin/main/assets/images/dashboard/no3.png"/> <a-avatar v-else-if="index===2" src="/assets/images/dashboard/no3.png"/>
<a-avatar v-else :style="{ backgroundColor: '#B8C0CCFF', verticalAlign: 'middle' }" size="small"> <a-avatar v-else :style="{ backgroundColor: '#B8C0CCFF', verticalAlign: 'middle' }" size="small">
{{ index + 1 }} {{ index + 1 }}
</a-avatar> </a-avatar>
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</template> </template>
<a-empty v-else image="/admin/main/assets/images/common_account.png" description="暂无该车辆的出厂档案信息" style="margin-top: 148px"></a-empty> <a-empty v-else image="/assets/images/common_account.png" description="暂无该车辆的出厂档案信息" style="margin-top: 148px"></a-empty>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Prop, Vue} from 'vue-facing-decorator'; import {Component, Prop, Vue} from 'vue-facing-decorator';
......
<template> <template>
<view v-if="auctionVehicle" class="car-item" @click="viewCarDetail()"> <view v-if="auctionVehicle" class="car-item" @click="viewCarDetail()">
<vehicle-cover-wrapper :auction-vehicle="auctionVehicle"></vehicle-cover-wrapper> <vehicle-cover-wrapper :auction-vehicle="auctionVehicle" @emitLoadListData="emitLoadListData"></vehicle-cover-wrapper>
<view class="recharge-info"> <view class="recharge-info">
<text class="car-name">【{{ cityName }}】{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</text> <text class="car-name">【{{ cityName }}】{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</text>
<text class="car-specs">{{ productionYear }}年 | {{ mileage }}万公里</text> <text class="car-specs">{{ productionYear }}年 | {{ mileage }}万公里</text>
...@@ -59,10 +59,16 @@ export default class AuctionVehicleItem extends AbstractVehicleItem { ...@@ -59,10 +59,16 @@ export default class AuctionVehicleItem extends AbstractVehicleItem {
setTimeout(() => { setTimeout(() => {
uni.showToast({title: this.auctionVehicle.favorite ? '收藏成功' : '取消收藏 '}); uni.showToast({title: this.auctionVehicle.favorite ? '收藏成功' : '取消收藏 '});
}, 300); }, 300);
this.$emit('emitLoadList');
}).finally(() => uni.hideLoading()); }).finally(() => uni.hideLoading());
} }
emitLoadListData(): void {
const that = this;
setTimeout(() => {
that.$emit('emitLoadList');
}, 1600);
}
} }
</script> </script>
......
...@@ -2,35 +2,39 @@ ...@@ -2,35 +2,39 @@
<view> <view>
<uni-popup ref="popupRef" type="center" background-color="#fff" border-radius="24px" z-index="10000" <uni-popup ref="popupRef" type="center" background-color="#fff" border-radius="24px" z-index="10000"
:show-close="false" :mask-click="false"> :show-close="false" :mask-click="false">
<view class="wrapper" v-if="endState == '1'"> <view style="position: relative;">
<view class="top-bg"> <view class="closeIcon" @click.stop="closePopup()">
<view class="top-icon"> <uni-icons type="closeempty" size="20" color="#999999"></uni-icons>
<image src="https://img02.glsx.com.cn/aus/images/roundBid/pop_icon1.png" </view>
class="top-icon-image" /> <view class="wrapper" v-if="endState == '1'">
<view class="top-bg">
<view class="top-icon">
<image src="https://img02.glsx.com.cn/aus/images/roundBid/pop_icon1.png"
class="top-icon-image" />
</view>
<view class="title">竞拍结束</view>
<view class="content">本场全部拍卖已结束</view>
<view class="popup-primary" @click="closePopup()">好的</view>
</view> </view>
<view class="title">竞拍结束</view>
<view class="content">本场全部拍卖已结束</view>
<view class="popup-primary" @click="closePopup()">好的</view>
</view> </view>
</view>
<view class="wrapper" v-if="endState == '2'"> <view class="wrapper" v-if="endState == '2'">
<view class="top-bg"> <view class="top-bg">
<view class="top-icon"> <view class="top-icon">
<image src="https://img02.glsx.com.cn/aus/images/roundBid/pop_icon1.png" <image src="https://img02.glsx.com.cn/aus/images/roundBid/pop_icon1.png"
class="top-icon-image" /> class="top-icon-image" />
</view> </view>
<view class="title">竞拍已结束</view> <view class="title">竞拍已结束</view>
<view class="content">{{ nextAucVehData.remainSecond || 0 }}s后将自动切换到下一台车</view> <view class="content">{{ Math.floor(nextAucVehData.remainSecond || 0) }}s后将自动切换到下一台车</view>
<view class="operation_but"> <view class="operation_but">
<view class="operation_but_primary operation_but_2" @click="closePopup()">取消</view> <view class="operation_but_primary operation_but_2" @click="closePopup()">取消</view>
<view class="operation_but_primary operation_but_1" @click="toNextAucVeh()"> <view class="operation_but_primary operation_but_1" @click="toNextAucVeh()">
确认({{ nextAucVehData.remainSecond || 0 }}s) 确认({{ Math.floor(nextAucVehData.remainSecond || 0) }}s)
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
...@@ -48,9 +52,7 @@ export default class RoundBidPopup extends Vue { ...@@ -48,9 +52,7 @@ export default class RoundBidPopup extends Vue {
isClose = false; isClose = false;
created(): void { created(): void { }
}
//初始化数据 //初始化数据
initData(data: any) { initData(data: any) {
...@@ -69,9 +71,11 @@ export default class RoundBidPopup extends Vue { ...@@ -69,9 +71,11 @@ export default class RoundBidPopup extends Vue {
} }
setTimeoutSecond() { setTimeoutSecond() {
if (this.nextAucVehData.remainSecond) { if (this.endState != '2') return;
if (this.nextAucVehData.remainSecond && Number(this.nextAucVehData.remainSecond) > 0) {
setTimeout(() => { setTimeout(() => {
this.nextAucVehData.remainSecond = Number(this.nextAucVehData.remainSecond) - 1; //取整数部分
this.nextAucVehData.remainSecond = Math.floor(Number(this.nextAucVehData.remainSecond)) - 1;
this.setTimeoutSecond(); this.setTimeoutSecond();
}, 1000); }, 1000);
} else { } else {
...@@ -86,6 +90,7 @@ export default class RoundBidPopup extends Vue { ...@@ -86,6 +90,7 @@ export default class RoundBidPopup extends Vue {
toNextAucVeh() { toNextAucVeh() {
this.popupRef.close('center'); this.popupRef.close('center');
uni.navigateTo({ url: '/module/auction/AuctionVehiclePage?aucvehId=' + this.nextAucVehData.aucvehId }); uni.navigateTo({ url: '/module/auction/AuctionVehiclePage?aucvehId=' + this.nextAucVehData.aucvehId });
this.isClose = true;
} }
closePopup() { closePopup() {
...@@ -206,4 +211,14 @@ export default class RoundBidPopup extends Vue { ...@@ -206,4 +211,14 @@ export default class RoundBidPopup extends Vue {
background: #f2f3f5; background: #f2f3f5;
color: #666666; color: #666666;
} }
.closeIcon {
position: absolute;
top: 20px;
right: 20px;
width: 20px;
height: 20px;
line-height: 20px;
cursor: pointer;
}
</style> </style>
...@@ -27,19 +27,26 @@ ...@@ -27,19 +27,26 @@
<view class="tag-item"> <view class="tag-item">
<template v-if="auctionVehicle.auctionState==='PREVIEW'"> <template v-if="auctionVehicle.auctionState==='PREVIEW'">
<template v-if="previewLessThen24h"> <template v-if="previewLessThen24h">
<van-count-down class="white-small-count-down" :time="previewCountDown" format="HH:mm:ss 后开拍" @finish="countDownBidStart"/> <view v-show="auctionVehicle.auction.auctionMode == 1">
<van-count-down v-if="Number(previewCountDown) > 0 " class="white-small-count-down" :time="previewCountDown" format="HH:mm:ss 后开拍" @finish="finishCountDownBidStart"/>
</view>
<view v-show="auctionVehicle.auction.auctionMode == 2">
{{ (auctionVehicle.auction.auctionStartTime || '').slice(0, 16) }}
</view>
</template> </template>
<template v-else> <template v-else>
{{ previewStatus }} {{ previewStatus }}
</template> </template>
</template> </template>
<template v-if="auctionVehicle.auctionState==='AUCTIONING'"> <template v-if="auctionVehicle.auctionState==='AUCTIONING'">
<template v-if="auctionVehicle.auction.auctionMode==1">
<template v-if="remaining5m"> <template v-if="remaining5m">
<van-count-down class="white-small-count-down" :time="endRemaining" format="距离结束 mm:ss" @finish="countDownBidEnd"/> <van-count-down class="white-small-count-down" :time="endRemaining" format="距离结束 mm:ss" @finish="countDownBidEnd"/>
</template> </template>
<template v-else> <template v-else>
<van-count-down class="white-small-count-down" :time="endRemaining" format="距离结束 HH:mm:ss" @finish="countDownBidEnd"/> <van-count-down class="white-small-count-down" :time="endRemaining" format="距离结束 HH:mm:ss" @finish="countDownBidEnd"/>
</template> </template>
</template>
</template> </template>
</view> </view>
</view> </view>
...@@ -54,6 +61,11 @@ import AbstractVehicleItem from "@/components/AbstractVehicleItem"; ...@@ -54,6 +61,11 @@ import AbstractVehicleItem from "@/components/AbstractVehicleItem";
}) })
export default class VehicleCoverWrapper extends AbstractVehicleItem { export default class VehicleCoverWrapper extends AbstractVehicleItem {
finishCountDownBidStart(): void {
this.countDownBidStart();
this.$emit('emitLoadListData');
}
} }
</script> </script>
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
</van-dropdown-menu> </van-dropdown-menu>
<search-query-filter :search-query="searchQuery" @clear-all="clearAllFilters" @change="pageFilterReload"></search-query-filter> <search-query-filter :search-query="searchQuery" @clear-all="clearAllFilters" @change="pageFilterReload"></search-query-filter>
</view> </view>
<view class="auction-session-container" :style="{ paddingTop: statusBarHeight+filterHeight + 'px' }"> <view class="auction-session-container" :style="{ paddingTop: statusBarHeight+filterHeight + 'px' }">
<!-- 车辆列表 --> <!-- 车辆列表 -->
<scroll-view class="scroll-content" scroll-y :refresher-enabled="true" :refresher-triggered="loading" @scrolltolower="doInfinite()" @refresherrefresh="pageReload"> <scroll-view class="scroll-content" scroll-y :refresher-enabled="true" :refresher-triggered="loading" @scrolltolower="doInfinite()" @refresherrefresh="pageReload">
<view class="car-list"> <view class="car-list">
<template v-if="contents.length>0" v-for="(car, index) in contents" :key="index"> <template v-if="contents.length>0" v-for="(car, index) in contents" :key="index">
<auction-vehicle-item :auction-vehicle="car"></auction-vehicle-item> <auction-vehicle-item :auction-vehicle="car" @emitLoadList="pageReload"></auction-vehicle-item>
</template> </template>
<van-empty class="search-empty" v-else image="https://img02.glsx.com.cn/aus/images/empty_2.png" width="100" height="100" description="未找到相关车源,为你推荐以下车源"/> <van-empty class="search-empty" v-else image="https://img02.glsx.com.cn/aus/images/empty_2.png" width="100" height="100" description="未找到相关车源,为你推荐以下车源"/>
</view> </view>
...@@ -41,6 +41,8 @@ import {BACKGROUND_IMAGE_1} from "@/static/ResourceConstants"; ...@@ -41,6 +41,8 @@ import {BACKGROUND_IMAGE_1} from "@/static/ResourceConstants";
import AuctionVehicleFilter from "@/components/filter/AuctionVehicleFilter"; import AuctionVehicleFilter from "@/components/filter/AuctionVehicleFilter";
import SearchQueryFilter from "@/components/filter/SearchQueryFilter.vue"; import SearchQueryFilter from "@/components/filter/SearchQueryFilter.vue";
import VehiclePriceRangeFilter from "@/components/filter/VehiclePriceRangeFilter.vue"; import VehiclePriceRangeFilter from "@/components/filter/VehiclePriceRangeFilter.vue";
import {AuctionVehicle} from "lib/src/entity/auction/entity/AuctionVehicle";
@Component({ @Component({
components: {VehiclePriceRangeFilter, SearchQueryFilter, CustomNavBar, AuctionVehicleItem} components: {VehiclePriceRangeFilter, SearchQueryFilter, CustomNavBar, AuctionVehicleItem}
...@@ -109,6 +111,14 @@ export default class AuctionSessionPage extends AuctionVehicleFilter { ...@@ -109,6 +111,14 @@ export default class AuctionSessionPage extends AuctionVehicleFilter {
return this.searchQuery != null ? 120 : 85; return this.searchQuery != null ? 120 : 85;
} }
get contents(): AuctionVehicle[] {
const list = (this.pagination.content || []).map(item => {
const vehicleObj = item.vehicle || {};
return { ...item, auctionState: vehicleObj.vehicleState || item.auctionState }
});
return list;
}
loadAuctionVehicles() { loadAuctionVehicles() {
AuctionController.getAuctionById(this.axios, this.auctionId).then(res => { AuctionController.getAuctionById(this.axios, this.auctionId).then(res => {
this.auction = res.data; this.auction = res.data;
......
<template> <template>
<view class="dialog-container"> <view class="dialog-container">
<view class="bg-image" :style="{ backgroundImage:`url(${backgroundImageUrl})` }"></view> <view class="bg-image" :style="{ backgroundImage: `url(${backgroundImageUrl})` }"></view>
<view class="dialog-body"> <view class="dialog-body">
<view class="dialog-icon"> <view class="dialog-icon">
<van-image width="100" height="100" fit="cover" src="https://img02.glsx.com.cn/aus/images/order/payment.png"></van-image> <van-image width="100" height="100" fit="cover"
src="https://img02.glsx.com.cn/aus/images/order/payment.png"></van-image>
</view> </view>
<view class="dialog-header"> <view class="dialog-header">
恭喜你中拍成功! 恭喜你中拍成功!
</view> </view>
<view v-if="auctionVehicle.auction.auctionMode != 2" class="dialog-content"> <view v-if="auctionVehicle.auction.auctionMode != 2" class="dialog-content">
<text>请尽快签署购车协议,并支付款项以锁定车辆</text> <text>请尽快签署购车协议,并支付款项以锁定车辆</text>
</view> </view>
<view v-if="auctionVehicle.auction.auctionMode == 2" class="dialog-auctionMode" > <view v-if="auctionVehicle.auction.auctionMode == 2 && isNextAucVeh" class="nextTip">
是否前往参拍下一辆车?
</view>
<view v-if="auctionVehicle.auction.auctionMode == 2" class="dialog-auctionMode">
<view class="auctionMode-img"> <view class="auctionMode-img">
<van-image width="28" height="28" style="margin: 6px;float: left;" fit="cover" src="https://img02.glsx.com.cn/aus/images/roundBid/title_icon.png"></van-image> <van-image width="28" height="28" style="margin: 6px;float: left;" fit="cover"
src="https://img02.glsx.com.cn/aus/images/roundBid/title_icon.png"></van-image>
</view> </view>
<view class="auctionMode-text"> <view class="auctionMode-text">
已中拍车辆可在【我的-购车订单】中进行付款与确认购车 <text style="color: #185EFE;" @click="signContract" >前往购车确认</text> 已中拍车辆可在【我的-购车订单】中进行付款与确认购车
<text style="color: #185EFE; cursor: pointer;display: inline-block;"
@click.stop="signContract()">前往购车确认</text>
</view> </view>
</view> </view>
<view class="dialog-footer"> <view v-if="!isNextAucVeh" class="dialog-footer">
<van-button class="dialog-footer_but" type="default" round block @click="$emit('close')">知道了</van-button> <van-button class="dialog-footer_but" type="default" round block @click="handleClose()">取消</van-button>
<van-button class="dialog-footer_but" type="primary" style="margin-left: 12px;" hairline round block @click="signContract">去签署购车协议</van-button> <van-button class="dialog-footer_but" type="primary" style="margin-left: 12px;" hairline round block
</view> @click="signContract()">去签署购车协议</van-button>
</view>
<view v-if="isNextAucVeh" class="dialog-footer">
<van-button class="dialog-footer_but" type="default" round block @click="handleClose()">取消</van-button>
<van-button class="dialog-footer_but" type="primary" style="margin-left: 12px;" hairline round block @click="toNextAucVeh()">
继续参拍
<text v-if="nextAucVehData.remainSecond">({{ Math.floor(nextAucVehData.remainSecond || 0) }}s)</text>
</van-button>
</view>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Prop, Vue} from "vue-facing-decorator"; import { Component, Prop, Vue } from "vue-facing-decorator";
import {BACKGROUND_IMAGE_2} from "@/static/ResourceConstants"; import { BACKGROUND_IMAGE_2 } from "@/static/ResourceConstants";
@Component({ @Component({
components: {} components: {}
...@@ -40,17 +58,63 @@ import {BACKGROUND_IMAGE_2} from "@/static/ResourceConstants"; ...@@ -40,17 +58,63 @@ import {BACKGROUND_IMAGE_2} from "@/static/ResourceConstants";
export default class BidSuccessDialog extends Vue { export default class BidSuccessDialog extends Vue {
backgroundImageUrl = BACKGROUND_IMAGE_2; backgroundImageUrl = BACKGROUND_IMAGE_2;
@Prop({type: Number, required: true}) @Prop({ type: Number, required: true })
orderId: number; orderId: number;
@Prop({ type: Object, required: true }) @Prop({ type: Object, required: true })
auctionVehicle: any; auctionVehicle: any;
signContract(): void { nextAucVehData = {
aucvehId: '',
remainSecond: 0,
};
isNextAucVeh = false;
isHandleClose = false;
initData(data: any) {
if (this.nextAucVehData.remainSecond) {
return;
}
this.isHandleClose = false;
const { aucvehId, remainSecond } = data || {};
this.nextAucVehData.aucvehId = aucvehId || '';
this.nextAucVehData.remainSecond = remainSecond || 0;
this.isNextAucVeh = aucvehId ? true : false;
this.setTimeoutSecond();
}
setTimeoutSecond() {
if (this.nextAucVehData.aucvehId) {
if (this.nextAucVehData.remainSecond && Number(this.nextAucVehData.remainSecond) > 0) {
setTimeout(() => {
this.nextAucVehData.remainSecond = Math.floor(Number(this.nextAucVehData.remainSecond)) - 1;
this.setTimeoutSecond();
}, 1000);
} else {
this.nextAucVehData.remainSecond = 0;
if (!this.isHandleClose) {
this.toNextAucVeh();
}
}
}
}
handleClose() {
this.isHandleClose = true;
this.$emit('close');
}
//跳转到下一辆车
toNextAucVeh() {
this.$emit('close');
uni.navigateTo({ url: '/module/auction/AuctionVehiclePage?aucvehId=' + this.nextAucVehData.aucvehId });
}
signContract() {
console.log('signContract called', this.orderId); // 添加调试信息
uni.navigateTo({ url: '/module/order/contract/ContractPage?orderId=' + this.orderId });
this.$emit('close'); this.$emit('close');
uni.navigateTo({
url: '/module/order/contract/ContractPage?orderId=' + this.orderId
});
} }
} }
</script> </script>
...@@ -65,7 +129,8 @@ export default class BidSuccessDialog extends Vue { ...@@ -65,7 +129,8 @@ export default class BidSuccessDialog extends Vue {
} }
.bg-image { .bg-image {
background-attachment: inherit; /* 将背景图固定不动 */ background-attachment: inherit;
/* 将背景图固定不动 */
} }
.dialog-body { .dialog-body {
...@@ -102,7 +167,7 @@ export default class BidSuccessDialog extends Vue { ...@@ -102,7 +167,7 @@ export default class BidSuccessDialog extends Vue {
float: left; float: left;
} }
.dialog-footer_but{ .dialog-footer_but {
width: -webkit-calc(50% - 6px); width: -webkit-calc(50% - 6px);
width: -moz-calc(50% - 6px); width: -moz-calc(50% - 6px);
width: calc(50% - 6px); width: calc(50% - 6px);
...@@ -127,15 +192,34 @@ export default class BidSuccessDialog extends Vue { ...@@ -127,15 +192,34 @@ export default class BidSuccessDialog extends Vue {
float: left; float: left;
} }
.auctionMode-text{ .auctionMode-text {
width: -webkit-calc(100% - 64px); width: -webkit-calc(100% - 64px);
width: -webkit-calc(100% - 64px); width: -moz-calc(100% - 64px);
width: -webkit-calc(100% - 64px); width: calc(100% - 64px);
float: left; float: left;
color: #676d7d; color: #676d7d;
font-size: 12px; font-size: 12px;
font-family: "苹方-简";
line-height: 20px; line-height: 20px;
margin: 8px 0; margin: 8px 0;
position: relative; // 确保元素在正确的层级
z-index: 1; // 确保元素在上方
text {
display: inline-block; // 确保文本块可点击
padding: 2px 0; // 增加点击区域
}
}
.nextTip {
width: 100%;
height: 22px;
float: left;
margin-top: 8px;
text-align: center;
color: #676d7d;
font-size: 14px;
font-weight: 常规体;
font-family: "苹方-简";
line-height: 22px;
} }
</style> </style>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<view class="car-list"> <view class="car-list">
<template v-if="contents.length>0" v-for="(car, index) in contents" :key="index"> <template v-if="contents.length>0" v-for="(car, index) in contents" :key="index">
<!-- 车辆项 --> <!-- 车辆项 -->
<auction-vehicle-item :auction-vehicle="car"></auction-vehicle-item> <auction-vehicle-item :auction-vehicle="car" @emitLoadList="pageReload"></auction-vehicle-item>
<!-- 广告横幅 --> <!-- 广告横幅 -->
<!-- <view class="banner" v-if="index%5===4">--> <!-- <view class="banner" v-if="index%5===4">-->
<!-- <image src="/static/images/banner.png" mode="aspectFill" class="banner-image"/>--> <!-- <image src="/static/images/banner.png" mode="aspectFill" class="banner-image"/>-->
......
<template>
<view class="custom-nav" :style="{ height: statusBarHeight + 'px' }">
<view :style="{ height: statusBarHeight + 'px' }"></view>
<view class="nav-content">
<view class="nav-left" @click="onBack">
<uni-icons type="left" size="24" color="#333" />
</view>
<view class="nav-title">车辆详情</view>
</view>
</view>
</template>
<script lang="ts">
import { Vue, Component, Prop } from 'vue-facing-decorator';
@Component({})
export default class customNav extends Vue {
// 状态栏高度(微信小程序中由系统提供)
@Prop({ type: Number, required: false, default: 48 })
statusBarHeight: number;
onBack() {
if (this.getPreviousPageOptions() == 'module/auction/AuctionVehiclePage') {
uni.switchTab({ url: '/pages/tabbar/AuctionPage' });
} else {
uni.navigateBack();
}
}
//获取上一个页面传递的参数
getPreviousPageOptions(): any {
const pages = getCurrentPages();
const previousPage = pages[pages.length - 2];
return previousPage?.route || '';
}
}
</script>
<style scoped lang="scss">
.custom-nav {
width: 100%;
position: fixed;
top: -1px;
left: 0;
z-index: 999; // 确保在页面内容上方
background: #ffffff;
}
.nav-content {
display: flex;
align-items: center;
justify-content: center;
position: relative;
height: 44px;
background: #ffffff;
}
.nav-left {
position: absolute;
left: 2px;
width: 80rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.back-icon {
font-size: 36rpx;
color: #333;
}
.nav-title {
font-size: 32rpx;
color: #333;
font-weight: 400;
}
.nav-right {
position: absolute;
right: 16rpx;
height: 100%;
display: flex;
align-items: center;
}
</style>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<template v-if="contents.length>0" v-for="(favorite, index) in contents" :key="index"> <template v-if="contents.length>0" v-for="(favorite, index) in contents" :key="index">
<!-- 车辆项 --> <!-- 车辆项 -->
<van-swipe-cell :right-width="65" :async-close="false" class="van-swipe-cell"> <van-swipe-cell :right-width="65" :async-close="false" class="van-swipe-cell">
<auction-vehicle-item :auction-vehicle="favorite.auctionVehicle" :show-favorite="false"></auction-vehicle-item> <auction-vehicle-item :auction-vehicle="favorite.auctionVehicle" :show-favorite="false" @emitLoadList="pageReload"></auction-vehicle-item>
<view slot="right" class="van-swipe-cell__right" @click="removeFavorite(favorite)">删除</view> <view slot="right" class="van-swipe-cell__right" @click="removeFavorite(favorite)">删除</view>
</van-swipe-cell> </van-swipe-cell>
</template> </template>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="car-list"> <view class="car-list">
<template v-if="contents.length>0" v-for="(favorite, index) in contents" :key="index"> <template v-if="contents.length>0" v-for="(favorite, index) in contents" :key="index">
<!-- 车辆项 --> <!-- 车辆项 -->
<auction-vehicle-item :auction-vehicle="favorite.auctionVehicle" :show-favorite="false"></auction-vehicle-item> <auction-vehicle-item :auction-vehicle="favorite.auctionVehicle" :show-favorite="false" @emitLoadList="pageReload"></auction-vehicle-item>
</template> </template>
<van-empty v-else image="https://img02.glsx.com.cn/aus/images/empty.png" style="margin-top: 100px" description="暂无浏览记录"/> <van-empty v-else image="https://img02.glsx.com.cn/aus/images/empty.png" style="margin-top: 100px" description="暂无浏览记录"/>
<view v-if="contents.length>0&&pagination.isLast()" class="empty-tip"> <view v-if="contents.length>0&&pagination.isLast()" class="empty-tip">
......
...@@ -72,8 +72,8 @@ ...@@ -72,8 +72,8 @@
{ {
"path": "AuctionVehiclePage", "path": "AuctionVehiclePage",
"style": { "style": {
"navigationBarTitleText": "车辆详情", "disableScroll": true,
"enablePullDownRefresh": true "navigationStyle": "custom"
} }
}, },
{ {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<uni-search-bar v-else v-model="searchText" placeholder="搜索车型名称" radius="60" @clear="onDarkCancel" @confirm="onDarkSearch" <uni-search-bar v-else v-model="searchText" placeholder="搜索车型名称" radius="60" @clear="onDarkCancel" @confirm="onDarkSearch"
cancelButton="none" @cancel="onDarkCancel" bgColor="#fff" class="search-bar"/> cancelButton="none" @cancel="onDarkCancel" bgColor="#fff" class="search-bar"/>
<view class="favorite-icon" @click="navigateTo('/module/profile/FavoritePage')"> <view class="favorite-icon" @click="navigateTo('/module/profile/FavoritePage')">
<image src="https://img02.glsx.com.cn/aus/images/auction/favorite.png"></image> <image src="https://img02.glsx.com.cn/aus/images/common/favorite.png"></image>
</view> </view>
</view> </view>
<!-- 拍卖类型切换 --> <!-- 拍卖类型切换 -->
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</view> </view>
<view class="tool-item" @click="navigateTo('/module/profile/FavoritePage')"> <view class="tool-item" @click="navigateTo('/module/profile/FavoritePage')">
<view class="tool-icon"> <view class="tool-icon">
<image src="https://img02.glsx.com.cn/aus/images/auction/favorite.png" mode="aspectFill" class="tools-image"/> <image src="https://img02.glsx.com.cn/aus/images/profile/favorite.png" mode="aspectFill" class="tools-image"/>
</view> </view>
<text class="tool-name">我的收藏</text> <text class="tool-name">我的收藏</text>
</view> </view>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<scroll-view class="scroll-content" scroll-y :refresher-enabled="true" :refresher-triggered="loading" @scrolltolower="doInfinite()" @refresherrefresh="pageReload"> <scroll-view class="scroll-content" scroll-y :refresher-enabled="true" :refresher-triggered="loading" @scrolltolower="doInfinite()" @refresherrefresh="pageReload">
<view v-if="pagination.content.length>0" class="car-list"> <view v-if="pagination.content.length>0" class="car-list">
<template v-for="(car, index) in contents" :key="index"> <template v-for="(car, index) in contents" :key="index">
<auction-vehicle-item :auction-vehicle="car"></auction-vehicle-item> <auction-vehicle-item :auction-vehicle="car" @emitLoadList="pageRefresh" ></auction-vehicle-item>
</template> </template>
</view> </view>
<van-empty v-else image="https://img02.glsx.com.cn/aus/images/empty_2.png" description="未找到相关车源"/> <van-empty v-else image="https://img02.glsx.com.cn/aus/images/empty_2.png" description="未找到相关车源"/>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<scroll-view class="scroll-content" :refresher-enabled="true" scroll-y :refresher-triggered="loading" @scrolltolower="doInfinite()" @refresherrefresh="pageReload"> <scroll-view class="scroll-content" :refresher-enabled="true" scroll-y :refresher-triggered="loading" @scrolltolower="doInfinite()" @refresherrefresh="pageReload">
<view v-if="pagination.content.length>0" class="car-list"> <view v-if="pagination.content.length>0" class="car-list">
<template v-for="(car, index) in contents"> <template v-for="(car, index) in contents">
<auction-vehicle-item :auction-vehicle="car"></auction-vehicle-item> <auction-vehicle-item :auction-vehicle="car" @emitLoadList="pageRefresh"></auction-vehicle-item>
</template> </template>
</view> </view>
<van-empty v-else image="https://img02.glsx.com.cn/aus/images/empty_2.png" description="未找到相关车源"/> <van-empty v-else image="https://img02.glsx.com.cn/aus/images/empty_2.png" description="未找到相关车源"/>
......
...@@ -45,7 +45,14 @@ export default class LikeAuctionVehicles extends PaginationComponent<AuctionVehi ...@@ -45,7 +45,14 @@ export default class LikeAuctionVehicles extends PaginationComponent<AuctionVehi
get contents(): AuctionVehicle[] { get contents(): AuctionVehicle[] {
return this.pagination.content; const list = (this.pagination.content || []).map(item => {
let auctionState = item.auctionState;
if (item.auction?.auctionMode == 2) {
auctionState = item.vehicle?.vehicleState || item.auctionState;
}
return { ...item, auctionState: auctionState, }
});
return list;
} }
} }
</script> </script>
......
...@@ -67,7 +67,14 @@ export default class RecommendAuctionVehicles extends PaginationComponent<Auctio ...@@ -67,7 +67,14 @@ export default class RecommendAuctionVehicles extends PaginationComponent<Auctio
} }
get contents(): AuctionVehicle[] { get contents(): AuctionVehicle[] {
return this.pagination.content; const list = (this.pagination.content || []).map(item => {
let auctionState = item.auctionState;
if (item.auction?.auctionMode == 2) {
auctionState = item.vehicle?.vehicleState || item.auctionState;
}
return { ...item, auctionState: auctionState, }
});
return list;
} }
} }
</script> </script>
......
...@@ -5,7 +5,12 @@ ...@@ -5,7 +5,12 @@
<view class="light-status"> <view class="light-status">
<template v-if="auctionVehicle.auctionState==='PREVIEW'"> <template v-if="auctionVehicle.auctionState==='PREVIEW'">
<template v-if="previewLessThen24h"> <template v-if="previewLessThen24h">
<van-count-down class="red-small-count-down" :time="previewCountDown" format="HH:mm:ss 后开拍" @finish="countDownBidStart"/> <view v-show="auctionVehicle?.auction?.auctionMode == 1">
<van-count-down class="red-small-count-down" :time="previewCountDown" format="HH:mm:ss 后开拍" @finish="countDownBidStart"/>
</view>
<view v-show="auctionVehicle?.auction?.auctionMode == 2">
{{ (auctionVehicle?.auctionStartTime || '').slice(5, 16).replace('-', '/') }} 起拍
</view>
</template> </template>
<template v-else> <template v-else>
{{ previewStatus }} 开拍 {{ previewStatus }} 开拍
...@@ -17,7 +22,7 @@ ...@@ -17,7 +22,7 @@
</template> </template>
<template v-else> <template v-else>
<text style="color: #EE3140;font-size: 10px;margin-right: 3px">竞拍中</text> <text style="color: #EE3140;font-size: 10px;margin-right: 3px">竞拍中</text>
<van-count-down class="white-small-count-down" :time="endRemaining" format="HH:mm:ss" @finish="countDownBidEnd"/> <van-count-down v-show="auctionVehicle?.auction?.auctionMode == 1" class="white-small-count-down" :time="endRemaining" format="HH:mm:ss" @finish="countDownBidEnd"/>
</template> </template>
</template> </template>
<template v-else> <template v-else>
......
...@@ -22,15 +22,11 @@ public class LightPoollingAuctionSchedule { ...@@ -22,15 +22,11 @@ public class LightPoollingAuctionSchedule {
*/ */
@Scheduled(fixedDelay = 1000, initialDelay = 1000 * 5) @Scheduled(fixedDelay = 1000, initialDelay = 1000 * 5)
public void autoBidding() { public void autoBidding() {
// log.info("自动竞价定时任务");
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
try { try {
auctionService.autoBidding(); auctionService.autoBidding();
} catch (Exception e) { } catch (Exception e) {
log.error("自动竞价定时任务异常", e); log.error("自动竞价定时任务异常", e);
} finally {
// long end = System.currentTimeMillis();
// log.info("自动竞价定时任务耗时{}ms", end - start);
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!