xiongzhu 3 anni fa
parent
commit
e379077a4b

+ 6 - 0
src/main/java/com/izouma/awesomeAdmin/domain/Delegation.java

@@ -44,6 +44,12 @@ public class Delegation extends BaseEntity {
     @ApiModelProperty(value = "最终价", name = "finalPrice")
     private BigDecimal finalPrice;
 
+    @Column(precision = 10, scale = 2)
+    private BigDecimal capital;
+
+    @Column(precision = 10, scale = 2)
+    private BigDecimal premium;
+
     @Column(precision = 10, scale = 2)
     @ApiModelProperty(value = "手续费", name = "serviceCharge")
     private BigDecimal serviceCharge;

+ 1 - 1
src/main/java/com/izouma/awesomeAdmin/domain/Order.java

@@ -42,7 +42,7 @@ public class Order extends BaseEntity {
     private BigDecimal capital;
 
     @Column(precision = 10, scale = 2)
-    private BigDecimal interest;
+    private BigDecimal premium;
 
     @Column(precision = 10, scale = 2)
     @ApiModelProperty(value = "出售价格", name = "sellPrice")

+ 1 - 1
src/main/java/com/izouma/awesomeAdmin/domain/Product.java

@@ -56,7 +56,7 @@ public class Product extends BaseEntity {
     private BigDecimal capital;
 
     @Column(precision = 10, scale = 2)
-    private BigDecimal interest;
+    private BigDecimal premium;
 
     @ApiModelProperty(value = "销量", name = "sales")
     private Integer sales = 0;

+ 17 - 1
src/main/java/com/izouma/awesomeAdmin/service/DelegationService.java

@@ -73,7 +73,8 @@ public class DelegationService {
                              Environment env,
                              TaskScheduler taskScheduler,
                              UserMoneyRecordRepo userMoneyRecordRepo,
-                             SaleBatchRepo saleBatchRepo) {
+                             SaleBatchRepo saleBatchRepo,
+                             UserBalanceService userBalanceService) {
         this.delegationRepo = delegationRepo;
         this.orderRepo = orderRepo;
         this.sysConfigService = sysConfigService;
@@ -86,6 +87,7 @@ public class DelegationService {
         this.taskScheduler = taskScheduler;
         this.userMoneyRecordRepo = userMoneyRecordRepo;
         this.saleBatchRepo = saleBatchRepo;
+        this.userBalanceService = userBalanceService;
     }
 
     public void payDelegationAlipay(Long userId, Long orderId, BigDecimal riseRate, String returnUrl, Model model) {
@@ -272,6 +274,8 @@ public class DelegationService {
         if (finalPrice.compareTo(maxPrice) >= 0) {
             BigDecimal splitProductPrice = finalPrice.subtract(splitPrice);
             finalPrice = splitPrice;
+            BigDecimal capital1 = splitProductPrice.divide(riseRate.add(new BigDecimal(1)), 2, RoundingMode.HALF_UP);
+            BigDecimal premium1 = splitProductPrice.subtract(capital1);
 
             Product product1 = productRepo.findFirstByUserIdNull()
                     .orElseThrow(new BusinessException("商品池库存不足,无法分裂"));
@@ -279,6 +283,8 @@ public class DelegationService {
             product1.setReserve(false);
             product1.setStatus(ProductStatus.SOLD_OUT);
             product1.setCurrentPrice(splitProductPrice);
+            product1.setCapital(capital1);
+            product1.setPremium(premium1);
             Order order = orderRepo.save(Order.builder()
                     .userId(userId)
                     .productId(product1.getId())
@@ -288,6 +294,7 @@ public class DelegationService {
                     .rated(false)
                     .paidTime(LocalDateTime.now())
                     .confirmTime(LocalDateTime.now())
+                    .batchId(product.getBatchId())
                     .build());
             Delegation delegation1 = delegationRepo.save(Delegation.builder()
                     .userId(userId)
@@ -295,16 +302,20 @@ public class DelegationService {
                     .sellerOrderId(order.getId())
                     .originalPrice(product1.getCurrentPrice())
                     .finalPrice(splitProductPrice)
+                    .capital(capital1)
+                    .premium(premium1)
                     .serviceCharge(BigDecimal.ZERO)
                     .riseRate(BigDecimal.ZERO)
                     .active(false)
                     .enabled(true)
+                    .batchId(product.getBatchId())
                     .build());
             product1.setDelegationId(delegation1.getId());
             productRepo.save(product1);
             activeDelegation(delegation1);
         }
 
+        BigDecimal capital = finalPrice.divide(riseRate.add(new BigDecimal(1)), 2, RoundingMode.HALF_UP);
         delegation = delegationRepo.save(Delegation.builder()
                 .sellerOrderId(orderId)
                 .productId(sellerOrder.getProductId())
@@ -312,9 +323,12 @@ public class DelegationService {
                 .serviceCharge(serviceCharge)
                 .originalPrice(sellerOrder.getTotalPrice())
                 .finalPrice(finalPrice)
+                .capital(capital)
+                .premium(finalPrice.subtract(capital))
                 .riseRate(riseRate)
                 .active(false)
                 .enabled(true)
+                .batchId(product.getBatchId())
                 .build());
         product.setDelegationId(delegation.getId());
         productRepo.save(product);
@@ -360,6 +374,8 @@ public class DelegationService {
         orderRepo.save(order);
         product.setOriginalPrice(product.getCurrentPrice());
         product.setCurrentPrice(delegation.getFinalPrice());
+        product.setCapital(delegation.getCapital());
+        product.setPremium(delegation.getPremium());
         product.setStatus(ProductStatus.IN_STOCK);
         productRepo.save(product);
     }

+ 9 - 3
src/main/java/com/izouma/awesomeAdmin/service/OrderService.java

@@ -160,11 +160,14 @@ public class OrderService {
                 .fromUserId(product.getUserId())
                 .productId(productId)
                 .totalPrice(product.getCurrentPrice())
+                .capital(product.getCapital())
+                .premium(product.getPremium())
                 .address(address.getFullAddress())
                 .phone(address.getPhone())
                 .name(address.getName())
                 .status(OrderStatus.NOT_PAID)
                 .rated(false)
+                .batchId(product.getBatchId())
                 .build();
         order = orderRepo.save(order);
         delegation.setBuyerOrderId(order.getId());
@@ -298,11 +301,14 @@ public class OrderService {
         if (buyerOrder.getStatus() != OrderStatus.NOT_PAID) {
             throw new BusinessException(Translator.toLocale("status.error"));
         }
-        if (sellerOrder.getStatus() != OrderStatus.SOLD_NOT_CONFIRMED) {
+        if (sellerOrder.getStatus() != OrderStatus.SOLD_NOT_PAID) {
             throw new BusinessException(Translator.toLocale("status.error"));
         }
-        userBalanceService.modify(userId, buyerOrder.getInterest().negate(), Constants.BalanceRemark.PAY);
-        userBalanceService.modify(sellerOrder.getUserId(), buyerOrder.getInterest(), Constants.BalanceRemark.RECEIPT);
+        if (!userId.equals(buyerOrder.getUserId())) {
+            throw new BusinessException(Translator.toLocale("permission.denied"));
+        }
+        userBalanceService.modify(userId, buyerOrder.getPremium().negate(), Constants.BalanceRemark.PAY);
+        userBalanceService.modify(sellerOrder.getUserId(), buyerOrder.getPremium(), Constants.BalanceRemark.RECEIPT);
 
         sellerOrder.setStatus(OrderStatus.SOLD);
         sellerOrder.setSoldTime(LocalDateTime.now());

+ 14 - 1
src/main/java/com/izouma/awesomeAdmin/service/ProductService.java

@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
 
 import javax.persistence.criteria.*;
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
@@ -44,25 +45,34 @@ public class ProductService {
             product.setReserve(true);
             return productRepo.save(product);
         }
-        User user = userRepo.findById(product.getUserId()).orElseThrow(new BusinessException(Translator.toLocale("user.not_found")));
+//        User user = userRepo.findById(product.getUserId()).orElseThrow(new BusinessException(Translator.toLocale("user.not_found")));
 //        if (StringUtils.isEmpty(user.getAliAccount()) || StringUtils.isEmpty(user.getAliName())) {
 //            throw new BusinessException("此用户未绑定支付宝账号");
 //        }
 //        if (StringUtils.isEmpty(user.getAlipayUserId())) {
 //            throw new BusinessException("此用户未进行支付宝授权");
 //        }
+        BigDecimal max = sysConfigService.getBigDecimal(Constants.MAX_RISE_RATE);
+        BigDecimal capital = product.getCurrentPrice().divide(max.add(new BigDecimal("1")), 2, RoundingMode.HALF_UP);
+        BigDecimal premium = product.getCurrentPrice().subtract(capital);
+
         product.setReserve(false);
         product.setStatus(ProductStatus.IN_STOCK);
+        product.setCapital(capital);
+        product.setPremium(premium);
         product = productRepo.save(product);
         Order order = orderRepo.save(Order.builder()
                 .userId(product.getUserId())
                 .productId(product.getId())
                 .totalPrice(product.getCurrentPrice())
+                .capital(capital)
+                .premium(premium)
                 .status(OrderStatus.SELLING)
                 .rated(false)
                 .paidTime(LocalDateTime.now())
                 .confirmTime(LocalDateTime.now())
                 .createProduct(true)
+                .batchId(product.getBatchId())
                 .build());
         Delegation delegation = delegationRepo.save(Delegation.builder()
                 .userId(product.getUserId())
@@ -70,10 +80,13 @@ public class ProductService {
                 .sellerOrderId(order.getId())
                 .originalPrice(product.getCurrentPrice())
                 .finalPrice(product.getCurrentPrice())
+                .capital(capital)
+                .premium(premium)
                 .serviceCharge(BigDecimal.ZERO)
                 .riseRate(BigDecimal.ZERO)
                 .active(true)
                 .enabled(true)
+                .batchId(product.getBatchId())
                 .build());
         product.setDelegationId(delegation.getId());
         product = productRepo.save(product);

+ 16 - 8
src/main/java/com/izouma/awesomeAdmin/service/SaleBatchService.java

@@ -17,9 +17,7 @@ import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalTime;
 import java.time.ZoneId;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledFuture;
 
@@ -31,7 +29,7 @@ public class SaleBatchService {
     private final DelegationService delegationService;
     private final TaskScheduler     taskScheduler;
 
-    private Map<String, ScheduledFuture<?>> taskMap = new HashMap<>();
+    private List<ScheduledFuture<?>> tasks = new ArrayList<>();
 
     public SaleBatchService(SaleBatchRepo saleBatchRepo, DelegationService delegationService, TaskScheduler taskScheduler) {
         this.saleBatchRepo = saleBatchRepo;
@@ -40,25 +38,35 @@ public class SaleBatchService {
     }
 
     public SaleBatch create(SaleBatch record) {
-        return saleBatchRepo.save(record);
+        record = saleBatchRepo.saveAndFlush(record);
+        schedule();
+        return record;
     }
 
     public SaleBatch update(SaleBatch record) {
         SaleBatch orig = saleBatchRepo.findById(record.getId())
                 .orElseThrow(new BusinessException(Translator.toLocale("record.not_found")));
         ObjUtils.merge(orig, record);
-        return saleBatchRepo.save(orig);
+        record = saleBatchRepo.saveAndFlush(orig);
+        schedule();
+        return record;
     }
 
     @PostConstruct
     @Scheduled(cron = "1 0 0 * * ?")
     public void schedule() {
+        for (ScheduledFuture<?> task : tasks) {
+            if (!(task.isDone() || task.isCancelled())) {
+                task.cancel(false);
+            }
+        }
+        tasks.clear();
         for (SaleBatch saleBatch : saleBatchRepo.findAllByEnabledTrue()) {
             if (saleBatch.getDelegateStart().isAfter(LocalTime.now())) {
-                taskScheduler.schedule(() -> {
+                tasks.add(taskScheduler.schedule(() -> {
                     delegationService.active(saleBatch.getId());
                 }, Date.from(saleBatch.getDelegateStart().atDate(LocalDate.now())
-                        .atZone(ZoneId.systemDefault()).toInstant()));
+                        .atZone(ZoneId.systemDefault()).toInstant())));
             }
         }
     }

+ 2 - 4
src/main/java/com/izouma/awesomeAdmin/service/UserBalanceService.java

@@ -22,10 +22,8 @@ public class UserBalanceService {
     @Transactional
     public void modify(Long userId, BigDecimal amount, String remark) {
         UserBalance userBalance = userBalanceRepo.findById(userId).orElse(new UserBalance(userId));
-        if (amount.compareTo(BigDecimal.ZERO) > 0) {
-            if (userBalance.getBalance().compareTo(amount) < 0) {
-                throw new BusinessException("余额不足");
-            }
+        if (userBalance.getBalance().add(amount).compareTo(BigDecimal.ZERO) < 0) {
+            throw new BusinessException("余额不足");
         }
         userBalance.setLastBalance(userBalance.getBalance());
         userBalance.setBalance(userBalance.getBalance().add(amount));

+ 5 - 0
src/main/java/com/izouma/awesomeAdmin/web/OrderController.java

@@ -156,5 +156,10 @@ public class OrderController extends BaseController {
     public void restore(@PathVariable Long id) {
         orderService.restore(id);
     }
+
+    @PostMapping("/balancePay")
+    public void balancePay(@RequestParam Long orderId) {
+        orderService.balancePay(SecurityUtils.getAuthenticatedUser().getId(), orderId);
+    }
 }
 

+ 5 - 3
src/main/java/com/izouma/awesomeAdmin/web/PayDelegationController.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
 import com.izouma.awesomeAdmin.domain.Delegation;
 import com.izouma.awesomeAdmin.service.DelegationService;
+import com.izouma.awesomeAdmin.utils.SecurityUtils;
 import com.izouma.awesomeAdmin.utils.Translator;
 import lombok.AllArgsConstructor;
 import lombok.Data;
@@ -44,9 +45,10 @@ public class PayDelegationController {
         return delegationService.payDelegationThird(userId, orderId, riseRate, payType);
     }
 
-    @RequestMapping(value = "/balance", method = RequestMethod.GET)
-    public Delegation payDelegationBalance(@RequestParam Long userId, @RequestParam Long orderId, @RequestParam BigDecimal riseRate) {
-        return delegationService.payDelegationBalance(userId, orderId, riseRate);
+    @RequestMapping(value = "/balance", method = RequestMethod.POST)
+    @ResponseBody
+    public Delegation payDelegationBalance(  @RequestParam Long orderId, @RequestParam BigDecimal riseRate) {
+        return delegationService.payDelegationBalance(SecurityUtils.getAuthenticatedUser().getId(), orderId, riseRate);
     }
 
     @RequestMapping(value = "/thirdNotify", method = RequestMethod.POST)

+ 7 - 2
src/main/java/com/izouma/awesomeAdmin/web/SaleBatchController.java

@@ -1,4 +1,5 @@
 package com.izouma.awesomeAdmin.web;
+
 import com.izouma.awesomeAdmin.domain.SaleBatch;
 import com.izouma.awesomeAdmin.service.SaleBatchService;
 import com.izouma.awesomeAdmin.dto.PageQuery;
@@ -31,14 +32,18 @@ public class SaleBatchController extends BaseController {
     @PreAuthorize("hasRole('ADMIN')")
     @PostMapping("/save")
     public SaleBatch save(@RequestBody SaleBatch record) {
-        return saleBatchService.save(record);
+        if (record.getId() == null) {
+            return saleBatchService.create(record);
+        } else {
+            return saleBatchService.update(record);
+        }
     }
 
 
     @PreAuthorize("hasRole('ADMIN')")
     @GetMapping("/all")
     public Page<SaleBatch> all(PageQuery pageQuery) {
-        return saleBatchRepo.findAll(toSpecification(pageQuery,SaleBatch.class), toPageRequest(pageQuery));
+        return saleBatchRepo.findAll(toSpecification(pageQuery, SaleBatch.class), toPageRequest(pageQuery));
     }
 
     @GetMapping("/get/{id}")

+ 41 - 15
src/main/paintingmarket/src/components/OrderInfo.vue

@@ -34,7 +34,7 @@
         <div class="order-button">
             <span class="problem" @click="problem">遇到问题?</span>
             <template v-if="info.status == 'NOT_PAID'">
-                <van-button color="#FF8F00" round plain size="small" @click="confirmPayment">我已付款</van-button>
+                <!-- <van-button color="#FF8F00" round plain size="small" @click="confirmPayment">我已付款</van-button> -->
                 <van-button type="primary" round size="small" @click="pay">立即支付</van-button>
             </template>
 
@@ -44,7 +44,7 @@
 
             <template v-else-if="info.status == 'SOLD_NOT_CONFIRMED'">
                 <!-- <van-button color="#AAACAD" round plain size="small" @click="confirmPayment">未收到款</van-button> -->
-                <van-button type="primary" round size="small" @click="confirmReceipt">确认收款</van-button>
+                <!-- <van-button type="primary" round size="small" @click="confirmReceipt">确认收款</van-button> -->
             </template>
 
             <template v-else-if="info.status == 'SELLING'">
@@ -134,7 +134,7 @@ export default {
             platformCommission: 0.02,
             maxRiseRate: 6,
             loading: false,
-            payType: 'weixin'
+            payType: 'balance'
         };
     },
     computed: {
@@ -180,17 +180,17 @@ export default {
             this.maxRiseRate = res.value * 100;
             this.value = this.maxRiseRate;
         });
-        this.$http.get('/sysConfig/get/pay_type').then(res => {
-            if (res.value == '0') {
-                if (this.isWeixin) {
-                    this.payType = 'weixin';
-                } else {
-                    this.payType = 'alipay';
-                }
-            } else {
-                this.payType = 'third';
-            }
-        });
+        // this.$http.get('/sysConfig/get/pay_type').then(res => {
+        //     if (res.value == '0') {
+        //         if (this.isWeixin) {
+        //             this.payType = 'weixin';
+        //         } else {
+        //             this.payType = 'alipay';
+        //         }
+        //     } else {
+        //         this.payType = 'third';
+        //     }
+        // });
     },
     methods: {
         goDetail() {
@@ -323,6 +323,21 @@ export default {
                         this.loading = false;
                         return this.$toast(e.error);
                     });
+            } else if (this.payType === 'balance') {
+                this.$toast.loading('支付中');
+                this.$http
+                    .post('/payDelegation/balance', {
+                        userId: this.userInfo.id,
+                        orderId: this.info.id,
+                        riseRate: this.value / 100
+                    })
+                    .then(res => {
+                        this.$toast.success('支付成功');
+                        this.$emit('updateOrder', res);
+                    })
+                    .catch(e => {
+                        this.$toast(e.error);
+                    });
             }
         },
         applyShip() {
@@ -364,7 +379,18 @@ export default {
                 });
         },
         pay() {
-            window.open(this.$baseUrl + '/order/pay/' + this.info.id);
+            this.$toast.loading('支付中');
+            this.$http
+                .post('/order/balancePay', { orderId: this.orderInfo.id })
+                .then(res => {
+                    this.$toast.success('支付成功');
+                    setTimeout(() => {
+                        this.getInfo();
+                    }, 1000);
+                })
+                .catch(e => {
+                    this.$toast(e.error);
+                });
         },
         showTip() {
             this.$dialog.alert({

+ 4 - 0
src/main/paintingmarket/src/main.js

@@ -6,9 +6,13 @@ import Vant from 'vant';
 import Formatters from '@/mixins/formatters';
 import PageMethods from '@/mixins/pageMethods';
 import http from './plugins/http';
+import { Toast } from 'vant';
+
 import 'vant/lib/index.less';
 import './main.less';
 
+Toast.setDefaultOptions('loading', { duration: 0 });
+
 Vue.use(Vant);
 Vue.use(http);
 

+ 11 - 11
src/main/paintingmarket/src/views/Detail.vue

@@ -641,17 +641,17 @@ export default {
             this.$router.push(_routerJson);
         },
         buy() {
-            if (!this.userInfo.phone || !this.hasAddress || !this.userInfo.aliAccount || !this.userInfo.alipayUserId) {
-                this.show = true;
-                this.$http
-                    .get('/alipay/auth', {
-                        userId: this.userInfo.id
-                    })
-                    .then(res => {
-                        this.authUrl = res;
-                    });
-                return;
-            }
+            // if (!this.userInfo.phone || !this.hasAddress || !this.userInfo.aliAccount || !this.userInfo.alipayUserId) {
+            //     this.show = true;
+            //     this.$http
+            //         .get('/alipay/auth', {
+            //             userId: this.userInfo.id
+            //         })
+            //         .then(res => {
+            //             this.authUrl = res;
+            //         });
+            //     return;
+            // }
             this.goNext('submit', { productId: this.productInfo.id });
         },
         addInfo() {

+ 47 - 16
src/main/paintingmarket/src/views/order/OrderDetail.vue

@@ -16,7 +16,7 @@
 
         <div class="product">
             <div class="product-content">
-                <van-image class="suk-img" width="80" height="80" fit="fill" :src="pic" />
+                <van-image class="suk-img" style="min-width:80px" width="80" height="80" fit="fill" :src="pic" />
 
                 <div class="order-text">
                     <div class="van-ellipsis text1">{{ productInfo.name }}</div>
@@ -100,7 +100,7 @@
         <div class="bottom" style="height:50px;">
             <van-goods-action>
                 <div class="order-button" v-if="orderInfo.status == 'NOT_PAID'">
-                    <van-button color="#FF8F00" round plain @click="confirmPayment">我已付款</van-button>
+                    <!-- <van-button color="#FF8F00" round plain @click="confirmPayment">我已付款</van-button> -->
                     <van-button type="primary" round @click="pay">立即支付</van-button>
                 </div>
 
@@ -109,7 +109,7 @@
                     v-else-if="orderInfo.status == 'SOLD_NOT_CONFIRMED' && !orderInfo.delegationId"
                 >
                     <!-- <van-button color="#AAACAD" round plain @click="confirmPayment">未收到款</van-button> -->
-                    <van-button type="primary" round @click="confirmReceipt"> 确认收款</van-button>
+                    <!-- <van-button type="primary" round @click="confirmReceipt">确认收款</van-button> -->
                 </div>
 
                 <div class="order-button" v-else-if="orderInfo.status == 'CONFIRMED'">
@@ -173,7 +173,7 @@ export default {
             delegationTime: '',
             maxRiseRate: 6,
             loading: false,
-            payType: 'weixin'
+            payType: 'balance'
         };
     },
     computed: {
@@ -237,17 +237,17 @@ export default {
                 }
             });
         });
-        this.$http.get('/sysConfig/get/pay_type').then(res => {
-            if (res.value == '0') {
-                if (this.isWeixin) {
-                    this.payType = 'weixin';
-                } else {
-                    this.payType = 'alipay';
-                }
-            } else {
-                this.payType = 'third';
-            }
-        });
+        // this.$http.get('/sysConfig/get/pay_type').then(res => {
+        //     if (res.value == '0') {
+        //         if (this.isWeixin) {
+        //             this.payType = 'weixin';
+        //         } else {
+        //             this.payType = 'alipay';
+        //         }
+        //     } else {
+        //         this.payType = 'third';
+        //     }
+        // });
     },
     methods: {
         showTip() {
@@ -384,6 +384,21 @@ export default {
                         this.loading = false;
                         return this.$toast(e.error);
                     });
+            } else if (this.payType === 'balance') {
+                this.$toast.loading('支付中');
+                this.$http
+                    .post('/payDelegation/balance', {
+                        userId: this.userInfo.id,
+                        orderId: this.info.id,
+                        riseRate: this.value / 100
+                    })
+                    .then(res => {
+                        this.$toast.success('支付成功');
+                        this.getInfo();
+                    })
+                    .catch(e => {
+                        this.$toast(e.error);
+                    });
             }
         },
         applyShip() {
@@ -437,7 +452,18 @@ export default {
                 });
         },
         pay() {
-            window.open(this.$baseUrl + '/order/pay/' + this.orderInfo.id);
+            this.$toast.loading('支付中');
+            this.$http
+                .post('/order/balancePay', { orderId: this.orderInfo.id })
+                .then(res => {
+                    this.$toast.success('支付成功');
+                    setTimeout(() => {
+                        this.getInfo();
+                    }, 1000);
+                })
+                .catch(e => {
+                    this.$toast(e.error);
+                });
         }
     }
 };
@@ -496,10 +522,15 @@ export default {
         .order-text {
             margin-left: 10px;
             flex-grow: 1;
+            flex-basis: 0;
+            min-width: 0;
             .text1 {
                 font-size: 14px;
                 color: rgba(0, 0, 0, 1);
                 line-height: 20px;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                overflow: hidden;
             }
 
             .text2 {

+ 1 - 3
src/main/paintingmarket/src/views/order/Submit.vue

@@ -160,7 +160,7 @@ export default {
                     addressId: this.chooseAddressId
                 })
                 .then(res => {
-                    this.$toast.success('确认成功');
+                    this.$toast.success('下单成功');
                     setTimeout(() => {
                         this.$router.replace({
                             name: 'orderDetail',
@@ -171,8 +171,6 @@ export default {
                                 isNext: 1
                             }
                         });
-
-                        window.open(this.$baseUrl + '/order/pay/' + res.id);
                     }, 1000);
                 })
                 .catch(e => {

+ 1 - 1
src/main/resources/application.yaml

@@ -9,7 +9,7 @@ spring:
     profiles:
         active: dev
     datasource:
-        url: jdbc:mysql://rdsave1o67m1ido6gwp6public.mysql.rds.aliyuncs.com/art_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
+        url: jdbc:mysql://rdsave1o67m1ido6gwp6public.mysql.rds.aliyuncs.com/art_2_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8
         username: microball
         password: 2wsx@WSX#EDC
         hikari: