lex-xin 5 months ago
parent
commit
927d3f7826

+ 12 - 1
src/student/teacher-dependent/components/practice.tsx

@@ -65,7 +65,7 @@ export default defineComponent({
           }
         }
       )
-      this.loadDataStatus = false
+      
       const result = res.data || []
       if (result.length > 0) {
         const userSubjectId = this.subjectId || state.user.data?.subjectId
@@ -95,6 +95,17 @@ export default defineComponent({
       } else {
         this.settingStatus = false
       }
+
+      // 判断如果是审核的则不显示
+      const resVersion = await request.post('/api-teacher/open/appVersion', {
+        data: {
+          platform:
+            state.platformType === 'STUDENT' ? 'ios-student' : 'ios-teacher',
+          version: state.version
+        }
+      })
+      this.settingStatus =  resVersion.data.check ? false : true
+      this.loadDataStatus = false
     } catch {
       this.loadDataStatus = false
     }

+ 13 - 10
src/teacher/live-class/create-components/course.tsx

@@ -216,16 +216,19 @@ export default defineComponent({
           )}
         </ColFieldGroup>
 
-        <div class={styles['class-info-tip']}>
-          <p>扣除手续费后您的课程预计收入为:</p>
-          <p>
-            单课时<span>{this.calcSingleRatePrice}</span>元/人
-          </p>
-          <p>
-            课程组总收入<span>{this.calcRatePrice}</span>元/人
-          </p>
-          <p>您的课程收入将在课程结束后结算到您的账户中</p>
-        </div>
+        {/* 是审核版本才会显示金额 */}
+        {!this.checked && (
+          <div class={styles['class-info-tip']}>
+            <p>扣除手续费后您的课程预计收入为:</p>
+            <p>
+              单课时<span>{this.calcSingleRatePrice}</span>元/人
+            </p>
+            <p>
+              课程组总收入<span>{this.calcRatePrice}</span>元/人
+            </p>
+            <p>您的课程收入将在课程结束后结算到您的账户中</p>
+          </div>
+        )}
 
         <Sticky offsetBottom={0} position="bottom">
           <div class={'btnGroup'}>

+ 120 - 77
src/teacher/music/upload/index.tsx

@@ -11,7 +11,7 @@ import {
   Toast,
   CellGroup
 } from 'vant'
-import { state as appState } from '@/state'
+import { state as appState, state } from '@/state'
 import { teachershowAudiType, teacherPaymentType } from '@/constant/music'
 import { getXmlInfo, FormatXMLInfo } from '@/helpers/music-xml'
 import Upload from './upload'
@@ -111,7 +111,8 @@ export default defineComponent({
       fileInfo: {
         url: '',
         name: '' as any
-      }
+      },
+      checked: false
     }
   },
   watch: {
@@ -171,6 +172,20 @@ export default defineComponent({
           })
         })
       })
