소스 검색

fix:营期红包下限

ct 2 주 전
부모
커밋
2088508328
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 5
      src/views/course/userCoursePeriod/redPacket.vue

+ 5 - 5
src/views/course/userCoursePeriod/redPacket.vue

@@ -31,7 +31,7 @@
           <template slot-scope="scope">
             <el-input-number
               v-model="scope.row.amount"
-              :min="0.1"
+              :min="0.0"
               :precision="2"
               :step="0.01"
               size="small"
@@ -130,23 +130,23 @@ export default {
       }).then(response => {
         this.redPacketList = (response.data || []).map(item => ({
           ...item,
-          amount: item.amount || 0.1
+          amount:item.amount ?? 0.1
         }));
       });
     },
     // 保存红包金额
     handleSave() {
       // 筛选出有金额的项目
-      const validAmountItems = this.redPacketList.filter(item => item.amount > 0);
+      const validAmountItems = this.redPacketList.filter(item => item.amount >= 0);
       if (validAmountItems.length === 0) {
         this.$message.warning('请至少设置一个红包金额');
         return;
       }
 
       // 验证金额范围
-      const invalidItems = validAmountItems.filter(item => item.amount < 0.1);
+      const invalidItems = validAmountItems.filter(item => item.amount < 0.0);
       if (invalidItems.length > 0) {
-        this.$message.error('红包金额需要大于等于0.1元');
+        this.$message.error('红包金额需要大于等于0元');
         return;
       }