lex 2 年之前
父节点
当前提交
ca232a5190

+ 6 - 0
src/constant/music.ts

@@ -52,3 +52,9 @@ export const teacherStyleType = {
   HOMEMODE: '自制伴奏',
   COMMON: '普通伴奏'
 }
+
+/** 老师端展示是否精品乐谱 */
+export const teacherExquisiteType = {
+  0: '否',
+  1: '是'
+}

+ 42 - 18
src/teacher/music/upload/index.tsx

@@ -26,7 +26,8 @@ import {
   teachershowFingeringType,
   teachershowHasBeatType,
   teacherNotationType,
-  teacherStyleType
+  teacherStyleType,
+  teacherExquisiteType
 } from '@/constant/music'
 import { getXmlInfo, FormatXMLInfo } from '@/helpers/music-xml'
 import Upload from './upload'
@@ -95,6 +96,7 @@ export default defineComponent({
       submitLoading: false,
       showPicker: false,
       music_sheet_service_fee: 0,
+      exquisiteFlag: 0,
       backgroundMp3s: [
         {
           url: '',
@@ -201,7 +203,7 @@ export default defineComponent({
         for (let i = 0; i < names.length; i++) {
           this.tagsNames[this.tags[i]] = names[i]
         }
-
+        this.exquisiteFlag = res.data.exquisiteFlag
         this.xmlFileUrl = res.data.xmlFileUrl
         this.accompanimentType = res.data.accompanimentType
         this.titleImg = res.data.titleImg
@@ -258,6 +260,7 @@ export default defineComponent({
         xmlFileUrl: this.xmlFileUrl,
         canEvaluate: Number(this.canEvaluate),
         chargeType: this.chargeType === 0 ? 'FREE' : 'CHARGE',
+        exquisiteFlag: this.exquisiteFlag,
         composer: this.composer,
         musicPrice: this.chargeType === 0 ? 0 : this.musicPrice, // 当选择免费时,重置金额为0
         background: this.backgroundMp3s.map(item => ({
@@ -870,6 +873,22 @@ export default defineComponent({
                 })}
               </RadioGroup>
             </ColField>
+            {this.chargeType === 2 && (
+              <ColField required title="收费价格">
+                <Field
+                  clearable
+                  class={styles['clear-px']}
+                  placeholder="请输入收费价格"
+                  formatter={this.onFormatter}
+                  v-slots={{ button: () => '元' }}
+                  modelValue={this.musicPrice}
+                  rules={[
+                    { required: true, validator, message: '请输入收费价格' }
+                  ]}
+                  onUpdate:modelValue={val => (this.musicPrice = val)}
+                />
+              </ColField>
+            )}
             <ColField required title="支持简谱" border={false}>
               <RadioGroup
                 class={styles['radio-group']}
@@ -891,22 +910,27 @@ export default defineComponent({
                 })}
               </RadioGroup>
             </ColField>
-            {this.chargeType === 2 && (
-              <ColField required title="收费价格">
-                <Field
-                  clearable
-                  class={styles['clear-px']}
-                  placeholder="请输入收费价格"
-                  formatter={this.onFormatter}
-                  v-slots={{ button: () => '元' }}
-                  modelValue={this.musicPrice}
-                  rules={[
-                    { required: true, validator, message: '请输入收费价格' }
-                  ]}
-                  onUpdate:modelValue={val => (this.musicPrice = val)}
-                />
-              </ColField>
-            )}
+            <ColField required title="是否精品乐谱" border={false}>
+              <RadioGroup
+                class={styles['radio-group']}
+                modelValue={this.exquisiteFlag}
+                onUpdate:modelValue={val => {
+                  this.exquisiteFlag = Number(val)
+                }}
+              >
+                {Object.keys(teacherExquisiteType).map((item: string) => {
+                  const isActive = item === String(this.exquisiteFlag)
+                  const type = isActive ? 'primary' : 'default'
+                  return (
+                    <Radio class={styles.radio} name={item}>
+                      <Tag size="large" plain={isActive} type={type}>
+                        {teacherExquisiteType[item]}
+                      </Tag>
+                    </Radio>
+                  )
+                })}
+              </RadioGroup>
+            </ColField>
           </ColFieldGroup>
           {this.chargeType === 2 && (
             <div class={styles.rule}>

二进制
src/views/music/component/images/icon_ exquisite.png


+ 5 - 0
src/views/music/component/song/index.module.less

@@ -184,3 +184,8 @@
     line-height: 20px;
   }
 }
+
+.exquisiteFlag {
+  width: 14px;
+  margin-left: 5px;
+}

+ 7 - 0
src/views/music/component/song/index.tsx

@@ -96,6 +96,13 @@ export default defineComponent({
                 >
                   {colors[n.chargeType].text}
                 </Tag>
+                {n.exquisiteFlag === 1 && (
+                  <Image
+                    class={styles.exquisiteFlag}
+                    src={getAssetsHomeFile('icon_ exquisite.png')}
+                  />
+                )}
+
                 <span class={[styles.title, 'van-ellipsis']}>
                   {n.musicSheetName}
                 </span>