瀏覽代碼

update:红包金额下限设置

ct 17 小時之前
父節點
當前提交
16c70d4404
共有 1 個文件被更改,包括 8 次插入6 次删除
  1. 8 6
      src/views/course/userCoursePeriod/redPacket.vue

+ 8 - 6
src/views/course/userCoursePeriod/redPacket.vue

@@ -27,11 +27,11 @@
         <el-table-column label="课程" prop="courseName" align="center" />
         <el-table-column label="小节" prop="videoName" align="center" />
         <el-table-column label="营期日期" prop="dayDate" align="center"/>
-        <el-table-column label="红包金额(0.1-0.3元)" width="200px" align="center">
+        <el-table-column label="红包金额(0.0-0.3元)" width="200px" align="center">
           <template slot-scope="scope">
             <el-input-number
               v-model="scope.row.amount"
-              :min="0.1"
+              :min="0.0"
               :max="0.3"
               :precision="2"
               :step="0.01"
@@ -129,25 +129,27 @@ export default {
         periodId: this.periodId,
         companyId: this.currentCompany.companyId
       }).then(response => {
+        console.log("-----------",JSON.stringify(response.data))  
         this.redPacketList = (response.data || []).map(item => ({
           ...item,
-          amount: item.amount || 0.1
+          // 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 || item.amount > 0.3);
+      const invalidItems = validAmountItems.filter(item => item.amount < 0.0 || item.amount > 0.3);
       if (invalidItems.length > 0) {
-        this.$message.error('红包金额需要在0.1元至0.3元之间');
+        this.$message.error('红包金额需要在0.0元至0.3元之间');
         return;
       }