Przeglądaj źródła

Merge branch 'iteration-20241126' into dev

lex-xin 4 miesięcy temu
rodzic
commit
77d232eadd
26 zmienionych plików z 303 dodań i 150 usunięć
  1. 2 0
      src/constant/index.ts
  2. BIN
      src/student/activePage/double12Active/imgs/svipCon1.png
  3. BIN
      src/student/activePage/double12Active/imgs/svipCon2.png
  4. BIN
      src/student/activePage/double12Active/imgs/tip1Img.png
  5. BIN
      src/student/activePage/double12Active/imgs/tip2Img.png
  6. 6 2
      src/student/activePage/double12Active/index.module.less
  7. 2 2
      src/student/activePage/double12Active/index.tsx
  8. 4 3
      src/student/teacher-dependent/components/video-item/index.module.less
  9. 1 1
      src/student/teacher-dependent/components/video-item/index.tsx
  10. 2 2
      src/student/teacher-dependent/teacher-follow.tsx
  11. 1 1
      src/student/teacher-dependent/teacher-home.module.less
  12. 13 9
      src/student/teacher-dependent/teacher-style/index.module.less
  13. 93 40
      src/student/teacher-dependent/teacher-style/index.tsx
  14. 30 8
      src/student/trade/tradeOrder.ts
  15. 4 28
      src/teacher/layout/login-cert.tsx
  16. 1 1
      src/teacher/practice-class/practice-setting.tsx
  17. 25 16
      src/views/member-center/index.module.less
  18. 16 17
      src/views/member-center/index.tsx
  19. 3 1
      src/views/music/album-detail/index.tsx
  20. 10 4
      src/views/music/music-detail/index.tsx
  21. 4 3
      src/views/order-detail/add-discount/index.tsx
  22. 32 3
      src/views/order-detail/index.tsx
  23. 1 1
      src/views/order-detail/use-coupons/choice-coupon.tsx
  24. 3 2
      src/views/order-detail/use-coupons/index.module.less
  25. 15 2
      src/views/order-detail/use-coupons/index.tsx
  26. 35 4
      src/views/trade/trade-detail.tsx

+ 2 - 0
src/constant/index.ts

