xiongzhu il y a 4 ans
Parent
commit
e031281aed

+ 8 - 0
src/main/java/com/izouma/nineth/service/OrderService.java

@@ -82,6 +82,14 @@ public class OrderService {
         if (qty > collection.getStock()) {
             throw new BusinessException("库存不足");
         }
+        if (!collection.isCanResale()) {
+            throw new BusinessException("该藏品当前不可购买");
+        }
+        if (collection.getType() == CollectionType.BLIND_BOX) {
+            if (collection.getStartTime().isAfter(LocalDateTime.now())) {
+                throw new BusinessException("盲盒未开售");
+            }
+        }
         UserAddress userAddress = null;
         if (addressId != null) {
             userAddress = userAddressRepo.findById(addressId).orElseThrow(new BusinessException("地址信息不存在"));

+ 2 - 2
src/main/vue/src/views/OrderEdit.vue

@@ -81,8 +81,8 @@
                     <el-form-item prop="txHash" label="链上hash">
                         <el-input v-model="formData.txHash" disabled></el-input>
                     </el-form-item>
-                    <el-form-item prop="gas" label="消耗gas">
-                        <el-input v-model="formData.gas" disabled></el-input>
+                    <el-form-item prop="gasUsed" label="消耗gas">
+                        <el-input v-model="formData.gasUsed" disabled></el-input>
                     </el-form-item>
                     <el-form-item class="form-submit">
                         <!-- <el-button @click="onSave" :loading="saving" type="primary"> 保存 </el-button>