lex-xin 7 ماه پیش
والد
کامیت
7d932c9206

+ 2 - 2
src/student/discount-card/index.tsx

@@ -171,8 +171,8 @@ export default defineComponent({
                   userInfo.value.userVip.vipType === 'PERMANENT_SVIP') &&
                   styles.userSVip,
                 userInfo.value.userVip.vipType === 'VIP' && styles.userVip,
-                userInfo.value.userVip.svipEndDays > 0 ||
-                userInfo.value.userVip.vipEndDays > 0
+                (userInfo.value.userVip.vipType === 'SVIP' ||
+                  userInfo.value.userVip.vipType === 'PERMANENT_SVIP')
                   ? styles.isVip
                   : ''
               ]}

+ 7 - 1
src/student/teacher-dependent/teacher-home.tsx

@@ -17,6 +17,7 @@ import Single from './components/single'
 import JoinChat from './model/join-chat'
 import FansList from './model/fans-list'
 import MusicList from '@/views/music/list'
+import { setLogin } from '@/state'
 
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `./images/${fileName}`
@@ -57,7 +58,12 @@ export default defineComponent({
       this.tabsHeight = height
       this.stickyHeight()
     })
-
+    try {
+      const userInfo = await request.get('/api-student/student/queryUserInfo')
+      setLogin(userInfo.data)
+    } catch {
+      //
+    }
     this.getTeacherDetail()
     // 监听页面返回
     listenerMessage('webViewOnResume', () => {

+ 6 - 6
src/student/trade/tradeOrder.ts

@@ -284,7 +284,8 @@ export const formatOrderDetail = async (item: any, amount?: IAmount) => {
   }
   tempList.orderType = type
   tempList.goodName = item.goodName
-  return tempList
+  // return tempList
+  orderStatus.orderObject.orderList.push(tempList)
 }
 // 获取视频课详情
 export const getVideoDetail = async (groupId: any) => {
@@ -435,17 +436,16 @@ export const tradeOrder = async (result: any, callBack?: any) => {
       }
     })
     orderDetails[0] && (orderDetails[0].activityList = orderDetailsActivity)
-    // console.log(orderDetails, 'orderDetails')
-    orderDetails.forEach(async (item: any) => {
-      const child = await formatOrderDetail(item, {
+    for(let i = 0; i < orderDetails.length; i++) {
+      await formatOrderDetail(orderDetails[i], {
         couponAmount,
         discountPrice,
         expectPrice,
         activityType
       })
-      orderStatus.orderObject.orderList.push(child)
+      
       moveToEnd()
-    })
+    }
 
     callBack && callBack()
   } catch {

+ 1 - 0
src/tenant/music/music-detail/index.tsx

@@ -407,6 +407,7 @@ export default defineComponent({
           orderType: 'MUSIC',
           goodsName: music.musicSheetName,
           actualPrice: music.musicPrice,
+          price: music.musicPrice,
           ...music
         }
       ]

+ 1 - 0
src/views/music/music-detail/index.tsx

@@ -407,6 +407,7 @@ export default defineComponent({
           orderType: 'MUSIC',
           goodsName: music.musicSheetName,
           actualPrice: music.musicPrice,
+          price: music.musicPrice,
           ...music
         }
       ]

+ 37 - 37
src/views/order-detail/index.tsx

@@ -157,6 +157,7 @@ export default defineComponent({
             orderType: 'MUSIC',
             goodsName: item.musicSheetName,
             actualPrice: item.musicPrice,
+            price: item.musicPrice,
             ...item
           }
         ]
@@ -171,12 +172,11 @@ export default defineComponent({
     orderList.forEach((order: any) => {
       tempGoodsType.push({
         orderType: order.orderType,
-        basePrice: order.price,
-        price: order.price
+        basePrice: order.price || 0,
+        price: order.price || 0
       })
     })
     this.orderGoodsType = tempGoodsType
-
     await this.getOrderPayType()
 
     this.orderAmount = orderStatus.orderObject.actualPrice || 0
@@ -226,49 +226,49 @@ export default defineComponent({
     async getOrderPayType() {
       try {
         const orderObject = orderStatus.orderObject
+        // 单独处理其它支付类型下面用的bizId
+        const orderItem = orderObject.orderList.find(
+          (item: any) => item.orderType === this.orderType
+        )
+        let bizId = orderItem ? orderItem.id : ''
+        if (orderObject.orderType === 'PRACTICE') {
+          const orderItem = orderObject.orderList.find(
+            (item: any) => item.orderType === 'PRACTICE'
+          )
+          bizId = orderItem ? orderItem.teacherId : ''
+        }
+        if (
+          orderObject.orderType === 'LIVE' ||
+          orderObject.orderType === 'VIDEO'
+        ) {
+          const orderItem = orderObject.orderList.find(
+            (item: any) =>
+              item.orderType === 'VIDEO' || item.orderType === 'LIVE'
+          )
+          bizId = orderItem ? orderItem.courseGroupId : ''
+        }
+        const { data } = await request.post(
+          state.platformApi + '/userOrder/orderPayType',
+          {
+            data: {
+              goodType: orderObject.orderType,
+              bizId,
+              recomUserId: orderObject.recomUserId
+                ? orderObject.recomUserId
+                : null
+            }
+          }
+        )
         // 判断是否已经有支付方式了
         const paymentConfig = orderStatus.orderObject.paymentConfig || {}
         if (paymentConfig.paymentVersion && orderStatus.orderObject.orderNo) {
           this.paymentVersion = paymentConfig.paymentVersion || 'V1'
           this.paymentVendor = paymentConfig.paymentVendor
         } else {
-          // 单独处理其它支付类型下面用的bizId
-          const orderItem = orderObject.orderList.find(
-            (item: any) => item.orderType === this.orderType
-          )
-          let bizId = orderItem ? orderItem.id : ''
-          if (orderObject.orderType === 'PRACTICE') {
-            const orderItem = orderObject.orderList.find(
-              (item: any) => item.orderType === 'PRACTICE'
-            )
-            bizId = orderItem ? orderItem.teacherId : ''
-          }
-          if (
-            orderObject.orderType === 'LIVE' ||
-            orderObject.orderType === 'VIDEO'
-          ) {
-            const orderItem = orderObject.orderList.find(
-              (item: any) =>
-                item.orderType === 'VIDEO' || item.orderType === 'LIVE'
-            )
-            bizId = orderItem ? orderItem.courseGroupId : ''
-          }
-          const { data } = await request.post(
-            state.platformApi + '/userOrder/orderPayType',
-            {
-              data: {
-                goodType: orderObject.orderType,
-                bizId,
-                recomUserId: orderObject.recomUserId
-                  ? orderObject.recomUserId
-                  : null
-              }
-            }
-          )
           this.paymentVersion = data.paymentVersion || 'V1'
           this.paymentVendor = data.paymentVendor
-          this.paymentChannels = data.paymentChannels // 可以选择的支付类型
         }
+        this.paymentChannels = data.paymentChannels // 可以选择的支付类型
       } catch {
         //
       }

+ 1 - 0
src/views/order-detail/use-coupons/index.tsx

@@ -147,6 +147,7 @@ export default defineComponent({
             this.orderGoodsType.forEach((goods: any) => {
               allAmount += Number(goods.price)
             })
+            console.log(allAmount, '1212')
             item.disabled = item.useLimit <= allAmount ? false : true
           } else {
             const disItem: any = this.orderGoodsType.find((goods: any) => couponEnum[goods.orderType] === item.couponCategory)