Jelajahi Sumber

feat: 订单详情页,赠送的乐器不显示brandName

TIANYONG 4 bulan lalu
induk
melakukan
f62532a3c7
1 mengubah file dengan 17 tambahan dan 6 penghapusan
  1. 17 6
      src/views/collection-record-detail/index.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>