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 923 additions and 370 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"/>
......
...@@ -53,51 +53,35 @@ ...@@ -53,51 +53,35 @@
:field-names="{ label: 'realName', value: 'userId' }" placeholder="请选择拍卖管理员"></m-select> :field-names="{ label: 'realName', value: 'userId' }" placeholder="请选择拍卖管理员"></m-select>
</a-form-item> </a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="结束后自动跳转延期" name="delay" tooltip="用户在小程序端完成认证/充值或一辆车拍卖结束后,触发自动跳转前的等待时间。" <a-form-item v-if="formState.auctionMode == '2'" label="结束后自动跳转延期" name="bidAucVehDuration" tooltip="用户在小程序端完成认证/充值或一辆车拍卖结束后,触发自动跳转前的等待时间。"
:rules="[{ required: true, message: '请输入结束后自动跳转延期时间!' }]"> :rules="[{ required: true, message: '请输入结束后自动跳转延期时间!' }]">
<a-input-number style="width: 100%" v-model:value="formState.delay" :min="1" :step="1" <a-input-number style="width: 100%" v-model:value="formState.bidAucVehDuration" :min="1" :step="1"
:max="60" :maxlength="2" addon-after="秒" placeholder="请输入结束后自动跳转延期时间" /> :max="60" :maxlength="2" :precision="0" addon-after="秒" placeholder="请输入结束后自动跳转延期时间" />
</a-form-item> </a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="接近保留价提醒阈值" tooltip="当车辆当前价达到(保留价-此阈值)时,小程序端将对用户展示‘’的标签。" name="nearReservePriceThreshold" <a-form-item v-if="formState.auctionMode == '2'" label="接近保留价提醒阈值" tooltip="当车辆当前价达到(保留价-此阈值)时,小程序端将对用户展示的标签。" name="nearReservePriceThreshold"
:rules="[{ required: true, message: '请输入接近保留价提醒阈值!' }]"> :rules="[{ required: true, message: '请输入接近保留价提醒阈值!' }]">
<a-input-number style="width: 100%" v-model:value="formState.nearReservePriceThreshold" <a-input-number style="width: 100%" v-model:value="formState.nearReservePriceThreshold"
:min="0" :step="100" :max="100000" :maxlength="5" addon-after="元" placeholder="请输入接近保留价提醒阈值" /> :min="0" :step="100" :max="1000000" :precision="0" :maxlength="6" addon-after="元" placeholder="请输入接近保留价提醒阈值" />
</a-form-item> </a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="系统&用户加价重置延时" tooltip="在价格未达到保留价前,由系统自动加价或后台用户手动加价后,重置给下一位出价者的倒计时时长。该时长会受到下方的“分段延时规则”影响。" name="resetDelay" <a-form-item v-if="formState.auctionMode == '2'" label="车辆拍卖时长" name="aucvehDuration"
:rules="[{ required: true, message: '请输入车辆拍卖时长!' }]">
<a-input-number v-model:value="formState.aucvehDuration" :min="1" :max="99999" :precision="0" :maxlength="5" style="width: 100%" addon-after="秒" @blur="changeAucvehDuration" placeholder="请输入车辆持续时间"></a-input-number>
</a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="系统&用户加价重置延时" tooltip="在价格未达到保留价前,由系统自动加价或用户手动加价后,重置给下一位出价者的倒计时时长。该时长会受到下方的“分段延时规则”影响。" name="resetDelay"
:rules="[{ required: true, message: '请输入重置延时!' }]"> :rules="[{ required: true, message: '请输入重置延时!' }]">
<a-input-number v-model:value="formState.resetDelay" :min="1" :max="99999" :maxlength="5" <a-input-number v-model:value="formState.resetDelay" :min="1" :step="1" :max="formState.aucvehDuration" :precision="0" :maxlength="5"
style="width: 100%" addon-after="秒" placeholder="请输入重置延时"> style="width: 100%" addon-after="秒" placeholder="请输入重置延时">
<!-- <template #addonAfter>
<a-select v-model:value="resetDelayUnit" style="width: 80px">
<a-select-option value="second">秒</a-select-option>
<a-select-option value="minute">分</a-select-option>
</a-select>
</template> -->
</a-input-number> </a-input-number>
</a-form-item> </a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="车辆持续时间" name="aucvehDuration"
:rules="[{ required: true, message: '请输入车辆持续时间!' }]">
<a-input-number v-model:value="formState.aucvehDuration" :min="1" :max="99999" :maxlength="5" style="width: 100%" addon-after="秒" placeholder="请输入车辆持续时间"></a-input-number>
</a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="拍卖车辆间隔时间" name="bidAucVehDuration"
:rules="[{ required: true, message: '请输入拍卖车辆间隔时间!' }]">
<a-input-number v-model:value="formState.bidAucVehDuration" :min="1" :max="99999" :maxlength="5" style="width: 100%" addon-after="秒" placeholder="请输入拍卖车辆间隔时间"></a-input-number>
</a-form-item>
<a-form-item v-if="formState.auctionMode == '2'" label="分段延时规则" name="resetDelayDuration" tooltip="这是对“用户加价重置倒计时”的高级补充规则,用于在最后阶段制造紧张感。校验规则: 此处设置的时长必须为正整数,且不能超过“用户加价重置倒计时”的总时长。逻辑示例: 若“用户加价重置”为20秒,此处设为10秒。那么:倒计时在 10-30秒 之间时出价,倒计时不重置。倒计时在 0-10秒 之间时出价,倒计时才会重置为20秒。" :rules="[{ required: true, message: '请输入分段延时规则!' }]"> <a-form-item v-if="formState.auctionMode == '2'" label="分段延时规则" name="resetDelayDuration" tooltip="这是对“用户加价重置倒计时”的高级补充规则,用于在最后阶段制造紧张感。校验规则: 此处设置的时长必须为正整数,且不能超过“用户加价重置倒计时”的总时长。逻辑示例: 若“用户加价重置”为20秒,此处设为10秒。那么:倒计时在 10-30秒 之间时出价,倒计时不重置。倒计时在 0-10秒 之间时出价,倒计时才会重置为20秒。" :rules="[{ required: true, message: '请输入分段延时规则!' }]">
<span style="line-height: 32px;">在倒计时剩余 </span> <span style="line-height: 32px;">在倒计时剩余 </span>
<a-input-number v-model:value="formState.resetDelayDuration" :min="1" :max="formState.resetDelay-1" <a-input-number v-model:value="formState.resetDelayDuration" :min="1" :max="formState.resetDelay-1"
:maxlength="5" style="width: 48%" addon-after="秒" placeholder="请输入"> :precision="0" :maxlength="5" style="width: 48%" addon-after="秒" placeholder="请输入">
<!-- <template #addonAfter>
<a-select v-model:value="resetDelayDurationUnit" style="width: 80px">
<a-select-option value="second">秒</a-select-option>
<a-select-option value="minute">分</a-select-option>
</a-select>
</template> -->
</a-input-number> </a-input-number>
<span style="line-height: 32px;"> 内出价,才会重置倒计时</span> <span style="line-height: 32px;"> 内出价,才会重置倒计时</span>
</a-form-item> </a-form-item>
...@@ -112,7 +96,7 @@ ...@@ -112,7 +96,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item v-if="formState.auctionMode == '1'" label="延时规则" name="beforeEndMinute" :rules="[{ required: true, message: '请输入延时规则!' }]" :label-col="{span: 3}" :wrapper-col="{span: 19}" class="row-item"> <a-form-item v-if="formState.auctionMode == '1'" label="延时规则" name="beforeEndMinute" :rules="[{ required: true, message: '请输入延时规则!' }]" :label-col="{span: 3}" :wrapper-col="{span: 19}" class="row-item">
<a-input-number v-model:value="formState.beforeEndMinute" addon-before="最后" :min="0" :step="1" :max="9999" :maxlength="4" addon-after="分钟内的出价" placeholder="请输入"/> <a-input-number v-model:value="formState.beforeEndMinute" addon-before="最后" :min="0" :step="1" :max="9999" :maxlength="4" addon-after="分钟内的出价" placeholder="请输入"/>
<a-input-number v-model:value="formState.delayMinute" addon-before="自动延时" :min="0" :step="1" :max="9999" :maxlength="4" addon-after="分钟" placeholder="请输入"/> <a-input-number v-model:value="formState.delayMinute" addon-before="自动延时" :min="0" :step="1" :max="9999" :maxlength="4" addon-after="分钟" placeholder="请输入"/>
</a-form-item> </a-form-item>
...@@ -137,7 +121,8 @@ ...@@ -137,7 +121,8 @@
<a-form-item :wrapper-col="{span: 24}" class="row-item"> <a-form-item :wrapper-col="{span: 24}" class="row-item">
<a-alert message="请先在基本信息中设置拍卖开始时间,以便自动计算各车辆的起拍时间" type="warning" show-icon/> <a-alert message="请先在基本信息中设置拍卖开始时间,以便自动计算各车辆的起拍时间" type="warning" show-icon/>
</a-form-item> </a-form-item>
<a-form-item label="批量设置" :label-col="{span: 3}" :wrapper-col="{span: 19}" class="row-item">
<a-form-item v-if="formState.auctionMode == '1'" label="批量设置" :label-col="{span: 3}" :wrapper-col="{span: 19}" class="row-item">
<a-input-number v-model:value="intervalMinute" addon-before="每辆车拍卖间隔" :min="0" :step="1" :maxlength="4" :max="9999" addon-after="分钟" placeholder="请输入"/> <a-input-number v-model:value="intervalMinute" addon-before="每辆车拍卖间隔" :min="0" :step="1" :maxlength="4" :max="9999" addon-after="分钟" placeholder="请输入"/>
<a-button type="default" @click="applyInterval" class="ml-10">应用到全部</a-button> <a-button type="default" @click="applyInterval" class="ml-10">应用到全部</a-button>
</a-form-item> </a-form-item>
...@@ -164,7 +149,7 @@ ...@@ -164,7 +149,7 @@
<check-outlined class="editable-cell-icon-check" @click="saveVehicle(record.vehicle.vehicleId,'previewStartTime')"/> <check-outlined class="editable-cell-icon-check" @click="saveVehicle(record.vehicle.vehicleId,'previewStartTime')"/>
</div> </div>
<div v-else class="editable-cell-text-wrapper"> <div v-else class="editable-cell-text-wrapper">
{{ record.previewStartTime }} {{ record.previewStartTime.length == 16 ? record.previewStartTime + ':00' : record.previewStartTime }}
<edit-outlined class="editable-cell-icon" @click="editVehicle(record.vehicle.vehicleId,'previewStartTime')"/> <edit-outlined class="editable-cell-icon" @click="editVehicle(record.vehicle.vehicleId,'previewStartTime')"/>
</div> </div>
</div> </div>
...@@ -178,7 +163,7 @@ ...@@ -178,7 +163,7 @@
<check-outlined class="editable-cell-icon-check" @click="saveVehicle(record.vehicle.vehicleId, 'auctionStartTime')"/> <check-outlined class="editable-cell-icon-check" @click="saveVehicle(record.vehicle.vehicleId, 'auctionStartTime')"/>
</div> </div>
<div v-else class="editable-cell-text-wrapper"> <div v-else class="editable-cell-text-wrapper">
{{ record.auctionStartTime }} {{ record.auctionStartTime.length == 16 ? record.auctionStartTime + ':00' : record.auctionStartTime }}
<edit-outlined class="editable-cell-icon" @click="editVehicle(record.vehicle.vehicleId, 'auctionStartTime')"/> <edit-outlined class="editable-cell-icon" @click="editVehicle(record.vehicle.vehicleId, 'auctionStartTime')"/>
</div> </div>
</div> </div>
...@@ -192,7 +177,7 @@ ...@@ -192,7 +177,7 @@
<check-outlined class="editable-cell-icon-check" @click="saveVehicle(record.vehicle.vehicleId, 'auctionEndTime')"/> <check-outlined class="editable-cell-icon-check" @click="saveVehicle(record.vehicle.vehicleId, 'auctionEndTime')"/>
</div> </div>
<div v-else class="editable-cell-text-wrapper"> <div v-else class="editable-cell-text-wrapper">
{{ record.auctionEndTime }} {{ record.auctionEndTime.length == 16 ? record.auctionEndTime + ':00' : record.auctionEndTime }}
<edit-outlined class="editable-cell-icon" @click="editVehicle(record.vehicle.vehicleId, 'auctionEndTime')"/> <edit-outlined class="editable-cell-icon" @click="editVehicle(record.vehicle.vehicleId, 'auctionEndTime')"/>
</div> </div>
</div> </div>
...@@ -295,9 +280,9 @@ export default class AuctionForm extends FormComponent<Auction> { ...@@ -295,9 +280,9 @@ export default class AuctionForm extends FormComponent<Auction> {
{title: '所属门店', dataIndex: ['vehicle', 'venue', 'venueName'], key: 'venueName', align: 'right', width: 130, resizable: true, ellipsis: true, sorter: false}, {title: '所属门店', dataIndex: ['vehicle', 'venue', 'venueName'], key: 'venueName', align: 'right', width: 130, resizable: true, ellipsis: true, sorter: false},
{title: '起拍价', dataIndex: ['vehicle', 'startingBidPrice'], key: 'startingBidPrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: false}, {title: '起拍价', dataIndex: ['vehicle', 'startingBidPrice'], key: 'startingBidPrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: false},
{title: '保留价', dataIndex: ['vehicle', 'reservePrice'], key: 'reservePrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: false}, {title: '保留价', dataIndex: ['vehicle', 'reservePrice'], key: 'reservePrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: false},
{title: '预展时间', dataIndex: 'previewStartTime', key: 'previewStartTime', align: 'center', fixed: 'right', width: 192, resizable: false, ellipsis: true, sorter: false}, {title: '预展时间', dataIndex: 'previewStartTime', key: 'previewStartTime', align: 'center', fixed: 'right', width: 240, resizable: false, ellipsis: true, sorter: false},
{title: '起拍时间', dataIndex: 'auctionStartTime', key: 'auctionStartTime', align: 'center', fixed: 'right', width: 192, resizable: false, ellipsis: true, sorter: false}, {title: '起拍时间', dataIndex: 'auctionStartTime', key: 'auctionStartTime', align: 'center', fixed: 'right', width: 240, resizable: false, ellipsis: true, sorter: false},
{title: '拍卖结束时间', dataIndex: 'auctionEndTime', key: 'auctionEndTime', align: 'center', fixed: 'right', width: 192, resizable: false, ellipsis: true, sorter: false}, {title: '拍卖结束时间', dataIndex: 'auctionEndTime', key: 'auctionEndTime', align: 'center', fixed: 'right', width: 240, resizable: false, ellipsis: true, sorter: false},
// {title: '审核状态', dataIndex: 'auditState', key: 'auditState', align: 'center', fixed: 'right', width: 100, resizable: true, ellipsis: true, sorter: true}, // {title: '审核状态', dataIndex: 'auditState', key: 'auditState', align: 'center', fixed: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '操作', key: 'action', width: 80, align: 'center', fixed: 'right'}, {title: '操作', key: 'action', width: 80, align: 'center', fixed: 'right'},
]; ];
...@@ -326,12 +311,11 @@ export default class AuctionForm extends FormComponent<Auction> { ...@@ -326,12 +311,11 @@ export default class AuctionForm extends FormComponent<Auction> {
this.formState.auctionType = 'LIGHT'; this.formState.auctionType = 'LIGHT';
this.formState.auctionMode = '1'; this.formState.auctionMode = '1';
this.formState.delay = '5'; this.formState.bidAucVehDuration = 5;
this.formState.nearReservePriceThreshold = '1000'; this.formState.nearReservePriceThreshold = 1000;
this.formState.resetDelay = '10'; this.formState.resetDelay = 10;
this.formState.resetDelayDuration = '10'; this.formState.resetDelayDuration = 10;
this.formState.bidAucVehDuration = '5'; this.formState.aucvehDuration = 30;
this.formState.aucvehDuration = '10';
this.resetDelayUnit = 'second'; this.resetDelayUnit = 'second';
this.resetDelayDurationUnit = 'second'; this.resetDelayDurationUnit = 'second';
...@@ -352,12 +336,11 @@ export default class AuctionForm extends FormComponent<Auction> { ...@@ -352,12 +336,11 @@ export default class AuctionForm extends FormComponent<Auction> {
this.formState = reactive<Auction>({ this.formState = reactive<Auction>({
...auction, ...auction,
auctionMode: auction.auctionMode?.toString() || '1', auctionMode: auction.auctionMode?.toString() || '1',
delay: extraJson.delay || '5', bidAucVehDuration: parseInt(extraJson.bidAucVehDuration) || 5,
nearReservePriceThreshold: extraJson.nearReservePriceThreshold || '1000', nearReservePriceThreshold: parseInt(extraJson.nearReservePriceThreshold) || 1000,
resetDelay: extraJson.resetDelay || '10', resetDelay: parseInt(extraJson.resetDelay) || 10,
resetDelayDuration: extraJson.resetDelayDuration || '10', resetDelayDuration: parseInt(extraJson.resetDelayDuration) || 10,
aucvehDuration: extraJson.aucvehDuration || '10', aucvehDuration: parseInt(extraJson.aucvehDuration) || 30,
bidAucVehDuration: extraJson.bidAucVehDuration || '10',
resetDelayUnit: extraJson.resetDelayUnit || 'second', resetDelayUnit: extraJson.resetDelayUnit || 'second',
resetDelayDurationUnit: extraJson.resetDelayDurationUnit || 'second', resetDelayDurationUnit: extraJson.resetDelayDurationUnit || 'second',
}); });
...@@ -420,6 +403,12 @@ export default class AuctionForm extends FormComponent<Auction> { ...@@ -420,6 +403,12 @@ export default class AuctionForm extends FormComponent<Auction> {
} }
} }
changeAucvehDuration(): void {
if (this.formState.aucvehDuration && this.formState.resetDelay > this.formState.aucvehDuration) {
this.formState.resetDelay = this.formState.aucvehDuration
}
}
saveVehicle(vehicleId: number, filed: string): void { saveVehicle(vehicleId: number, filed: string): void {
console.log(this.editableVehicle[vehicleId + filed]); console.log(this.editableVehicle[vehicleId + filed]);
const auctionVehicle = this.formState.auctionVehicles.find(item => vehicleId === item.vehicle.vehicleId); const auctionVehicle = this.formState.auctionVehicles.find(item => vehicleId === item.vehicle.vehicleId);
...@@ -438,8 +427,11 @@ export default class AuctionForm extends FormComponent<Auction> { ...@@ -438,8 +427,11 @@ export default class AuctionForm extends FormComponent<Auction> {
if (!this.hasPrivilege('auction_19')) { if (!this.hasPrivilege('auction_19')) {
return; return;
} }
this.editableVehicle[vehicleId + filed] = cloneDeep(this.formState.auctionVehicles.find(item => vehicleId === item.vehicle.vehicleId)[filed]); let time = cloneDeep(this.formState.auctionVehicles.find(item => vehicleId === item.vehicle.vehicleId)[filed]);
console.log(this.editableVehicle[vehicleId + filed]); if (time.length == 16) {
time = time + ':00';
}
this.editableVehicle[vehicleId + filed] = time;
} }
applyInterval(): void { applyInterval(): void {
...@@ -595,11 +587,10 @@ export default class AuctionForm extends FormComponent<Auction> { ...@@ -595,11 +587,10 @@ export default class AuctionForm extends FormComponent<Auction> {
}); });
} }
const extraJson = { const extraJson = {
delay: String(formValue.delay || 0), bidAucVehDuration: String(formValue.bidAucVehDuration || 0),
nearReservePriceThreshold: String(formValue.nearReservePriceThreshold || 0), nearReservePriceThreshold: String(formValue.nearReservePriceThreshold || 0),
resetDelay: String(formValue.resetDelay || 0), resetDelay: String(formValue.resetDelay || 0),
resetDelayDuration: String(formValue.resetDelayDuration || 0), resetDelayDuration: String(formValue.resetDelayDuration || 0),
bidAucVehDuration: String(formValue.bidAucVehDuration || 0),
aucvehDuration: String(formValue.aucvehDuration || 0), aucvehDuration: String(formValue.aucvehDuration || 0),
resetDelayUnit: this.resetDelayUnit || 'second', resetDelayUnit: this.resetDelayUnit || 'second',
resetDelayDurationUnit: this.resetDelayDurationUnit || 'second', resetDelayDurationUnit: this.resetDelayDurationUnit || 'second',
...@@ -619,17 +610,27 @@ export default class AuctionForm extends FormComponent<Auction> { ...@@ -619,17 +610,27 @@ export default class AuctionForm extends FormComponent<Auction> {
switch (this.action) { switch (this.action) {
case 'create': case 'create':
case 'add': case 'add':
AuctionController.addAuction(this.axios, {...formValue, extraJson: JSON.stringify(extraJson)}).then(response => { AuctionController.addAuction(this.axios, { ...formValue, extraJson: JSON.stringify(extraJson) }).then(response => {
message.success('保存成功'); const data = response.data || {};
this.$emit('handleOk', response.data); if (data && data.success) {
this.$goBack(); message.success('保存成功');
this.$emit('handleOk', data);
this.$goBack();
} else {
message.error(data.message || '保存失败');
}
}).finally(() => this.submitted = false); }).finally(() => this.submitted = false);
break; break;
case 'edit': case 'edit':
formValue.auctionId = this.formState.auctionId; formValue.auctionId = this.formState.auctionId;
AuctionController.updateAuction(this.axios, {...formValue, extraJson: JSON.stringify(extraJson)}).then(response => { AuctionController.updateAuction(this.axios, { ...formValue, extraJson: JSON.stringify(extraJson) }).then(response => {
message.success('修改成功'); const data = response.data || {};
this.$goBack(); if (data.success) {
message.success('修改成功');
this.$goBack();
} else {
message.error(data.message || '修改失败');
}
}).finally(() => this.submitted = false); }).finally(() => this.submitted = false);
break; break;
} }
......
...@@ -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>
<page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta> <page-meta :page-style="'overflow:'+(show?'hidden':'visible')"></page-meta>
<customNav :status-bar-height="statusBarHeight"></customNav>
<view class="page" :style="{ paddingTop: statusBarHeight + 44 + 'px' }" >
<view class="car-detail-container" v-if="auctionVehicle"> <view class="car-detail-container" v-if="auctionVehicle">
<view v-if="currentAnchorId && currentAnchorId != 'section0'" class="header-anchor" :style="{ top: statusBarHeight + 44 + 'px' }" >
<view class="header-anchor-list" :class="{ headerActive: currentAnchorId === 'section1' }" @click="scrollToSection('section1')">
车辆档案
<view v-if="currentAnchorId === 'section1'" class="header-anchor-absolute"></view>
</view>
<view class="header-anchor-list" :class="{ headerActive: currentAnchorId === 'section2' }" @click="scrollToSection('section2')">
车况描述
<view v-if="currentAnchorId === 'section2'" class="header-anchor-absolute"></view>
</view>
<view class="header-anchor-list" :class="{ headerActive: currentAnchorId === 'section3' }" @click="scrollToSection('section3')">
检测报告
<view v-if="currentAnchorId === 'section3'" class="header-anchor-absolute"></view>
</view>
<view class="header-anchor-list" :class="{ headerActive: currentAnchorId === 'section4' }" @click="scrollToSection('section4')">
车辆图片
<view v-if="currentAnchorId === 'section4'" class="header-anchor-absolute"></view>
</view>
<view class="header-anchor-list" :class="{ headerActive: currentAnchorId === 'section5' }" @click="scrollToSection('section5')">
协议规则
<view v-if="currentAnchorId === 'section5'" class="header-anchor-absolute"></view>
</view>
</view>
<!-- 页面头部 --> <!-- 页面头部 -->
<!-- <view class="page-header">--> <!-- <view class="page-header">-->
<!-- &lt;!&ndash; 搜索框 &ndash;&gt;--> <!-- &lt;!&ndash; 搜索框 &ndash;&gt;-->
...@@ -24,8 +49,10 @@ ...@@ -24,8 +49,10 @@
<!-- 车辆基本信息 --> <!-- 车辆基本信息 -->
<view class="vehicle-content"> <view class="vehicle-content">
<section id="section0">
<view class="car-basic-info" v-if="auctionVehicle"> <view class="car-basic-info" v-if="auctionVehicle">
<view class="auction-header" v-if="auctionVehicle.auctionState==='SOLD'"> <view v-if="auctionVehicle.auction.auctionMode != 2">
<view class="auction-header" v-if="auctionVehicle.auctionState==='SOLD'">
<text class="auction-title">已成交</text> <text class="auction-title">已成交</text>
</view> </view>
<view class="auction-header" v-else-if="auctionVehicle.auctionState==='UNSOLD'"> <view class="auction-header" v-else-if="auctionVehicle.auctionState==='UNSOLD'">
...@@ -43,6 +70,7 @@ ...@@ -43,6 +70,7 @@
<van-count-down class="blue-count-down" :time="bidEndRemaining" format="HH:mm:ss" @finish="countDownBidEnd"/> <van-count-down class="blue-count-down" :time="bidEndRemaining" format="HH:mm:ss" @finish="countDownBidEnd"/>
</view> </view>
</view> </view>
</view>
<view class="car-title">【{{ cityName }}】{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</view> <view class="car-title">【{{ cityName }}】{{ vehicle.baseInfo.carSeriesName }} {{ vehicle.baseInfo.carTypeName }}</view>
<view class="car-tags"> <view class="car-tags">
<text class="tag" v-if="licensePlate">{{ licensePlate }}</text> <text class="tag" v-if="licensePlate">{{ licensePlate }}</text>
...@@ -64,7 +92,7 @@ ...@@ -64,7 +92,7 @@
</view> </view>
</view> </view>
</view> </view>
</section>
<!-- 出价信息 --> <!-- 出价信息 -->
<!-- <view class="section-card"> <!-- <view class="section-card">
<view class="bid-header"> <view class="bid-header">
...@@ -82,6 +110,7 @@ ...@@ -82,6 +110,7 @@
</view> --> </view> -->
<!-- 车辆基本参数 --> <!-- 车辆基本参数 -->
<section id="section1">
<view class="section-card" v-if="auctionVehicle"> <view class="section-card" v-if="auctionVehicle">
<view class="section-title">车辆档案</view> <view class="section-title">车辆档案</view>
<view class="params-row"> <view class="params-row">
...@@ -114,17 +143,19 @@ ...@@ -114,17 +143,19 @@
<text class="config-tip">*过户次数、年检到期、交强险到期、钥匙、是否有抵押、电池购买方式均为车主口述</text> <text class="config-tip">*过户次数、年检到期、交强险到期、钥匙、是否有抵押、电池购买方式均为车主口述</text>
<van-button type="default" round block @click="navigateTo('/module/auction/AuctionVehicleDetail?aucvehId=' + auctionVehicle?.aucvehId)">查看完整车辆信息</van-button> <van-button type="default" round block @click="navigateTo('/module/auction/AuctionVehicleDetail?aucvehId=' + auctionVehicle?.aucvehId)">查看完整车辆信息</van-button>
</view> </view>
</section>
<!-- 车况描述 --> <!-- 车况描述 -->
<section id="section2">
<view class="section-card"> <view class="section-card">
<view class="section-title">车况描述</view> <view class="section-title">车况描述</view>
<view class="description-content"> <view class="description-content">
<text>{{ vehicle.historyCondition.conditionDescription }}</text> <text>{{ vehicle.historyCondition.conditionDescription }}</text>
</view> </view>
</view> </view>
</section>
<!-- 检测报告 -->
<!-- 车辆配置 --> <section id="section3">
<view class="section-card"> <view class="section-card">
<view class="section-title">检测报告</view> <view class="section-title">检测报告</view>
<van-row :gutter="12"> <van-row :gutter="12">
...@@ -142,9 +173,10 @@ ...@@ -142,9 +173,10 @@
</van-col> </van-col>
</van-row> </van-row>
</view> </view>
</section>
<!-- 车辆图片展示 --> <!-- 车辆图片展示 -->
<section id="section4">
<view class="section-card"> <view class="section-card">
<view class="section-title">车辆图片</view> <view class="section-title">车辆图片</view>
<view style="margin-bottom: 6px" v-if="albums.length>0"> <view style="margin-bottom: 6px" v-if="albums.length>0">
...@@ -161,8 +193,10 @@ ...@@ -161,8 +193,10 @@
<uni-icons type="right" size="14" color="#999"/> <uni-icons type="right" size="14" color="#999"/>
</view> </view>
</view> </view>
</section>
<!-- 协议规则 --> <!-- 协议规则 -->
<section id="section5">
<view class="protocolBox" > <view class="protocolBox" >
<view class="protocolBox-title">协议规则</view> <view class="protocolBox-title">协议规则</view>
<view class="protocolBox-content" > <view class="protocolBox-content" >
...@@ -171,8 +205,9 @@ ...@@ -171,8 +205,9 @@
<text class="protocolBox-rule" @click="navigateToAgreement('VIOLATION')">《违约扣款规则》</text> <text class="protocolBox-rule" @click="navigateToAgreement('VIOLATION')">《违约扣款规则》</text>
</view> </view>
</view> </view>
</section>
<view :style="{ height: auctionVehicle.auction.auctionMode == 2 ? '146px' : '60px' }"></view> <view :style="{ height: auctionVehicle.auction.auctionMode == 2 ? '146px' : '60px' }"></view>
</view> </view>
<!-- 底部操作栏 --> <!-- 底部操作栏 -->
<view class="bottom-action-bar" v-if="auctionVehicle.auction.auctionMode != 2"> <view class="bottom-action-bar" v-if="auctionVehicle.auction.auctionMode != 2">
...@@ -277,7 +312,7 @@ ...@@ -277,7 +312,7 @@
<van-button v-else type="primary" hairline round block @click="submitBid">支付保证金【{{ auctionVehicle.auction.deposit }}元】参拍</van-button> <van-button v-else type="primary" hairline round block @click="submitBid">支付保证金【{{ auctionVehicle.auction.deposit }}元】参拍</van-button>
</view> </view>
<!-- 同意规则 --> <!-- 同意规则 -->
<view class="agreement-container"> <!-- <view class="agreement-container">
<view class="checkbox-item"> <view class="checkbox-item">
<van-checkbox :value="isAgreed" shape="square" @change="toggleAgreement"></van-checkbox> <van-checkbox :value="isAgreed" shape="square" @change="toggleAgreement"></van-checkbox>
<view class="agreement-text"> <view class="agreement-text">
...@@ -285,16 +320,16 @@ ...@@ -285,16 +320,16 @@
<text @click="navigateTo('/module/profile/AgreementPage?key=VIOLATION')">《违规扣款规则》</text> <text @click="navigateTo('/module/profile/AgreementPage?key=VIOLATION')">《违规扣款规则》</text>
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<!-- <van-dialog id="van-dialog"/>--> <!-- <van-dialog id="van-dialog"/>-->
<van-dialog use-slot :show="showBidSuccessDialog" :show-cancel-button="false" :show-confirm-button="false"> <van-dialog use-slot :show="showBidSuccessDialog" :show-cancel-button="false" :show-confirm-button="false">
<bid-success-dialog :order-id="orderId" :auctionVehicle="auctionVehicle" @close="closeBidSuccessDialog"></bid-success-dialog> <bid-success-dialog :order-id="orderId" ref="bidSuccessDialogRef" :auctionVehicle="auctionVehicle" @close="closeBidSuccessDialog"></bid-success-dialog>
</van-dialog> </van-dialog>
</view> </view>
</view>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Component, Hook, Ref, Vue} from "vue-facing-decorator"; import {Component, Hook, Ref, Vue} from "vue-facing-decorator";
...@@ -319,11 +354,16 @@ import {DepositController} from "@/api/DepositController"; ...@@ -319,11 +354,16 @@ import {DepositController} from "@/api/DepositController";
import roundBidBottom from "@/module/auction/roundBidBottom.vue"; import roundBidBottom from "@/module/auction/roundBidBottom.vue";
import RoundBidPopup from "@/components/RoundBidPopup.vue"; import RoundBidPopup from "@/components/RoundBidPopup.vue";
import customNav from "@/module/auction/customNav.vue";
@Component({ @Component({
components: {BidSuccessDialog, roundBidBottom, RoundBidPopup} components: {BidSuccessDialog, roundBidBottom, RoundBidPopup, customNav}
}) })
export default class AuctionVehiclePage extends Vue { export default class AuctionVehiclePage extends Vue {
statusBarHeight = 0;// 用于接收头部总高度,设置内容区 padding
amountStyle = {'font-size': '20px'}; amountStyle = {'font-size': '20px'};
@Ref() @Ref()
...@@ -338,6 +378,16 @@ export default class AuctionVehiclePage extends Vue { ...@@ -338,6 +378,16 @@ export default class AuctionVehiclePage extends Vue {
show = false; show = false;
/** /**
* 当前激活的锚点ID
*/
currentAnchorId = '';
/**
* 各个锚点的位置信息
*/
anchorPositions: any = {};
/**
* 距开拍剩余时间 * 距开拍剩余时间
*/ */
bidStartRemaining = 0; bidStartRemaining = 0;
...@@ -368,6 +418,12 @@ export default class AuctionVehiclePage extends Vue { ...@@ -368,6 +418,12 @@ export default class AuctionVehiclePage extends Vue {
* 显示中标弹窗 * 显示中标弹窗
*/ */
showBidSuccessDialog = false; showBidSuccessDialog = false;
/**
* 中标弹窗是否手动关闭
*/
isHandleClose = false;
/** /**
* 中标订单id * 中标订单id
*/ */
...@@ -479,6 +535,7 @@ export default class AuctionVehiclePage extends Vue { ...@@ -479,6 +535,7 @@ export default class AuctionVehiclePage extends Vue {
const that = this; const that = this;
onLoad((option) => { onLoad((option) => {
this.aucvehId = option.aucvehId; this.aucvehId = option.aucvehId;
this.statusBarHeight = uni.getWindowInfo().statusBarHeight;
this.loadBidPriceRange(); this.loadBidPriceRange();
FavoriteController.getFavoriteCountByAucvehId(this.axios, this.aucvehId).then(res => { FavoriteController.getFavoriteCountByAucvehId(this.axios, this.aucvehId).then(res => {
this.favoriteCount = res.data; this.favoriteCount = res.data;
...@@ -487,6 +544,7 @@ export default class AuctionVehiclePage extends Vue { ...@@ -487,6 +544,7 @@ export default class AuctionVehiclePage extends Vue {
onShow((option) => { onShow((option) => {
this.loadData(); this.loadData();
this.loadBidInfo(); this.loadBidInfo();
this.updateAnchorPositions();
}); });
onUnload(() => { onUnload(() => {
this.stopFetchOrderState(); this.stopFetchOrderState();
...@@ -528,6 +586,26 @@ export default class AuctionVehiclePage extends Vue { ...@@ -528,6 +586,26 @@ export default class AuctionVehiclePage extends Vue {
async onPullDownRefresh() { async onPullDownRefresh() {
this.loadData().finally(() => uni.stopPullDownRefresh()); this.loadData().finally(() => uni.stopPullDownRefresh());
this.loadBidInfo(); this.loadBidInfo();
this.updateAnchorPositions();
}
/**
* 监听页面滚动
*/
@Hook('onPageScroll')
onPageScroll(e: any) {
const scrollTop = e.scrollTop + 47; // 加上头部锚点的高度
// 遍历所有锚点位置,找到当前滚动位置对应的锚点
let currentSection = 'section0';
const sections = ['section0','section1', 'section2', 'section3', 'section4', 'section5'];
for (let i = sections.length - 1; i >= 0; i--) {
const sectionId = sections[i];
if (this.anchorPositions[sectionId] && scrollTop >= this.anchorPositions[sectionId]) {
currentSection = sectionId;
break;
}
}
this.currentAnchorId = currentSection;
} }
loadData(): Promise<void> { loadData(): Promise<void> {
...@@ -550,6 +628,12 @@ export default class AuctionVehiclePage extends Vue { ...@@ -550,6 +628,12 @@ export default class AuctionVehiclePage extends Vue {
} }
} }
} }
// 数据加载完成后,延迟更新锚点位置,确保 DOM 已渲染
this.$nextTick(() => {
setTimeout(() => {
this.updateAnchorPositions();
}, 300);
});
return Promise.resolve(); return Promise.resolve();
}); });
} }
...@@ -561,12 +645,18 @@ export default class AuctionVehiclePage extends Vue { ...@@ -561,12 +645,18 @@ export default class AuctionVehiclePage extends Vue {
// 代码请求优化 // 代码请求优化
const pages = getCurrentPages(); const pages = getCurrentPages();
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
if (this.auctionVehicle.auctionState === 'SOLD' && this.$auth.isLogin() && currentPage.route == 'module/auction/AuctionVehiclePage') { //this.auctionVehicle.auctionState === 'SOLD' &&
if (this.$auth.isLogin() && currentPage.route == 'module/auction/AuctionVehiclePage') {
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
AuctionOrderController.getAuctionOrderByVehicleId(this.axios, this.vehicle.vehicleId).then(res => { AuctionOrderController.getAuctionOrderByVehicleId(this.axios, this.vehicle.vehicleId).then(res => {
if (res.data > 0) { if (res.data > 0) {
this.orderId = res.data; this.orderId = res.data;
this.showBidSuccessDialog = true; if (!this.isHandleClose) {
AuctionOrderController.getNextAucVeh(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => {
this.$refs.bidSuccessDialogRef.initData(res.data?.data || {});
this.showBidSuccessDialog = true;
});
}
} }
}); });
}, 4000); }, 4000);
...@@ -575,6 +665,7 @@ export default class AuctionVehiclePage extends Vue { ...@@ -575,6 +665,7 @@ export default class AuctionVehiclePage extends Vue {
closeBidSuccessDialog() { closeBidSuccessDialog() {
this.showBidSuccessDialog = false; this.showBidSuccessDialog = false;
this.isHandleClose = true;
this.stopFetchOrderState(); this.stopFetchOrderState();
} }
...@@ -856,10 +947,52 @@ export default class AuctionVehiclePage extends Vue { ...@@ -856,10 +947,52 @@ export default class AuctionVehiclePage extends Vue {
}; };
} }
/**
* 滚动到指定锚点
* @param sectionId 锚点ID
*/
scrollToSection(sectionId: string) {
// 使用 selector 方式滚动,更准确
uni.pageScrollTo({
selector: `#${sectionId}`,
offsetTop: -88, // 偏移量,减去头部锚点的高度
duration: 300
});
// 延迟更新当前激活的锚点
setTimeout(() => {
this.currentAnchorId = sectionId;
}, 300);
}
/**
* 更新所有锚点的位置信息
*/
updateAnchorPositions() {
const sections = ['section0', 'section1', 'section2', 'section3', 'section4', 'section5'];
const query = uni.createSelectorQuery();
sections.forEach(sectionId => {
query.select(`#${sectionId}`).boundingClientRect();
});
query.exec((res) => {
sections.forEach((sectionId, index) => {
if (res[index]) {
this.anchorPositions[sectionId] = res[index].top;
}
});
});
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page {
width: 100vw;
height: 100vh;
position: relative;
}
.protocolBox { .protocolBox {
width: -webkit-calc(100% - 20px); width: -webkit-calc(100% - 20px);
...@@ -910,6 +1043,43 @@ export default class AuctionVehiclePage extends Vue { ...@@ -910,6 +1043,43 @@ export default class AuctionVehiclePage extends Vue {
margin-bottom: 60px; margin-bottom: 60px;
} }
.header-anchor{
position: fixed;
top: -1px;
left: 0;
width: 100%;
height: 47px;
z-index: 99;
background: #ffffff;
}
.header-anchor-list{
width: 20%;
height: 47px;
line-height: 47px;
color: #333333;
font-size: 14px;
float: left;
text-align: center;
position: relative;
}
.header-anchor-absolute {
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 0;
width: 16px;
height: 3px;
border-radius: 1.5px;
background: #185efe;
}
.headerActive{
color: #333333;
font-size: 16px;
}
/* 页面头部样式 */ /* 页面头部样式 */
.page-header { .page-header {
display: flex; display: flex;
......
<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>
<template> <template>
<view> <view v-if="pageState">
<view v-if="pageState == 'PREVIEW'" class="bottom_action"> <view v-if="pageState == 'PREVIEW'" class="bottom_action">
<view class="awaitbut">等待竞拍</view> <view class="awaitbut">等待竞拍</view>
</view> </view>
...@@ -55,14 +55,17 @@ ...@@ -55,14 +55,17 @@
<view class="upBox_amount"> <view class="upBox_amount">
合手价: 合手价:
<text class="upBox_money"> <text class="upBox_money">
{{ resultPrice }} {{ (resultPrice || 0).toFixed(2) }}
</text> </text>
<text class="upBox_unit">万</text> <text class="upBox_unit">万</text>
</view> </view>
<view class="upBox_add"> <view class="upBox_add">
<view class="upBox_second">{{ pageData.remainSecond }}秒</view> <view class="upBox_second">{{ newRemainSecond }}秒</view>
<view class="border_solid"> <view @click="handleAddBid()" class="progress-circle-up"
<view class="border_but" @click="handleAddBid()">{{ addPrice ? '+' : '' }}{{ addPrice }}</view> :style="{ '--progress': progressValue + '%' }">
<view class="progress-inner-up">
<text class="progress-value" style="font-size: 12px;">+{{ addPrice }}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -83,21 +86,22 @@ ...@@ -83,21 +86,22 @@
<view class="downBox_list"> <view class="downBox_list">
<view class="downBox_title">平台佣金:</view> <view class="downBox_title">平台佣金:</view>
<view class="downBox_money colorBlack"> <view class="downBox_money colorBlack">
+{{ (Number(pageData.commissionPrice || 0)) / 10000 }} 万元 +{{ ((Number(pageData.commissionPrice || 0)) / 10000).toFixed(2) }} 万元
</view> </view>
</view> </view>
<view class="downBox_list"> <view class="downBox_list">
<view class="downBox_title colorBlack">合手价:</view> <view class="downBox_title colorBlack">合手价:</view>
<view class="downBox_money colorRed"> <view class="downBox_money colorRed">
{{ resultPrice }} 万元 {{ (resultPrice || 0).toFixed(2) }} 万元
</view> </view>
</view> </view>
</view> </view>
<view class="downBox_right"> <view class="downBox_right">
<view class="downBox_second">{{ pageData.remainSecond }}秒</view> <view class="downBox_second">{{ newRemainSecond }}秒</view>
<view class="downBox_border_solid"> <view @click="handleAddBid()" class="progress-circle"
<view class="downBox_border_but" @click="handleAddBid()"> :style="{ '--progress': progressValue + '%' }">
{{ addPrice ? '+' : '' }}{{ addPrice }} <view class="progress-inner">
<text class="progress-value">+{{ addPrice }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -106,7 +110,7 @@ ...@@ -106,7 +110,7 @@
<view class="listButton"> <view class="listButton">
<view v-for="(item, index) in operationButList" :key="index" @click="handleOperationBut(item.value)" <view v-for="(item, index) in operationButList" :key="index" @click="handleOperationBut(item.value)"
class="listButton_item" class="listButton_item"
:class="{ 'listButton_active': item.value == addPrice || (item.value == '自定义' && isShowCustom) }"> :class="{ 'listButton_active': (item.value == addPrice && !isShowCustom) || (item.value == '自定义' && isShowCustom) }">
+{{ item.value }} +{{ item.value }}
</view> </view>
</view> </view>
...@@ -116,7 +120,10 @@ ...@@ -116,7 +120,10 @@
<view class="downBox_custom_hand"> <view class="downBox_custom_hand">
<view class="downBox_custom_input"> <view class="downBox_custom_input">
<view class="downBox_custom_unit">¥</view> <view class="downBox_custom_unit">¥</view>
<van-field :value="customBid" style="height: 36px;" placeholder="最低100" /> <view style="margin-top: 4px;">
<uni-easyinput v-model="customBid" type="number" :inputBorder="false" maxlength="6"
:clearable="false" placeholder="最低100"></uni-easyinput>
</view>
</view> </view>
<view class="downBox_custom_but" @click="handleCustomBidConfirm()">确认</view> <view class="downBox_custom_but" @click="handleCustomBidConfirm()">确认</view>
</view> </view>
...@@ -178,7 +185,7 @@ import { Component, Prop, Vue } from "vue-facing-decorator"; ...@@ -178,7 +185,7 @@ import { Component, Prop, Vue } from "vue-facing-decorator";
import { AuctionOrderController } from "@/api/AuctionOrderController"; import { AuctionOrderController } from "@/api/AuctionOrderController";
import { AuthService } from "@/common/AuthService"; import { AuthService } from "@/common/AuthService";
import { BidController } from "@/api/BidController"; import { BidController } from "@/api/BidController";
import { AuctionController } from "@/api/AuctionController";
@Component({ @Component({
components: {} components: {}
...@@ -188,12 +195,9 @@ export default class roundBidBottom extends Vue { ...@@ -188,12 +195,9 @@ export default class roundBidBottom extends Vue {
@Prop({ type: Object, required: true }) @Prop({ type: Object, required: true })
auctionVehicle: any; auctionVehicle: any;
//页面状态 认证 COMMON 充值 NOTOPUP 等待开始 PREVIEW 进行中 AUCTIONING 结束 END 结束自动跳转 JUMP //页面状态 认证 COMMON 充值 NOTOPUP 等待开始 PREVIEW 进行中 AUCTIONING 结束 END 结束自动跳转 JUMP
pageState = 'COMMON'; pageState = 'AUCTIONING';
endState = ''; // 1 未成交 2 已中拍 3 未中拍
endState = '1'; // 1 未成交 2 已中拍 3 未中拍
//页面显示数据 //页面显示数据
pageData = { pageData = {
accountBidPrice: 0, // 用户出价 价格 accountBidPrice: 0, // 用户出价 价格
...@@ -207,21 +211,24 @@ export default class roundBidBottom extends Vue { ...@@ -207,21 +211,24 @@ export default class roundBidBottom extends Vue {
bidPriceType: 0, bidPriceType: 0,
}; };
newRemainSecond = 0; // 新的剩余时间 单位秒
foldState = 'UP'; //展开 UP 收起 DOWN foldState = 'UP'; //展开 UP 收起 DOWN
addPrice = '100';//加价金额 addPrice = '100';//加价金额
remainingTime = '5';//剩余时间 remainingTime = '5';//剩余时间
isShowCustom = false; //是否显示自定义输入框 isShowCustom = false; //是否显示自定义输入框
customBid = ''; //自定义出价 customBid = ''; //自定义出价
resultPrice = 0; // 最终成交价 resultPrice = 0; // 最终成交价
orderId = ''; progressValue = 100; // 进度值
isAudio = true; // 是否是语音出价
//自定义金额 //自定义金额
operationButList = [{ value: '100', }, { value: '300', }, { value: '500', }, { value: '1000', }, { value: '自定义', }]; operationButList = [{ value: '100', }, { value: '300', }, { value: '500', }, { value: '1000', }, { value: '自定义', }];
IsDebounce = false; // 是否防抖
created(): void { created(): void {
console.log('auctionVehicleauctionVehicleauctionVehicleauctionVehicle1111', this.auctionVehicle) console.log('auctionVehicleauctionVehicleauctionVehicleauctionVehicle1111', this.auctionVehicle)
setTimeout(() => { setTimeout(() => {
...@@ -237,10 +244,10 @@ export default class roundBidBottom extends Vue { ...@@ -237,10 +244,10 @@ export default class roundBidBottom extends Vue {
if (accountInfo.accountType == 'COMMON') { // 未认证 if (accountInfo.accountType == 'COMMON') { // 未认证
this.pageState = 'COMMON'; this.pageState = 'COMMON';
} else { } else {
if (this.auctionVehicle.auctionState === 'SOLD') { if ((this.auctionVehicle.vehicle.vehicleState || this.auctionVehicle.auctionState) === 'SOLD') {
this.pageState = 'END'; this.pageState = 'END';
//已经结束拍获取拍卖结果 //已经结束拍获取拍卖结果
this.getAccountBidResultData(); this.getAccountBidResultData('END');
} else { } else {
this.getCheckDeposit(); this.getCheckDeposit();
} }
...@@ -278,14 +285,38 @@ export default class roundBidBottom extends Vue { ...@@ -278,14 +285,38 @@ export default class roundBidBottom extends Vue {
if (!data.checkResult) { if (!data.checkResult) {
this.pageState = 'NOTOPUP'; this.pageState = 'NOTOPUP';
} else { } else {
if (this.auctionVehicle.auctionState == 'PREVIEW') { //预展中 if ((this.auctionVehicle.vehicle.vehicleState || this.auctionVehicle.auctionState) == 'PREVIEW') { //预展中
this.pageState = 'PREVIEW'; this.pageState = 'PREVIEW';
} else if (this.auctionVehicle.auctionState == 'AUCTIONING') { //竞拍中 this.getAuctionVehicleDetail();
} else if ((this.auctionVehicle.vehicle.vehicleState || this.auctionVehicle.auctionState) == 'AUCTIONING') { //竞拍中
this.pageState = 'AUCTIONING'; this.pageState = 'AUCTIONING';
this.getBidRemainSecData(); this.getBidRemainSecData();
} else { //竞拍已结束SOLD } else { //竞拍已结束SOLD
this.pageState = 'END'; this.pageState = 'END';
this.getAccountBidResultData('END');
}
}
});
}
//等待竞拍中获取拍卖详情最新状态
getAuctionVehicleDetail(): void {
const that = this;
AuctionController.getAuctionVehicleDetailById(this.axios, this.auctionVehicle.aucvehId).then(res => {
const data = res.data || {};
if (data.auctionState == 'PREVIEW') { //预展中
this.pageState = 'PREVIEW';
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
if (currentPage.route == 'module/auction/AuctionVehiclePage') {
setTimeout(() => {
that.getAuctionVehicleDetail();
}, 1600);
} }
} else if (data.auctionState == 'AUCTIONING') { //竞拍中
this.pageState = 'AUCTIONING';
this.newRemainSecond = 0;
this.getBidRemainSecData();
} }
}); });
} }
...@@ -297,55 +328,90 @@ export default class roundBidBottom extends Vue { ...@@ -297,55 +328,90 @@ export default class roundBidBottom extends Vue {
//获取轮询拍卖详情 //获取轮询拍卖详情
getBidRemainSecData() { getBidRemainSecData() {
const that = this;
AuctionOrderController.getBidRemainSec(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => { AuctionOrderController.getBidRemainSec(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => {
const data = res.data?.data || {}; const data = res.data?.data || {};
//价格改变重新获取佣金 //价格改变重新获取佣金
if (this.pageData.price != data.price) { if (this.pageData.price != data.price) {
this.realCalcCommissionPriceData(); this.realCalcCommissionPriceData();
this.handleAudio();
} }
this.pageData = { ...this.pageData, ...data, remainSecond: Math.floor(data.remainSecond || 0) }; this.pageData = { ...this.pageData, ...data, remainSecond: Math.floor(data.remainSecond || 0) };
// 计算最终成交价 // 计算最终成交价
this.resultPrice = (Number(this.pageData.price || 0) + Number(this.pageData.commissionPrice || 0)) / 10000; this.resultPrice = (Number(this.pageData.price || 0) + Number(this.pageData.commissionPrice || 0)) / 10000;
//拍卖结束后获取下一辆车及拍卖状态 //拍卖结束后获取下一辆车及拍卖状态
if (this.pageData.over) { if (this.pageData.over) {
this.pageState = 'END'; this.pageState = 'END';
this.getAccountBidResultData(); setTimeout(() => {
this.getAccountBidResultData('OVER');
}, 600);
}
if (data.significantPriceIncrease) {
setTimeout(() => {
that.resultPrice = (Number(that.pageData.price || 0) + Number(that.pageData.commissionPrice || 0)) / 10000;
uni.showToast({ title: '有用户大幅度加价!最新价升至' + (that.resultPrice || 0).toFixed(2) + '万', icon: 'none' });
}, 800);
} }
// 获取当前路由地址
const pages = getCurrentPages(); const pages = getCurrentPages();
// 数组的最后一个元素就是当前正在显示的页面实例
const currentPage = pages[pages.length - 1]; const currentPage = pages[pages.length - 1];
if (currentPage.route == 'module/auction/AuctionVehiclePage' && !this.pageData.over) { if (currentPage.route == 'module/auction/AuctionVehiclePage' && !this.pageData.over) {
setTimeout(() => { setTimeout(() => {
this.getBidRemainSecData(); this.getBidRemainSecData();
}, 1000); }, 1000);
} }
this.calcProgress();
if (!this.newRemainSecond) {
this.setNewRemainSecond();
}
console.log('获取最新订单信息数据', this.pageData)
}); });
} }
setNewRemainSecond() {
let newTime = this.pageData.remainSecond;
if (newTime) {
this.newRemainSecond = Math.max(0, newTime);
}
if (newTime && !this.pageData.over) {
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
if (currentPage.route == 'module/auction/AuctionVehiclePage') {
setTimeout(() => {
this.newRemainSecond = Math.max(0, Number(this.newRemainSecond) - 1);
if (this.newRemainSecond <= 0 || this.pageData.over) {
this.newRemainSecond = 0;
}
this.setNewRemainSecond();
}, 1000);
}
} else {
this.newRemainSecond = 0;
}
}
//获取拍卖佣金 //获取拍卖佣金
realCalcCommissionPriceData() { realCalcCommissionPriceData() {
AuctionOrderController.realCalcCommissionPrice(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => { AuctionOrderController.realCalcCommissionPrice(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => {
const data = res.data?.data || {}; const data = res.data?.data || {};
this.pageData.commissionPrice = (Number(data.commissionPrice || 0)) / 10000; this.pageData.commissionPrice = Number(data.commissionPrice || 0);
}); });
} }
//点击提交价格 //点击提交价格
handleAddBid() { handleAddBid() {
const that = this;
if (!this.addPrice) return uni.showToast({ title: '请输入加价金额', icon: 'none' }); if (!this.addPrice) return uni.showToast({ title: '请输入加价金额', icon: 'none' });
if (this.IsDebounce) return console.log('重复提交');
this.IsDebounce = true;
setTimeout(() => {
that.IsDebounce = false
}, 1000);
const bidPrice = Number(this.pageData.price || 0) + Number(this.addPrice); const bidPrice = Number(this.pageData.price || 0) + Number(this.addPrice);
const bidRequest = { aucvehId: this.auctionVehicle.aucvehId, bidPrice: bidPrice }; const bidRequest = { aucvehId: this.auctionVehicle.aucvehId, bidPrice: bidPrice };
uni.showLoading({ title: '正在提交竞价信息...', mask: true }); uni.showLoading({ title: '正在提交竞价信息...', mask: true });
BidController.addBid(this.axios, bidRequest).then(res => { BidController.addBid(this.axios, bidRequest).then(res => {
setTimeout(() => { setTimeout(() => {
uni.showToast({ title: '出价成功', icon: 'success' }); uni.showToast({ title: '出价成功', icon: 'success' });
this.handleAudio();
}, 300); }, 300);
}).finally(() => { }).finally(() => {
uni.hideLoading(); uni.hideLoading();
...@@ -353,45 +419,44 @@ export default class roundBidBottom extends Vue { ...@@ -353,45 +419,44 @@ export default class roundBidBottom extends Vue {
} }
handleAudio() { handleAudio() {
console.log('播放音频'); const that = this;
const innerAudioContext = uni.createInnerAudioContext(); if (!that.isAudio) {
innerAudioContext.autoplay = true; console.log('播放音频');
innerAudioContext.src = 'https://img02.glsx.com.cn/aus/images/roundBid/notice.mp3'; that.isAudio = true;
innerAudioContext.onEnded(() => { const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.destroy(); innerAudioContext.autoplay = true;
console.log('音频播放完成'); innerAudioContext.src = 'https://img02.glsx.com.cn/aus/images/roundBid/notice.mp3';
}); innerAudioContext.onEnded(() => {
innerAudioContext.destroy();
that.isAudio = false;
console.log('音频播放完成');
});
} else {
that.isAudio = false;
}
} }
//获取拍卖结果 //获取拍卖结果
getAccountBidResultData() { getAccountBidResultData(state: string) {
AuctionOrderController.getAccountBidResult(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => { AuctionOrderController.getAccountBidResult(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => {
const data = res.data?.data || {}; const data = res.data?.data || {};
this.endState = data.bidResult ? String(Number(data.bidResult) + 1) : '1'; this.endState = data.bidResult ? String(Number(data.bidResult) + 1) : '1';
this.resultPrice = (Number(data.price || 0)) / 10000; this.resultPrice = (Number(data.price || 0)) / 10000;
if (this.endState != '2') { if (this.endState != '2' && state == 'OVER') {
this.getNextAucVehData(); this.getNextAucVehData();
if(this.pageState == 'END'){
this.noticeBidEnd();
}
} }
}); });
} }
//获取拍卖订单号 //签署购车合同
noticeBidEnd() { signContract() {
AuctionOrderController.getAuctionOrderByVehicleId(this.axios, this.auctionVehicle.vehicle.vehicleId).then(res => { AuctionOrderController.getAuctionOrderByVehicleId(this.axios, this.auctionVehicle.vehicle.vehicleId).then(res => {
if (res.data > 0) { if (res.data > 0 && res.data) {
this.orderId = res.data; uni.navigateTo({ url: '/module/order/contract/ContractPage?orderId=' + res.data });
} }
}); });
} }
//签署购车合同
signContract() {
uni.navigateTo({ url: '/module/order/contract/ContractPage?orderId=' + this.orderId });
}
//获取下一辆车 //获取下一辆车
getNextAucVehData() { getNextAucVehData() {
AuctionOrderController.getNextAucVeh(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => { AuctionOrderController.getNextAucVeh(this.axios, { aucvehId: this.auctionVehicle.aucvehId }).then(res => {
...@@ -399,14 +464,6 @@ export default class roundBidBottom extends Vue { ...@@ -399,14 +464,6 @@ export default class roundBidBottom extends Vue {
}); });
} }
//展开收起
handleFoldState(state: string) {
this.foldState = state;
if (state == 'UP' && !this.addPrice) {
this.addPrice = '100';
}
}
//金额操作按钮 //金额操作按钮
handleOperationBut(value: string) { handleOperationBut(value: string) {
if (value != '自定义') { if (value != '自定义') {
...@@ -414,34 +471,62 @@ export default class roundBidBottom extends Vue { ...@@ -414,34 +471,62 @@ export default class roundBidBottom extends Vue {
this.isShowCustom = false; this.isShowCustom = false;
this.handleAddBid(); this.handleAddBid();
} else { } else {
// this.addPrice = '';
this.customBid = ''; this.customBid = '';
this.isShowCustom = true; this.isShowCustom = this.isShowCustom ? false : true;
} }
} }
//自定义确认出价 //自定义确认出价
handleCustomBidConfirm() { handleCustomBidConfirm() {
const that = this;
if (!this.customBid) { if (!this.customBid) {
uni.showToast({ title: '请输入自定义加价金额', icon: 'none' }) return uni.showToast({ title: '请输入自定义加价金额', icon: 'none' })
} else { }
// this.addPrice = this.customBid; // 校验自定义加价金额是否为数字
this.handleAddBid(); if (isNaN(Number(this.customBid))) {
return uni.showToast({ title: '请输入正确的加价金额', icon: 'none' })
}
// 校验自定义加价金额是否符合规则
if (Number(this.customBid) < 100) {
return uni.showToast({ title: '自定义加价金额不能小于100', icon: 'none' })
}
//校验加价金额必须是100的倍数
if (Number(this.customBid) % 100 != 0) {
return uni.showToast({ title: '自定义加价金额必须是100的倍数', icon: 'none' })
}
if (this.IsDebounce) return console.log('重复提交');
that.IsDebounce = true;
setTimeout(() => {
that.IsDebounce = false
}, 1000);
const bidPrice = Number(this.pageData.price || 0) + Number(this.customBid);
const bidRequest = { aucvehId: this.auctionVehicle.aucvehId, bidPrice: bidPrice };
uni.showLoading({ title: '正在提交竞价信息...', mask: true });
BidController.addBid(this.axios, bidRequest).then(res => {
uni.showToast({ title: '出价成功', icon: 'success' });
}).finally(() => {
uni.hideLoading();
});
}
//展开收起
handleFoldState(state: string) {
this.foldState = state;
if (state == 'UP' && !this.addPrice) {
this.addPrice = '100';
} }
} }
//自定义金额输入框 //计算进度
// handleCustomBidInput(value: any) { calcProgress() {
// let numStr = String(value?.detail?.value || '').replace(/\D/g, ''); const aucvehDuration = JSON.parse(this.auctionVehicle?.auction?.extraJson || '{}')?.aucvehDuration || 0;
// let num = parseInt(numStr, 10); if (Number(aucvehDuration) > 0) {
// if (num > 0) { const progress = (this.pageData.remainSecond || 0) / Number(aucvehDuration);
// num = Math.floor(num / 100) * 100; this.progressValue = 100 - Math.floor(progress * 100);
// if (num < 100) num = 100; } else {
// this.customBid = num.toString(); this.progressValue = 100;
// } else { }
// this.customBid = '100'; }
// }
// }
} }
</script> </script>
...@@ -664,35 +749,6 @@ export default class roundBidBottom extends Vue { ...@@ -664,35 +749,6 @@ export default class roundBidBottom extends Vue {
font-family: "D-DIN-PRO"; font-family: "D-DIN-PRO";
} }
.border_solid {
width: 58px;
height: 58px;
float: left;
border: 3px solid #e3ebf4;
background: #f4f8ff;
border-radius: 50%;
margin-top: 8px;
margin-left: 8px;
margin-bottom: 8px;
}
.border_but {
width: 48px;
height: 48px;
float: left;
margin: 5px;
line-height: 48px;
text-align: center;
background: linear-gradient(148.6deg, #7aa3fe 0%, #185efe 100%);
box-shadow: 0 2px 4px 0 #8ab5e640;
border-radius: 50%;
color: #ffffff;
font-size: 14px;
font-weight: 700;
font-family: "D DIN PRO";
cursor: pointer;
}
.downBox { .downBox {
width: 100%; width: 100%;
min-height: 80px; min-height: 80px;
...@@ -710,9 +766,9 @@ export default class roundBidBottom extends Vue { ...@@ -710,9 +766,9 @@ export default class roundBidBottom extends Vue {
} }
.downBox_left { .downBox_left {
width: -webkit-calc(46% - 16px); width: -webkit-calc(48% - 16px);
width: -moz-calc(46% - 16px); width: -moz-calc(48% - 16px);
width: calc(46% - 16px); width: calc(48% - 16px);
float: left; float: left;
margin-left: 16px; margin-left: 16px;
margin-top: 12px; margin-top: 12px;
...@@ -734,33 +790,6 @@ export default class roundBidBottom extends Vue { ...@@ -734,33 +790,6 @@ export default class roundBidBottom extends Vue {
margin-right: 4px; margin-right: 4px;
} }
.downBox_border_solid {
width: 100px;
height: 100px;
float: left;
border: 4px solid #e3ebf4;
background: #f4f8ff;
border-radius: 50%;
margin-right: 40px;
margin-top: 16px;
}
.downBox_border_but {
width: 76px;
height: 76px;
float: left;
margin: 12px;
line-height: 76px;
text-align: center;
background: linear-gradient(148.6deg, #7aa3fe 0%, #185efe 100%);
box-shadow: 0 2px 4px 0 #8ab5e640;
border-radius: 50%;
color: #ffffff;
font-size: 18px;
font-weight: 500;
font-family: "D DIN PRO";
}
.downBox_list { .downBox_list {
width: 100%; width: 100%;
height: 20px; height: 20px;
...@@ -795,11 +824,11 @@ export default class roundBidBottom extends Vue { ...@@ -795,11 +824,11 @@ export default class roundBidBottom extends Vue {
width: calc(100% - 32px); width: calc(100% - 32px);
height: 30px; height: 30px;
float: left; float: left;
margin: 0 16px; margin: 0 8px;
} }
.listButton_item { .listButton_item {
width: 60.4px; padding: 0 10px;
height: 28px; height: 28px;
float: left; float: left;
margin-left: 8px; margin-left: 8px;
...@@ -807,7 +836,7 @@ export default class roundBidBottom extends Vue { ...@@ -807,7 +836,7 @@ export default class roundBidBottom extends Vue {
border-radius: 4px; border-radius: 4px;
background: #f8f9fc; background: #f8f9fc;
color: #333333; color: #333333;
font-size: 14px; font-size: 12px;
font-family: "D DIN PRO"; font-family: "D DIN PRO";
text-align: center; text-align: center;
border: 1px solid #f8f9fc; border: 1px solid #f8f9fc;
...@@ -945,4 +974,64 @@ export default class roundBidBottom extends Vue { ...@@ -945,4 +974,64 @@ export default class roundBidBottom extends Vue {
.color3 { .color3 {
color: #F15662 !important; color: #F15662 !important;
} }
.progress-circle {
width: 108px;
height: 108px;
border-radius: 50%;
background: conic-gradient(#e3ebf4 0% var(--progress), #185efe var(--progress) 100%);
display: flex;
align-items: center;
justify-content: center;
position: relative;
float: left;
margin-right: 16px;
margin-top: 16px;
}
.progress-inner {
width: 76px;
height: 76px;
background: linear-gradient(148.6deg, #185efe 0%, #7aa3fe 100%);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
border: 10px solid #ffffff;
}
.progress-circle-up {
width: 58px;
height: 58px;
border-radius: 50%;
background: conic-gradient(#e3ebf4 0% var(--progress), #185efe var(--progress) 100%);
display: flex;
align-items: center;
justify-content: center;
position: relative;
float: left;
margin-top: 11px;
margin-left: 8px;
margin-bottom: 11px;
}
.progress-inner-up {
width: 48px;
height: 48px;
background: linear-gradient(148.6deg, #7aa3fe 0%, #185efe 100%);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
border: 2px solid #ffffff;
}
.progress-value {
width: 100%;
text-align: center;
color: #ffffff;
font-size: 18px;
font-weight: 500;
font-family: "D DIN PRO";
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -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!