瀏覽代碼

Merge branch 'feature-2025-1-10' into jenkins-test

TIANYONG 5 月之前
父節點
當前提交
035f608b18
共有 2 個文件被更改,包括 21 次插入10 次删除
  1. 17 6
      src/views/collection-record-detail/index.tsx
  2. 4 4
      src/views/student-register/index-apply.tsx

+ 17 - 6
src/views/collection-record-detail/index.tsx

@@ -68,9 +68,17 @@ export default defineComponent({
       tempGoods.forEach((item: any) => {
         const img = item.goodsUrl ? item.goodsUrl.split(',')[0] : '';
         item.goodsUrl = img;
-        item.brandName = item.brandName
+        /**
+         * 如果是赠送的乐器,不显示brandName
+         */
+        if (!item.brandName && item.goodsType === 'INSTRUMENTS' && item.giftFlag) {
+          item.brandName = ''
+          item.isInstrumentGift = true
+        } else {
+          item.brandName = item.brandName
           ? item.brandName
           : goodsType[item.goodsType];
+        }
       });
       state.goodsInfos = tempGoods;
       if (isRefund) {
@@ -237,11 +245,14 @@ export default defineComponent({
                 title: () => (
                   <div class={styles.buyContent}>
                     <p class={styles.goodsTitle}>{goods.goodsName}</p>
-                    <Tag class={styles.brandName}>
-                      {state.orders.orderType === 'VIP'
-                        ? '12个月'
-                        : goods.brandName}
-                    </Tag>
+                    {
+                      !goods.isInstrumentGift && 
+                      <Tag class={styles.brandName}>
+                        {state.orders.orderType === 'VIP'
+                          ? '12个月'
+                          : goods.brandName}
+                      </Tag>                      
+                    }
                   </div>
                 ),
                 value: () => <span>x {goods.goodsNum}</span>

+ 4 - 4
src/views/student-register/index-apply.tsx

@@ -1000,7 +1000,7 @@ export default defineComponent({
           });
         });
         // 添加赠送的乐器
-        if (state.currentIntrument?.instrumentId) {
+        if (state.currentIntrument?.instrumentId && forms.registerType === 'MUST_BUY_GOODS') {
           params.push({
             goodsId: state.currentIntrument?.instrumentId,
             goodsNum: 1,
@@ -2052,10 +2052,10 @@ export default defineComponent({
                   studentInfo.extra.currentClass = '';
                 }
                 // 更换年级班级后,判断是否需要更换赠送的乐器
-                if (forms.schoolInstrumentSetType === 'GRADE') {
+                if (forms.schoolInstrumentSetType === 'GRADE' && forms.registerType === 'MUST_BUY_GOODS') {
                   state.currentIntrument = state.intrumentList.find((item: any) => (item.gradeNum === selectedOption.value))
                 }         
-                if (forms.schoolInstrumentSetType === 'CLASS') {
+                if (forms.schoolInstrumentSetType === 'CLASS' && forms.registerType === 'MUST_BUY_GOODS') {
                   state.currentIntrument = null
                 }       
                 console.log('选择111',state.currentIntrument)
@@ -2090,7 +2090,7 @@ export default defineComponent({
                   forms.instrumentCode = selectedOption.instrumentCode;
                 }
                 // 更换年级班级后,判断是否需要更换赠送的乐器
-                if (forms.schoolInstrumentSetType === 'CLASS') {
+                if (forms.schoolInstrumentSetType === 'CLASS' && forms.registerType === 'MUST_BUY_GOODS') {
                   state.currentIntrument = state.intrumentList.find((item: any) => (item.gradeNum === studentInfo.extra.currentGradeNum && item.classNum === selectedOption.value) )
                 }                
                 console.log('选择222',state.currentIntrument)