lex hai 1 ano
pai
achega
3c786ae4dd

+ 6 - 1
src/helpers/utils.ts

@@ -161,7 +161,12 @@ export const getBaseUrl = (platform?: string) => {
 
 export const getCodeBaseUrl = (platform?: string) => {
   let url = window.location.origin
-  url = url.replace('www.', 'online.')
+  if (url.indexOf('https://colexiu.com') > -1) {
+    url = 'https://online.colexiu.com'
+  } else {
+    url = url.replace('www.', 'online.')
+  }
+
   const pathname = platform || window.location.pathname
   return `${url}${pathname}`
 }

+ 10 - 4
src/views/user-info/components/item/index.tsx

@@ -93,10 +93,16 @@ export default defineComponent({
         )}
 
         <div class="mx-2.5 pt-1.5 pb-2 flex items-center justify-between">
-          <div class="text-xl text-[#F90000] font-semibold leading-none">
-            <span class="text-sm leading-7">¥</span>
-            {item.coursePrice}
-          </div>
+          {item.payType === 'VIP' ? (
+            <div class="text-xl text-[#C76E21] font-semibold leading-none">
+              会员
+            </div>
+          ) : (
+            <div class="text-xl text-[#F90000] font-semibold leading-none">
+              <span class="text-sm leading-7">¥</span>
+              {item.coursePrice}
+            </div>
+          )}
           {item.type === 'video' && item.status === 'PASS' && (
             <div>
               <ElButton

+ 1 - 0
src/views/user-info/video-class/list.tsx

@@ -166,6 +166,7 @@ export default defineComponent({
                         backgroundPic: item.lessonCoverUrl,
                         courseGroupName: item.lessonName,
                         studentCount: item.countStudent,
+                        payType: item.payType,
                         avatar: item.avatar,
                         teacherName: item.username,
                         coursePrice: item.lessonPrice,

+ 6 - 4
src/views/user-info/video-operation/course-content/index.tsx

@@ -92,6 +92,8 @@ export default defineComponent({
           lessonList: createState.lessonList,
           lessonGroup: {
             ...videoDetail,
+            lessonPrice:
+              videoDetail.payType === 'VIP' ? 0 : videoDetail.lessonPrice,
             lessonCoverUrl:
               videoDetail.lessonCoverTemplateUrl || videoDetail.lessonCoverUrl
           }
@@ -257,17 +259,17 @@ export default defineComponent({
               <ElRow>
                 <ElCol span={12}>
                   <ElFormItem label="课程视频" required>
-                    {/* <ColVideo
+                    <ColVideo
                       styleValue={{ with: '150px', height: '85px' }}
                       controls={false}
                       preview
                       src={item.videoUrl}
                       volume={false}
-                    /> */}
-                    <VideoTcplayer
+                    />
+                    {/* <VideoTcplayer
                       styleValue={{ with: '150px', height: '85px' }}
                       src={item.videoUrl}
-                    />
+                    /> */}
                     <p></p>
                   </ElFormItem>
                 </ElCol>

+ 17 - 1
src/views/user-info/video-operation/course-info/index.module.less

@@ -13,16 +13,32 @@
 
 .courseInfo {
   --el-component-size-large: 48px;
+
   :global {
+
     .el-input,
     .el-select--large,
     .el-form-item--large .el-form-item__label {
       height: 48px;
       line-height: 48px;
     }
+
     .el-form-item__label {
       font-size: 16px;
       color: rgba(0, 0, 0, 0.85);
     }
+
+    .el-radio-button__inner {
+      border: var(--el-border);
+      border-radius: var(--el-border-radius-base) !important;
+      width: 100%;
+      padding: 16px 19px !important;
+    }
+
+    .el-radio-button__original-radio:checked+.el-radio-button__inner {
+      background-color: #e9fff8;
+      color: var(--el-color-primary);
+      box-shadow: none;
+    }
   }
-}
+}

+ 57 - 31
src/views/user-info/video-operation/course-info/index.tsx

@@ -11,6 +11,7 @@ import {
   ElInput,
   ElOption,
   ElRadio,
+  ElRadioButton,
   ElRadioGroup,
   ElRow,
   ElSelect,
@@ -33,7 +34,7 @@ export default defineComponent({
   computed: {
     choiceSubjectIds() {
       // 选择的科目编号
-      let ids = createState.lessonGroup.lessonSubject
+      const ids = createState.lessonGroup.lessonSubject
         ? Number(createState.lessonGroup.lessonSubject)
         : null
       return ids ? [ids] : []
@@ -54,8 +55,8 @@ export default defineComponent({
     },
     calcRatePrice() {
       // 计算手续费
-      let rate = createState.rate || 0
-      let price = createState.lessonGroup.lessonPrice || 0
+      const rate = createState.rate || 0
+      const price = createState.lessonGroup.lessonPrice || 0
       return (price - (rate / 100) * price).toFixed(2)
     }
   },
@@ -88,8 +89,8 @@ export default defineComponent({
       e.target.value = verifyNumberIntegerAndFloat(e.target.value)
 
       // 计算手续费
-      let rate = createState.rate || 0
-      let price = e.target.value || 0
+      const rate = createState.rate || 0
+      const price = e.target.value || 0
       // this.calcRatePrice = (price - (rate / 100) * price).toFixed(2)
     },
     tabChange(name: number) {
@@ -175,39 +176,64 @@ export default defineComponent({
               showWordLimit
             />
           </ElFormItem>
+
           <ElFormItem
-            label="课程组售价"
-            prop="lessonPrice"
+            label="收费方式"
+            prop="payType"
             rules={[
               {
                 required: true,
-                message: '请输入课程组售价'
+                message: '请选择收费方式'
               }
             ]}
           >
-            <ElInput
-              placeholder="请输入课程组售价"
-              v-model={createState.lessonGroup.lessonPrice}
-              // @ts-ignore
-              onKeyup={this.onFormatter}
-              maxlength={9}
-              v-slots={{
-                suffix: () => <span class="text-base text-[#999]">元</span>
-              }}
-              // disabled={createState.lessonGroup.id ? true : false}
-            />
+            <ElRadioGroup v-model={createState.lessonGroup.payType}>
+              <ElRadioButton label={'PAY'} class="mr-3 w-24">
+                购买
+              </ElRadioButton>
+              <ElRadioButton label={'VIP'} class="w-24">
+                会员
+              </ElRadioButton>
+            </ElRadioGroup>
           </ElFormItem>
-          <div class="text-sm text-[#999] pl-[120px] leading-relaxed pb-2">
-            <p>扣除手续费后您的课程预计收入为: </p>
-            <p>
-              课程组总收入
-              <span class="px-1 text-[#FF4E19]">{this.calcRatePrice}</span>元/人
-            </p>
-            <p>
-              您的课程收入将在学员购买{createState.video_account_period}
-              天后结算到您的账户中
-            </p>
-          </div>
+          {createState.lessonGroup.payType === 'PAY' && (
+            <>
+              <ElFormItem
+                label="课程组售价"
+                prop="lessonPrice"
+                rules={[
+                  {
+                    required: true,
+                    message: '请输入课程组售价'
+                  }
+                ]}
+              >
+                <ElInput
+                  placeholder="请输入课程组售价"
+                  v-model={createState.lessonGroup.lessonPrice}
+                  // @ts-ignore
+                  onKeyup={this.onFormatter}
+                  maxlength={9}
+                  v-slots={{
+                    suffix: () => <span class="text-base text-[#999]">元</span>
+                  }}
+                  // disabled={createState.lessonGroup.id ? true : false}
+                />
+              </ElFormItem>
+              <div class="text-sm text-[#999] pl-[120px] leading-relaxed pb-2">
+                <p>扣除手续费后您的课程预计收入为: </p>
+                <p>
+                  课程组总收入
+                  <span class="px-1 text-[#FF4E19]">{this.calcRatePrice}</span>
+                  元/人
+                </p>
+                <p>
+                  您的课程收入将在学员购买{createState.video_account_period}
+                  天后结算到您的账户中
+                </p>
+              </div>
+            </>
+          )}
           {/* <ElFormItem label="课程封面" class="!mb-0" required>
            <ElTabs
               v-model={createState.tabIndex}
@@ -313,7 +339,7 @@ export default defineComponent({
                   scrollAnimation(currentY, 0)
                 } else {
                   this.$nextTick(() => {
-                    let isError = document.getElementsByClassName('is-error')
+                    const isError = document.getElementsByClassName('is-error')
                     isError[0].scrollIntoView({
                       block: 'center',
                       behavior: 'smooth'

+ 25 - 10
src/views/user-info/video-operation/course-preview/index.module.less

@@ -59,14 +59,14 @@
       font-size: 14px;
       display: flex;
       align-items: center;
-      &::before {
-        content: ' ';
-        display: inline-block;
-        width: 1px;
-        height: 12px;
-        margin: 0 8px;
-        background: #d3d3d3;
-      }
+      // &::before {
+      //   content: ' ';
+      //   display: inline-block;
+      //   width: 1px;
+      //   height: 12px;
+      //   margin: 0 8px;
+      //   background: #d3d3d3;
+      // }
     }
 
     .buyNumInfo {
@@ -74,6 +74,7 @@
       color: #6a6a6a;
       display: flex;
       align-items: center;
+
       .iconBuy {
         margin-right: 5px;
       }
@@ -84,6 +85,15 @@
       font-weight: 400;
       color: var(--van-primary);
       line-height: 17px;
+
+      &.infoVip {
+        display: flex;
+        align-items: center;
+      }
+
+      .memberIcon {
+        color: #C76E21;
+      }
     }
 
     .userTitle {
@@ -121,11 +131,13 @@
   flex-direction: column;
   height: 100%;
   justify-content: space-around;
+
   .videoTitleText {
     font-size: 15px;
     color: #333;
     max-width: 210px;
   }
+
   .videoTitleContent {
     color: #7a7a7a;
     line-height: 18px;
@@ -147,14 +159,17 @@
   display: flex;
   align-items: center;
   justify-content: space-between;
-  & > div {
+
+  &>div {
     display: flex;
     align-items: center;
   }
+
   img {
     width: 16px;
     height: 16px;
   }
+
   span {
     padding-left: 8px;
     max-width: 240px;
@@ -172,4 +187,4 @@
     background: #ffefe0;
     color: #ff8900;
   }
-}
+}

+ 17 - 7
src/views/user-info/video-operation/course-preview/index.tsx

@@ -24,6 +24,7 @@ export default defineComponent({
         headUrl: users.heardUrl,
         lessonName: videoDetail.lessonName,
         buyNum: 0,
+        payType: videoDetail.payType,
         lessonDesc: videoDetail.lessonDesc,
         lessonPrice: videoDetail.lessonPrice,
         lessonCoverUrl:
@@ -51,7 +52,7 @@ export default defineComponent({
               {this.userInfo.lessonName}
             </div>
             <div class={[styles.userInfo, 'mx-[14px] py-[14px]']}>
-              <div class="flex">
+              <div class="flex" style={{ alignItems: 'center' }}>
                 <ElImage
                   class={styles.avatar}
                   src={this.userInfo.headUrl || defaultIcon}
@@ -61,16 +62,25 @@ export default defineComponent({
                   <div class={styles.userName}>
                     {this.userInfo.username || `游客${this.userInfo.id || ''}`}
                   </div>
-
+                </div>
+              </div>
+              {this.userInfo.payType === 'VIP' ? (
+                <div class={[styles.info, styles.infoVip]}>
+                  <span class={styles.memberIcon}>会员</span>/
+                  {this.userInfo.lessonNum}
+                  课时
+                </div>
+              ) : (
+                <div class={styles.info}>
+                  <div>
+                    ¥{this.userInfo.lessonPrice}/{this.userInfo.lessonNum}
+                    课时
+                  </div>
                   <div class={styles.buyNum}>
                     {this.userInfo.buyNum}人已购买
                   </div>
                 </div>
-              </div>
-              <div class={styles.info}>
-                ¥{this.userInfo.lessonPrice}/{this.userInfo.lessonNum}
-                课时
-              </div>
+              )}
             </div>
           </div>
         </div>

+ 1 - 0
src/views/user-info/video-operation/createState.tsx

@@ -20,6 +20,7 @@ const original = () => {
       lessonName: '',
       lessonSubject: null as any,
       lessonDesc: '',
+      payType: 'PAY',
       lessonPrice: null as any,
       lessonCoverUrl: '',
       relationType: 'RECOMMEND',

+ 2 - 0
src/views/user-info/video-operation/index.tsx

@@ -39,6 +39,7 @@ export default defineComponent({
         lessonCoverUrl,
         lessonPrice,
         lessonDesc,
+        payType,
         lessonSubject,
         lessonName,
         id,
@@ -54,6 +55,7 @@ export default defineComponent({
         lessonName: lessonName,
         lessonSubject: Number(lessonSubject),
         lessonDesc: lessonDesc,
+        payType,
         lessonPrice: lessonPrice,
         relationType: 'RECOMMEND',
         // lessonCoverTemplateUrl: statusUrl ? lessonCoverUrl : '',

+ 1 - 1
vite.config.ts

@@ -15,7 +15,7 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://www.colexiu.com/';
-const proxyUrl = 'https://test.colexiu.com/'
+const proxyUrl = 'https://dev.colexiu.com/'
 export default defineConfig({
   base: './',
   plugins: [