+
+    const resVersion = await request.post('/api-teacher/open/appVersion', {
+      data: {
+        platform:
+          state.platformType === 'STUDENT' ? 'ios-student' : 'ios-teacher',
+        version: state.version
+      }
+    })
+    this.checked = resVersion.data.check ? true : false
+    // 审核版本金额默认为0
+    if (this.checked) {
+      this.musicPrice = '0'
+      this.paymentType = 'FREE'
+    }
   },
   methods: {
     async setDetail(id: string) {
@@ -585,9 +600,15 @@ export default defineComponent({
                           this.naiveMp3File()
                         }}
                       >
-                        {this.mp3Url
-                          ? <span style='text-decoration-line: underline;color: #14BC9C;'>{this.fileName(this.mp3Url)}</span>
-                          : <span style='text-decoration-line: underline;color: #14BC9C;'>上传伴奏文件</span>}
+                        {this.mp3Url ? (
+                          <span style="text-decoration-line: underline;color: #14BC9C;">
+                            {this.fileName(this.mp3Url)}
+                          </span>
+                        ) : (
+                          <span style="text-decoration-line: underline;color: #14BC9C;">
+                            上传伴奏文件
+                          </span>
+                        )}
                       </Button>
 
                       {this.mp3Url && !this.auditDisabled && (
@@ -655,9 +676,13 @@ export default defineComponent({
                           this.naiveMidFile()
                         }}
                       >
-                        {this.midiFileUrl
-                          ? this.fileName(this.midiFileUrl)
-                          : <span style='text-decoration-line: underline;color: #14BC9C;'>上传MIDI文件</span>}
+                        {this.midiFileUrl ? (
+                          this.fileName(this.midiFileUrl)
+                        ) : (
+                          <span style="text-decoration-line: underline;color: #14BC9C;">
+                            上传MIDI文件
+                          </span>
+                        )}
                       </Button>
 
                       {this.midiFileUrl && !this.auditDisabled && (
@@ -714,9 +739,13 @@ export default defineComponent({
                         this.naiveXMLFile()
                       }}
                     >
-                      {this.xmlFileUrl
-                        ? this.fileName(this.xmlFileUrl)
-                        : <span style='text-decoration-line: underline;color: #14BC9C;'>上传XML文件</span>}
+                      {this.xmlFileUrl ? (
+                        this.fileName(this.xmlFileUrl)
+                      ) : (
+                        <span style="text-decoration-line: underline;color: #14BC9C;">
+                          上传XML文件
+                        </span>
+                      )}
                     </Button>
 
                     {this.xmlFileUrl && !this.auditDisabled && (
@@ -805,7 +834,15 @@ export default defineComponent({
                               this.naiveBGMp3File(index)
                             }}
                           >
-                            {mp3.url ? <span style='text-decoration-line: underline;color: #14BC9C;'>{this.fileName(mp3.url)}</span> : <span style='text-decoration-line: underline;color: #14BC9C;'>上传原声文件</span>}
+                            {mp3.url ? (
+                              <span style="text-decoration-line: underline;color: #14BC9C;">
+                                {this.fileName(mp3.url)}
+                              </span>
+                            ) : (
+                              <span style="text-decoration-line: underline;color: #14BC9C;">
+                                上传原声文件
+                              </span>
+                            )}
                           </Button>
 
                           {mp3.url && !this.auditDisabled && (
@@ -824,14 +861,16 @@ export default defineComponent({
                             accept=".mp3"
                             disabled={this.auditDisabled}
                           />
-                          <div style={{ marginLeft: '8px' }}
+                          <div
+                            style={{ marginLeft: '8px' }}
                             onClick={() => {
                               this.listenAudioShow = true
                               this.fileInfo = {
                                 url: mp3.url as any,
                                 name: this.fileName(mp3.url)
                               }
-                          }}>
+                            }}
+                          >
                             {this.fileName(mp3.url)}
                           </div>
                         </>
@@ -983,66 +1022,68 @@ export default defineComponent({
             </Field>
           )}
 
-          <Field required label="是否收费" center inputAlign="right">
-            {{
-              input: () => (
-                <RadioGroup
-                  class={styles['radio-group']}
-                  modelValue={this.paymentType}
-                  onUpdate:modelValue={val => {
-                    this.paymentType = val
-                  }}
-                  disabled={this.auditDisabled}
-                >
-                  {Object.keys(teacherPaymentType).map((item: string) => {
-                    const isActive = item === String(this.paymentType)
-                    const type = isActive ? 'primary' : 'default'
-                    return (
-                      <Radio class={styles.radio} name={item}>
-                        <Tag size="large" plain={isActive} type={type}>
-                          {teacherPaymentType[item]}
-                        </Tag>
-                      </Radio>
-                    )
-                  })}
-                </RadioGroup>
-              )
-            }}
-          </Field>
-          {this.paymentType === 'CHARGE' && (
+          {!this.checked && (
             <>
-              <Field
-                label="收费价格"
-                required
-                border={false}
-                class={styles.inputControl}
-                placeholder=" "
-                formatter={this.onFormatter}
-                autocomplete="off"
-                v-slots={{ button: () => '元' }}
-                modelValue={this.musicPrice}
-                maxlength={8}
-                center
-                rules={[
-                  { required: true, validator, message: '请输入收费价格' }
-                ]}
-                errorMessageAlign="right"
-                onUpdate:modelValue={val => (this.musicPrice = val)}
-              />
+              <Field required label="是否收费" center inputAlign="right">
+                {{
+                  input: () => (
+                    <RadioGroup
+                      class={styles['radio-group']}
+                      modelValue={this.paymentType}
+                      onUpdate:modelValue={val => {
+                        this.paymentType = val
+                      }}
+                      disabled={this.auditDisabled}
+                    >
+                      {Object.keys(teacherPaymentType).map((item: string) => {
+                        const isActive = item === String(this.paymentType)
+                        const type = isActive ? 'primary' : 'default'
+                        return (
+                          <Radio class={styles.radio} name={item}>
+                            <Tag size="large" plain={isActive} type={type}>
+                              {teacherPaymentType[item]}
+                            </Tag>
+                          </Radio>
+                        )
+                      })}
+                    </RadioGroup>
+                  )
+                }}
+              </Field>
+              {this.paymentType === 'CHARGE' && (
+                <>
+                  <Field
+                    label="收费价格"
+                    required
+                    border={false}
+                    class={styles.inputControl}
+                    placeholder=" "
+                    formatter={this.onFormatter}
+                    autocomplete="off"
+                    v-slots={{ button: () => '元' }}
+                    modelValue={this.musicPrice}
+                    maxlength={8}
+                    center
+                    rules={[
+                      { required: true, validator, message: '请输入收费价格' }
+                    ]}
+                    errorMessageAlign="right"
+                    onUpdate:modelValue={val => (this.musicPrice = val)}
+                  />
 
-              <div class={styles.rule}>
-                <p>
-                  扣除手续费后该曲目预计收入为:
-                  <span>
-                    {(
-                      ((parseFloat(this.musicPrice || '0') || 0) *
-                        (100 - this.music_sheet_service_fee)) /
-                      100
-                    ).toFixed(2)}
-                    <span>元/人</span>
-                  </span>
-                </p>
-                {/* <p>
+                  <div class={styles.rule}>
+                    <p>
+                      扣除手续费后该曲目预计收入为:
+                      <span>
+                        {(
+                          ((parseFloat(this.musicPrice || '0') || 0) *
+                            (100 - this.music_sheet_service_fee)) /
+                          100
+                        ).toFixed(2)}
+                        <span>元/人</span>
+                      </span>
+                    </p>
+                    {/* <p>
                   每人:
                   <span>
                     {(
@@ -1054,11 +1095,13 @@ export default defineComponent({
                   元/人
                 </p> */}
 
-                <p>
-                  您的乐谱收入在学员购买后{this.music_account_period}
-                  天结算到您的账户中
-                </p>
-              </div>
+                    <p>
+                      您的乐谱收入在学员购买后{this.music_account_period}
+                      天结算到您的账户中
+                    </p>
+                  </div>
+                </>
+              )}
             </>
           )}
         </CellGroup>

+ 14 - 4
src/teacher/piano-room/index.tsx

@@ -77,7 +77,8 @@ export default defineComponent({
       setLoading: false,
       startClassTime: '',
       endClassTime: '',
-      minDate: new Date()
+      minDate: new Date(),
+      checked: true,
     }
   },
   async mounted() {
@@ -96,6 +97,15 @@ export default defineComponent({
   methods: {
     async _init() {
       try {
+        const resVersion = await request.post('/api-teacher/open/appVersion', {
+          data: {
+            platform:
+              state.platformType === 'STUDENT' ? 'ios-student' : 'ios-teacher',
+            version: state.version
+          }
+        })
+        this.checked = resVersion.data.check ? true : false
+
         const res = await request.get(
           '/api-teacher/courseSchedule/selectRemainTime'
         )
@@ -120,7 +130,6 @@ export default defineComponent({
             }
           }
         )
-        console.log(result)
         const tempResult = result.data
         for (let i = 0, len = tempResult.length; i < len; i++) {
           if (tempResult[i].paramName === 'course_start_setting') {
@@ -308,7 +317,7 @@ export default defineComponent({
               </p>
             </Col>
             <Col span={6}>
-              <Button
+            {!this.checked && <Button
                 type="primary"
                 round
                 size="small"
@@ -323,7 +332,8 @@ export default defineComponent({
               >
                 时长充值
                 <img src={getAssetsHomeFile('icon_arrow.png')} />
-              </Button>
+              </Button>}
+              
             </Col>
           </Row>
 

+ 52 - 54
src/teacher/video-class/class-info.tsx

@@ -80,10 +80,11 @@ export default defineComponent({
           version: state.version
         }
       })
-      this.checked = resVersion.data.check ? true : false
+      this.checked =  resVersion.data.check ? true : false
       // 审核版本金额默认为0
       if (this.checked) {
         createState.lessonGroup.lessonPrice = 0
+        createState.lessonGroup.payType = 'PAY'
       }
     } catch {
       //
@@ -165,62 +166,59 @@ export default defineComponent({
           </ColField>
         </ColFieldGroup>
 
-        <ColFieldGroup>
-          <ColField title="收费方式" required border={false}>
-            <div class={styles.radioGroup}>
-              <div
-                onClick={() => {
-                  createState.lessonGroup.payType = 'PAY'
-                }}
-                class={[
-                  styles.radio,
-                  createState.lessonGroup.payType === 'PAY'
-                    ? styles.active
-                    : null
-                ]}
-              >
-                购买
-              </div>
-              <div
-                onClick={() => {
-                  createState.lessonGroup.payType = 'VIP'
-                }}
-                class={[
-                  styles.radio,
-                  createState.lessonGroup.payType === 'VIP'
-                    ? styles.active
-                    : null
-                ]}
-              >
-                会员
+        {!this.checked && (
+          <ColFieldGroup>
+            <ColField title="收费方式" required border={false}>
+              <div class={styles.radioGroup}>
+                <div
+                  onClick={() => {
+                    createState.lessonGroup.payType = 'PAY'
+                  }}
+                  class={[
+                    styles.radio,
+                    createState.lessonGroup.payType === 'PAY'
+                      ? styles.active
+                      : null
+                  ]}
+                >
+                  购买
+                </div>
+                <div
+                  onClick={() => {
+                    createState.lessonGroup.payType = 'VIP'
+                  }}
+                  class={[
+                    styles.radio,
+                    createState.lessonGroup.payType === 'VIP'
+                      ? styles.active
+                      : null
+                  ]}
+                >
+                  会员
+                </div>
               </div>
-            </div>
-          </ColField>
-        </ColFieldGroup>
+            </ColField>
+          </ColFieldGroup>
+        )}
 
-        {createState.lessonGroup.payType === 'PAY' && (
+        {createState.lessonGroup.payType === 'PAY' && !this.checked && (
           <>
-            {!this.checked && (
-              <ColFieldGroup>
-                <ColField title="课程组售价" required>
-                  <Field
-                    v-model={createState.lessonGroup.lessonPrice}
-                    name="lessonPrice"
-                    placeholder="请输入您的课程组售价"
-                    formatter={this.onFormatter}
-                    type="number"
-                    maxlength={8}
-                    rules={[
-                      { required: true, message: '请输入您的课程组售价' }
-                    ]}
-                    v-slots={{
-                      button: () => <span>元</span>
-                    }}
-                  />
-                </ColField>
-              </ColFieldGroup>
-            )}
-
+            <ColFieldGroup>
+              <ColField title="课程组售价" required>
+                <Field
+                  v-model={createState.lessonGroup.lessonPrice}
+                  name="lessonPrice"
+                  placeholder="请输入您的课程组售价"
+                  formatter={this.onFormatter}
+                  type="number"
+                  maxlength={8}
+                  rules={[{ required: true, message: '请输入您的课程组售价' }]}
+                  v-slots={{
+                    button: () => <span>元</span>
+                  }}
+                />
+              </ColField>
+            </ColFieldGroup>
             <div class={styles['class-info-tip']}>
               <p>扣除手续费后您的课程预计收入为:</p>
               <p>

+ 0 - 8
src/teacher/video-class/create.tsx

@@ -97,14 +97,6 @@ export default defineComponent({
   },
   async mounted() {
     try {
-      // const sysConfig = await request.get(
-      //   '/api-teacher/sysConfig/queryByParamName',
-      //   {
-      //     params: {
-      //       paramName: 'video_lesson_service_fee'
-      //     }
-      //   }
-      // )
       request
         .get('/api-teacher/sysConfig/queryByParamNameList', {
           params: {

+ 1 - 1
src/views/live-class/index.tsx

@@ -123,7 +123,7 @@ export default defineComponent({
         const params: any = {
           ...this.params
         }
-        // 只有学生端会有version
+        // 会有version
         if (state.version) {
           params.version = state.version || '' // 处理ios审核版本
           params.platform =