@@ -6,6 +6,8 @@ export const goodsType = {
   SVIP: '开通SVIP会员',
   MUSIC: '单曲点播',
   ALBUM: '专辑购买',
+  VIP_COURSE: 'VIP定制课',
+  DISCOUNT: '畅学卡',
   PIANO_ROOM: '琴房时长充值',
   ACTI_REGIST: '活动报名',
   TENANT_ALBUM: '机构专辑'

BIN
src/student/activePage/double12Active/imgs/svipCon1.png


BIN
src/student/activePage/double12Active/imgs/svipCon2.png


BIN
src/student/activePage/double12Active/imgs/tip1Img.png


BIN
src/student/activePage/double12Active/imgs/tip2Img.png


+ 6 - 2
src/student/activePage/double12Active/index.module.less

@@ -45,7 +45,7 @@
       z-index: 0;
       width: 100%;
       height: 60px;
-      border-radius: 20px 20px 0 0;
+      border-radius: 19px 19px 0 0;
     }
     .activeCon {
       margin-top: 24px;
@@ -56,6 +56,7 @@
         height: 27px;
         background: #ffdd71;
         border-radius: 14px;
+        font-family: Helvetica Neue, Helvetica, PingFangSC;
         font-weight: 600;
         font-size: 15px;
         color: #000000;
@@ -213,7 +214,7 @@
       z-index: 0;
       width: 100%;
       height: 60px;
-      border-radius: 20px 20px 0 0;
+      border-radius: 19px 19px 0 0;
     }
     .titCon {
       position: relative;
@@ -243,6 +244,8 @@
         align-items: flex-end;
         font-size: 15px;
         color: #ffffff;
+        font-weight: 600;
+        font-family: Helvetica Neue, Helvetica, PingFangSC;
         & > span:nth-child(1) {
           font-size: 22px;
           font-weight: 500;
@@ -281,6 +284,7 @@
       color: #ffffff;
       letter-spacing: 1px;
       text-align: center;
+      font-weight: 600;
       &.disable {
         pointer-events: none;
         opacity: 0.4;

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

@@ -271,9 +271,9 @@ export default defineComponent({
             <div class={styles.activeBox}>活动时间</div>
             <div class={styles.activeTimes}>
               {`${dayjs(activitData.activityStart).format(
-                'YYYY年MM月DD日HH:MM'
+                'YYYY年MM月DD日HH:mm'
               )}-${dayjs(activitData.activityEnd).format(
-                'YYYY年MM月DD日HH:MM'
+                'YYYY年MM月DD日HH:mm'
               )}`}
             </div>
           </div>

+ 4 - 3
src/student/teacher-dependent/components/video-item/index.module.less

@@ -9,8 +9,8 @@
   align-items: center;
 
   .viCover {
-    height: 94px;
-    width: 100%;
+    height: 81px;
+    width: 146px;
     border-radius: 6px;
     vertical-align: middle;
     overflow: hidden;
@@ -25,7 +25,8 @@
     font-weight: 600;
     font-size: 15px;
     color: #131415;
-    line-height: 21px;
+    line-height: 21px;  
+    max-width: 165px;
   }
 
   .viUserNum {

+ 1 - 1
src/student/teacher-dependent/components/video-item/index.tsx

@@ -36,7 +36,7 @@ export default defineComponent({
           this.onClick(item)
         }}
       >
-        <div style={{ position: 'relative' }}>
+        <div style={{ position: 'relative', flexShrink: 0 }}>
           <Image
             class={styles.viCover}
             fit="cover"

+ 2 - 2
src/student/teacher-dependent/teacher-follow.tsx

@@ -236,12 +236,12 @@ export default defineComponent({
                       <div class={styles.teacherInfoName}>
                         {item.userName || `游客${item.userId || ''}`}
                       </div>
-                      {this.checkBadge('DEGREE', item.teacher) && (
+                      {/* {this.checkBadge('DEGREE', item.teacher) && (
                         <img src={IconXueli} />
                       )}
                       {this.checkBadge('TEACHER', item.teacher) && (
                         <img src={IconJiaozi} />
-                      )}
+                      )} */}
                     </div>
                     <div class={styles.piNameSubject}>
                       {/* <Image

+ 1 - 1
src/student/teacher-dependent/teacher-home.module.less

@@ -31,7 +31,7 @@
       background-color: transparent;
     }
     .van-tabs__line {
-      width: 44px !important;
+      width: 32px !important;
       height: 6px;  
       background: linear-gradient( 90deg, #2DC7AA 0%, rgba(45,199,170,0) 100%) !important;
       border-radius: 3px;

+ 13 - 9
src/student/teacher-dependent/teacher-style/index.module.less

@@ -1,9 +1,15 @@
 .elegant {
-  // display: flex;
-  // flex-wrap: wrap;
-  // justify-content: space-between; /* 让元素均匀分布在容器内 */
-  column-count: 2; /* 设置列数 */
+  display: flex;
+  // column-count: 2; /* 设置列数 */
   padding: 14px;
+
+  .line:first-child {
+    .tedeoItem:first-child {
+      .teCover {
+        height: 170px;
+      }
+    }
+  }
 }
 
 .itemBg {
@@ -17,6 +23,8 @@
   z-index: 89;
 }
 
+
+
 .tedeoItem {
   border-radius: 8px;
   background-color: #fff;
@@ -25,11 +33,7 @@
   margin-bottom: 12px;
   position: relative;
   display: inline-block;
-  &:first-child {
-    .teCover {
-      height: 170px;
-    }
-  }
+  
   position: relative;
   :global {
     .van-image {

+ 93 - 40
src/student/teacher-dependent/teacher-style/index.tsx

@@ -57,54 +57,107 @@ export default defineComponent({
         state.isAddBrowse = false
       } catch {}
     }
-    
+
     return () => (
       <div class={styles['teacher-elegant']}>
         <TheSticky>
-          <ColHeader
-            border={false}
-            background="transparent"
-            isFixed={false}
-          />
+          <ColHeader border={false} background="transparent" isFixed={false} />
         </TheSticky>
 
         {state.dataShow ? (
           <div class={[styles.elegant]}>
-            {state.list.map((item: any) => (
-              <div class={styles.tedeoItem}>
-                <div
-                  class={styles.itemBg}
-                  onClick={() => {
-                    state.videoStatus = true
-                    state.isAddBrowse = true
-                    state.videoItem = item
-                  }}
-                ></div>
-                <img class={styles.iconVideo} src={iconVideo} />
-                <div class={styles.teCover}>
-                  <Image src={item.cover || iconUploadPoster} fit="cover" />
-                </div>
-                <div class={styles.teSection}>
-                  <div class={styles.info}>
-                    <div class={styles.teUserInfo}>
-                      <Image
-                        src={item.avatar || iconTeacher}
-                        class={styles.teUserLogo}
-                      />
-                      <span
-                        class={[
-                          styles.teUserName,
-                          'van-hairline--right van-ellipsis'
-                        ]}
-                      >
-                        {item?.username || `游客${item?.userId || ''}`}
-                      </span>
+            <div class={styles.line}>
+              {state.list.map(
+                (item: any, index: number) =>
+                  index % 2 === 0 && (
+                    <div class={styles.tedeoItem}>
+                      <div
+                        class={styles.itemBg}
+                        onClick={() => {
+                          state.videoStatus = true
+                          state.isAddBrowse = true
+                          state.videoItem = item
+                        }}
+                      ></div>
+                      <img class={styles.iconVideo} src={iconVideo} />
+                      <div class={styles.teCover}>
+                        <Image
+                          src={item.cover || iconUploadPoster}
+                          fit="cover"
+                        />
+                      </div>
+                      <div class={styles.teSection}>
+                        <div class={styles.info}>
+                          <div class={styles.teUserInfo}>
+                            <Image
+                              src={item.avatar || iconTeacher}
+                              class={styles.teUserLogo}
+                            />
+                            <span
+                              class={[
+                                styles.teUserName,
+                                'van-hairline--right van-ellipsis'
+                              ]}
+                            >
+                              {state.userInfo?.username ||
+                                `游客${item?.userId || ''}`}
+                            </span>
+                          </div>
+                          <span class={styles.teUserNum}>
+                            {item.browse}浏览
+                          </span>
+                        </div>
+                      </div>
+                    </div>
+                  )
+              )}
+            </div>
+            <div class={styles.line}>
+              {state.list.map(
+                (item: any, index: number) =>
+                  index % 2 === 1 && (
+                    <div class={styles.tedeoItem}>
+                      <div
+                        class={styles.itemBg}
+                        onClick={() => {
+                          state.videoStatus = true
+                          state.isAddBrowse = true
+                          state.videoItem = item
+                        }}
+                      ></div>
+                      <img class={styles.iconVideo} src={iconVideo} />
+                      <div class={styles.teCover}>
+                        <Image
+                          src={item.cover || iconUploadPoster}
+                          fit="cover"
+                        />
+                      </div>
+                      <div class={styles.teSection}>
+                        <div class={styles.info}>
+                          <div class={styles.teUserInfo}>
+                            <Image
+                              src={item.avatar || iconTeacher}
+                              class={styles.teUserLogo}
+                            />
+                            <span
+                              class={[
+                                styles.teUserName,
+                                'van-hairline--right van-ellipsis'
+                              ]}
+                            >
+                              {state.userInfo?.username ||
+                                `游客${item?.userId || ''}`}
+                            </span>
+                          </div>
+                          <span class={styles.teUserNum}>
+                            {item.browse}浏览
+                          </span>
+                        </div>
+                      </div>
                     </div>
-                    <span class={styles.teUserNum}>{item.browse}浏览</span>
-                  </div>
-                </div>
-              </div>
-            ))}
+                  )
+              )}
+            </div>
           </div>
         ) : (
           <ColResult

+ 30 - 8
src/student/trade/tradeOrder.ts

@@ -35,6 +35,7 @@ interface IAmount {
   couponAmount: number
   discountPrice: number
   expectPrice: number
+  activityType: string
 }
 export const formatOrderDetail = async (item: any, amount?: IAmount) => {
   const type = item.goodType
@@ -107,19 +108,38 @@ export const formatOrderDetail = async (item: any, amount?: IAmount) => {
     case 'SVIP':
       {
         try {
+          // // couponAmount 总的优惠金额
+          // // discountPrice 优惠券金额
+          // let tempPrice = amount?.expectPrice || item.actualPrice
+          
+          // // 如果是赠送活动 就是一口价
+          // if (item.activityType !== 'MEMBER') {
+          //   if (amount?.couponAmount) {
+          //     tempPrice = Number(
+          //       (
+          //         (amount?.expectPrice -
+          //           (amount.couponAmount - amount.discountPrice)) / item.goodNum
+          //       ).toFixed(2)
+          //     )
+          //   }
+          // }
+
           // couponAmount 总的优惠金额
           // discountPrice 优惠券金额
           let tempPrice = amount?.expectPrice || item.actualPrice
-          // 如果是赠送活动 就是一口价
-          if (item.activityType !== 'MEMBER') {
-            if (amount?.couponAmount) {
+          
+          // 如果是赠送活动 就是一口价 amount?.activityType !== 'MEMBER' && 
+          if (amount?.couponAmount) {
               tempPrice = Number(
                 (
-                  amount?.expectPrice -
-                  (amount.couponAmount - amount.discountPrice) / item.goodNum
+                  (amount?.expectPrice -
+                    (amount.couponAmount - amount.discountPrice)) / item.goodNum
                 ).toFixed(2)
               )
-            }
+          } else {
+            tempPrice = Number(
+              tempPrice / item.goodNum
+              ).toFixed(2)
           }
           // 判断是否有会员
           let startTime = new Date()
@@ -382,6 +402,7 @@ export const tradeOrder = async (result: any, callBack?: any) => {
     paymentConfig,
     paymentVendor,
     paymentVersion,
+    activityType, // 活动类型
     expectPrice
   } = result
   orderStatus.orderObject.orderType = orderType
@@ -410,12 +431,13 @@ 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, {
         couponAmount,
         discountPrice,
-        expectPrice
+        expectPrice,
+        activityType
       })
       orderStatus.orderObject.orderList.push(child)
       moveToEnd()

+ 4 - 28
src/teacher/layout/login-cert.tsx

@@ -10,13 +10,11 @@ import topBg from './image-cert/top.png'
 import activeButtonIcon from '@common/images/icon_checkbox.png'
 import inactiveButtonIcon from '@common/images/icon_checkbox_default.png'
 
-type loginType = 'PWD' | 'SMS'
 export default defineComponent({
   name: 'login',
   data() {
     return {
       checked: false,
-      loginType: 'SMS' as loginType,
       username: '',
       password: '',
       smsCode: '',
@@ -29,11 +27,8 @@ export default defineComponent({
   computed: {
     codeDisable() {
       let status = true
-      if (this.loginType === 'PWD') {
-        this.username && this.password && (status = false)
-      } else {
         this.username && this.smsCode && this.checked && (status = false)
-      }
+      
       return status
     }
   },
@@ -72,28 +67,16 @@ export default defineComponent({
     },
     async onLogin() {
       try {
-        let res: any
-        if (this.loginType === 'PWD') {
-          res = await request.post('/api-auth/usernameLogin', {
-            requestType: 'form',
-            data: {
-              username: this.username,
-              password: this.password,
-              clientId: 'teacher',
-              clientSecret: 'teacher'
-            }
-          })
-        } else {
-          res = await request.post('/api-auth/smsLogin', {
+        let res = await request.post('/api-auth/smsLogin', {
             requestType: 'form',
             data: {
               clientId: 'teacher',
               clientSecret: 'teacher',
               phone: this.username,
-              smsCode: this.smsCode
+              smsCode: this.smsCode,
+              isSurportRegister: true
             }
           })
-        }
 
         const { authentication } = res.data
         setAuth(authentication.token_type + ' ' + authentication.access_token)
@@ -120,13 +103,6 @@ export default defineComponent({
     onFinished() {
       this.countDownStatus = true
       this.countDownRef.reset()
-    },
-    onChange() {
-      if (this.loginType === 'PWD') {
-        this.loginType = 'SMS'
-      } else if (this.loginType === 'SMS') {
-        this.loginType = 'PWD'
-      }
     }
   },
   render() {

+ 1 - 1
src/teacher/practice-class/practice-setting.tsx

@@ -156,7 +156,7 @@ export default defineComponent({
     onCalcCoursePrice(price: number | string) {
       if(!price) { return '-' }
       const money = Number(price)
-      return moneyFormat(numberToTwoUp(this.rate * money / 100))
+      return moneyFormat(numberToTwoUp(money - (this.rate * money / 100)))
     },
     onSelect(item: any) {
       this.form.courseMinutes = item.courseMinutes

+ 25 - 16
src/views/member-center/index.module.less

@@ -222,11 +222,32 @@
     text-align: center;
     padding: 12px 0;
     cursor: pointer;
-    opacity: 0.3;
+    position: relative;
+    & > div{
+      opacity: 0.3;
+    }
+    .activitTip{
+      background: linear-gradient( 315deg, #FF1E3D 0%, #FF0704 51%, #FF7A4F 100%);
+      border-radius: 11px 11px 11px 0px;
+      font-weight: 600;
+      font-size: 12px;
+      color: #FFFFFF;
+      line-height: 18px;
+      padding: 1px 6px;
+      white-space: nowrap;
+      position: absolute;
+      left: 50%;
+      top: 0;
+      transform: translateY(-50%);
+      opacity: 1;
+      font-family: Helvetica Neue, Helvetica, PingFangSC;
+    }
   }
 
   .member_tab_active {
-    opacity: 1;
+    & > div{
+      opacity: 1;
+    }
   }
 
   .icon_member {
@@ -239,19 +260,6 @@
   .icon_text {
     position: relative;
     margin-top: 3px;
-    .activitTip{
-      background: linear-gradient( 315deg, #FF1E3D 0%, #FF0704 51%, #FF7A4F 100%);
-      border-radius: 11px 11px 11px 0px;
-      font-weight: 600;
-      font-size: 12px;
-      color: #FFFFFF;
-      line-height: 18px;
-      padding: 1px 6px;
-      white-space: nowrap;
-      position: absolute;
-      left: 18px;
-      top: -25px;
-    }
   }
 
   .bottom_line {
@@ -498,6 +506,7 @@
     padding: 1px 6px 2px;
     left: -1px;
     top: -9px;
+    font-family: Helvetica Neue, Helvetica, PingFangSC;
   }
 
   .s_title {
@@ -514,7 +523,7 @@
   .price {
     font-family: DINAlternate-Bold, DINAlternate;
     font-weight: bold;
-    font-size: 28px;
+    font-size: 26px;
     color: #333333;
     padding: 3px 0 6px;
 

+ 16 - 17
src/views/member-center/index.tsx

@@ -607,18 +607,17 @@ export default defineComponent({
                       <i class={[styles.icon_member]}></i>
                       <span class={styles.icon_text}>
                         <i class={styles.bottom_line}></i>
-                        {/* 活动显示 */}
-                        {activitData.vipCardId &&
-                          activitData.vipType === 'VIP' &&
-                          activitData.extConfig?.title1 && (
-                            <div class={styles.activitTip}>
-                              {activitData.extConfig?.title1}
-                            </div>
-                          )}
-                        <div class={styles}></div>
                       </span>
                     </div>
                     <div class={styles.vip_member_tip}></div>
+                    {/* 活动显示 */}
+                    {!!activitData.vipCardId &&
+                      activitData.vipType === 'VIP' &&
+                      activitData.extConfig?.title1 && (
+                        <div class={styles.activitTip}>
+                          {activitData.extConfig?.title1}
+                        </div>
+                      )}
                   </div>
                   <div
                     class={[
@@ -631,17 +630,17 @@ export default defineComponent({
                       <i class={[styles.icon_member]}></i>
                       <span class={styles.icon_text}>
                         <i class={styles.bottom_line}></i>
-                        {/* 活动显示 */}
-                        {activitData.vipCardId &&
-                          activitData.vipType === 'SVIP' &&
-                          activitData.extConfig?.title1 && (
-                            <div class={styles.activitTip}>
-                              {activitData.extConfig?.title1}
-                            </div>
-                          )}
                       </span>
                     </div>
                     <div class={styles.svip_member_tip}></div>
+                    {/* 活动显示 */}
+                    {!!activitData.vipCardId &&
+                      activitData.vipType === 'SVIP' &&
+                      activitData.extConfig?.title1 && (
+                        <div class={styles.activitTip}>
+                          {activitData.extConfig?.title1}
+                        </div>
+                      )}
                   </div>
                 </div>
               </>

+ 3 - 1
src/views/music/album-detail/index.tsx

@@ -171,7 +171,9 @@ export default defineComponent({
         }
       ]
 
-      const res = await request.post('/api-student/userOrder/getPendingOrder', {
+      const res = await request.post('/userOrder/getPendingOrder', {
+        prefix:
+            state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student',
         data: {
           goodType: 'ALBUM',
           bizId: album.id

+ 10 - 4
src/views/music/music-detail/index.tsx

@@ -2,6 +2,7 @@ import {
   computed,
   defineComponent,
   nextTick,
+  onBeforeUnmount,
   onMounted,
   onUnmounted,
   reactive,
@@ -261,8 +262,9 @@ export default defineComponent({
       })
 
       const config = await request.get(
-        '/api-student/sysConfig/queryByParamNameList',
+        '/sysConfig/queryByParamNameList',
         {
+          prefix: state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student',
           params: {
             paramNames: 'music_sheet_free_rate'
           }
@@ -316,11 +318,13 @@ export default defineComponent({
 
       window.addEventListener('message', showLoading)
     })
-    onUnmounted(() => {
+    onBeforeUnmount(() => {
       postMessage({
         api: 'setStatusBarTextColor',
         content: { statusBarTextColor: false }
       })
+    })
+    onUnmounted(() => {
       window.removeEventListener('message', showLoading)
     })
 
@@ -407,7 +411,8 @@ export default defineComponent({
         }
       ]
 
-      const res = await request.post('/api-student/userOrder/getPendingOrder', {
+      const res = await request.post('/userOrder/getPendingOrder', {
+        prefix: state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student',
         data: {
           goodType: 'MUSIC',
           bizId: music.id
@@ -455,7 +460,8 @@ export default defineComponent({
     }
     const cancelPayment = async (orderNo: string) => {
       try {
-        await request.post('/api-student/userOrder/orderCancel', {
+        await request.post('/userOrder/orderCancel', {
+          prefix: state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student',
           data: {
             orderNo
           }

+ 4 - 3
src/views/order-detail/add-discount/index.tsx

@@ -8,6 +8,7 @@ import request from '@/helpers/request'
 import { state } from '@/state'
 import { moneyFormat } from '@/helpers/utils'
 import dayjs from 'dayjs'
+import { numberToTwoDown } from '..'
 
 type DiscountDetail = {
   /** 编号 */
@@ -69,12 +70,12 @@ export default defineComponent({
     // 格式化显示
     const formatShowTime = () => {
       if(checked.value) {
-        params.discountPrice = (
+        params.discountPrice = numberToTwoDown((
           props.actualPrice -
           (props.actualPrice * discountDetail.value.discountRate / 100)
-        ).toFixed(2)
+        ))
         const users = state.user.data
-        const startTime = users.discountEndTime || new Date()
+        const startTime = users.discountCardFlag ? users.discountEndTime || new Date() : new Date()
         let endTime = dayjs(new Date()).format('YYYY-MM-DD')
         if (discountDetail.value.period === 'MONTH') {
           endTime = dayjs(startTime).add(1, 'month').format('YYYY-MM-DD')

+ 32 - 3
src/views/order-detail/index.tsx

@@ -48,8 +48,13 @@ import AddDiscount from './add-discount'
 /** 保留两位小数向上取整 */
 export const numberToTwoUp = (num: number | string) => {
   num = Number(num)
+  return Math.ceil(Number((num * 100).toFixed(1))) / 100
+}
 
-  return Math.ceil(num * 100) / 100
+/** 保留两位小数向下取整 */
+export const numberToTwoDown = (num: number | string) => {
+  num = Number(num)
+  return Math.floor(Number((num * 100).toFixed(1))) / 100
 }
 
 export default defineComponent({
@@ -63,7 +68,7 @@ export default defineComponent({
       dialogBtnText: '确定',
       dialogType: 'back' as 'back' | 'refresh',
       orderType: query.orderType as string,
-      orderGoodsType: [],
+      orderGoodsType: [] as any[],
       recomUserId: query.recomUserId, // 推荐人id
       activityId: query.activityId, // 活动编号
       id: query.id,
@@ -117,7 +122,7 @@ export default defineComponent({
     },
     countDiscountPrice() {
       const orderObject = orderStatus.orderObject
-      return orderObject.couponAmount || numberToTwoUp(orderObject.couponDiscountPrice + orderObject.discountCardPrice + orderObject.discountCardPrice)
+      return orderObject.couponAmount || numberToTwoDown(orderObject.couponDiscountPrice + orderObject.discountPrice + orderObject.discountCardPrice)
     }
   },
   async mounted() {
@@ -166,6 +171,7 @@ export default defineComponent({
 
     this.orderAmount = orderStatus.orderObject.actualPrice || 0
     this.orderPrice = orderStatus.orderObject.actualPrice || 0
+    console.log(this.orderAmount, this.orderPrice, 'orderPrice')
 
     this.disabledCoupon = orderStatus.orderObject.orderNo ? true : false
     this.dataLoading = false
@@ -637,12 +643,14 @@ export default defineComponent({
                   vipType: string
                 }) => {
                   // 畅学卡变更状态时需要重新选择优惠券
+                  // debugger
                   orderStatus.orderObject.couponId = ''
                   orderStatus.orderObject.couponDiscountPrice = 0
                   // 是否选中畅学卡
                   const index = this.selectGoods?.findIndex(
                     (child: any) => child.id === item.id
                   )
+                  const tempType = this.orderGoodsType
                   if (item.checked) {
                     orderStatus.orderObject.discountCardPrice = Number(
                       item.discountPrice
@@ -655,15 +663,34 @@ export default defineComponent({
                         num: 1,
                         id: item.id
                       })
+                      const typeIndex = tempType.findIndex((child: any) => child === item.vipType)
+                      if(typeIndex === -1) {
+                        tempType.push(item.vipType)
+                      }
                     }
                   } else {
                     orderStatus.orderObject.discountCardPrice = 0
                     if (index !== -1) {
                       this.selectGoods.splice(index, 1)
                       this.orderAmount = this.orderAmount - item.salePrice
+
+                      const typeIndex = tempType.findIndex((child: any) => child === item.vipType)
+                      if(typeIndex !== -1) {
+                        tempType.splice(typeIndex, 1)
+                      }
                     }
                   }
+                  this.orderGoodsType = tempType
 
+                  console.log(item, this.orderAmount, '-----------------', Number(this.orderAmount) -
+                  Number(item.discountPrice) -
+                  Number(orderStatus.orderObject.couponDiscountPrice))
+                  // 更新优惠券列表
+                  const useCouponRef: any =  this.$refs.useCouponRef
+                  if(useCouponRef) {
+                    console.log(useCouponRef, 'useCouponRef')
+                    useCouponRef.resetCouponList()
+                  }
                   this.orderPrice = Number(
                     numberToTwoUp(
                       Number(this.orderAmount) -
@@ -671,6 +698,7 @@ export default defineComponent({
                       Number(orderStatus.orderObject.couponDiscountPrice)
                     )
                   )
+                  this.$forceUpdate()
                 }}
               />
             ) : (
@@ -700,6 +728,7 @@ export default defineComponent({
             {/* 优惠券使用 */}
             {!this.dataLoading && (
               <UseCoupon
+                ref="useCouponRef"
                 couponId={orderStatus.orderObject.couponId}
                 discountPrice={orderStatus.orderObject.discountPrice}
                 orderType={this.orderType}

+ 1 - 1
src/views/order-detail/use-coupons/choice-coupon.tsx

@@ -142,7 +142,7 @@ export default defineComponent({
       if(this.usedLength === 'SINGLE') {
         // 判断使用优惠券之后还有没有其它优惠券可用
         this.list.forEach((item: any) => {
-          if (!item.checked && useList.length > 0) {
+          if (!item.checked && (useList.length > 0  || Number(item.useLimit) > useLastAmount)) {
             item.disabled = true
           } else {
             item.disabled = false

+ 3 - 2
src/views/order-detail/use-coupons/index.module.less

@@ -1,6 +1,7 @@
 .useCoupon {
-  padding-top: 16px;
-  padding-bottom: 16px;
+  // padding-top: 16px;
+  // padding-bottom: 16px;
+  border-radius: 10px;
 
   .couponCount {
     color: #ff3535;

+ 15 - 2
src/views/order-detail/use-coupons/index.tsx

@@ -89,7 +89,12 @@ export default defineComponent({
     },
     couponCategory() {
       // 如果订单类型不在优惠券类型里面,则默认查询通用券
-      const temp = this.orderGoodsType.map((item: any)=> couponEnum[item])
+      const temp: any[] = []
+      this.orderGoodsType.forEach((item: any) => {
+        if(couponEnum[item]) {
+          temp.push(couponEnum[item])
+        }
+      })
       return  temp.join(',') + (temp.length ? ',UNIVERSAL' : 'UNIVERSAL')
     }
   },
@@ -104,6 +109,10 @@ export default defineComponent({
         }
       });
       this.useCouponList = selectCouponList
+    },
+    orderGoodsType(val: any) {
+      console.log(val, '121221')
+      this.getList()
     }
   },
   mounted() {
@@ -111,6 +120,10 @@ export default defineComponent({
     this.getList()
   },
   methods: {
+    resetCouponList() {
+      this.list = []
+      this.getList()
+    },
     async getList() {
       if (this.dataLoading) return
       this.dataLoading = true
@@ -137,6 +150,7 @@ export default defineComponent({
           // 如果使用金额大于订单金额则优惠券不可用
           if (item.useLimit > this.orderAmount) {
             item.disabled = true
+            console.log(this.orderAmount, item.useLimit)
           } else {
             item.disabled = false
           }
@@ -184,7 +198,6 @@ export default defineComponent({
         <Cell
           title="优惠券"
           class={styles.useCoupon}
-          style={{ borderRadius: '8px' }}
           isLink={!this.disabled}
           clickable={false}
           v-slots={{

+ 35 - 4
src/views/trade/trade-detail.tsx

@@ -59,8 +59,28 @@ export default defineComponent({
   },
   computed: {
     orderDetailList() {
+
       const result: any = this.result
-      return result.orderDetailList || []
+      const orderDetailList = result.orderDetailList || []
+
+      orderDetailList.forEach((item: any) => {
+        let tempPrice = item?.expectPrice || item.actualPrice
+        if (item?.couponAmount) {
+            tempPrice = Number(
+              (
+                (tempPrice - result.couponAmount) / item.goodNum
+              ).toFixed(2)
+            )
+        } else {
+          tempPrice = Number(
+            tempPrice / item.goodNum
+            ).toFixed(2)
+        }
+
+        item.showPrice = tempPrice || 0
+      })
+
+      return orderDetailList || []
     }
   },
   async mounted() {
@@ -204,10 +224,13 @@ export default defineComponent({
                     ),
                     default: () => (
                       <div class={styles.content}>
-                        <span class={styles.price}>
+                        {item.giftFlag ? <span class={styles.price}>
+                          赠送
+                        </span>: <span class={styles.price}>
-                          {(this as any).$filters.moneyFormat(item.expectPrice)}
-                        </span>
+                          {(this as any).$filters.moneyFormat(item.showPrice)}
+                        </span>}
+                        
                         <span class={styles.num}>x{item.goodNum}</span>
                       </div>
                     )
@@ -215,6 +238,14 @@ export default defineComponent({
                 />
               ))}
 
+              {this.result.couponAmount > 0 && <Row class={styles.optionRow}>
+                <Col span="8" offset={1}>
+                  优惠金额:
+                </Col>
+                <Col span="14">¥{(this as any).$filters.moneyFormat(this.result.couponAmount)}</Col>
+                <Col span="1"> </Col>
+              </Row>}
+              
               <Row class={styles.optionRow}>
                 <Col span="8" offset={1}>
                   订单号: