Browse Source

Merge remote-tracking branch 'origin/hqyDev' into iteration-20241126

lex-xin 3 months ago
parent
commit
06b2610bea

+ 1 - 1
src/student/activePage/double12Active/index.module.less

@@ -178,7 +178,7 @@
         & > span:nth-child(3) {
           font-weight: 500;
           font-size: 12px;
-          color: #ffffff;
+          color: rgba(255, 255, 255, 0.8);
         }
       }
     }

+ 1 - 1
src/student/activePage/double12Active/index.tsx

@@ -107,7 +107,7 @@ export default defineComponent({
               }
               return {
                 goodType: rewardType,
-                goodName: `小酷Ai SVIP ${memberType[unit]}`,
+                goodName: `小酷Ai ${rewardType} ${memberType[unit]}`,
                 goodNum: 1,
                 bizContent: vipCardId,
                 giftFlag: true,

+ 1 - 1
src/views/member-center/index.tsx

@@ -462,7 +462,7 @@ export default defineComponent({
                   }
                   return {
                     goodType: rewardType,
-                    goodName: `小酷Ai SVIP ${memberType[unit]}`,
+                    goodName: `小酷Ai ${rewardType} ${memberType[unit]}`,
                     goodNum: 1,
                     bizContent: vipCardId,
                     giftFlag: true,

+ 25 - 23
src/views/order-detail/order-vip/index.tsx

@@ -61,29 +61,31 @@ export default defineComponent({
     // 畅学卡 活动计算
     studyCardTimes() {
       const { activityList, discountEndTime } = this.item
-      const studyCardVal = (activityList || []).find(item => {
+      const studyCardVals = (activityList || []).filter(item => {
         return item.goodType === 'DISCOUNT'
       })
-      if (studyCardVal) {
+      if (studyCardVals.length) {
         const startTime = dayjs(discountEndTime || new Date()).toDate()
-        let endTime = new Date()
-        if (studyCardVal.unit === 'MONTH') {
-          endTime = dayjs(startTime)
-            .add(1 * studyCardVal.goodsNum, 'month')
-            .toDate()
-        } else if (studyCardVal.unit === 'QUARTERLY') {
-          endTime = dayjs(startTime)
-            .add(3 * studyCardVal.goodsNum, 'month')
-            .toDate()
-        } else if (studyCardVal.unit === 'YEAR_HALF') {
-          endTime = dayjs(startTime)
-            .add(6 * studyCardVal.goodsNum, 'month')
-            .toDate()
-        } else if (studyCardVal.unit === 'YEAR') {
-          endTime = dayjs(startTime)
-            .add(1 * studyCardVal.goodsNum, 'year')
-            .toDate()
-        }
+        let endTime = startTime
+        studyCardVals.map(studyCardVal => {
+          if (studyCardVal.unit === 'MONTH') {
+            endTime = dayjs(endTime)
+              .add(1 * studyCardVal.goodsNum, 'month')
+              .toDate()
+          } else if (studyCardVal.unit === 'QUARTERLY') {
+            endTime = dayjs(endTime)
+              .add(3 * studyCardVal.goodsNum, 'month')
+              .toDate()
+          } else if (studyCardVal.unit === 'YEAR_HALF') {
+            endTime = dayjs(endTime)
+              .add(6 * studyCardVal.goodsNum, 'month')
+              .toDate()
+          } else if (studyCardVal.unit === 'YEAR') {
+            endTime = dayjs(endTime)
+              .add(1 * studyCardVal.goodsNum, 'year')
+              .toDate()
+          }
+        })
         return {
           startTime: dayjs(startTime).format('YYYY-MM-DD'),
           endTime: dayjs(endTime).format('YYYY-MM-DD')
@@ -97,11 +99,11 @@ export default defineComponent({
     },
     // vip 结束时间
     vipEndTime() {
-      const vipVal = (this.item.activityList || []).find(item => {
+      const vipVals = (this.item.activityList || []).filter(item => {
         return this.item.orderType === item.goodType
       })
       let endTime = this.item.endTime
-      if(vipVal){
+      vipVals.map(vipVal => {
         if (vipVal.unit === 'MONTH') {
           endTime = dayjs(endTime)
             .add(1 * vipVal.goodsNum, 'month')
@@ -119,7 +121,7 @@ export default defineComponent({
             .add(1 * vipVal.goodsNum, 'year')
             .toDate()
         }
-      }
+      })
       return dayjs(endTime).format('YYYY-MM-DD')
     }
   },