Browse Source

Merge branch 'colexiu1.3'

lex 1 year ago
parent
commit
67d5d5266d
55 changed files with 3777 additions and 2237 deletions
  1. 308 309
      src/business-components/subject-list/index.tsx
  2. BIN
      src/components/col-result/images/empty_tenant.png
  3. BIN
      src/components/col-result/images/network_tenant.png
  4. BIN
      src/components/col-result/images/notFond_tenant.png
  5. 49 33
      src/components/col-result/index.module.less
  6. 130 120
      src/components/col-result/index.tsx
  7. 72 71
      src/constant/index.ts
  8. 1 1
      src/helpers/request.ts
  9. 7 0
      src/router/routes-teacher.ts
  10. 27 2
      src/router/routes-tenant.ts
  11. 1 1
      src/state.ts
  12. 1 1
      src/tenant/activation-code/index.tsx
  13. 33 29
      src/tenant/exercise-record/exercis-detail.tsx
  14. 0 420
      src/tenant/goods-order/after-sale.tsx
  15. 0 115
      src/tenant/goods-order/components/after-sale-btns/index.tsx
  16. 0 119
      src/tenant/goods-order/index.module.less
  17. 0 234
      src/tenant/goods-order/index.tsx
  18. 0 44
      src/tenant/goods-order/item.tsx
  19. BIN
      src/tenant/images/album-bg.png
  20. BIN
      src/tenant/images/bg-image-search.png
  21. BIN
      src/tenant/images/icon-album-cover.png
  22. BIN
      src/tenant/images/music-bg.png
  23. 115 115
      src/tenant/layout/auth.tsx
  24. 28 22
      src/tenant/music/personal/practice.tsx
  25. 22 4
      src/tenant/music/personal/tenant-album.tsx
  26. 1 0
      src/tenant/music/search/all-search.module.less
  27. 64 0
      src/tenant/music/search/all-search.tsx
  28. 135 81
      src/tenant/music/search/header.tsx
  29. 120 12
      src/tenant/music/search/index.module.less
  30. 20 7
      src/tenant/music/search/index.tsx
  31. 1 0
      src/tenant/music/train-list/index.module.less
  32. 179 228
      src/tenant/music/train-list/index.tsx
  33. 2 0
      src/tenant/music/train-tool/index.module.less
  34. 62 38
      src/tenant/music/train-tool/index.tsx
  35. 256 0
      src/tenant/trade/index.module.less
  36. 355 0
      src/tenant/trade/index.tsx
  37. 65 0
      src/tenant/trade/list/index.module.less
  38. 336 0
      src/tenant/trade/list/index.tsx
  39. 299 0
      src/tenant/trade/tradeOrder.ts
  40. 34 32
      src/views/404/index.tsx
  41. 17 41
      src/views/order-detail/index.tsx
  42. 41 1
      src/views/order-detail/orderStatus.ts
  43. BIN
      src/views/tenantStudentRejest/images/studentSuccess.png
  44. 126 0
      src/views/tenantStudentRejest/index.module.less
  45. 111 13
      src/views/tenantStudentRejest/index.tsx
  46. BIN
      src/views/tenantTeacherRejest/images/checkBoxActive.png
  47. BIN
      src/views/tenantTeacherRejest/images/checkBoxDefault.png
  48. BIN
      src/views/tenantTeacherRejest/images/chioseOk.png
  49. BIN
      src/views/tenantTeacherRejest/images/teacherSuccess.png
  50. 64 0
      src/views/tenantTeacherRejest/index.module.less
  51. 263 141
      src/views/tenantTeacherRejest/index.tsx
  52. 110 0
      src/views/tenantTeacherRejest/modals/chioseSuond.module.less
  53. 315 0
      src/views/tenantTeacherRejest/modals/chioseSuond.tsx
  54. 2 2
      src/views/trade/trade-detail.module.less
  55. 5 1
      vite.config.ts

+ 308 - 309
src/business-components/subject-list/index.tsx

@@ -1,309 +1,308 @@
-import {
-  Button,
-  Checkbox,
-  CheckboxGroup,
-  Icon,
-  Image,
-  Loading,
-  Radio,
-  RadioGroup,
-  Sticky,
-  Toast
-} from 'vant'
-import { defineComponent, PropType } from 'vue'
-import styles from './index.module.less'
-
-import checkBoxActive from '@/teacher/teacher-cert/images/checkbox_active.png'
-import checkBoxDefault from '@/teacher/teacher-cert/images/checkbox_default.png'
-import ColResult from '@/components/col-result'
-
-export default defineComponent({
-  name: 'SubjectList',
-  props: {
-    onChoice: {
-      type: Function,
-      default: (item: any) => {}
-    },
-    choiceSubjectIds: {
-      type: Array,
-      default: []
-    },
-    subjectList: {
-      type: Array,
-      default: []
-    },
-    max: {
-      // 最多可选数量
-      type: Number,
-      default: 5
-    },
-    selectType: {
-      // 选择类型,Radio:单选,Checkbox:多选
-      type: String as PropType<'Checkbox' | 'Radio'>,
-      default: 'Checkbox'
-    },
-    single: {
-      // 单选模式
-      type: Boolean,
-      default: false
-    }
-  },
-  data() {
-    return {
-      checkBox: [],
-      checkboxRefs: [] as any,
-      radio: null as any // 单选
-    }
-  },
-  async mounted() {
-    if (this.selectType === 'Radio') {
-      this.radio = this.choiceSubjectIds[0]
-    } else {
-      this.checkBox = this.choiceSubjectIds as never[]
-    }
-  },
-  watch: {
-    choiceSubjectIds(val: any, oldVal) {
-      // 同步更新显示数据
-      this.checkBox = [...val] as never[]
-    }
-  },
-  methods: {
-    onSelect(id: number) {
-      if (this.selectType === 'Checkbox') {
-        if (
-          this.max === this.checkBox.length &&
-          !this.checkBox.includes(id as never)
-        ) {
-          Toast(`乐器最多选择${this.max}个`)
-        }
-        this.checkboxRefs[id].toggle()
-      } else if (this.selectType === 'Radio') {
-        this.radio = id
-      }
-    }
-  },
-  render() {
-    return (
-      <div class={styles.subjects}>
-        <div class={styles.subjectContainer}>
-          {this.subjectList.length ? (
-            this.selectType === 'Checkbox' ? (
-              <CheckboxGroup v-model={this.checkBox} max={this.max}>
-                <div class={styles.subjectMaxLength}>
-                  最多可选择{this.max}个乐器
-                </div>
-
-                {!this.single &&
-                  this.subjectList.map((item: any) =>
-                    item.subjects && item.subjects.length > 0 ? (
-                      <>
-                        <div class={styles.title}>{item.name}</div>
-                        <div class={styles['subject-list']}>
-                          {item.subjects &&
-                            item.subjects.map((sub: any) => (
-                              <div
-                                class={styles['subject-item']}
-                                onClick={() => this.onSelect(sub.id)}
-                              >
-                                <Image
-                                  src={sub.img || 'xxx'}
-                                  width="100%"
-                                  height="100%"
-                                  fit="cover"
-                                  v-slots={{
-                                    loading: () => (
-                                      <Loading type="spinner" size={20} />
-                                    )
-                                  }}
-                                />
-                                <div class={styles.topBg}>
-                                  <Checkbox
-                                    name={sub.id}
-                                    class={styles.checkbox}
-                                    disabled
-                                    ref={(el: any) =>
-                                      (this.checkboxRefs[sub.id] = el)
-                                    }
-                                    v-slots={{
-                                      icon: (props: any) => (
-                                        <Icon
-                                          name={
-                                            props.checked
-                                              ? checkBoxActive
-                                              : checkBoxDefault
-                                          }
-                                          size="20"
-                                        />
-                                      )
-                                    }}
-                                  />
-                                  <p class={styles.name}>{sub.name}</p>
-                                </div>
-                              </div>
-                            ))}
-                        </div>
-                      </>
-                    ) : null
-                  )}
-                {this.single ? (
-                  <div class={styles['subject-list']}>
-                    {this.subjectList.map((item: any) => (
-                      <div
-                        class={styles['subject-item']}
-                        onClick={() => this.onSelect(item.id)}
-                      >
-                        <Image
-                          src={item.img || 'xxx'}
-                          width="100%"
-                          height="100%"
-                          fit="cover"
-                          v-slots={{
-                            loading: () => <Loading type="spinner" size={20} />
-                          }}
-                        />
-                        <div class={styles.topBg}>
-                          <Checkbox
-                            name={item.id}
-                            class={styles.checkbox}
-                            disabled
-                            ref={(el: any) => (this.checkboxRefs[item.id] = el)}
-                            v-slots={{
-                              icon: (props: any) => (
-                                <Icon
-                                  name={
-                                    props.checked
-                                      ? checkBoxActive
-                                      : checkBoxDefault
-                                  }
-                                  size="20"
-                                />
-                              )
-                            }}
-                          />
-                          <p class={styles.name}>{item.name}</p>
-                        </div>
-                      </div>
-                    ))}
-                  </div>
-                ) : null}
-              </CheckboxGroup>
-            ) : (
-              <RadioGroup v-model={this.radio}>
-                {!this.single &&
-                  this.subjectList.map((item: any) =>
-                    item.subjects && item.subjects.length > 0 ? (
-                      <>
-                        <div class={styles.title}>{item.name}</div>
-                        <div class={styles['subject-list']}>
-                          {item.subjects &&
-                            item.subjects.map((sub: any) => (
-                              <div
-                                class={styles['subject-item']}
-                                onClick={() => this.onSelect(sub.id)}
-                              >
-                                <Image
-                                  src={sub.img || 'xxx'}
-                                  width="100%"
-                                  height="100%"
-                                  fit="cover"
-                                  v-slots={{
-                                    loading: () => (
-                                      <Loading type="spinner" size={20} />
-                                    )
-                                  }}
-                                />
-                                <div class={styles.topBg}>
-                                  <Radio
-                                    name={sub.id}
-                                    class={styles.checkbox}
-                                    v-slots={{
-                                      icon: (props: any) => (
-                                        <Icon
-                                          name={
-                                            props.checked
-                                              ? checkBoxActive
-                                              : checkBoxDefault
-                                          }
-                                          size="20"
-                                        />
-                                      )
-                                    }}
-                                  />
-                                  <p class={styles.name}>{sub.name}</p>
-                                </div>
-                              </div>
-                            ))}
-                        </div>
-                      </>
-                    ) : null
-                  )}
-                {this.single ? (
-                  <div class={styles['subject-list']}>
-                    {this.subjectList.map((item: any) => (
-                      <div
-                        class={styles['subject-item']}
-                        onClick={() => this.onSelect(item.id)}
-                      >
-                        <Image
-                          src={item.img || 'xxx'}
-                          width="100%"
-                          height="100%"
-                          fit="cover"
-                          v-slots={{
-                            loading: () => <Loading type="spinner" size={20} />
-                          }}
-                        />
-                        <div class={styles.topBg}>
-                          <Radio
-                            name={item.id}
-                            class={styles.checkbox}
-                            v-slots={{
-                              icon: (props: any) => (
-                                <Icon
-                                  name={
-                                    props.checked
-                                      ? checkBoxActive
-                                      : checkBoxDefault
-                                  }
-                                  size="20"
-                                />
-                              )
-                            }}
-                          />
-                          <p class={styles.name}>{item.name}</p>
-                        </div>
-                      </div>
-                    ))}
-                  </div>
-                ) : null}
-              </RadioGroup>
-            )
-          ) : (
-            <ColResult tips="暂无声部数据" btnStatus={false} />
-          )}
-        </div>
-
-        {this.subjectList.length > 0 && (
-          <Sticky offsetBottom={0} position="bottom">
-            <div class={'btnGroup'}>
-              <Button
-                round
-                block
-                type="primary"
-                style={{ width: '96%', margin: '0 auto' }}
-                onClick={() =>
-                  this.onChoice(
-                    this.selectType === 'Checkbox' ? this.checkBox : this.radio
-                  )
-                }
-              >
-                确定
-              </Button>
-            </div>
-          </Sticky>
-        )}
-      </div>
-    )
-  }
-})
+import {
+  Button,
+  Checkbox,
+  CheckboxGroup,
+  Icon,
+  Image,
+  Loading,
+  Radio,
+  RadioGroup,
+  Sticky,
+  Toast
+} from 'vant'
+import { defineComponent, PropType } from 'vue'
+import styles from './index.module.less'
+import checkBoxActive from '@/teacher/teacher-cert/images/checkbox_active.png'
+import checkBoxDefault from '@/teacher/teacher-cert/images/checkbox_default.png'
+import ColResult from '@/components/col-result'
+
+export default defineComponent({
+  name: 'SubjectList',
+  props: {
+    onChoice: {
+      type: Function,
+      default: (item: any) => { }
+    },
+    choiceSubjectIds: {
+      type: Array,
+      default: []
+    },
+    subjectList: {
+      type: Array,
+      default: []
+    },
+    max: {
+      // 最多可选数量
+      type: Number,
+      default: 5
+    },
+    selectType: {
+      // 选择类型,Radio:单选,Checkbox:多选
+      type: String as PropType<'Checkbox' | 'Radio'>,
+      default: 'Checkbox'
+    },
+    single: {
+      // 单选模式
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      checkBox: [],
+      checkboxRefs: [] as any,
+      radio: null as any // 单选
+    }
+  },
+  async mounted() {
+    if (this.selectType === 'Radio') {
+      this.radio = this.choiceSubjectIds[0]
+    } else {
+      this.checkBox = this.choiceSubjectIds as never[]
+    }
+  },
+  watch: {
+    choiceSubjectIds(val: any, oldVal) {
+      // 同步更新显示数据
+      this.checkBox = [...val] as never[]
+    }
+  },
+  methods: {
+    onSelect(id: number) {
+      if (this.selectType === 'Checkbox') {
+        if (
+          this.max === this.checkBox.length &&
+          !this.checkBox.includes(id as never)
+        ) {
+          Toast(`乐器最多选择${this.max}个`)
+        }
+        this.checkboxRefs[id].toggle()
+      } else if (this.selectType === 'Radio') {
+        this.radio = id
+      }
+    }
+  },
+  render() {
+    return (
+      <div class={styles.subjects}>
+        <div class={styles.subjectContainer}>
+          {this.subjectList.length ? (
+            this.selectType === 'Checkbox' ? (
+              <CheckboxGroup v-model={this.checkBox} max={this.max}>
+                <div class={styles.subjectMaxLength}>
+                  最多可选择{this.max}个乐器
+                </div>
+
+                {!this.single &&
+                  this.subjectList.map((item: any) =>
+                    item.subjects && item.subjects.length > 0 ? (
+                      <>
+                        <div class={styles.title}>{item.name}</div>
+                        <div class={styles['subject-list']}>
+                          {item.subjects &&
+                            item.subjects.map((sub: any) => (
+                              <div
+                                class={styles['subject-item']}
+                                onClick={() => this.onSelect(sub.id)}
+                              >
+                                <Image
+                                  src={sub.img || 'xxx'}
+                                  width="100%"
+                                  height="100%"
+                                  fit="cover"
+                                  v-slots={{
+                                    loading: () => (
+                                      <Loading type="spinner" size={20} />
+                                    )
+                                  }}
+                                />
+                                <div class={styles.topBg}>
+                                  <Checkbox
+                                    name={sub.id}
+                                    class={styles.checkbox}
+                                    disabled
+                                    ref={(el: any) =>
+                                      (this.checkboxRefs[sub.id] = el)
+                                    }
+                                    v-slots={{
+                                      icon: (props: any) => (
+                                        <Icon
+                                          name={
+                                            props.checked
+                                              ? checkBoxActive
+                                              : checkBoxDefault
+                                          }
+                                          size="20"
+                                        />
+                                      )
+                                    }}
+                                  />
+                                  <p class={styles.name}>{sub.name}</p>
+                                </div>
+                              </div>
+                            ))}
+                        </div>
+                      </>
+                    ) : null
+                  )}
+                {this.single ? (
+                  <div class={styles['subject-list']}>
+                    {this.subjectList.map((item: any) => (
+                      <div
+                        class={styles['subject-item']}
+                        onClick={() => this.onSelect(item.id)}
+                      >
+                        <Image
+                          src={item.img || 'xxx'}
+                          width="100%"
+                          height="100%"
+                          fit="cover"
+                          v-slots={{
+                            loading: () => <Loading type="spinner" size={20} />
+                          }}
+                        />
+                        <div class={styles.topBg}>
+                          <Checkbox
+                            name={item.id}
+                            class={styles.checkbox}
+                            disabled
+                            ref={(el: any) => (this.checkboxRefs[item.id] = el)}
+                            v-slots={{
+                              icon: (props: any) => (
+                                <Icon
+                                  name={
+                                    props.checked
+                                      ? checkBoxActive
+                                      : checkBoxDefault
+                                  }
+                                  size="20"
+                                />
+                              )
+                            }}
+                          />
+                          <p class={styles.name}>{item.name}</p>
+                        </div>
+                      </div>
+                    ))}
+                  </div>
+                ) : null}
+              </CheckboxGroup>
+            ) : (
+              <RadioGroup v-model={this.radio}>
+                {!this.single &&
+                  this.subjectList.map((item: any) =>
+                    item.subjects && item.subjects.length > 0 ? (
+                      <>
+                        <div class={styles.title}>{item.name}</div>
+                        <div class={styles['subject-list']}>
+                          {item.subjects &&
+                            item.subjects.map((sub: any) => (
+                              <div
+                                class={styles['subject-item']}
+                                onClick={() => this.onSelect(sub.id)}
+                              >
+                                <Image
+                                  src={sub.img || 'xxx'}
+                                  width="100%"
+                                  height="100%"
+                                  fit="cover"
+                                  v-slots={{
+                                    loading: () => (
+                                      <Loading type="spinner" size={20} />
+                                    )
+                                  }}
+                                />
+                                <div class={styles.topBg}>
+                                  <Radio
+                                    name={sub.id}
+                                    class={styles.checkbox}
+                                    v-slots={{
+                                      icon: (props: any) => (
+                                        <Icon
+                                          name={
+                                            props.checked
+                                              ? checkBoxActive
+                                              : checkBoxDefault
+                                          }
+                                          size="20"
+                                        />
+                                      )
+                                    }}
+                                  />
+                                  <p class={styles.name}>{sub.name}</p>
+                                </div>
+                              </div>
+                            ))}
+                        </div>
+                      </>
+                    ) : null
+                  )}
+                {this.single ? (
+                  <div class={styles['subject-list']}>
+                    {this.subjectList.map((item: any) => (
+                      <div
+                        class={styles['subject-item']}
+                        onClick={() => this.onSelect(item.id)}
+                      >
+                        <Image
+                          src={item.img || 'xxx'}
+                          width="100%"
+                          height="100%"
+                          fit="cover"
+                          v-slots={{
+                            loading: () => <Loading type="spinner" size={20} />
+                          }}
+                        />
+                        <div class={styles.topBg}>
+                          <Radio
+                            name={item.id}
+                            class={styles.checkbox}
+                            v-slots={{
+                              icon: (props: any) => (
+                                <Icon
+                                  name={
+                                    props.checked
+                                      ? checkBoxActive
+                                      : checkBoxDefault
+                                  }
+                                  size="20"
+                                />
+                              )
+                            }}
+                          />
+                          <p class={styles.name}>{item.name}</p>
+                        </div>
+                      </div>
+                    ))}
+                  </div>
+                ) : null}
+              </RadioGroup>
+            )
+          ) : (
+            <ColResult tips="暂无声部数据" btnStatus={false} />
+          )}
+        </div>
+
+        {this.subjectList.length > 0 && (
+          <Sticky offsetBottom={0} position="bottom">
+            <div class={'btnGroup'}>
+              <Button
+                round
+                block
+                type="primary"
+                style={{ width: '96%', margin: '0 auto' }}
+                onClick={() =>
+                  this.onChoice(
+                    this.selectType === 'Checkbox' ? this.checkBox : this.radio
+                  )
+                }
+              >
+                确定
+              </Button>
+            </div>
+          </Sticky>
+        )}
+      </div>
+    )
+  }
+})

BIN
src/components/col-result/images/empty_tenant.png


BIN
src/components/col-result/images/network_tenant.png


BIN
src/components/col-result/images/notFond_tenant.png


+ 49 - 33
src/components/col-result/index.module.less

@@ -1,33 +1,49 @@
-.col-result {
-  padding: 30px 14px 14px;
-  text-align: center;
-  margin: 0 auto;
-  .tips {
-    font-size: 14px;
-    color: #333;
-    padding: 20px 0;
-  }
-  .btn {
-    width: 55%;
-    margin: 0 auto;
-  }
-  .SMALL {
-    :global {
-      .van-empty__image {
-        width: 182px;
-        height: 161px;
-      }
-    }
-  }
-  .CERT {
-    :global {
-      .van-empty__image {
-        width: 260px;
-        height: 230px;
-      }
-      .van-empty__description {
-        padding: 0 30px;
-      }
-    }
-  }
-}
+.col-result {
+  padding: 30px 14px 14px;
+  text-align: center;
+  margin: 0 auto;
+
+  .tips {
+    font-size: 14px;
+    color: #333;
+    padding: 20px 0;
+  }
+
+  .btn {
+    width: 55%;
+    margin: 0 auto;
+  }
+
+  :global {
+    .van-empty__image {
+      width: 260px;
+      height: 230px;
+    }
+
+    .van-empty__description {
+      padding: 0 30px;
+    }
+  }
+
+  .SMALL {
+    :global {
+      .van-empty__image {
+        width: 182px;
+        height: 161px;
+      }
+    }
+  }
+
+  .CERT {
+    :global {
+      .van-empty__image {
+        width: 260px;
+        height: 230px;
+      }
+
+      .van-empty__description {
+        padding: 0 30px;
+      }
+    }
+  }
+}

+ 130 - 120
src/components/col-result/index.tsx

@@ -1,120 +1,130 @@
-import { defineComponent, PropType } from 'vue'
-import styles from './index.module.less'
-import empty from '@common/images/icon_nodata.png'
-import { Button, Empty, Image } from 'vant'
-import { postMessage } from '@/helpers/native-message'
-
-export const getAssetsHomeFile = (fileName: string) => {
-  const path = `./images/${fileName}`
-  const modules = import.meta.globEager('./images/*')
-  return modules[path].default
-}
-
-export default defineComponent({
-  name: 'col-result',
-  props: {
-    tips: {
-      type: String
-    },
-    type: {
-      // 空 | 达人认证 | 音乐人认证 | 直播认证
-      type: String as PropType<
-        | 'empty'
-        | 'teacherCert'
-        | 'musicCert'
-        | 'liveCert'
-        | 'error'
-        | 'network'
-        | 'search'
-        | 'emptyContent'
-        | 'notFond'
-      >,
-      default: 'empty'
-    },
-    classImgSize: {
-      type: String as PropType<'CERT' | 'SMALL'>,
-      default: ''
-    },
-    plain: {
-      type: Boolean,
-      default: false
-    },
-    btnStatus: {
-      type: Boolean,
-      default: true
-    },
-    buttonText: {
-      type: String,
-      default: '我知道了'
-    },
-    onClick: Function
-  },
-  methods: {
-    onResult() {
-      if (this.onClick) {
-        this.onClick()
-      } else {
-        postMessage({ api: 'back', content: {} })
-      }
-    }
-  },
-  computed: {
-    image() {
-      let image = null as any
-      switch (this.type) {
-        case 'teacherCert':
-          image = getAssetsHomeFile('teacherCert.png')
-          break
-        case 'musicCert':
-          image = getAssetsHomeFile('musicCert.png')
-          break
-        case 'liveCert':
-          image = getAssetsHomeFile('liveCert.png')
-          break
-        case 'emptyContent':
-          image = getAssetsHomeFile('emptyContent.png')
-          break
-        case 'error':
-          image = 'error'
-          break
-        case 'network':
-          image = getAssetsHomeFile('network.png')
-          break
-        case 'search':
-          image = 'search'
-          break
-        case 'notFond':
-          image = getAssetsHomeFile('notFond.png')
-          break
-        default:
-          image = getAssetsHomeFile('empty.png')
-          break
-      }
-      return image
-    }
-  },
-  render() {
-    return (
-      <div class={[styles['col-result'], 'col-result-container']}>
-        <Empty
-          image={this.image}
-          class={styles[this.classImgSize]}
-          description={this.tips}
-        />
-
-        {this.btnStatus ? (
-          <Button
-            class={styles.btn}
-            round
-            block
-            type="primary"
-            plain={this.plain}
-            onClick={this.onResult}
-          >
-            {this.buttonText}
-          </Button>
-        ) : null}
-      </div>
-    )
-  }
-})
+import { defineComponent, PropType } from 'vue'
+import styles from './index.module.less'
+import empty from '@common/images/icon_nodata.png'
+import { Button, Empty, Image } from 'vant'
+import { postMessage } from '@/helpers/native-message'
+import { state } from '@/state'
+
+export const getAssetsHomeFile = (fileName: string) => {
+  const path = `./images/${fileName}`
+  const modules = import.meta.globEager('./images/*')
+  return modules[path].default
+}
+
+export default defineComponent({
+  name: 'col-result',
+  props: {
+    tips: {
+      type: String
+    },
+    type: {
+      // 空 | 达人认证 | 音乐人认证 | 直播认证
+      type: String as PropType<
+        | 'empty'
+        | 'teacherCert'
+        | 'musicCert'
+        | 'liveCert'
+        | 'error'
+        | 'network'
+        | 'search'
+        | 'emptyContent'
+        | 'notFond'
+      >,
+      default: 'empty'
+    },
+    classImgSize: {
+      type: String as PropType<'CERT' | 'SMALL'>,
+      default: ''
+    },
+    plain: {
+      type: Boolean,
+      default: false
+    },
+    btnStatus: {
+      type: Boolean,
+      default: true
+    },
+    buttonText: {
+      type: String,
+      default: '我知道了'
+    },
+    onClick: Function
+  },
+  methods: {
+    onResult() {
+      if (this.onClick) {
+        this.onClick()
+      } else {
+        postMessage({ api: 'back', content: {} })
+      }
+    }
+  },
+  computed: {
+    image() {
+      let image = null as any
+      switch (this.type) {
+        case 'teacherCert':
+          image = getAssetsHomeFile('teacherCert.png')
+          break
+        case 'musicCert':
+          image = getAssetsHomeFile('musicCert.png')
+          break
+        case 'liveCert':
+          image = getAssetsHomeFile('liveCert.png')
+          break
+        case 'emptyContent':
+          image = getAssetsHomeFile('emptyContent.png')
+          break
+        case 'error':
+          image = 'error'
+          break
+        case 'network':
+          image =
+            state.projectType === 'tenant'
+              ? getAssetsHomeFile('network_tenant.png')
+              : getAssetsHomeFile('network.png')
+          break
+        case 'search':
+          image = 'search'
+          break
+        case 'notFond':
+          image =
+            state.projectType === 'tenant'
+              ? getAssetsHomeFile('notFond_tenant.png')
+              : getAssetsHomeFile('notFond.png')
+          break
+        default:
+          image =
+            state.projectType === 'tenant'
+              ? getAssetsHomeFile('empty_tenant.png')
+              : getAssetsHomeFile('empty.png')
+          break
+      }
+      return image
+    }
+  },
+  render() {
+    return (
+      <div class={[styles['col-result'], 'col-result-container']}>
+        <Empty
+          image={this.image}
+          class={styles[this.classImgSize]}
+          description={this.tips}
+        />
+
+        {this.btnStatus ? (
+          <Button
+            class={styles.btn}
+            round
+            block
+            type="primary"
+            plain={this.plain}
+            onClick={this.onResult}
+          >
+            {this.buttonText}
+          </Button>
+        ) : null}
+      </div>
+    )
+  }
+})

+ 72 - 71
src/constant/index.ts

@@ -1,71 +1,72 @@
-export const goodsType = {
-  LIVE: '直播课',
-  PRACTICE: '陪练课',
-  VIDEO: '视频课',
-  VIP: '开通会员',
-  MUSIC: '单曲点播',
-  ALBUM: '专辑购买',
-  PIANO_ROOM: '琴房时长充值',
-  ACTI_REGIST: '活动报名'
-}
-
-export const orderType = {
-  WAIT_PAY: '待支付',
-  PAYING: '支付中',
-  PAID: '已付款',
-  CLOSE: '已关闭',
-  FAIL: '支付失败'
-}
-
-export const returnType = {
-  DOING: '审核中',
-  PASS: '通过',
-  UNPASS: '不通过'
-}
-
-export const levelMember = {
-  BEGINNER: '入门级',
-  ADVANCED: '进阶级',
-  PERFORMER: '大师级'
-}
-
-export const memberType = {
-  MONTH: '月度会员',
-  QUARTERLY: '季度会员',
-  YEAR_HALF: '半年会员',
-  YEAR: '年度会员'
-}
-
-export const courseType = {
-  NOT_START: '未开始',
-  ING: '进行中',
-  COMPLETE: '已完成',
-  CANCEL: '已取消'
-}
-
-export const bizStatus = {
-  PRACTICE: '陪练课',
-  LIVE: '直播课',
-  VIDEO: '视频课',
-  MUSIC: '乐谱',
-  WITHDRAWAL: '提现',
-  LIVE_SHARE: '直播课分润',
-  VIDEO_SHARE: '视频课分润',
-  MUSIC_SHARE: '乐谱分润',
-  VIP_SHARE: '会员分润',
-  MALL_SHARE: '商品分润'
-}
-
-export const postStatus = {
-  WAIT: '待入账',
-  FROZEN: '冻结入账 ',
-  RECORDED: '已入账 ',
-  CANCEL: '取消'
-}
-
-// 评测难度
-export const difficulty = {
-  BEGINNER: '入门级',
-  ADVANCED: '进阶级',
-  PERFORMER: '大师级'
-}
+export const goodsType = {
+  LIVE: '直播课',
+  PRACTICE: '陪练课',
+  VIDEO: '视频课',
+  VIP: '开通会员',
+  MUSIC: '单曲点播',
+  ALBUM: '专辑购买',
+  PIANO_ROOM: '琴房时长充值',
+  ACTI_REGIST: '活动报名',
+  TENANT_ALBUM: '机构专辑'
+}
+
+export const orderType = {
+  WAIT_PAY: '待支付',
+  PAYING: '支付中',
+  PAID: '已付款',
+  CLOSE: '已关闭',
+  FAIL: '支付失败'
+}
+
+export const returnType = {
+  DOING: '审核中',
+  PASS: '通过',
+  UNPASS: '不通过'
+}
+
+export const levelMember = {
+  BEGINNER: '入门级',
+  ADVANCED: '进阶级',
+  PERFORMER: '大师级'
+}
+
+export const memberType = {
+  MONTH: '月度会员',
+  QUARTERLY: '季度会员',
+  YEAR_HALF: '半年会员',
+  YEAR: '年度会员'
+}
+
+export const courseType = {
+  NOT_START: '未开始',
+  ING: '进行中',
+  COMPLETE: '已完成',
+  CANCEL: '已取消'
+}
+
+export const bizStatus = {
+  PRACTICE: '陪练课',
+  LIVE: '直播课',
+  VIDEO: '视频课',
+  MUSIC: '乐谱',
+  WITHDRAWAL: '提现',
+  LIVE_SHARE: '直播课分润',
+  VIDEO_SHARE: '视频课分润',
+  MUSIC_SHARE: '乐谱分润',
+  VIP_SHARE: '会员分润',
+  MALL_SHARE: '商品分润'
+}
+
+export const postStatus = {
+  WAIT: '待入账',
+  FROZEN: '冻结入账 ',
+  RECORDED: '已入账 ',
+  CANCEL: '取消'
+}
+
+// 评测难度
+export const difficulty = {
+  BEGINNER: '入门级',
+  ADVANCED: '进阶级',
+  PERFORMER: '大师级'
+}

+ 1 - 1
src/helpers/request.ts

@@ -85,7 +85,7 @@ request.interceptors.response.use(
       throw new Error(msg)
     }
     const data = await res.clone().json()
-    if (data.code !== 200 && data.errCode !== 0) {
+    if (data.code !== 200 && data.errCode !== 0 && data.code !== 5004) {
       let msg = data.msg || data.message || '处理失败,请重试'
       if (initRequest) {
         if (data.code === 403 || data.code === 401) {

+ 7 - 0
src/router/routes-teacher.ts

@@ -318,6 +318,13 @@ export default [
         meta: {
           title: '老师主页'
         }
+      },
+      {
+        path: '/train-tool',
+        component: () => import('@/tenant/music/train-tool'),
+        meta: {
+          title: '训练工具'
+        }
       }
     ]
   },

+ 27 - 2
src/router/routes-tenant.ts

@@ -180,11 +180,36 @@ export default [
       {
         path: '/goodsOrder',
         name: 'goodsOrder',
-        component: () => import('@/tenant/goods-order/index'),
+        component: () => import('@/tenant/trade/index'),
         meta: {
-          title: '订单信息'
+          title: '交易记录'
         }
       },
+      {
+        path: '/music-songbook',
+        component: () => import('@/tenant/music/search/header'),
+        meta: {
+          title: '搜索顶部'
+        },
+        children: [
+          {
+            path: '/music-songbook/search',
+            name: 'musicSearch',
+            component: () => import('@/tenant/music/search'),
+            meta: {
+              title: '搜索结果'
+            }
+          },
+          {
+            path: '/music-songbook/musicSongbook',
+            name: 'musicSongbook',
+            component: () => import('@/tenant/music/songbook'),
+            meta: {
+              title: '乐谱库'
+            }
+          }
+        ]
+      },
       // {
       //   path: '/practiceClass',
       //   name: 'practiceClass',

+ 1 - 1
src/state.ts

@@ -18,7 +18,7 @@ export const state = reactive({
     unionId: 0 // 是否已关联账号
   } as any, // 管乐团信息
   projectType: 'default' as 'default' | 'tenant', // 机构端,还是默认
-  payBackPath: '/tenant/',
+  payBackPath: '/tenant.html',
   platformType: '' as 'STUDENT' | 'TEACHER',
   platformApi: '/api-student' as '/api-student' | '/api-teacher',
   version: '', // 版本号 例如: 1.0.0

+ 1 - 1
src/tenant/activation-code/index.tsx

@@ -151,7 +151,7 @@ export default defineComponent({
                 {state.list.map((item: any) => (
                   <Row>
                     <Col span={5}>{item.activationCode}</Col>
-                    <Col span={4}>6个月</Col>
+                    <Col span={4}>{item.purchaseCycle}个月</Col>
                     <Col
                       span={6}
                       class={item.activationStatus ? styles.c1 : styles.c3}

+ 33 - 29
src/tenant/exercise-record/exercis-detail.tsx

@@ -172,37 +172,37 @@ export default defineComponent({
       }
       state.isClick = false
 
-      if (showContact.value) {
-        nextTick(() => {
-          if (document.getElementById('exerciseWeek')) {
-            state.myChart = markRaw(
-              echarts.init(
-                document.getElementById('exerciseWeek') as HTMLDivElement
-              )
+      // if (showContact.value) {
+      nextTick(() => {
+        if (document.getElementById('exerciseWeek')) {
+          state.myChart = markRaw(
+            echarts.init(
+              document.getElementById('exerciseWeek') as HTMLDivElement
             )
+          )
 
-            const cloudTime: any = []
-            const cloudNum: any = []
-            state.userTrainChartData.forEach((data: any) => {
-              const indexData = data.indexMonthData || []
-              if (data.dataType === 'CLOUD_STUDY_TRAIN_TIME') {
-                indexData.forEach((d: any) => {
-                  cloudTime.push(d.totalNum)
-                })
-              } else if (data.dataType === 'CLOUD_STUDY_TRAIN_NUM') {
-                indexData.forEach((d: any) => {
-                  cloudNum.push(d.totalNum)
-                })
-              }
-            })
-            lineChartOption.series[0].data = cloudTime
-            lineChartOption.series[1].data = cloudNum
+          const cloudTime: any = []
+          const cloudNum: any = []
+          state.userTrainChartData.forEach((data: any) => {
+            const indexData = data.indexMonthData || []
+            if (data.dataType === 'CLOUD_STUDY_TRAIN_TIME') {
+              indexData.forEach((d: any) => {
+                cloudTime.push(d.totalNum)
+              })
+            } else if (data.dataType === 'CLOUD_STUDY_TRAIN_NUM') {
+              indexData.forEach((d: any) => {
+                cloudNum.push(d.totalNum)
+              })
+            }
+          })
+          lineChartOption.series[0].data = cloudTime
+          lineChartOption.series[1].data = cloudNum
 
-            state.myChart.clear()
-            state.myChart.setOption(lineChartOption)
-          }
-        })
-      }
+          state.myChart.clear()
+          state.myChart.setOption(lineChartOption)
+        }
+      })
+      // }
     }
     const onRefresh = () => {
       finished.value = false
@@ -367,7 +367,11 @@ export default defineComponent({
             // }}
             class={styles.emptyContainer}
           >
-            <ColResult tips="暂无学练统计" btnStatus={false} />
+            <ColResult
+              tips="暂无学练统计"
+              classImgSize="SMALL"
+              btnStatus={false}
+            />
           </div>
         )}
 

+ 0 - 420
src/tenant/goods-order/after-sale.tsx

@@ -1,420 +0,0 @@
-import ColHeader from '@/components/col-header'
-import ColResult from '@/components/col-result'
-import request from '@/helpers/request'
-import { state } from '@/state'
-import {
-  ActionSheet,
-  Button,
-  Cell,
-  CellGroup,
-  Dialog,
-  Field,
-  Image,
-  List,
-  Tab,
-  Tabs,
-  Toast
-} from 'vant'
-import { defineComponent } from 'vue'
-import Item from './item'
-import styles from './index.module.less'
-
-const returnState = {
-  0: '待处理',
-  1: '退货中',
-  2: '已完成',
-  3: '已拒绝'
-}
-type good = {
-  description: string
-  memberUsername: string
-  orderId: number
-  orderSn: string
-  productAttr: string
-  productBrand: string
-  productCount: number
-  productId: number
-  productName: string
-  productPic: string
-  productPrice: number
-  productRealPrice: number
-  proofPics: string
-  returnName: string
-  returnPhone: string
-  orderItemId: string
-}
-
-export default defineComponent({
-  name: 'after-sale',
-  data() {
-    return {
-      active: '0',
-      list: [],
-      dataShow: false, // 判断是否有数据
-      loading: false,
-      finished: false,
-      show: false,
-      kmsShow: false,
-      params: {
-        pageNum: 1,
-        pageSize: 20
-      },
-
-      returnGood: {} as good,
-      reason: '', // 退货原因
-      returnOrderSn: '', // 退货快递单号
-      returnGoodId: 0 // 退货申请服务单号
-    }
-  },
-  watch: {
-    active() {
-      this.init()
-      this.getList()
-    }
-  },
-  mounted() {
-    this.getList()
-  },
-  methods: {
-    init() {
-      this.params.pageNum = 1
-      this.finished = false
-      this.list = []
-    },
-
-    async getList() {
-      //避免重复请求
-      console.log(this.loading, this.finished)
-      if (this.loading && this.finished) {
-        return
-      }
-      this.loading = true
-      let res: any
-      if (this.active === '0') {
-        // 可退货列表
-        res = await this.getIsReturnOrderList()
-      } else {
-        // 退货申请列表
-        res = await this.getReturnList()
-      }
-      if (res && res.code === 200 && res.data.list) {
-        let data = res.data
-        if (Array.isArray(data.list)) {
-          let list = [] as any
-          // 过滤一个订单里面所有商品都申请了退货
-          for (let i = 0; i < data.list.length; i++) {
-            if (data.list[i].orderItemList) {
-              let isHave =
-                data.list[i].orderItemList.findIndex(n => n.returnStatus < 0) >
-                -1
-              if (isHave) {
-                list.push(data.list[i])
-              }
-            } else {
-              list.push(data.list[i])
-            }
-          }
-          this.list = this.list.concat(this.list, list)
-        }
-        // this.list = [].concat(this.list, res.data.list)
-
-        this.params.pageNum = res.data.pageNum + 1
-      }
-      this.finished = this.params.pageNum >= res?.data?.totalPage
-      this.loading = false
-    },
-
-    //获取可退货列表
-    async getIsReturnOrderList(): Promise<object> {
-      try {
-        let res = await request.get('/api-mall-portal/order/list', {
-          params: {
-            ...this.params,
-            status: '1,2,3'
-          }
-        })
-        return res
-      } catch (error) {}
-      return {}
-    },
-
-    // 获取退货申请
-    async getReturnList(): Promise<object> {
-      try {
-        let res = await request.post('/api-mall-portal/returnApply/list', {
-          data: {
-            ...this.params,
-            status: this.active === '1' ? '0,1' : '2,3'
-          }
-        })
-        return res
-      } catch (error) {}
-      return {}
-    },
-
-    // 设置退货参数
-    setReturnParams(item: any, n: any): void {
-      this.returnGood.memberUsername = state.user.data.username
-      this.returnGood.orderId = item.id
-      this.returnGood.orderSn = item.orderSn
-      this.returnGood.productAttr = n.productAttr
-      this.returnGood.productBrand = n.productBrand
-      this.returnGood.productCount = n.productQuantity
-      this.returnGood.productId = n.productId
-      this.returnGood.productName = n.productName
-      this.returnGood.productPic = n.productPic
-      this.returnGood.productPrice = n.productPrice
-      this.returnGood.productRealPrice = n.productPrice
-      this.returnGood.proofPics = ''
-      this.returnGood.returnName = item.receiverName
-      this.returnGood.returnPhone = item.receiverPhone
-      this.returnGood.orderItemId = n.id
-      console.log(this.returnGood)
-    },
-    // 退商品
-    async setReturnShop(): Promise<void> {
-      if (!this.reason) {
-        Toast('请填写退货原因!')
-        return
-      }
-      try {
-        let res = await request.post('/api-mall-portal/returnApply/create', {
-          data: {
-            ...this.returnGood,
-            reason: this.reason
-          }
-        })
-        if (res.code === 200) {
-          Toast({
-            message: '退货申请成功',
-            icon: 'success'
-          })
-          setTimeout(() => {
-            this.show = false
-            this.reason = ''
-            this.returnOrderSn = ''
-            this.active = '1'
-          }, 500)
-        }
-      } catch (error) {}
-      this.returnGood = {} as good
-    },
-
-    // 填写快递单号
-    async setReturnApplySn(): Promise<void> {
-      if (!this.returnOrderSn) {
-        Toast('请填写退货快递单号')
-        return
-      }
-
-      try {
-        let { code, data } = await request.post(
-          '/api-mall-portal/returnApply/deliverySn',
-          {
-            data: {
-              deliverySn: this.returnOrderSn,
-              id: this.returnGoodId
-            }
-          }
-        )
-        if (code === 200) {
-          this.returnOrderSn = ''
-          this.kmsShow = false
-          this.init()
-          this.getList()
-        }
-      } catch (error) {}
-    },
-    //撤销申请
-    deleteReturnApply(): void {
-      Dialog.confirm({
-        title: '提示',
-        message: '是否撤销退货申请?',
-        confirmButtonText: '撤销',
-        confirmButtonColor: 'var(--van-primary)'
-      }).then(async () => {
-        try {
-          let { code, data } = await request.post(
-            '/api-mall-portal/returnApply/delete/' + this.returnGoodId
-          )
-          if (code === 200) {
-            this.init()
-            this.getList()
-          }
-        } catch (err) {}
-      })
-    }
-  },
-  render() {
-    const tabs = [
-      { name: '0', title: '全部' },
-      { name: '1', title: '处理中' },
-      { name: '2', title: '已处理' }
-    ]
-    return (
-      <div class={styles.shopOrder}>
-        <ColHeader />
-
-        <Tabs
-          v-model:active={this.active}
-          color="var(--van-primary)"
-          lineWidth={28}
-          animated
-          swipeable
-        >
-          {tabs.map(tab => (
-            <Tab name={tab.name} title={tab.title}>
-              {this.list.length ? (
-                <List
-                  loading={this.loading}
-                  finished={this.finished}
-                  finishedText=" "
-                  class={[styles.goodsList]}
-                  onLoad={this.getList}
-                >
-                  {this.active === tab.name &&
-                    this.list.map((item: any) => (
-                      <>
-                        {item.orderItemList && item.orderItemList.length ? (
-                          item.orderItemList.map((n: any) => (
-                            <CellGroup class={styles.cellGroup}>
-                              <Item item={n} />
-                              <Cell
-                                center
-                                v-slots={{
-                                  default: () => (
-                                    <div class={styles.btnList}>
-                                      {this.active === '0' &&
-                                      n.returnStatus < 0 && (item.status == 3 ? (item.afterSale == 0) : true) ? (
-                                        <Button
-                                          size="small"
-                                          round
-                                          type="primary"
-                                          onClick={() => {
-                                            this.show = true
-                                            this.setReturnParams(item, n)
-                                          }}
-                                        >
-                                          退货申请
-                                        </Button>
-                                      ) : null}
-                                      {n.returnStatus >= 0 ? (
-                                        <div>{returnState[n.returnStatus]}</div>
-                                      ) : null}
-                                    </div>
-                                  )
-                                }}
-                              ></Cell>
-                            </CellGroup>
-                          ))
-                        ) : (
-                          <CellGroup class={styles.cellGroup}>
-                            <Cell
-                              title={item.createTime}
-                              titleClass={styles.payTime}
-                              value={returnState[item.status]}
-                              // valueClass={}
-                            ></Cell>
-                            <Item item={item} />
-                            <Cell
-                              center
-                              v-slots={{
-                                default: () => (
-                                  <div class={styles.btnList}>
-                                    {item.status === 1 && !item.deliverySn ? (
-                                      <Button
-                                        size="small"
-                                        round
-                                        onClick={() => {
-                                          this.returnGoodId = item.id
-                                          this.kmsShow = true
-                                        }}
-                                      >
-                                        填写退货快递单号
-                                      </Button>
-                                    ) : null}
-                                    {item.status <= 1 ? (
-                                      <Button
-                                        size="small"
-                                        round
-                                        type="primary"
-                                        onClick={() => {
-                                          this.returnGoodId = item.id
-                                          this.deleteReturnApply()
-                                        }}
-                                      >
-                                        撤销申请
-                                      </Button>
-                                    ) : null}
-                                    {item.status === 2 ? (
-                                      <div class={styles.returnDes}>
-                                        该商品金额已于 {item.handleTime}{' '}
-                                        原路退还
-                                      </div>
-                                    ) : item.status === 3 ? (
-                                      <div class={styles.returnDes}>
-                                        拒绝原因: {item.handleNote}
-                                      </div>
-                                    ) : null}
-                                  </div>
-                                )
-                              }}
-                            ></Cell>
-                          </CellGroup>
-                        )}
-                      </>
-                    ))}
-                </List>
-              ) : (
-                <ColResult
-                  btnStatus={false}
-                  classImgSize="SMALL"
-                  tips="暂无数据"
-                />
-              )}
-            </Tab>
-          ))}
-        </Tabs>
-
-        <ActionSheet v-model:show={this.show} title="退货原因">
-          <div style={{ paddingTop: '15px' }}>
-            <Field
-              class={[styles.field]}
-              placeholder="请输入退货原因"
-              type="textarea"
-              rows={3}
-              v-model={this.reason}
-            />
-          </div>
-          <div class={styles['btn-group']}>
-            <Button
-              type="primary"
-              block
-              round
-              onClick={() => this.setReturnShop()}
-            >
-              确定
-            </Button>
-          </div>
-        </ActionSheet>
-        <ActionSheet v-model:show={this.kmsShow} title="填写退货快递单号">
-          <Field
-            v-model={this.returnOrderSn}
-            class={[styles.field]}
-            placeholder="请输入退货快递单号"
-          />
-          <div class={styles['btn-group']}>
-            <Button
-              type="primary"
-              block
-              round
-              onClick={() => this.setReturnApplySn()}
-            >
-              确定
-            </Button>
-          </div>
-        </ActionSheet>
-      </div>
-    )
-  }
-})

+ 0 - 115
src/tenant/goods-order/components/after-sale-btns/index.tsx

@@ -1,115 +0,0 @@
-import { moneyFormat } from '@/helpers/utils'
-import { Button, Cell } from 'vant'
-import { defineComponent, PropType } from 'vue'
-import styles from '../../index.module.less'
-
-export default defineComponent({
-  name: 'AfterSaleBtns',
-  props: {
-    item: {
-      type: Object,
-      default: {}
-    },
-    onCancelOrder: {
-      type: Function,
-      default: (n: any) => {}
-    },
-    onPayOrder: {
-      type: Function,
-      default: (n: any) => {}
-    },
-    onConfirmReceipt: {
-      type: Function,
-      default: (n: any) => {}
-    },
-    onAginOrder: {
-      type: Function,
-      default: (n: any) => {}
-    }
-  },
-  setup({ item, onCancelOrder, onPayOrder, onConfirmReceipt, onAginOrder }) {
-    return () => (
-      <Cell
-        center
-        v-slots={{
-          title: () => (
-            <div class={styles.orderPrice}>
-              <div>
-                订单金额
-                <span class={styles.price} style={{ paddingLeft: '5px' }}>
-                  <i>¥ </i>
-                  {moneyFormat(item.payAmount)}
-                </span>
-              </div>
-              {!!item.couponAmount && (
-                <div class={styles.coupon}>
-                  优惠券: -¥ {moneyFormat(item.couponAmount)}
-                </div>
-              )}
-            </div>
-          ),
-          default: () => (
-            <div class={styles.btnList}>
-              {/* <span class={styles.sureGoods}>已确认收货</span> */}
-
-              {item.status === 0 || item.status === 6 ? (
-                <>
-                  <Button
-                    size="small"
-                    round
-                    onClick={(e: Event) => {
-                      e.stopPropagation()
-                      onCancelOrder!(item)
-                    }}
-                  >
-                    取消订单
-                  </Button>
-                  <Button
-                    size="small"
-                    round
-                    type="primary"
-                    onClick={(e: Event) => {
-                      e.stopPropagation()
-                      onPayOrder!(item)
-                    }}
-                  >
-                    继续支付
-                  </Button>
-                </>
-              ) : null}
-              {item.status === 2 ? (
-                <Button
-                  size="small"
-                  round
-                  type="primary"
-                  onClick={(e: Event) => {
-                    e.stopPropagation()
-                    onConfirmReceipt!(item)
-                  }}
-                >
-                  确认收货
-                </Button>
-              ) : null}
-              {item.status === 3 ? (
-                <>
-                  <span class={styles.confirmReceipt}>已确认收货</span>
-                  <Button
-                    size="small"
-                    round
-                    type="primary"
-                    onClick={(e: Event) => {
-                      e.stopPropagation()
-                      onAginOrder!(item)
-                    }}
-                  >
-                    再来一单
-                  </Button>
-                </>
-              ) : null}
-            </div>
-          )
-        }}
-      ></Cell>
-    )
-  }
-})

+ 0 - 119
src/tenant/goods-order/index.module.less

@@ -1,119 +0,0 @@
-.shopOrder {
-  --van-nav-bar-text-color: #666666;
-  :global {
-    .van-tab__panel {
-      min-height: calc(100vh - var(--van-tabs-line-height) - var(--van-nav-bar-height) - 45px);
-    }
-  }
-}
-
-.goodsList {
-  margin-top: 12px;
-}
-
-.payTime {
-  font-size: 13px;
-  color: #666666;
-}
-.payStatus {
-  color: #ff4e19;
-}
-.paySuccess {
-  color: var(--van-primary);
-}
-
-.cellGroup {
-  margin: 12px 14px;
-  border-radius: 10px;
-  overflow: hidden;
-}
-
-.goodsImg {
-  width: 100px;
-  height: 100px;
-  border-radius: 8px;
-  overflow: hidden;
-}
-
-.goodsContainer {
-  margin-left: 10px;
-}
-
-.goodsTitle {
-  font-size: 16px;
-  color: #333333;
-  line-height: 22px;
-}
-
-.model {
-  font-size: 14px;
-  color: #999999;
-  line-height: 20px;
-  padding: 6px 0 10px 0;
-}
-
-.goodsPrice {
-  display: flex;
-  justify-content: space-between;
-
-  .num {
-    font-size: 12px;
-    font-weight: 500;
-    color: #666666;
-    line-height: 17px;
-  }
-}
-
-.btnList {
-  display: flex;
-  align-items: center;
-  justify-content: flex-end;
-  :global {
-    .van-button + .van-button {
-      margin-left: 10px;
-    }
-  }
-}
-
-.price {
-  color: #ff4e19;
-  font-size: 16px;
-  i {
-    font-size: 12px;
-    font-style: normal;
-  }
-}
-.coupon{
-  font-size: 12px;
-  color: #ff4e19;
-}
-
-.sureGoods {
-  padding-right: 12px;
-  font-size: 12px;
-  color: #999999;
-  line-height: 17px;
-}
-
-.field {
-  margin: 0 26px 13px;
-  border: 1px solid #dedede;
-  width: auto;
-  border-radius: 10px;
-  overflow: hidden;
-}
-
-.btn-group {
-  padding: 0 15% 12px;
-}
-.returnDes {
-  color: #666;
-  font-size: 14px;
-  margin-right: auto;
-}
-
-.confirmReceipt{
-  font-size: 12px;
-  color: #999;
-  margin-right: 19px;
-}

+ 0 - 234
src/tenant/goods-order/index.tsx

@@ -1,234 +0,0 @@
-import ColHeader from '@/components/col-header'
-import ColResult from '@/components/col-result'
-import request from '@/helpers/request'
-import { Button, Cell, CellGroup, Dialog, Image, List, Tab, Tabs } from 'vant'
-import { defineComponent } from 'vue'
-import styles from './index.module.less'
-import { orderState } from '@/views/shop-mall/shop-mall'
-import { cartConfirm } from '@/views/cart/cart'
-import Item from './item'
-import AfterSaleBtns from './components/after-sale-btns'
-import { useEventTracking } from '@/helpers/hooks'
-
-export default defineComponent({
-  name: 'shop-order',
-  data() {
-    return {
-      active: 0,
-      list: [],
-      dataShow: true, // 判断是否有数据
-      loading: false,
-      finished: false,
-      params: {
-        search: '',
-        groupStatus: 'APPLY',
-        page: 1,
-        rows: 20
-      },
-      page: {
-        pageNum: 1,
-        pageSize: 20
-      }
-    }
-  },
-  watch: {
-    active(val) {
-      this.init()
-      this.getList()
-    }
-  },
-  mounted() {
-    useEventTracking('订单')
-  },
-  methods: {
-    init() {
-      this.page.pageNum = 1
-      this.finished = false
-      this.list = []
-      this.dataShow = true
-    },
-    async getList() {
-      if (this.loading || this.finished) {
-        return
-      }
-      this.loading = true
-      try {
-        const { code, data } = await request.get(
-          '/api-mall-portal/order/list',
-          {
-            params: {
-              ...this.page,
-              status:
-                this.active === 0 ? '0,6' : this.active === 1 ? '1,2' : '3,4'
-            }
-          }
-        )
-
-        if (code === 200 && data.list) {
-          this.page.pageNum += 1
-          this.list = [].concat(this.list as any, data.list)
-        }
-        if (this.list.length >= data.total) {
-          this.finished = true
-        }
-
-        if (this.list.length === 0) {
-          this.dataShow = false
-        }
-      } catch (error) {
-        this.finished = true
-        this.dataShow = false
-      }
-      this.loading = false
-    },
-    onClickRight() {
-      this.$router.push('/afterSale')
-    },
-
-    async cancelOrder(item: any) {
-      const dialog = await Dialog.confirm({
-        title: '提示',
-        message: '确认取消订单?',
-        confirmButtonText: '取消订单',
-        confirmButtonColor: 'var(--van-primary)'
-      })
-      if (dialog === 'confirm') {
-        const { code, data } = await request.post(
-          '/api-mall-portal/order/cancelUserOrder',
-          { params: { orderId: item.id } }
-        )
-        if (code === 200) {
-          this.init()
-          this.getList()
-        }
-      }
-    },
-    payOrder(item: any) {
-      cartConfirm.orderInfo = item
-      this.$router.push({ path: '/cartConfirmAgin' })
-    },
-
-    // 再来一单
-    async onAginOrder(item: any) {
-      try {
-        const res = await request.post('/api-mall-portal/order/oneOrder', {
-          params: {
-            orderId: item.id
-          }
-        })
-        const { code, data } = res
-        if (code === 200) {
-          cartConfirm.calcAmount = data.calcAmount
-          cartConfirm.cartPromotionItemList = data.cartPromotionItemList
-          cartConfirm.memberReceiveAddressList = data.memberReceiveAddressList
-          this.$router.push({
-            path: '/cartConfirm'
-          })
-        }
-        console.log(res)
-      } catch (error) {}
-    },
-
-    // 确认收货
-    async onConfirmReceipt(item: any) {
-      const dialog = await Dialog.confirm({
-        title: '提示',
-        message: '确认收货?',
-        confirmButtonText: '收货',
-        confirmButtonColor: 'var(--van-primary)'
-      })
-      if (dialog === 'confirm') {
-        const res = await request.post(
-          '/api-mall-portal/order/confirmReceiveOrder',
-          { params: { orderId: item.id } }
-        )
-        if (res.code === 200) {
-          this.init()
-          this.getList()
-        }
-      }
-    }
-  },
-  render() {
-    const tabs = [
-      { name: 0, title: '待支付' },
-      { name: 1, title: '待收货' },
-      { name: 2, title: '已完成' }
-    ]
-
-    return (
-      <div class={styles.shopOrder}>
-        <ColHeader
-          ref="colHeader"
-          class="header"
-          rightText="售后服务"
-          onClickRight={this.onClickRight}
-        />
-        <Tabs
-          v-model:active={this.active}
-          color="var(--van-primary)"
-          lineWidth={28}
-          animated
-          swipeable
-        >
-          {tabs.map(tab => (
-            <Tab name={tab.name} title={tab.title}>
-              {this.active === tab.name && this.dataShow ? (
-                <List
-                  loading={this.loading}
-                  finished={this.finished}
-                  finishedText=" "
-                  class={[styles.goodsList]}
-                  onLoad={this.getList}
-                >
-                  {this.list.map((item: any) => (
-                    <>
-                      <CellGroup
-                        class={styles.cellGroup}
-                        onClick={() => {
-                          this.$router.push({
-                            path: '/shopOrderDetail',
-                            query: { id: item.id }
-                          })
-                        }}
-                      >
-                        <Cell
-                          title={item.createTime}
-                          titleClass={styles.payTime}
-                          value={orderState[item.status]}
-                          valueClass={
-                            [0, 4, 5, 6].includes(item.status)
-                              ? styles.payStatus
-                              : styles.paySuccess
-                          }
-                        ></Cell>
-                        {item.orderItemList && item.orderItemList.length
-                          ? item.orderItemList.map((n: any) => (
-                              <Item item={n} />
-                            ))
-                          : null}
-                        <AfterSaleBtns
-                          item={item}
-                          onCancelOrder={this.cancelOrder}
-                          onPayOrder={this.payOrder}
-                          onConfirmReceipt={this.onConfirmReceipt}
-                          onAginOrder={this.onAginOrder}
-                        />
-                      </CellGroup>
-                    </>
-                  ))}
-                </List>
-              ) : (
-                <ColResult
-                  btnStatus={false}
-                  classImgSize="SMALL"
-                  tips="暂无订单"
-                />
-              )}
-            </Tab>
-          ))}
-        </Tabs>
-      </div>
-    )
-  }
-})

+ 0 - 44
src/tenant/goods-order/item.tsx

@@ -1,44 +0,0 @@
-import { moneyFormat } from '@/helpers/utils'
-import { Cell, Image } from 'vant'
-import { defineComponent } from 'vue'
-import { formateAttr } from '../../views/cart/cart'
-import styles from './index.module.less'
-
-export default defineComponent({
-  name: 'GoodItem',
-  props: {
-    item: {
-      type: Object,
-      default: {}
-    }
-  },
-  setup({ item }) {
-    return () => (
-      <Cell
-        center
-        v-slots={{
-          icon: () => (
-            <Image class={styles.goodsImg} src={item.productPic} fit="cover" />
-          ),
-          default: () => (
-            <div class={styles.goodsContainer}>
-              <div class={[styles.goodsTitle, 'van-ellipsis']}>
-                {item.productName}
-              </div>
-              <div class={styles.model}>{formateAttr(item.productAttr)}</div>
-              <div class={styles.goodsPrice}>
-                <span class={styles.price}>
-                  <i>¥</i>
-                  {moneyFormat(item.productPrice)}
-                </span>
-                <span class={styles.num}>
-                  x{item.productQuantity || item.productCount}
-                </span>
-              </div>
-            </div>
-          )
-        }}
-      ></Cell>
-    )
-  }
-})

BIN
src/tenant/images/album-bg.png


BIN
src/tenant/images/bg-image-search.png


BIN
src/tenant/images/icon-album-cover.png


BIN
src/tenant/images/music-bg.png


+ 115 - 115
src/tenant/layout/auth.tsx

@@ -1,115 +1,115 @@
-import { defineComponent } from 'vue'
-import styles from './auth.module.less'
-import { state, setLogin, setLogout, setLoginError } from '@/state'
-import { browser, setAuth } from '@/helpers/utils'
-import { postMessage } from '@/helpers/native-message'
-import { RouterView } from 'vue-router'
-import { Button, Icon } from 'vant'
-import request from '@/helpers/request'
-import ColResult from '@/components/col-result'
-
-const browserInfo = browser()
-export default defineComponent({
-  name: 'Auth',
-  data() {
-    return {
-      loading: false as boolean
-    }
-  },
-  computed: {
-    isExternal() {
-      // 该路由在外部连接打开是否需要登录
-      // 只判断是否在学生端打开
-      return (this.$route.meta.isExternal && !browserInfo.isStudent) || false
-    },
-    isNeedView() {
-      return (
-        state.user.status === 'login' ||
-        this.$route.path === '/login' ||
-        (this as any).isExternal
-      )
-    }
-  },
-  mounted() {
-    !this.isExternal && this.setAuth()
-  },
-  methods: {
-    async setAuth() {
-      const { query } = this.$route
-      const token = query.userInfo || query.Authorization
-      if (token) {
-        setAuth(token)
-      }
-      if (this.loading) {
-        return
-      }
-      if (state.user.status === 'init' || state.user.status === 'error') {
-        this.loading = true
-        try {
-          let res = await request.get('/api-student/student/queryUserInfo', {
-            initRequest: true // 初始化接口
-          })
-          setLogin(res.data)
-        } catch (e: any) {
-          const message = e.message
-          if (
-            message.indexOf('403') === -1 &&
-            message.indexOf('authentication') === -1
-          ) {
-            setLoginError()
-          } else {
-            setLogout()
-          }
-        }
-        this.loading = false
-      }
-      if (state.user.status === 'logout') {
-        if (browser().isApp) {
-          postMessage({ api: 'login' })
-        } else {
-          try {
-            const route = this.$route
-            const query = {
-              returnUrl: this.$route.path,
-              ...this.$route.query
-            } as any
-            if (route.meta.isRegister) {
-              query.isRegister = route.meta.isRegister
-            }
-            this.$router.replace({
-              path: '/login',
-              query: query
-            })
-          } catch (error) {}
-        }
-      }
-    }
-  },
-  render() {
-    return (
-      <>
-        {state.user.status === 'error' ? (
-          <div class={styles.error}>
-            {/* <div class={styles.info}>
-              <Icon name="clear" size="36" color="#ee0a24" />
-              <span>加载失败,请重新尝试</span>
-            </div>
-            <Button type="primary" round onClick={this.setAuth}>
-              重新加载
-            </Button> */}
-            <ColResult
-              type="notFond"
-              classImgSize="CERT"
-              tips="加载失败,请稍后重试"
-              buttonText="重新加载"
-              plain={true}
-              onClick={this.setAuth}
-            />
-          </div>
-        ) : this.isNeedView ? (
-          <RouterView></RouterView>
-        ) : null}
-      </>
-    )
-  }
-})
+import { defineComponent } from 'vue'
+import styles from './auth.module.less'
+import { state, setLogin, setLogout, setLoginError } from '@/state'
+import { browser, setAuth } from '@/helpers/utils'
+import { postMessage } from '@/helpers/native-message'
+import { RouterView } from 'vue-router'
+import { Button, Icon } from 'vant'
+import request from '@/helpers/request'
+import ColResult from '@/components/col-result'
+
+const browserInfo = browser()
+export default defineComponent({
+  name: 'Auth',
+  data() {
+    return {
+      loading: false as boolean
+    }
+  },
+  computed: {
+    isExternal() {
+      // 该路由在外部连接打开是否需要登录
+      // 只判断是否在学生端打开
+      return (this.$route.meta.isExternal && !browserInfo.isStudent) || false
+    },
+    isNeedView() {
+      return (
+        state.user.status === 'login' ||
+        this.$route.path === '/login' ||
+        (this as any).isExternal
+      )
+    }
+  },
+  mounted() {
+    !this.isExternal && this.setAuth()
+  },
+  methods: {
+    async setAuth() {
+      const { query } = this.$route
+      const token = query.userInfo || query.Authorization
+      if (token) {
+        setAuth(token)
+      }
+      if (this.loading) {
+        return
+      }
+      if (state.user.status === 'init' || state.user.status === 'error') {
+        this.loading = true
+        try {
+          const res = await request.get('/api-student/student/queryUserInfo', {
+            initRequest: true // 初始化接口
+          })
+          setLogin(res.data)
+        } catch (e: any) {
+          const message = e.message
+          if (
+            message.indexOf('403') === -1 &&
+            message.indexOf('authentication') === -1
+          ) {
+            setLoginError()
+          } else {
+            setLogout()
+          }
+        }
+        this.loading = false
+      }
+      if (state.user.status === 'logout') {
+        if (browser().isApp) {
+          postMessage({ api: 'login' })
+        } else {
+          try {
+            const route = this.$route
+            const query = {
+              returnUrl: this.$route.path,
+              ...this.$route.query
+            } as any
+            if (route.meta.isRegister) {
+              query.isRegister = route.meta.isRegister
+            }
+            this.$router.replace({
+              path: '/login',
+              query: query
+            })
+          } catch (error) {}
+        }
+      }
+    }
+  },
+  render() {
+    return (
+      <>
+        {state.user.status === 'error' ? (
+          <div class={styles.error}>
+            {/* <div class={styles.info}>
+              <Icon name="clear" size="36" color="#ee0a24" />
+              <span>加载失败,请重新尝试</span>
+            </div>
+            <Button type="primary" round onClick={this.setAuth}>
+              重新加载
+            </Button> */}
+            <ColResult
+              type="notFond"
+              classImgSize="CERT"
+              tips="加载失败,请稍后重试"
+              buttonText="重新加载"
+              plain={true}
+              onClick={this.setAuth}
+            />
+          </div>
+        ) : this.isNeedView ? (
+          <RouterView></RouterView>
+        ) : null}
+      </>
+    )
+  }
+})

+ 28 - 22
src/tenant/music/personal/practice.tsx

@@ -43,29 +43,35 @@ export default defineComponent({
       return (
         <>
           {prevNum.value > 0 && (
-            <Cell titleClass={styles.pTitle} title="最近练习" border={false} />
+            <>
+              <Cell
+                titleClass={styles.pTitle}
+                title="最近练习"
+                border={false}
+              />
+              <div class={styles.practice}>
+                <Song
+                  showTitleImg
+                  list={list}
+                  onDetail={(item: any) => {
+                    const url =
+                      location.origin +
+                      location.pathname +
+                      '#/music-detail?id=' +
+                      item.id
+                    openDefaultWebView(url, () => {
+                      router.push({
+                        path: '/music-detail',
+                        query: {
+                          id: item.id
+                        }
+                      })
+                    })
+                  }}
+                />
+              </div>
+            </>
           )}
-          <div class={styles.practice}>
-            <Song
-              showTitleImg
-              list={list}
-              onDetail={(item: any) => {
-                const url =
-                  location.origin +
-                  location.pathname +
-                  '#/music-detail?id=' +
-                  item.id
-                openDefaultWebView(url, () => {
-                  router.push({
-                    path: '/music-detail',
-                    query: {
-                      id: item.id
-                    }
-                  })
-                })
-              }}
-            />
-          </div>
         </>
       )
     }

+ 22 - 4
src/tenant/music/personal/tenant-album.tsx

@@ -44,6 +44,15 @@ export default defineComponent({
       loading.value = false
     }
 
+    const onDetail = (item: any) => {
+      router.push({
+        path: '/train-tool',
+        query: {
+          albumId: item.id
+        }
+      })
+    }
+
     return () => {
       return (
         <List
@@ -55,11 +64,15 @@ export default defineComponent({
         >
           {rows.value.length
             ? rows.value.map((item: any) => (
-                <CellGroup class={styles.tennatCellGroup} border={false}>
-                  <Cell isLink>
+                <CellGroup
+                  class={styles.tennatCellGroup}
+                  border={false}
+                  onClick={() => onDetail(item)}
+                >
+                  <Cell isLink clickable={false}>
                     {{
                       icon: () => (
-                        <img src={item.coverImg} class={styles.tenantLogo} />
+                        <img src={item.tenantImg} class={styles.tenantLogo} />
                       ),
                       title: () => (
                         <div class={styles.tenantName}>{item.tenantName}</div>
@@ -68,7 +81,12 @@ export default defineComponent({
                   </Cell>
                   <Cell>
                     {{
-                      icon: () => <Image class={styles.tenantCoverImg} />,
+                      icon: () => (
+                        <Image
+                          src={item.coverImg}
+                          class={styles.tenantCoverImg}
+                        />
+                      ),
                       title: () => (
                         <div class={styles.tenantContent}>
                           <h2>{item.name}</h2>

+ 1 - 0
src/tenant/music/search/all-search.module.less

@@ -0,0 +1 @@
+.albumSection {}

+ 64 - 0
src/tenant/music/search/all-search.tsx

@@ -0,0 +1,64 @@
+import { defineComponent, onMounted, onUnmounted, reactive, ref } from 'vue'
+import styles from './all-search.module.less'
+import { useRoute, useRouter } from 'vue-router'
+import MusicGrid from '../component/music-grid'
+import request from '@/helpers/request'
+
+export default defineComponent({
+  name: 'MusicSearch',
+  props: {
+    defauleParams: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  emits: ['confirm'],
+  setup(props) {
+    const route = useRoute()
+    const router = useRouter()
+    const state = reactive({
+      albumList: [] as any
+    })
+
+    const getAlbumList = async () => {
+      try {
+        const { data } = await request.post('/api-student/music/album/list', {
+          data: {
+            ...props.defauleParams,
+            page: 1,
+            rows: 3
+          }
+        })
+        console.log(data)
+        state.albumList = data.rows || []
+      } catch {
+        //
+      }
+    }
+
+    // music-songbook/search
+    onMounted(() => {
+      getAlbumList()
+    })
+
+    return () => (
+      <div class={styles.allSearch}>
+        <div class={styles.albumSection}>
+          <div class={styles.musicGrid}>
+            <MusicGrid
+              list={state.albumList}
+              onGoto={(n: any) => {
+                router.push({
+                  name: 'music-album-detail',
+                  params: {
+                    id: n.id
+                  }
+                })
+              }}
+            />
+          </div>
+        </div>
+      </div>
+    )
+  }
+})

+ 135 - 81
src/tenant/music/search/header.tsx

@@ -1,21 +1,22 @@
-import { Sticky, Cell, Tag, Icon, Popup, Tabs, Tab, Dialog } from 'vant'
+import { Sticky, Cell, Tag, Icon, Popup, Tabs, Tab, Dialog, Button } from 'vant'
 import {
   RouterView,
   useRouter,
   useRoute,
   onBeforeRouteUpdate
 } from 'vue-router'
-import { defineComponent, onMounted, reactive, ref, watch } from 'vue'
+import { defineComponent, nextTick, onMounted, reactive, ref, watch } from 'vue'
 import mitt from 'mitt'
 import Search from '@/components/col-search'
 import { useLocalStorage } from '@vueuse/core'
 import styles from './index.module.less'
 import classNames from 'classnames'
-import SelectTag from './select-tag'
 import { getRandomKey } from '../music'
 import SelectSubject from './select-subject'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
 import { state } from '@/state'
+import TheSticky from '@/components/the-sticky'
+import bgImg from '../../images/bg-image-search.png'
 
 export const mitter = mitt()
 
@@ -52,9 +53,8 @@ export default defineComponent({
     const route = useRoute()
     const keyword = ref('')
     const tagids = ref('')
-    const tagVisibility = ref(false)
     const words = useLocalStorage<string[]>('music-search', [])
-    const activeTab = ref('songe')
+    const activeTab = ref('all')
 
     onBeforeRouteUpdate(() => {
       const getSubject: any = useSubjectId(SubjectEnum.SEARCH)
@@ -63,7 +63,7 @@ export default defineComponent({
       if (route.path === '/music-songbook/search') {
         keyword.value = ''
         tagids.value = ''
-        activeTab.value = 'songe'
+        activeTab.value = 'all'
         try {
           selectTagRef.value?.resetTags?.()
         } catch (error) {
@@ -85,18 +85,12 @@ export default defineComponent({
       }
       if (val) {
         words.value.unshift(val)
-        words.value.length = Math.min(words.value.length, 5)
+        console.log(words.value.length, 'words.value.length')
+        words.value.length = Math.min(words.value.length, 10)
       }
       mitter.emit('search', val)
     }
 
-    const onComfirm = (tags, name = '') => {
-      const data = Object.values(tags).flat().filter(Boolean).join(',')
-      tagids.value = data
-      mitter.emit('confirm', tags)
-      tagVisibility.value = false
-    }
-
     const onComfirmSubject = (item: any) => {
       // console.log('onSort', item)
       subject.name = item.name
@@ -121,42 +115,81 @@ export default defineComponent({
       name: getSubject.name || '全部声部',
       id: getSubject.id || ''
     })
+
+    const tagRef = ref<any>([])
+    const collapse = reactive({
+      line: 0,
+      arrowStatus: false
+    })
+
+    // 历史搜索默认收起
+    const defaultClose = () => {
+      nextTick(() => {
+        if (!words.value || !words.value.length) {
+          return
+        }
+        let offsetLeft = -1
+        collapse.line = 0
+        const tags = tagRef.value
+        tags.forEach((item: any, index: number) => {
+          try {
+            item.$el.style.display = 'block'
+            if (index === 0) {
+              collapse.line = 1
+              offsetLeft = item.$el.offsetLeft
+            } else if (item.$el.offsetLeft === offsetLeft && index != 0) {
+              // 如果某个标签的offsetLeft和第一个标签的offsetLeft相等  说明增加了一行
+              collapse.line += 1
+            }
+
+            if (!collapse.arrowStatus) {
+              if (collapse.line > 2) {
+                //从第3行开始 隐藏标签
+                item.$el.style.display = 'none'
+              } else {
+                item.$el.style.display = 'block'
+              }
+            } else {
+              item.$el.style.display = 'block'
+            }
+          } catch (e: any) {
+            console.log(e, 'Error')
+          }
+        })
+      })
+    }
+    // 首先调用默认收起的方法
+    defaultClose()
+
     return () => {
       return (
         <div class={styles.search}>
-          <Sticky class={styles.sticky}>
-            <Search
-              modelValue={keyword.value}
-              // showAction
-              ref={searchInputRef}
-              onSearch={onSearch}
-              // onFilter={() => (tagVisibility.value = true)}
-              // filterDot={!!tagids.value}
-              onClick={() => {
-                if (route.path === '/music-songbook') {
-                  router.push({
-                    path: '/music-songbook/search'
-                  })
-                }
-              }}
-              v-slots={{
-                left: () => (
-                  <div
-                    class={styles.label}
-                    onClick={() => (subject.show = true)}
-                  >
-                    {subject.name}
-                    <Icon
-                      classPrefix="iconfont"
-                      name="down"
-                      size={12}
-                      color="#333"
-                    />
-                  </div>
-                )
-              }}
-            />
-            {route.path === '/music-songbook/search' && (
+          <div class={styles.sticky}>
+            <TheSticky position="top">
+              <Search
+                modelValue={keyword.value}
+                background="transparent"
+                ref={searchInputRef}
+                onSearch={onSearch}
+                type="tenant"
+                v-slots={{
+                  left: () => (
+                    <div
+                      class={styles.label}
+                      onClick={() => (subject.show = true)}
+                    >
+                      {subject.name}
+                      <Icon
+                        classPrefix="iconfont"
+                        name="down"
+                        size={12}
+                        color="#333"
+                      />
+                    </div>
+                  )
+                }}
+              />
+              {/* {route.path === '/music-songbook/search' && (
               <Tabs
                 color="var(--van-primary)"
                 background="transparent"
@@ -168,45 +201,66 @@ export default defineComponent({
                 <Tab title="单曲" name="songe"></Tab>
                 <Tab title="专辑" name="album"></Tab>
               </Tabs>
-            )}
-          </Sticky>
+            )} */}
+            </TheSticky>
+            <img class={styles.bgImg} src={bgImg} />
+          </div>
           {words.value.length > 0 && route.path === '/music-songbook/search' && (
-            <div class={classNames(styles.keywords, 'van-hairline--bottom')}>
-              <div class={styles.content}>
-                {words.value.map(item => (
-                  <Tag
-                    round
-                    class={styles.searchKeyword}
-                    key={item}
-                    onClick={() => onSearch(item)}
-                  >
-                    {item}
-                  </Tag>
-                ))}
+            <div class={styles.keywordSection}>
+              <div class={styles.keywordTitle}>
+                <span class={styles.t}>搜索历史</span>
+                <Icon
+                  class={styles.remove}
+                  name="delete-o"
+                  onClick={() => (words.value = [])}
+                />
+              </div>
+              <div class={classNames(styles.keywords)}>
+                <div class={styles.content}>
+                  {words.value.map((item: any, index: number) => (
+                    <Tag
+                      ref={(el: any) => (tagRef.value[index] = el)}
+                      round
+                      class={[styles.searchKeyword, 'van-ellipsis']}
+                      key={item}
+                      onClick={() => onSearch(item)}
+                    >
+                      {item}
+                    </Tag>
+                  ))}
+                  {collapse.line > 2 && (
+                    <span
+                      class={[styles.arrowMore]}
+                      onClick={() => {
+                        collapse.arrowStatus = !collapse.arrowStatus
+                        defaultClose()
+                      }}
+                    >
+                      <Icon
+                        name={collapse.arrowStatus ? 'arrow-up' : 'arrow-down'}
+                      />
+                    </span>
+                  )}
+                </div>
               </div>
-              <Icon
-                class={styles.remove}
-                name="delete-o"
-                onClick={() => (words.value = [])}
-              />
             </div>
           )}
+          {route.path === '/music-songbook/search' && (
+            <Tabs
+              color="var(--van-primary)"
+              background="transparent"
+              lineWidth={20}
+              shrink
+              class={styles.tagTabs}
+              v-model:active={activeTab.value}
+              onChange={val => (activeTab.value = val)}
+            >
+              <Tab title="综合" name="all"></Tab>
+              <Tab title="单曲" name="songe"></Tab>
+              <Tab title="专辑" name="album"></Tab>
+            </Tabs>
+          )}
           <RouterView />
-          <Popup
-            show={tagVisibility.value}
-            round
-            closeable
-            position="bottom"
-            style={{ height: '60%' }}
-            teleport="body"
-            onUpdate:show={val => (tagVisibility.value = val)}
-          >
-            <SelectTag
-              ref={selectTagRef}
-              onConfirm={onComfirm}
-              onCancel={() => {}}
-            />
-          </Popup>
 
           {/* 声部弹框 */}
           <Popup

+ 120 - 12
src/tenant/music/search/index.module.less

@@ -11,56 +11,164 @@
     :global(.van-sticky--fixed) {
       box-shadow: 10px 10px 10px var(--box-shadow-color);
     }
-    > div {
+
+    >div {
       background-color: var(--base-bg);
     }
   }
+
   .title {
     padding-top: 16px;
+
     :global(.van-cell__value) {
       font-size: 12px;
     }
   }
+
+
+  .keywordTitle {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 8px 9px;
+
+    .t {
+      font-size: 14px;
+      font-weight: 500;
+      color: #000000;
+      line-height: 20px;
+    }
+
+    .remove {
+      font-size: 16px;
+    }
+  }
+
   .keywords {
     margin-top: 10px;
     padding: 0 14px;
-    padding-bottom: 10px;
     display: flex;
     align-items: center;
-    .content::-webkit-scrollbar {
-      display: none; /* Chrome Safari */
-    }
+
+    // .content::-webkit-scrollbar {
+    //   display: none;
+    // }
+
     .content {
       flex: 1;
-      overflow: hidden;
-      overflow-x: auto;
+      // overflow: hidden;
+      // overflow-x: auto;
       display: flex;
+      flex-wrap: wrap;
+
       .searchKeyword {
         --van-tag-default-color: white;
-        --van-tag-text-color: #333;
+        --van-tag-text-color: #313443;
         font-size: 14px;
-        padding: 4px 10px;
+        padding: 5px 14px;
         margin-right: 5px;
+        margin-bottom: 10px;
+        max-width: 100px;
+        display: block;
         word-break: keep-all;
       }
-    }
 
-    .remove {
-      font-size: 16px;
+      .arrowMore {
+        width: 27px;
+        height: 27px;
+        border-radius: 50%;
+        display: inline-flex;
+        align-items: center;
+        justify-content: center;
+        background-color: #fff;
+        font-size: 12px;
+        color: #93959F;
+      }
     }
   }
+
   .label {
     margin-right: 8px;
     font-size: 14px;
+
     :global {
+
       .van-list__loading,
       .van-list__finished-text,
       .van-list__error-text {
         width: 100%;
       }
+
       .iconfont-down {
         margin-left: 4px;
       }
     }
   }
 }
+
+
+.sticky {
+  :global {
+    .van-sticky {
+      background: url('../../images/bg-image-search.png') no-repeat top center;
+      background-size: 100% 214px;
+      box-shadow: none !important;
+    }
+
+    .van-search__content {
+      background: rgba(255, 255, 255, 0.5) !important;
+
+      input::placeholder {
+        color: rgba(0, 0, 0, 0.4) !important;
+      }
+
+      input {
+        color: rgba(0, 0, 0, 0.4) !important;
+      }
+
+      .van-field__clear {
+        color: rgba(0, 0, 0, 0.4) !important;
+      }
+    }
+
+  }
+}
+
+.bgImg {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 214px;
+  // object-fit: cover;
+  z-index: -1;
+}
+
+.tagTabs {
+  --van-cell-background-color: transparent;
+  --van-cell-font-size: 16px;
+  --van-cell-text-color: #333;
+  --van-cell-value-color: #999;
+  --van-cell-icon-size: 10px;
+
+  :global {
+    .van-tab {
+      font-size: 16px !important;
+
+      color: #999999;
+    }
+
+    .van-tab--active {
+      font-size: 16px !important;
+      color: #131415;
+    }
+
+    .van-tabs__line {
+      width: 24px;
+      height: 4px;
+      background: linear-gradient(90deg, #FF3C81 0%, rgba(255, 118, 166, 0.5) 100%) !important;
+      border-radius: 36px 36px 0px 0px;
+    }
+
+  }
+}

+ 20 - 7
src/tenant/music/search/index.tsx

@@ -7,6 +7,7 @@ import { useRoute, useRouter } from 'vue-router'
 import { getRandomKey } from '../music'
 import { mitter } from './header'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
+import AllSearch from './all-search'
 
 export default defineComponent({
   name: 'MusicSearch',
@@ -20,7 +21,7 @@ export default defineComponent({
     const subject = ref()
     const tagVisibility = ref(false)
     const words = useLocalStorage<string[]>('music-search', [])
-    const activeTab = ref('songe')
+    const activeTab = ref('all')
 
     const getSubject: any = useSubjectId(SubjectEnum.SEARCH)
     subject.value = getSubject.id
@@ -57,6 +58,7 @@ export default defineComponent({
     const musicList = ref(null)
 
     const changeTab = (val: any) => {
+      console.log(val, 'val')
       activeTab.value = val
     }
 
@@ -65,6 +67,8 @@ export default defineComponent({
       mitter.on('search', onSearch)
       mitter.on('confirm', onComfirm)
       mitter.on('confirmSubject', onConfirmSubject)
+
+      console.log(activeTab.value, 'activeTab.value')
     })
 
     onUnmounted(() => {
@@ -77,18 +81,27 @@ export default defineComponent({
     return () => {
       return (
         <div class={styles.search}>
-          {activeTab.value === 'album' ? (
+          {activeTab.value === 'all' && (
+            <AllSearch
+              defauleParams={{
+                albumTagIds: tagids.value,
+                subjectIds: subject.value
+              }}
+            />
+          )}
+          {activeTab.value === 'album' && (
             <AlbumList
               hideSearch
               ref={albumList}
               defauleParams={{
-                search: keyword.value,
-                tagids: tagids.value,
+                // search: keyword.value,
+                // tagids: tagids.value,
                 albumTagIds: tagids.value,
                 subjectIds: subject.value
               }}
             />
-          ) : (
+          )}
+          {activeTab.value === 'songe' && (
             <MusicList
               hideSearch
               ref={musicList}
@@ -102,8 +115,8 @@ export default defineComponent({
                 })
               }}
               defauleParams={{
-                search: keyword.value,
-                tagids: tagids.value,
+                // search: keyword.value,
+                // tagids: tagids.value,
                 musicTagIds: tagids.value,
                 subjectIds: subject.value
               }}

+ 1 - 0
src/tenant/music/train-list/index.module.less

@@ -89,6 +89,7 @@
   border-radius: 18px;
   background-color: #fff;
   margin: 6px;
+  min-height: 40vh;
 }
 
 .bgImg {

+ 179 - 228
src/tenant/music/train-list/index.tsx

@@ -1,35 +1,16 @@
 import { defineComponent, nextTick, onMounted, reactive, ref } from 'vue'
-import {
-  Sticky,
-  List,
-  Popup,
-  Icon,
-  Switch,
-  Tabs,
-  Tab,
-  DropdownMenu,
-  DropdownItem,
-  Tag
-} from 'vant'
+import { List, DropdownMenu, DropdownItem, Tag, Sticky, Button } from 'vant'
 import Search from '@/components/col-search'
 import request from '@/helpers/request'
-// import Item from './item'
-import SelectTag from '../search/select-tag'
 import { useRoute, useRouter } from 'vue-router'
 import ColResult from '@/components/col-result'
 import styles from './index.module.less'
 import { getRandomKey } from '../music'
 import { openDefaultWebView, state as baseState } from '@/state'
-import SelectSubject from '../search/select-subject'
 import { SubjectEnum, useSubjectId } from '@/helpers/hooks'
 import Song from '../component/song'
 import ColHeader from '@/components/col-header'
-import { useRect } from '@vant/use'
-import { useAsyncState } from '@vueuse/core'
 import bgImg from '../../images/bg-image.png'
-import iconSearch from './icons/icon_search.png'
-import iconFree from './icons/icon-free.png'
-import { browser } from '@/helpers/utils'
 import TheSticky from '@/components/the-sticky'
 
 const noop = () => {
@@ -39,18 +20,6 @@ const noop = () => {
 export default defineComponent({
   name: 'MusicList',
   props: {
-    hideSearch: {
-      type: Boolean,
-      default: false
-    },
-    defauleParams: {
-      type: Object,
-      default: () => ({})
-    },
-    onItemClick: {
-      type: Function,
-      default: noop
-    },
     teacherId: {
       type: String || Number,
       default: ''
@@ -60,77 +29,24 @@ export default defineComponent({
       default: false
     }
   },
-  setup(
-    { hideSearch, defauleParams, onItemClick, teacherId, myself },
-    { expose }
-  ) {
-    const teacherDetaultSubject = ref({
-      id: '',
-      name: ''
-    })
-    if (baseState.platformType === 'TEACHER') {
-      // defaultSubject
-      const users = baseState.user.data
-      teacherDetaultSubject.value = {
-        name: users.defaultSubjectName || '全部声部',
-        id: users.defaultSubject || ''
-      }
-    } else {
-      const subjects: any = useSubjectId(SubjectEnum.SEARCH)
-      // 判断是否已有数据
-      if (!subjects.id) {
-        const users = baseState.user.data
-        const subjectId = users.subjectId
-          ? Number(users.subjectId.split(',')[0])
-          : ''
-        const subjectName = users.subjectName
-          ? users.subjectName.split(',')[0]
-          : ''
-        if (subjectId) {
-          useSubjectId(
-            SubjectEnum.SEARCH,
-            JSON.stringify({
-              id: subjectId,
-              name: subjectName
-            }),
-            'set'
-          )
-        }
-      }
-    }
-
+  setup({ onItemClick }, { expose }) {
     localStorage.setItem('behaviorId', getRandomKey())
     const route = useRoute()
     const router = useRouter()
-    const tempParams: any = {}
-    if (baseState.version) {
-      tempParams.version = baseState.version || '' // 处理ios审核版本
-      tempParams.platform =
-        baseState.platformType === 'STUDENT' ? 'ios-student' : 'ios-teacher'
-    }
-    // 判断是否在搜索页面用过
-    if (!hideSearch) {
-      if (baseState.platformType === 'TEACHER') {
-        tempParams.subjectIds = teacherDetaultSubject.value.id
-      } else {
-        const getSubject: any = useSubjectId(SubjectEnum.SEARCH)
-        tempParams.subjectIds = getSubject.id
-      }
-
-      // const getMusic: any = useSubjectId(SubjectEnum.MUSIC_FREE)
-    }
     //
     const params = reactive({
       search: (route.query.search as string) || '',
       subjectType: (route.query.subjectType as string) || '',
       page: 1,
-      ...tempParams
+      subjectId: null,
+      level: '',
+      type: ''
     })
-    const subjectList = ref<any>([])
     const data = ref<any>(null)
     const loading = ref(false)
     const finished = ref(false)
     const isError = ref(false)
+    const searchObj = ref<any>({})
 
     const apiSuffix = ref(
       baseState.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
@@ -144,9 +60,6 @@ export default defineComponent({
     }
 
     const FetchList = async () => {
-      if (loading.value) {
-        return
-      }
       loading.value = true
       isError.value = false
       const tempParams = {
@@ -160,7 +73,6 @@ export default defineComponent({
             data: tempParams
           }
         )
-        console.log(res, 'res')
         if (data.value) {
           const result = (data.value?.rows || []).concat(res.data.rows || [])
           data.value.rows = result
@@ -174,70 +86,6 @@ export default defineComponent({
       loading.value = false
     }
 
-    // 设置默认声部
-    const setDefaultSubject = async (subjectId: any) => {
-      try {
-        await request.post('/api-teacher/teacher/defaultSubject', {
-          params: {
-            subjectId
-          }
-        })
-      } catch {
-        //
-      }
-    }
-
-    const onComfirmSubject = item => {
-      params.page = 1
-      params.subjectIds = item.id
-      data.value = null
-      if (baseState.platformType === 'TEACHER') {
-        teacherDetaultSubject.value = {
-          name: item.name,
-          id: item.id
-        }
-        setDefaultSubject(item.id)
-      } else {
-        subject.id = item.id
-        subject.name = item.name
-        useSubjectId(
-          SubjectEnum.SEARCH,
-          JSON.stringify({
-            id: item.id,
-            name: item.name
-          }),
-          'set'
-        )
-      }
-
-      FetchList()
-      subject.show = false
-    }
-
-    const getSubject: any = useSubjectId(SubjectEnum.SEARCH)
-    const subject = reactive({
-      show: false,
-      name: getSubject.id ? getSubject.name : '全部声部',
-      id: getSubject.id || ''
-    })
-
-    const getSubjectList = async () => {
-      const { data } = await request.get(
-        `${apiSuffix.value}/subject/subjectSelect?type=MUSIC`
-      )
-      if (Array.isArray(data)) {
-        const subject: any = []
-        data.forEach((item: any) => {
-          if (item.subjects && item.subjects.length) {
-            item.subjects.forEach(s => {
-              subject.push(s)
-            })
-          }
-        })
-        subjectList.value = subject || []
-      }
-    }
-
     const getSelectCondition = async () => {
       const { data } = await request.post(
         `${apiSuffix.value}/tenantAlbumMusic/selectCondition`,
@@ -247,7 +95,7 @@ export default defineComponent({
           }
         }
       )
-      console.log(data)
+      searchObj.value = data || {}
     }
 
     onMounted(async () => {
@@ -261,87 +109,190 @@ export default defineComponent({
       } else if (params.subjectType === 'ENSEMBLE') {
         document.title = '合奏练习'
       }
-      getSubjectList()
-      getSelectCondition()
-    })
-
-    expose({
-      onSearch,
-      onComfirmSubject
+      loading.value = true
+      await getSelectCondition()
+      await FetchList()
     })
 
     return () => {
       return (
         <>
-          {!hideSearch && (
-            <div class={styles.sticky}>
-              <TheSticky>
-                <ColHeader
-                  background="transparent"
-                  isFixed={false}
-                  border={false}
-                  color="#131415"
-                />
-                <Search
-                  onSearch={onSearch}
-                  type="tenant"
-                  background="transparent"
-                  inputBackground="transparent"
-                  // leftIcon={iconSearch}
-                  v-slots={{
-                    left: () => (
-                      <DropdownMenu>
-                        <DropdownItem title="筛选">
-                          <div
-                            class={styles.searchResult}
-                            style={{ maxHeight: '45vh', overflowY: 'auto' }}
-                          >
-                            <div class={styles.searchTitle}>声部</div>
-                            <div
-                              class={[
-                                styles['radio-group'],
-                                styles.radio,
-                                styles['organ-radio']
-                              ]}
-                            >
-                              {subjectList.value.map((subject: any) => {
-                                const isActive =
-                                  subject.id ===
-                                  Number(params.subjectIds || null)
-                                const type = isActive ? 'primary' : 'default'
-                                return (
-                                  <Tag
-                                    size="large"
-                                    plain={isActive}
-                                    type={type}
-                                    round
-                                    onClick={() => {
-                                      console.log(subject, '1212')
-                                      // this.subject = { ...subject }
-                                    }}
-                                  >
-                                    {subject.name}
-                                  </Tag>
-                                )
-                              })}
+          <div class={styles.sticky}>
+            <TheSticky>
+              <ColHeader
+                background="transparent"
+                isFixed={false}
+                border={false}
+                color="#131415"
+              />
+              <Search
+                onSearch={onSearch}
+                type="tenant"
+                background="transparent"
+                inputBackground="transparent"
+                // leftIcon={iconSearch}
+                v-slots={{
+                  left: () => (
+                    <DropdownMenu>
+                      <DropdownItem title="筛选">
+                        <div
+                          class={styles.searchResult}
+                          style={{ maxHeight: '45vh', overflowY: 'auto' }}
+                        >
+                          {searchObj.value.subjects &&
+                            searchObj.value.subjects.length > 0 && (
+                              <>
+                                <div class={styles.searchTitle}>声部</div>
+                                <div
+                                  class={[
+                                    styles['radio-group'],
+                                    styles.radio,
+                                    styles['organ-radio']
+                                  ]}
+                                >
+                                  {searchObj.value.subjects.map(
+                                    (subject: any) => {
+                                      const isActive =
+                                        subject.id ===
+                                        Number(params.subjectId || null)
+                                      const type = isActive
+                                        ? 'primary'
+                                        : 'default'
+                                      return (
+                                        <Tag
+                                          size="large"
+                                          plain={isActive}
+                                          type={type}
+                                          round
+                                          onClick={() => {
+                                            console.log(subject, '1212')
+                                            // this.subject = { ...subject }
+                                          }}
+                                        >
+                                          {subject.name}
+                                        </Tag>
+                                      )
+                                    }
+                                  )}
+                                </div>
+                              </>
+                            )}
+                          {searchObj.value.levels &&
+                            searchObj.value.levels.length > 0 && (
+                              <>
+                                <div class={styles.searchTitle}>级别</div>
+                                <div
+                                  class={[
+                                    styles['radio-group'],
+                                    styles.radio,
+                                    styles['organ-radio']
+                                  ]}
+                                >
+                                  {searchObj.value.levels.map(
+                                    (subject: any) => {
+                                      const isActive = subject === params.level
+                                      const type = isActive
+                                        ? 'primary'
+                                        : 'default'
+                                      return (
+                                        <Tag
+                                          size="large"
+                                          plain={isActive}
+                                          type={type}
+                                          round
+                                          onClick={() => {
+                                            console.log(subject, '1212')
+                                            // this.subject = { ...subject }
+                                          }}
+                                        >
+                                          {subject}
+                                        </Tag>
+                                      )
+                                    }
+                                  )}
+                                </div>
+                              </>
+                            )}
+                          {searchObj.value.types &&
+                            searchObj.value.types.length > 0 && (
+                              <>
+                                <div class={styles.searchTitle}>类型</div>
+                                <div
+                                  class={[
+                                    styles['radio-group'],
+                                    styles.radio,
+                                    styles['organ-radio']
+                                  ]}
+                                >
+                                  {searchObj.value.types.map((subject: any) => {
+                                    const isActive = subject === params.type
+                                    const type = isActive
+                                      ? 'primary'
+                                      : 'default'
+                                    return (
+                                      <Tag
+                                        size="large"
+                                        plain={isActive}
+                                        type={type}
+                                        round
+                                        onClick={() => {
+                                          console.log(subject, '1212')
+                                          // this.subject = { ...subject }
+                                        }}
+                                      >
+                                        {subject}
+                                      </Tag>
+                                    )
+                                  })}
+                                </div>
+                              </>
+                            )}
+
+                          <Sticky position="bottom" offsetBottom={0}>
+                            <div class={['btnGroup', 'btnMore']}>
+                              <Button
+                                type="primary"
+                                plain
+                                round
+                                onClick={() => {
+                                  params.subjectId = null
+                                  params.level = ''
+                                  params.type = ''
+                                }}
+                              >
+                                重 置
+                              </Button>
+
+                              <Button
+                                type="primary"
+                                round
+                                block
+                                onClick={() => {
+                                  // this.onComfirm({ ...this.subject })
+                                }}
+                              >
+                                确 认
+                              </Button>
                             </div>
-                          </div>
-                        </DropdownItem>
-                      </DropdownMenu>
-                    )
-                  }}
-                />
-              </TheSticky>
-              <img class={styles.bgImg} src={bgImg} />
-            </div>
-          )}
+                          </Sticky>
+                        </div>
+                      </DropdownItem>
+                    </DropdownMenu>
+                  )
+                }}
+              />
+            </TheSticky>
+            <img class={styles.bgImg} src={bgImg} />
+          </div>
+
           <div class={styles.alumnList}>
             <List
-              loading={loading.value}
+              // loading={loading.value}
               finished={finished.value}
               finished-text={data.value && data.value.rows.length ? '' : ''}
               onLoad={FetchList}
               error={isError.value}
+              immediateCheck={false}
             >
               {data.value && data.value.rows.length ? (
                 <Song

+ 2 - 0
src/tenant/music/train-tool/index.module.less

@@ -44,6 +44,8 @@
     border-radius: 6px;
     position: relative;
     z-index: 9;
+
+    --van-image-error-icon-size: 118px;
   }
 
   .iconPian {

+ 62 - 38
src/tenant/music/train-tool/index.tsx

@@ -7,9 +7,10 @@ import { useWindowScroll, useEventListener } from '@vueuse/core'
 import request from '@/helpers/request'
 import iconMenu from './images/icon-menu.png'
 import iconRightTop from './images/icon-right-top.png'
+import iconAlbumCover from '../../images/icon-album-cover.png'
 import { state as baseState } from '@/state'
 import Song from '../component/song'
-import { useRouter } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 import ColResult from '@/components/col-result'
 import { moneyFormat } from '@/helpers/utils'
 import { orderStatus } from '@/views/order-detail/orderStatus'
@@ -18,11 +19,13 @@ import { postMessage } from '@/helpers/native-message'
 export default defineComponent({
   name: 'train-tool',
   setup() {
+    const route = useRoute()
     const router = useRouter()
     const background = ref<string>('rgba(55, 205, 177, 0)')
     const color = ref<string>('#fff')
     const state = reactive({
       details: {} as any,
+      albumId: route.query.albumId || null,
       activeTab: 'SUBJECT',
       loading: false,
       finished: false,
@@ -67,7 +70,10 @@ export default defineComponent({
           costPrice: 0,
           status: false
         }
-      ]
+      ],
+      ensembleCounts: false,
+      musicCounts: false,
+      subjectCounts: false
     })
     const params = reactive({
       page: 1,
@@ -80,10 +86,12 @@ export default defineComponent({
     const getDetails = async () => {
       try {
         const { data } = await request.post(
-          apiSuffix.value + '/userTenantAlbumRecord/detail'
+          apiSuffix.value +
+            '/userTenantAlbumRecord/detail?albumId=' +
+            state.albumId
         )
         state.details = data || {}
-
+        console.log(state.details, 'details')
         state.buyList.forEach((item: any, index: number) => {
           item.salePrice = (index + 1) * data.salePrice
           item.costPrice = (index + 1) * data.costPrice
@@ -92,6 +100,18 @@ export default defineComponent({
         state.selectMember = {
           ...state.buyList[0]
         }
+
+        state.ensembleCounts = data.ensembleCounts <= 0 ? false : true
+        state.subjectCounts = data.subjectCounts <= 0 ? false : true
+        state.musicCounts = data.musicCounts <= 0 ? false : true
+
+        if (state.subjectCounts) {
+          state.activeTab = 'SUBJECT'
+        } else if (state.ensembleCounts) {
+          state.activeTab = 'ENSEMBLE'
+        } else if (state.musicCounts) {
+          state.activeTab = 'MUSIC'
+        }
       } catch {
         //
       }
@@ -101,6 +121,7 @@ export default defineComponent({
       if (state.loading) {
         return
       }
+      console.log(state.details, 'state.details')
       state.loading = true
       state.isError = false
       const tempParams = {
@@ -177,37 +198,38 @@ export default defineComponent({
         }
       ]
 
-      // const res = await request.post('/api-student/userOrder/getPendingOrder', {
-      //   data: {
-      //     goodType: 'TENANT_ALBUM',
-      //     bizId: details.id
-      //   }
-      // })
+      const res = await request.post('/api-student/userOrder/getPendingOrder', {
+        data: {
+          goodType: 'TENANT_ALBUM',
+          bizId: details.id
+        }
+      })
 
-      // const result = res.data
-      // if (result) {
-      //   state.popupStatus = false
-      //   Dialog.confirm({
-      //     title: '提示',
-      //     message: '您有一个未支付的订单,是否继续支付?',
-      //     confirmButtonColor: '#269a93',
-      //     cancelButtonText: '取消订单',
-      //     confirmButtonText: '继续支付'
-      //   })
-      //     .then(async () => {
-      //       orderStatus.orderObject.orderNo = result.orderNo
-      //       orderStatus.orderObject.actualPrice = result.actualPrice
-      //       orderStatus.orderObject.discountPrice = result.discountPrice
-      //       routerTo()
-      //     })
-      //     .catch(() => {
-      //       Dialog.close()
-      //       // 只用取消订单,不用做其它处理
-      //       cancelPayment(result.orderNo)
-      //     })
-      // } else {
-      routerTo()
-      // }
+      const result = res.data
+      if (result) {
+        state.popupStatus = false
+        Dialog.confirm({
+          title: '提示',
+          message: '您有一个未支付的订单,是否继续支付?',
+          confirmButtonColor: '#269a93',
+          cancelButtonText: '取消订单',
+          confirmButtonText: '继续支付'
+        })
+          .then(async () => {
+            orderStatus.orderObject.orderNo = result.orderNo
+            orderStatus.orderObject.actualPrice = result.actualPrice
+            orderStatus.orderObject.discountPrice = result.discountPrice
+            orderStatus.orderObject.paymentConfig = result.paymentConfig
+            routerTo()
+          })
+          .catch(() => {
+            Dialog.close()
+            // 只用取消订单,不用做其它处理
+            cancelPayment(result.orderNo)
+          })
+      } else {
+        routerTo()
+      }
     }
     const routerTo = () => {
       const album = state.details
@@ -253,7 +275,8 @@ export default defineComponent({
                 width="100%"
                 height="100%"
                 fit="cover"
-                src={state.details?.coverImg}
+                src={state.details?.coverImg || iconAlbumCover}
+                errorIcon={iconAlbumCover}
               />
               <span class={styles.numContent}>
                 <img src={iconMenu} class={styles.iconMenu} />共
@@ -302,9 +325,9 @@ export default defineComponent({
               FetchList()
             }}
           >
-            <Tab title="声部练习" name="SUBJECT"></Tab>
-            <Tab title="合奏练习" name="ENSEMBLE"></Tab>
-            <Tab title="独奏曲目" name="MUSIC"></Tab>
+            {state.subjectCounts && <Tab title="声部练习" name="SUBJECT"></Tab>}
+            {state.musicCounts && <Tab title="合奏练习" name="ENSEMBLE"></Tab>}
+            {state.ensembleCounts && <Tab title="独奏曲目" name="MUSIC"></Tab>}
           </Tabs>
 
           <div class={styles.alumnList}>
@@ -313,6 +336,7 @@ export default defineComponent({
               finished={state.finished}
               finished-text={' '}
               onLoad={FetchList}
+              immediateCheck={false}
               error={state.isError}
             >
               {state.list && state.list.length ? (

+ 256 - 0
src/tenant/trade/index.module.less

@@ -0,0 +1,256 @@
+.sticky {
+  :global {
+    .van-sticky {
+      background: url('../images/bg-image.png') no-repeat top center;
+      background-size: 100% 214px;
+    }
+
+    .van-search__content {
+      background: rgba(255, 255, 255, 0.5) !important;
+
+      input::placeholder {
+        color: rgba(0, 0, 0, 0.4) !important;
+      }
+
+      input {
+        color: rgba(0, 0, 0, 0.4) !important;
+      }
+
+      .van-field__clear {
+        color: rgba(0, 0, 0, 0.4) !important;
+      }
+    }
+
+  }
+}
+
+.label {
+  margin-right: 8px;
+  font-size: 14px;
+  color: #131415;
+
+  :global {
+
+    .van-list__loading,
+    .van-list__finished-text,
+    .van-list__error-text {
+      width: 100%;
+    }
+
+    .iconfont-down {
+      margin-left: 4px;
+    }
+  }
+}
+
+
+.bgImg {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 214px;
+  // object-fit: cover;
+  z-index: -1;
+}
+
+.tagTabs {
+  --van-cell-background-color: transparent;
+  --van-cell-font-size: 16px;
+  --van-cell-text-color: #333;
+  --van-cell-value-color: #999;
+  --van-cell-icon-size: 10px;
+
+  :global {
+    .van-tab {
+      font-size: 16px !important;
+      margin-top: 15px;
+      color: #999999;
+    }
+
+    .van-tab--active {
+      font-size: 16px !important;
+      color: #131415;
+    }
+
+    .van-tabs__line {
+      width: 24px;
+      height: 4px;
+      background: linear-gradient(90deg, #FF3C81 0%, rgba(255, 118, 166, 0.5) 100%) !important;
+      border-radius: 36px 36px 0px 0px;
+    }
+
+    .van-button--plain.van-button--primary {
+      background-color: transparent;
+    }
+  }
+
+  // :global {
+  // .van-tabs__nav {
+  //   background-color: transparent;
+  //   padding: 0;
+  //   margin: 0 15px;
+  // }
+
+  // .van-tab {
+  //   font-size: 16px;
+  //   font-weight: bold;
+  // }
+
+  // .van-tab--shrink {
+  //   padding: 0;
+  //   margin: 10px 0;
+  //   display: inline-block;
+  //   font-size: 14px;
+  //   background: transparent;
+  //   border-radius: 14px;
+  //   line-height: 26px;
+  //   padding: 0 12px;
+  //   color: rgba(0, 0, 0, 0.4);
+  // }
+
+  // .van-tab--active {
+  //   background: #FF699E;
+
+  //   color: #FFFFFF;
+
+  //   .van-tab__text {
+  //     z-index: 1;
+  //   }
+  // }
+
+  // .van-tabs__line {
+  //   height: 0;
+  // }
+  // }
+}
+
+
+.tradeList {
+  padding-top: 12px;
+
+  :global {
+    .van-cell-group {
+      overflow: hidden;
+      border-radius: 10px;
+      margin-bottom: 12px;
+      padding-bottom: 18px;
+    }
+
+    .van-cell {
+      padding: 16px 12px 12px;
+    }
+  }
+
+  .orderSection {
+    padding-top: 0;
+  }
+
+  .list {
+    padding: 0 14px;
+  }
+
+  .tradeLogo {
+    width: 80px;
+    height: 80px;
+    border-radius: 12px;
+    margin-right: 10px;
+    overflow: hidden;
+  }
+
+  .tradeType {
+    color: var(--van-primary);
+  }
+
+  .title {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 14px;
+    font-weight: 500;
+    color: #131415;
+    line-height: 24px;
+
+
+    .name {
+      max-width: 160px;
+    }
+
+    .desc {
+      font-size: 14px;
+      font-family: DINAlternate-Bold, DINAlternate;
+      font-weight: bold;
+      color: #131415;
+    }
+  }
+
+  .description {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 12px;
+    color: #777777;
+
+    .d {
+      max-width: 160px;
+    }
+
+  }
+
+  .paymentPrice {
+    text-align: right;
+    font-size: 14px;
+    font-weight: 500;
+    color: #131415;
+    padding-right: 12px;
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+
+    span {
+      font-family: DINAlternate-Bold, DINAlternate;
+      font-weight: bold;
+      color: #FE2451;
+      font-size: 20px;
+      padding-left: 4px;
+
+      i {
+        padding-right: 2px;
+        font-size: 14px;
+        font-style: normal;
+        vertical-align: middle;
+      }
+    }
+  }
+
+  .songLength {
+    border-radius: 4px;
+    border: 1px solid #FE2451;
+    font-size: 12px;
+    font-family: PingFangSC-Regular, PingFang SC;
+    font-weight: 400;
+    color: #FE2451;
+    line-height: 16px;
+    padding: 1px 6px;
+  }
+}
+
+.btnList {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  padding-top: 12px;
+  padding-right: 12px;
+
+  :global {
+    .van-button {
+      font-size: 14px;
+      font-weight: 500;
+      padding: 7px 16px;
+    }
+
+    .van-button+.van-button {
+      margin-left: 10px;
+    }
+  }
+}

+ 355 - 0
src/tenant/trade/index.tsx

@@ -0,0 +1,355 @@
+import { defineComponent, onMounted, reactive } from 'vue'
+import {
+  List,
+  Popup,
+  Icon,
+  Tabs,
+  Tab,
+  DatetimePicker,
+  CellGroup,
+  Button,
+  Dialog,
+  Cell,
+  Image
+} from 'vant'
+import Search from '@/components/col-search'
+import request from '@/helpers/request'
+import iconMember from '@common/images/icon_member.png'
+// import Item from './item'
+
+import { useRouter } from 'vue-router'
+import ColResult from '@/components/col-result'
+import styles from './index.module.less'
+import ColHeader from '@/components/col-header'
+import bgImg from '../images/bg-image.png'
+import { dateFormat, formatterDate, moneyFormat } from '@/helpers/utils'
+import TheSticky from '@/components/the-sticky'
+import { tradeOrder } from './tradeOrder'
+import dayjs from 'dayjs'
+import { goodsType, orderType } from '@/constant'
+
+export default defineComponent({
+  name: 'MusicList',
+  setup() {
+    const router = useRouter()
+    const state = reactive({
+      actions: [
+        { name: '待支付', status: 'WAIT_PAY' },
+        { name: '支付中', status: 'PAYING' },
+        { name: '已付款', status: 'PAID' },
+        { name: '已关闭', status: 'CLOSE' },
+        // { name: '已退费', status: 'REFUND' },
+        { name: '支付失败', status: 'FAIL' }
+      ],
+      timeStatus: false,
+      currentDate: new Date(),
+      list: [],
+      dataShow: true, // 判断是否有数据
+      loading: false,
+      finished: false,
+      searchName: '全部',
+      params: {
+        status: '',
+        page: 1,
+        rows: 20
+      },
+      type: 'buy'
+    })
+    const getList = async () => {
+      if (state.loading) return
+      state.loading = true
+      try {
+        const params = {
+          ...state.params,
+          searchDate: dayjs(state.currentDate).format('YYYY-MM')
+        }
+
+        const url =
+          state.type === 'buy'
+            ? '/api-student/userOrder/page'
+            : '/api-student/userOrderRefunds/page'
+        const { code, data } = await request.post(url, {
+          data: {
+            ...params,
+            dateTime: state.type === 'refund' ? params.searchDate : undefined,
+            timeType: state.type === 'refund' ? 'MONTH' : undefined
+          }
+        })
+        if (code === 200) {
+          const result = data || {}
+          state.list = state.list.concat(result.rows || [])
+          state.finished = result.pageNo >= result.totalPage
+          state.params.page = result.pageNo + 1
+          state.dataShow = state.list.length > 0
+        }
+      } catch {
+        state.dataShow = false
+        state.finished = true
+      }
+      state.loading = false
+    }
+    const onDetail = (item: any) => {
+      if (state.type === 'refund') return
+      router.push({
+        path: '/tradeDetail',
+        query: {
+          orderNo: item.orderNo,
+          path: 'tradeRecord'
+        }
+      })
+    }
+    const onConfirm = (date: Date) => {
+      state.currentDate = date
+      state.timeStatus = false
+      onSearch()
+    }
+    const onSearch = () => {
+      state.dataShow = true
+      state.loading = false
+      state.finished = false
+      state.list = []
+      state.params.page = 1
+      getList()
+    }
+    const onCancelPay = async (item: any) => {
+      Dialog.confirm({
+        message: '是否取消订单?',
+        confirmButtonText: '确定',
+        confirmButtonColor: 'var(--van-primary)',
+        cancelButtonText: '取消'
+      }).then(async () => {
+        try {
+          await request.post('/api-student/userOrder/orderCancel', {
+            data: {
+              orderNo: item.orderNo
+            }
+          })
+          // Toast('取消成功')
+          onSearch()
+        } catch {
+          //
+        }
+      })
+    }
+    const onPay = async (item: any) => {
+      try {
+        const res = await request.get(
+          `/api-student/userOrder/detailByOrderNo/${item.orderNo}`
+        )
+        const result = res.data
+        tradeOrder({ ...result, paymentConfig: item.paymentConfig }, () => {
+          router.push({
+            path: '/orderDetail',
+            query: {
+              orderType: result.orderType
+            }
+          })
+        })
+      } catch {
+        //
+      }
+    }
+
+    onMounted(() => {
+      getList()
+    })
+    return () => (
+      <>
+        <div class={styles.sticky}>
+          <TheSticky>
+            <ColHeader
+              background="transparent"
+              isFixed={false}
+              border={false}
+              color="#131415"
+            />
+            <Search
+              onSearch={onSearch}
+              type="tenant"
+              background="transparent"
+              inputBackground="transparent"
+              v-slots={{
+                left: () => (
+                  <div
+                    class={styles.label}
+                    onClick={() => (state.timeStatus = true)}
+                  >
+                    {dateFormat(state.currentDate, 'YYYY-MM')}
+
+                    <Icon
+                      classPrefix="iconfont"
+                      name="down"
+                      size={12}
+                      color="#131415"
+                    />
+                  </div>
+                )
+              }}
+            />
+            <Tabs
+              color="var(--van-primary)"
+              background="transparent"
+              lineWidth={20}
+              shrink
+              class={styles.tagTabs}
+              onClick-tab={(obj: any) => {
+                state.type = obj.name === 'REFUND' ? 'refund' : 'buy'
+                state.params.status = obj.name
+                onSearch()
+              }}
+            >
+              <Tab title="全部" name=""></Tab>
+              {state.actions.map((tag: any) => (
+                <Tab title={tag.name} name={tag.status}></Tab>
+              ))}
+            </Tabs>
+          </TheSticky>
+          <img class={styles.bgImg} src={bgImg} />
+        </div>
+        <div class={styles.tradeList}>
+          {state.dataShow ? (
+            <List
+              loading={state.loading}
+              finished={state.finished}
+              finishedText=" "
+              class={[styles.list]}
+              onLoad={getList}
+            >
+              {state.list.map((item: any) => (
+                <CellGroup
+                  border={false}
+                  onClick={() => {
+                    onDetail(item)
+                  }}
+                >
+                  <Cell
+                    border={false}
+                    title={dayjs(item.createTime).format('YYYY-MM-DD HH:mm')}
+                    value={
+                      state.type === 'buy'
+                        ? orderType[item.status]
+                        : item.operateReason
+                    }
+                    valueClass={styles.tradeType}
+                  />
+                  {item.orderDetailList &&
+                    item.orderDetailList.map((orderDetail: any) => (
+                      <Cell
+                        border={false}
+                        class={styles.orderSection}
+                        v-slots={{
+                          icon: () => (
+                            <Image
+                              src={
+                                orderDetail.goodType === 'VIP'
+                                  ? iconMember
+                                  : orderDetail.bizInfo?.bizCover
+                              }
+                              class={styles.tradeLogo}
+                            />
+                          ),
+                          title: () => (
+                            <div class={styles.goodsSection}>
+                              <div class={[styles.title]}>
+                                <span class={[styles.name, 'van-ellipsis']}>
+                                  {orderDetail.bizInfo?.bizName}
+                                </span>
+                                <span class={styles.desc}>
+                                  ¥{moneyFormat(orderDetail.actualPrice)}
+                                </span>
+                              </div>
+
+                              <div class={styles.description}>
+                                <span class={[styles.d, 'van-ellipsis']}>
+                                  {orderDetail.bizInfo?.bizDesc}
+                                </span>
+                                {orderDetail.goodType !== 'VIP' && (
+                                  <>
+                                    {orderDetail.goodType === 'TENANT_ALBUM' ? (
+                                      <span class={styles.t}>
+                                        x{orderDetail.bizInfo?.bizValidTime}个月
+                                      </span>
+                                    ) : (
+                                      <span class={styles.t}>永久</span>
+                                    )}
+                                  </>
+                                )}
+                              </div>
+
+                              {orderDetail.bizInfo?.bizMusicCount && (
+                                <span class={styles.songLength}>
+                                  共{orderDetail.bizInfo?.bizMusicCount}首
+                                </span>
+                              )}
+                            </div>
+                          )
+                        }}
+                      />
+                    ))}
+
+                  <div class={styles.paymentPrice}>
+                    {['PAYING', 'WAIT_PAY'].includes(item.status)
+                      ? '需付款'
+                      : '实付款'}
+                    <span>
+                      <i>¥</i>
+                      {moneyFormat(item.actualPrice)}
+                    </span>
+                  </div>
+                  {item.status === 'PAYING' || item.status === 'WAIT_PAY' ? (
+                    <div class={styles.btnList}>
+                      <Button
+                        size="small"
+                        round
+                        onClick={(e: any) => {
+                          e.stopPropagation()
+                          onCancelPay(item)
+                        }}
+                      >
+                        取消订单
+                      </Button>
+                      <Button
+                        size="small"
+                        round
+                        type="primary"
+                        onClick={(e: any) => {
+                          e.stopPropagation()
+                          onPay(item)
+                        }}
+                      >
+                        继续付款
+                      </Button>
+                    </div>
+                  ) : null}
+                </CellGroup>
+              ))}
+            </List>
+          ) : (
+            <ColResult
+              btnStatus={false}
+              classImgSize="SMALL"
+              tips={state.type === 'buy' ? '暂无购买记录' : '暂无退款记录'}
+            />
+          )}
+        </div>
+
+        <Popup
+          v-model:show={state.timeStatus}
+          position="bottom"
+          round
+          closeOnPopstate
+        >
+          <DatetimePicker
+            type="year-month"
+            v-model={state.currentDate}
+            formatter={formatterDate}
+            onCancel={() => {
+              state.timeStatus = false
+            }}
+            onConfirm={onConfirm}
+          />
+        </Popup>
+      </>
+    )
+  }
+})

+ 65 - 0
src/tenant/trade/list/index.module.less

@@ -0,0 +1,65 @@
+.tradeList {
+  .searchTime,
+  .searchType {
+    color: #1a1a1a;
+    font-size: 14px;
+  }
+  :global {
+    .iconfont-down {
+      margin-left: 4px;
+      // transform: scale(0.8);
+    }
+
+    .van-cell-group {
+      overflow: hidden;
+      border-radius: 10px;
+      margin-bottom: 12px;
+    }
+  }
+
+  .list {
+    padding: 0 14px;
+  }
+
+  .tradeLogo {
+    width: 35px;
+    height: 35px;
+    border-radius: 50%;
+    margin-right: 10px;
+    overflow: hidden;
+  }
+
+  .tradeType {
+    color: var(--van-primary);
+  }
+
+  .title,
+  .content {
+    padding-top: 1px;
+    display: flex;
+    justify-content: space-between;
+    flex-direction: column;
+    line-height: 18px;
+    color: #333333;
+    font-size: 14px;
+  }
+  .desc,
+  .num {
+    padding-top: 3px;
+    font-size: 13px;
+    color: #999999;
+  }
+}
+
+.btnList {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  padding-bottom: var(--van-cell-vertical-padding);
+  padding-right: var(--van-cell-horizontal-padding);
+  :global {
+    .van-button + .van-button {
+      margin-left: 10px;
+    }
+  }
+}

+ 336 - 0
src/tenant/trade/list/index.tsx

@@ -0,0 +1,336 @@
+import { defineComponent, PropType } from 'vue'
+import styles from './index.module.less'
+import {
+  ActionSheet,
+  Cell,
+  CellGroup,
+  DatetimePicker,
+  Icon,
+  Popup,
+  Sticky,
+  Image,
+  List,
+  Button,
+  Dialog,
+  Toast
+} from 'vant'
+import { formatterDate } from '@/helpers/utils'
+import { goodsType, orderType, returnType } from '@/constant'
+
+import iconTeacher from '@common/images/icon_teacher.png'
+import request from '@/helpers/request'
+import dayjs from 'dayjs'
+import ColResult from '@/components/col-result'
+import { orderStatus } from '@/views/order-detail/orderStatus'
+import { tradeOrder } from '../tradeOrder'
+
+export default defineComponent({
+  name: 'list',
+  props: {
+    type: {
+      type: String as PropType<'buy' | 'refund'>,
+      default: 'buy'
+    },
+    height: {
+      type: Number,
+      default: 44
+    }
+  },
+  data() {
+    return {
+      timeStatus: false,
+      currentDate: new Date(),
+      typeStatus: false,
+      // 订单状态 WAIT_PAY 待支付 PAYING 支付中 PAID 已付款 CLOSE 已关闭 FAIL 支付失败 (多选用,分割)
+      actions: [
+        { name: '全部' },
+        { name: '待支付', status: 'WAIT_PAY' },
+        { name: '支付中', status: 'PAYING' },
+        { name: '已付款', status: 'PAID' },
+        { name: '已关闭', status: 'CLOSE' },
+        { name: '支付失败', status: 'FAIL' }
+      ],
+      list: [],
+      dataShow: true, // 判断是否有数据
+      loading: false,
+      finished: false,
+      searchName: '全部',
+      params: {
+        status: '',
+        page: 1,
+        rows: 20
+      }
+    }
+  },
+  methods: {
+    async getList() {
+      if (this.loading) return
+      this.loading = true
+      try {
+        const params = {
+          ...this.params,
+          searchDate: dayjs(this.currentDate).format('YYYY-MM')
+        }
+
+        const url =
+          this.type === 'buy'
+            ? '/api-student/userOrder/page'
+            : '/api-student/userOrderRefunds/page'
+        const { code, data } = await request.post(url, {
+          data: {
+            ...params,
+            dateTime: this.type === 'refund' ? params.searchDate : undefined,
+            timeType: this.type === 'refund' ? 'MONTH' : undefined
+          }
+        })
+        if (code === 200) {
+          const result = data || {}
+          this.list = this.list.concat(result.rows || [])
+          this.finished = result.pageNo >= result.totalPage
+          this.params.page = result.pageNo + 1
+          this.dataShow = this.list.length > 0
+        }
+      } catch {
+        this.dataShow = false
+        this.finished = true
+      }
+      this.loading = false
+    },
+    onDetail(item: any) {
+      if (this.type === 'refund') return
+      this.$router.push({
+        path: '/tradeDetail',
+        query: {
+          orderNo: item.orderNo,
+          path: 'tradeRecord'
+        }
+      })
+    },
+    onConfirm(date: Date) {
+      this.currentDate = date
+      this.timeStatus = false
+      this.onSearch()
+    },
+    onSelect(item: any) {
+      this.params.status = item.status
+      this.searchName = item.name
+      this.onSearch()
+    },
+    onSearch() {
+      this.dataShow = true
+      this.loading = false
+      this.finished = false
+      this.list = []
+      this.params.page = 1
+      this.getList()
+    },
+    async onCancelPay(item: any) {
+      // orderPay: {
+      //   cancelUrl: '/api-student/userOrder/orderCancel',
+      //   payUrl: '/api-student/userOrder/orderPay'
+      // }
+      Dialog.confirm({
+        message: '是否取消订单?',
+        confirmButtonText: '确定',
+        confirmButtonColor: 'var(--van-primary)',
+        cancelButtonText: '取消'
+      }).then(async () => {
+        try {
+          await request.post('/api-student/userOrder/orderCancel', {
+            data: {
+              orderNo: item.orderNo
+            }
+          })
+          // Toast('取消成功')
+          this.onSearch()
+        } catch {}
+      })
+    },
+    async onPay(item: any) {
+      try {
+        const res = await request.get(
+          `/api-student/userOrder/detailByOrderNo/${item.orderNo}`
+        )
+        const result = res.data
+        tradeOrder(result, () => {
+          this.$router.push({
+            path: '/orderDetail',
+            query: {
+              orderType: result.orderType
+            }
+          })
+        })
+      } catch {}
+    }
+  },
+  render() {
+    return (
+      <div class={styles.tradeList}>
+        <Sticky position="top" offsetTop={this.height}>
+          <Cell
+            center
+            style={{ backgroundColor: '#F7F8F9' }}
+            v-slots={{
+              title: () => (
+                <div
+                  class={styles.searchTime}
+                  onClick={() => {
+                    this.timeStatus = true
+                  }}
+                >
+                  <span>
+                    {(this as any).$filters.dateFormat(
+                      this.currentDate,
+                      'YYYY-MM'
+                    )}
+                  </span>
+                  <Icon
+                    classPrefix="iconfont"
+                    name="down"
+                    size={12}
+                    color="var(--van-primary)"
+                  />
+                </div>
+              ),
+              value: () => {
+                if (this.type === 'buy') {
+                  return (
+                    <div
+                      class={styles.searchType}
+                      onClick={() => {
+                        this.typeStatus = true
+                      }}
+                    >
+                      <span>{this.searchName}</span>
+                      <Icon
+                        classPrefix="iconfont"
+                        name="down"
+                        size={12}
+                        color="var(--van-primary)"
+                      />
+                    </div>
+                  )
+                }
+                return null
+              }
+            }}
+          ></Cell>
+        </Sticky>
+        {this.dataShow ? (
+          <List
+            loading={this.loading}
+            finished={this.finished}
+            finishedText=" "
+            class={[styles.list]}
+            onLoad={this.getList}
+          >
+            {this.list.map((item: any) => (
+              <CellGroup
+                border={false}
+                onClick={() => {
+                  this.onDetail(item)
+                }}
+              >
+                <Cell
+                  title={dayjs(item.createTime).format('YYYY-MM-DD HH:mm')}
+                  value={
+                    this.type === 'buy'
+                      ? orderType[item.status]
+                      : item.operateReason
+                  }
+                  valueClass={styles.tradeType}
+                />
+                <Cell
+                  border={false}
+                  v-slots={{
+                    title: () => (
+                      <div class={styles.title}>
+                        <span>{item.orderName}</span>
+                        <span class={styles.desc}>
+                          {goodsType[item.orderType]}
+                        </span>
+                      </div>
+                    ),
+                    default: () => (
+                      <div class={styles.content}>
+                        <span class={styles.price}>
+                          ¥
+                          {this.type === 'buy'
+                            ? (this as any).$filters.moneyFormat(
+                                item.actualPrice
+                              )
+                            : (this as any).$filters.moneyFormat(
+                                item.actualAmount
+                              )}
+                        </span>
+                      </div>
+                    )
+                  }}
+                />
+                {item.status === 'PAYING' || item.status === 'WAIT_PAY' ? (
+                  <div class={styles.btnList}>
+                    <Button
+                      size="small"
+                      round
+                      onClick={(e: any) => {
+                        e.stopPropagation()
+                        this.onCancelPay(item)
+                      }}
+                    >
+                      取消订单
+                    </Button>
+                    <Button
+                      size="small"
+                      round
+                      type="primary"
+                      onClick={(e: any) => {
+                        e.stopPropagation()
+                        this.onPay(item)
+                      }}
+                    >
+                      继续支付
+                    </Button>
+                  </div>
+                ) : null}
+              </CellGroup>
+            ))}
+          </List>
+        ) : (
+          <ColResult
+            btnStatus={false}
+            classImgSize="SMALL"
+            tips={this.type === 'buy' ? '暂无购买记录' : '暂无退款记录'}
+          />
+        )}
+
+        <Popup
+          v-model:show={this.timeStatus}
+          position="bottom"
+          round
+          closeOnPopstate
+        >
+          <DatetimePicker
+            type="year-month"
+            v-model={this.currentDate}
+            formatter={formatterDate}
+            onCancel={() => {
+              this.timeStatus = false
+            }}
+            onConfirm={this.onConfirm}
+          />
+        </Popup>
+
+        <ActionSheet
+          v-model:show={this.typeStatus}
+          actions={this.actions}
+          closeOnClickAction
+          cancelText="取消"
+          onSelect={this.onSelect}
+          onCancel={() => {
+            this.typeStatus = false
+          }}
+        />
+      </div>
+    )
+  }
+})

+ 299 - 0
src/tenant/trade/tradeOrder.ts

@@ -0,0 +1,299 @@
+import { memberType } from '@/constant'
+import request from '@/helpers/request'
+import { state } from '@/state'
+import { orderStatus } from '@/views/order-detail/orderStatus'
+import dayjs from 'dayjs'
+
+const apiSuffix =
+  state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'
+// LIVE: '直播课',
+// PRACTICE: '陪练课',
+// VIDEO: '视频课',
+// VIP: '开通会员',
+// MUSIC: '单曲点播'
+interface IAmount {
+  couponAmount: number
+  discountPrice: number
+}
+export const formatOrderDetail = async (item: any, amount?: IAmount) => {
+  const type = item.goodType
+  let tempList: any = {}
+
+  switch (type) {
+    case 'LIVE':
+      {
+        try {
+          const live = await getLiveDetail(item.bizId)
+          const courseInfo: any[] = []
+          const coursePlanList = live.planList || []
+          coursePlanList.forEach((item: any) => {
+            const startTime = item.startTime || new Date()
+            const endTime = item.endTime || new Date()
+            courseInfo.push({
+              courseTime: `${dayjs(startTime).format('YYYY-MM-DD')} ${dayjs(
+                startTime
+              ).format('HH:mm')}~${dayjs(endTime).format('HH:mm')}`,
+              coursePlan: item.plan,
+              id: item.courseId
+            })
+          })
+          tempList = {
+            orderType: item.goodType,
+            goodName: item.goodName,
+            courseGroupId: live.courseGroupId,
+            courseGroupName: live.courseGroupName,
+            coursePrice: live.coursePrice,
+            teacherName: live.userName || `游客${live.teacherId || ''}`,
+            teacherId: live.teacherId,
+            avatar: live.avatar,
+            courseInfo
+          }
+        } catch (e: any) {
+          throw new Error(e.message)
+        }
+      }
+      break
+    case 'PRACTICE': {
+      const bizContent: any = JSON.parse(item.bizContent)
+      tempList = {
+        ...bizContent,
+        teacherName: item.username,
+        starGrade: item.starGrade,
+        avatar: item.avatar
+      }
+      break
+    }
+    case 'VIDEO': {
+      try {
+        const res = await getVideoDetail(item.bizId)
+        const { lessonGroup, detailList } = res
+        tempList = {
+          orderType: item.goodType,
+          goodName: item.goodName,
+          courseGroupId: lessonGroup.id,
+          courseGroupName: lessonGroup.lessonName,
+          coursePrice: lessonGroup.lessonPrice,
+          teacherName: lessonGroup.username,
+          teacherId: lessonGroup.teacherId,
+          avatar: lessonGroup.avatar,
+          courseInfo: detailList
+        }
+      } catch (e: any) {
+        throw new Error(e.message)
+      }
+      break
+    }
+    case 'VIP':
+      {
+        try {
+          const res = await getVipDetail(item.id)
+          tempList = {
+            orderType: item.goodType,
+            goodName: item.goodName,
+            id: item.id,
+            title: memberType[res.period] || '',
+            // 判断是否有优惠金额
+            price: amount?.couponAmount
+              ? Number(
+                  (
+                    res.salePrice -
+                    amount.couponAmount +
+                    amount.discountPrice
+                  ).toFixed(2)
+                )
+              : res.salePrice || item.actualPrice,
+            startTime: dayjs(res.startTime).format('YYYY-MM-DD'),
+            endTime: dayjs(res.endTime).format('YYYY-MM-DD')
+          }
+        } catch (e: any) {
+          throw new Error(e.message)
+        }
+      }
+      break
+    case 'MUSIC':
+      {
+        try {
+          const res = await getMusicDetail(item.bizId)
+          tempList = {
+            orderType: item.goodType,
+            goodName: item.goodName,
+            ...res
+          }
+        } catch (e: any) {
+          throw new Error(e.message)
+        }
+      }
+      break
+    case 'ALBUM':
+      {
+        try {
+          const res = await getAlbumDetail(item.bizId)
+          tempList = {
+            orderType: item.goodType,
+            goodName: item.goodName,
+            ...res
+          }
+        } catch (e: any) {
+          throw new Error(e.message)
+        }
+      }
+      break
+    case 'TENANT_ALBUM':
+      {
+        try {
+          const res = await getTenantAlbumDetail(item.bizId)
+          tempList = {
+            orderType: item.goodType,
+            goodName: item.goodName,
+            ...res
+          }
+        } catch (e: any) {
+          throw new Error(e.message)
+        }
+      }
+      break
+    case 'ACTI_REGIST':
+      {
+        try {
+          const res = await getMusicActiveTrack(item.bizId)
+          tempList = {
+            orderType: item.goodType,
+            goodsName: res.activityName,
+            activityId: res.id,
+            actualPrice: res.registrationPrice
+          }
+        } catch (e: any) {
+          throw new Error(e.message)
+        }
+      }
+      break
+  }
+  tempList.orderType = type
+  tempList.goodName = item.goodName
+  orderStatus.orderObject.orderList.push(tempList)
+}
+// 获取视频课详情
+export const getVideoDetail = async (groupId: any) => {
+  try {
+    const res = await request.get(
+      `${apiSuffix}/videoLesson/selectVideoLesson`,
+      {
+        params: {
+          groupId
+        }
+      }
+    )
+    return res.data
+  } catch {
+    throw new Error('获取视频课详情失败')
+  }
+}
+
+// 获取直播课详情
+export const getLiveDetail = async (groupId: any) => {
+  try {
+    const res = await request.get(
+      `${apiSuffix}/courseGroup/queryLiveCourseInfo`,
+      {
+        params: {
+          groupId
+        }
+      }
+    )
+    return res.data
+  } catch {
+    throw new Error('获取直播课详情失败')
+  }
+}
+
+// 获取会员详情
+export const getVipDetail = async (id: any) => {
+  try {
+    const setting = await request.get(`${apiSuffix}/vipCardRecord/detail/` + id)
+    return setting.data || []
+  } catch {
+    throw new Error('获取会员详情失败')
+  }
+}
+
+// 获取曲目详情
+export const getMusicDetail = async (id: any) => {
+  try {
+    const res = await request.get(`${apiSuffix}/music/sheet/detail/${id}`)
+    return res.data
+  } catch {
+    throw new Error('获取曲目详情失败')
+  }
+}
+
+// 活动列表
+// 获取曲目详情
+export const getMusicActiveTrack = async (id: any) => {
+  try {
+    const res = await request.post(`${apiSuffix}/open/activity/info/${id}`)
+    return res.data
+  } catch {
+    throw new Error('获取曲目详情失败')
+  }
+}
+
+// 获取专辑详情
+export const getAlbumDetail = async (id: any) => {
+  try {
+    const res = await request.post(`${apiSuffix}/music/album/detail`, {
+      data: { id }
+    })
+    return res.data
+  } catch {
+    throw new Error('获取专辑详情失败')
+  }
+}
+
+// 获取机构专辑详情
+export const getTenantAlbumDetail = async (id: any) => {
+  try {
+    const res = await request.post(
+      `${apiSuffix}/userTenantAlbumRecord/detail`,
+      {
+        data: { albumId: id }
+      }
+    )
+    return res.data
+  } catch {
+    throw new Error('获取机构专辑详情失败')
+  }
+}
+
+// 为了处理继续支付逻辑
+export const tradeOrder = (result: any, callBack?: any) => {
+  const {
+    orderNo,
+    actualPrice,
+    orderDesc,
+    orderName,
+    orderType,
+    orderDetailList,
+    couponAmount, // 优惠金额
+    discountPrice,
+    paymentConfig // v2 类型的订单才会用
+  } = result
+  orderStatus.orderObject.orderType = orderType
+  orderStatus.orderObject.orderName = orderName
+  orderStatus.orderObject.orderDesc = orderDesc
+  orderStatus.orderObject.actualPrice = actualPrice
+  orderStatus.orderObject.orderNo = orderNo
+  orderStatus.orderObject.discountPrice = discountPrice
+  orderStatus.orderObject.orderList = []
+  orderStatus.orderObject.paymentConfig = paymentConfig
+  try {
+    orderDetailList.forEach(async (item: any) => {
+      await formatOrderDetail(item, {
+        couponAmount,
+        discountPrice
+      })
+    })
+    callBack && callBack()
+  } catch {
+    //
+  }
+}

+ 34 - 32
src/views/404/index.tsx

@@ -1,32 +1,34 @@
-import { defineComponent } from 'vue'
-import styles from './index.module.less'
-import img404 from '@/common/images/404.png'
-import { Button, Image } from 'vant'
-import { postMessage } from '@/helpers/native-message'
-import { browser } from '@/helpers/utils'
-
-export default defineComponent({
-  name: 'NotFound',
-  render() {
-    return (
-      <div class={styles.f404}>
-        <Image src={img404} />
-        <p>页面找不到了</p>
-        <Button
-          type="primary"
-          plain
-          round
-          onClick={() => {
-            if (browser().isApp) {
-              postMessage({ api: 'back' })
-            } else {
-              this.$router.back()
-            }
-          }}
-        >
-          返回
-        </Button>
-      </div>
-    )
-  }
-})
+import { defineComponent } from 'vue'
+import styles from './index.module.less'
+import img404 from '@/common/images/404.png'
+import img404Tenant from '@/components/col-result/images/notFond_tenant.png'
+import { Button, Image } from 'vant'
+import { postMessage } from '@/helpers/native-message'
+import { browser } from '@/helpers/utils'
+import { state } from '@/state'
+
+export default defineComponent({
+  name: 'NotFound',
+  render() {
+    return (
+      <div class={styles.f404}>
+        <Image src={state.projectType === 'tenant' ? img404Tenant : img404} />
+        <p>页面找不到了</p>
+        <Button
+          type="primary"
+          plain
+          round
+          onClick={() => {
+            if (browser().isApp) {
+              postMessage({ api: 'back' })
+            } else {
+              this.$router.back()
+            }
+          }}
+        >
+          返回
+        </Button>
+      </div>
+    )
+  }
+})

+ 17 - 41
src/views/order-detail/index.tsx

@@ -19,7 +19,12 @@ import Payment from './payment'
 import UrlPayment from '../adapay/payment'
 import ColHeader from '@/components/col-header'
 import { state } from '@/state'
-import { orderInfos, orderStatus, resestState } from './orderStatus'
+import {
+  orderInfos,
+  orderStatus,
+  orderTenantInfos,
+  resestState
+} from './orderStatus'
 import OrderVideo from './order-video'
 import OrderLive from './order-live'
 import OrderPractice from './order-practice'
@@ -54,7 +59,7 @@ export default defineComponent({
       exists: false, // 是否签署过用户注册协议
       bottomHeight: 0,
       paymentVendor: '', //支付厂商
-      paymentVersion: '', // 支付版本,可用值:V1 老版,V2 新版
+      paymentVersion: 'V1', // 支付版本,可用值:V1 老版,V2 新版
       showQrcode: false,
       orderTimer: null as any,
       qrCodeUrl: '',
@@ -150,8 +155,14 @@ export default defineComponent({
     async getOrderPayType() {
       try {
         const orderObject = orderStatus.orderObject
-        const bizId =
+        let bizId =
           orderObject.orderList.length > 0 ? orderObject.orderList[0].id : ''
+        if (orderObject.orderType === 'PRACTICE') {
+          bizId =
+            orderObject.orderList.length > 0
+              ? orderObject.orderList[0].teacherId
+              : ''
+        }
         const { data } = await request.post(
           state.platformApi + '/userOrder/orderPayType',
           {
@@ -193,6 +204,8 @@ export default defineComponent({
       // 判断是否有订单号
       if (orderStatus.orderObject.orderNo) {
         this.paymentStatus = true
+        this.orderInfo = orderStatus.orderObject.paymentConfig || {}
+        this.orderNo = orderStatus.orderObject.paymentConfig.orderNo
         return
       }
 
@@ -236,50 +249,13 @@ export default defineComponent({
             state.platformType === 'TEACHER'
               ? '/api-teacher/userOrder/executeOrder/v2'
               : '/api-student/userOrder/executeOrder/v2'
-          const orders: any = []
-          this.orderList.forEach((item: any) => {
-            const params: any = {
-              goodType: item.orderType,
-              goodName: item.goodsName,
-              goodNum: 1,
-              bizContent: {}
-            }
-            if (item.orderType === 'VIP') {
-              params.bizContent = item.id
-            } else if (item.orderType === 'MUSIC') {
-              params.bizContent = {
-                musicSheetId: item.id,
-                actualPrice: item.actualPrice || 0,
-                clientType: state.platformType
-              }
-            } else if (item.orderType === 'ALBUM') {
-              params.bizContent = {
-                musicSheetId: item.id,
-                actualPrice: item.actualPrice || 0,
-                clientType: state.platformType
-              }
-            } else if (item.orderType === 'TENANT_ALBUM') {
-              params.bizContent = {
-                tenantAlbumId: item.id,
-                actualPrice: item.actualPrice || 0,
-                buyNumber: 1,
-                buyMultiple: item.purchaseCycle / 6,
-                clientType: state.platformType
-              }
-              params.bizId = item.id
-              params.buyNumber = 1
-              params.buyMultiple = item.purchaseCycle / 6
-            }
-            orders.push(params)
-          })
-
           const res = await request.post(url, {
             data: {
               activityId: orderObject.activityId || null,
               // bizId: '',
               couponIds: orderObject.couponId,
               // currentPrice: 0,
-              goodsInfos: [...orders],
+              goodsInfos: [...orderTenantInfos()],
               orderDesc: orderObject.orderDesc,
               orderName: orderObject.orderName,
               orderType: orderObject.orderType,

+ 41 - 1
src/views/order-detail/orderStatus.ts

@@ -37,7 +37,7 @@ const original = () => {
       activityId: '' as any, // 活动编号
       couponId: '' as string, // 优惠券编号
       discountPrice: 0 as number // 优惠
-    }
+    } as any
     // orderObject: {
     //   orderNo: '',
     //   actualPrice: 28,
@@ -138,6 +138,46 @@ export const orderInfos = () => {
   })
 }
 
+export const orderTenantInfos = () => {
+  // 商品列表
+  const orderList = orderStatus.orderObject.orderList || []
+  return orderList.map((item: any) => {
+    const params: any = {
+      goodType: item.orderType,
+      goodName: item.goodsName,
+      goodNum: 1,
+      bizContent: {}
+    }
+    if (item.orderType === 'VIP') {
+      params.bizContent = item.id
+    } else if (item.orderType === 'MUSIC') {
+      params.bizContent = {
+        musicSheetId: item.id,
+        actualPrice: item.actualPrice || 0,
+        clientType: state.platformType
+      }
+    } else if (item.orderType === 'ALBUM') {
+      params.bizContent = {
+        musicSheetId: item.id,
+        actualPrice: item.actualPrice || 0,
+        clientType: state.platformType
+      }
+    } else if (item.orderType === 'TENANT_ALBUM') {
+      params.bizContent = {
+        tenantAlbumId: item.id,
+        actualPrice: item.actualPrice || 0,
+        buyNumber: 1,
+        buyMultiple: item.purchaseCycle / 6,
+        clientType: state.platformType
+      }
+      params.bizId = item.id
+      params.buyNumber = 1
+      params.buyMultiple = item.purchaseCycle / 6
+    }
+    return params
+  })
+}
+
 /**
  * @title 0元购买
  * @param {function} callBack 回调函数

BIN
src/views/tenantStudentRejest/images/studentSuccess.png


+ 126 - 0
src/views/tenantStudentRejest/index.module.less

@@ -189,3 +189,129 @@
   margin-left: -151px;
   margin-top: 24px;
 }
+
+.showWrap {
+  width: 264px;
+  height: 326px;
+  position: absolute;
+  top: 212px;
+  left: 50%;
+  margin-left: -132px;
+  background-color: #fff;
+  z-index: 1001;
+  box-shadow: 1px 1px 9px 0px rgba(149, 145, 145, 0.07);
+  border-radius: 12px 12px;
+  position: relative;
+  .showWrapTop {
+    width: 264px;
+    height: 130px;
+    position: relative;
+    top: -23px;
+  }
+  h2 {
+    margin-top: 3px;
+    height: 25px;
+    font-size: 18px;
+    font-weight: 500;
+    color: #333333;
+    line-height: 25px;
+    text-align: center;
+    margin-bottom: 11px;
+  }
+  h4 {
+    font-size: 15px;
+    font-weight: 500;
+    color: #333333;
+    text-align: center;
+    margin-bottom: 11px;
+    span {
+      color: #fe2451;
+      font-weight: bold;
+    }
+  }
+  p {
+    font-size: 14px;
+    font-weight: 400;
+    color: #777777;
+    line-height: 20px;
+    text-align: center;
+    margin-bottom: 22px;
+  }
+  .downApp {
+    width: 200px;
+    height: 40px;
+    background: #fe2451;
+    border-radius: 39px;
+    font-size: 18px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #ffffff;
+    text-align: center;
+    line-height: 40px;
+    position: relative;
+    left: 50%;
+    margin-left: -100px;
+  }
+}
+.secondWrap {
+  width: 294px;
+  height: 182px;
+  background: #ffffff;
+  border-radius: 12px;
+  padding: 15px 21px 21px;
+  h2 {
+    height: 24px;
+    font-size: 17px;
+    font-weight: 600;
+    color: #333333;
+    line-height: 24px;
+    margin-bottom: 10px;
+    text-align: center;
+  }
+  p {
+    font-size: 15px;
+    font-weight: 400;
+    color: #666666;
+    line-height: 24px;
+    text-align: center;
+    margin-bottom: 3px;
+    span {
+      color: #fe2451;
+      font-weight: bold;
+    }
+  }
+  .buttonWrap {
+    margin-top: 24px;
+    box-sizing: border-box;
+    width: 100%;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: center;
+    .closeBtn {
+      width: 120px;
+      height: 40px;
+      background: #ffffff;
+      border-radius: 20px;
+      border: 1px solid #dbdbdb;
+      line-height: 40px;
+      font-size: 14px;
+      font-weight: 400;
+      color: #333333;
+      text-align: center;
+      margin-right: 12px;
+    }
+    .submitBtn {
+      width: 120px;
+      height: 40px;
+      background: #fe2451;
+      border-radius: 20px;
+      border: 1px solid #dbdbdb;
+      line-height: 40px;
+      font-size: 14px;
+      font-weight: 400;
+      color: #fff;
+      text-align: center;
+    }
+  }
+}

+ 111 - 13
src/views/tenantStudentRejest/index.tsx

@@ -1,6 +1,6 @@
 import ColHeader from '@/components/col-header'
 import ColSearch from '@/components/col-search'
-import { Sticky, Image, List, Popup, Icon, Area, Field, Form, CellGroup, Button, Toast, Picker, DatetimePicker  } from 'vant'
+import { Sticky, Image, List, Popup, Icon, Area, Field, Form, CellGroup, Button, Toast, Picker, DatetimePicker,Overlay,Dialog } from 'vant'
 import { defineComponent, onMounted, reactive } from 'vue'
 import styles from './index.module.less'
 import bg from './images/bg.png'
@@ -12,6 +12,7 @@ import studentText from './images/studentText.png'
 import { useRoute } from 'vue-router'
 import icon_arrow from './images/icon_arrow.png'
 import rejectBtn from './images/rejectBtn.png'
+import studentSuccess from './images/studentSuccess.png'
 import request from '@/helpers/request'
 import dayjs from 'dayjs'
 export default defineComponent({
@@ -23,14 +24,16 @@ export default defineComponent({
       name: '',
       phone: '',
       subjectId: '',
-      tenantId: '',
+      subjectName:'',
       birthdate: '',
       code: '',
-      genderName:''
+      genderName:'',
+      tenantId:route.query.tenantId,
     });
 
     const data = reactive({
-      schoolName: route.query.schoolName || '',
+      schoolName: route.query.name || '',
+      id:route.query.tenantId,
       cityName: '', // 所属城市
       showArea: false,
       checked: true,
@@ -43,9 +46,11 @@ export default defineComponent({
       openStatus: false,
       dateState: false,
       genderState:false,
-      genderList:[{text:'男',value:'1'},{text:'女',value:'0'}]
+      genderList:[{text:'男',value:'1'},{text:'女',value:'0'}],
+      showSuccess:false,
+      secondConfirm:false,
     });
-    const handleSubmit = () => {
+    const handleSubmit = async() => {
       console.log(forms, 'forms')
       if (!forms.name) {
         Toast('请输入姓名')
@@ -65,22 +70,44 @@ export default defineComponent({
       if (!forms.subjectId) {
         Toast('请选择声部')
       }
+
+        const res = await request.post('/api-tenant/open/student/save',{ data: { ... forms}})
+        console.log(res)
+      if(res.code == 200){
+        data.showSuccess = true
+      }
+
+      if(res.code == 5004){
+        data.secondConfirm = true
+      }
+
+
+
+
     }
     const getSubjectList = async () => {
       try {
-        const res = await request.get('/api-student/open/subject/subjectSelect')
-        data.subjectList = res.data || []
+        const res = await request.get('/api-tenant/open/subject/queryPage',{ data: { page: 1, rows: 9999 }})
+        data.subjectList = res.data.rows.map((item:any)=>{
+          return {
+            text:item.name,
+            value:item.id
+          }
+        }) || []
       } catch (e) {
         console.log(e)
       }
     }
     const confirmSubject = (val: any) => {
+      forms.subjectName = val.text;
+      forms.subjectId = val.value;
+      data.searchStatus = false
       console.log(val, 'confirmSubject')
     }
 
     const confirmDate = (val:any)=>{
       forms.birthdate = dayjs(val).format('YYYY-MM-DD')
-     data.genderState = false
+     data.dateState = false
     }
     onMounted(() => {
       getSubjectList()
@@ -96,7 +123,7 @@ export default defineComponent({
       data.genderState = false
     }
     /** 发送验证码 */
-    const onSendSms = () => {
+    const onSendSms = async () => {
       if (!forms.phone) {
         Toast('请输入手机号码');
         return;
@@ -105,8 +132,49 @@ export default defineComponent({
         Toast('手机号码格式不正确');
         return;
       }
-      data.imgCodeStatus = true;
+      await request.post('/api-student/code/sendSmsCode', {
+        requestType: 'form',
+        data: {
+          mobile: forms.phone,
+          type: 'LOGIN'
+        }
+      })
+      onCountDown()
+      setTimeout(() => {
+        Toast('验证码已发送')
+      }, 100)
     };
+
+    const onCountDown = ()=>{
+        data.sendMsg='60s'
+        let count = 60;
+        const timer = setInterval(() => {
+          count--;
+          data.sendMsg= `${count}s`
+          if (count <= 0) {
+           data.sendMsg='获取验证码'
+            clearInterval(timer);
+          }
+        }, 1000);
+
+    }
+
+    const downApp = ()=>{
+      window.open(location.origin + '/student/#/download')
+      data.showSuccess = false
+    }
+
+    const submitSecond = async()=>{
+      try{
+        const res = await request.post('/api-tenant/open/student/save',{ data: { ... forms,updateTenant:true}})
+        data.showSuccess=true
+        data.secondConfirm=false
+
+      }catch(e){
+        console.log(e)
+      }
+
+    }
     return () =>
       <>< div class={styles.videoClass} >
         <ColHeader
@@ -121,7 +189,7 @@ export default defineComponent({
           <img src={bg} class={styles.bgWrap} alt="" />
           <div class={styles.schoolNameWrap}>
             <img src={rejectSchool} class={styles.rejectSchool} alt="" />
-            <p>武汉星星小学</p>
+            <p>{data.schoolName}</p>
 
           </div>
           <img class={styles.centerLogo} src={centerLogo} alt="" />
@@ -233,7 +301,7 @@ export default defineComponent({
                     label="声部"
                     placeholder="请选择声部"
                     readonly
-                    v-model={data.cityName}
+                    v-model={forms.subjectName}
                     onClick={() => (data.searchStatus = true)}>
                     {{
                       button: () => (
@@ -289,6 +357,36 @@ export default defineComponent({
         >
           <Picker columns={data.genderList} onCancel={() => { data.genderState = false }} onConfirm={confirmGender}></Picker>
         </Popup>
+
+        <Overlay show={data.showSuccess}  z-index={1000}>
+          <div class={styles.showWrap}>
+           <img class={styles.showWrapTop} src={studentSuccess} alt="" />
+           <h2>恭喜您已成功登记为</h2>
+           <h4>{data.schoolName} <span>【学员】</span> </h4>
+           <p>请下载酷乐秀机构版APP进行学习</p>
+           <div class={styles.downApp} onClick={downApp}>立即下载</div>
+          </div>
+        </Overlay>
+
+
+          <Popup
+          show={data.secondConfirm}
+          position="center"
+          round
+          onClose={() => (data.secondConfirm = false)}
+          onClosed={() => (data.secondConfirm = false)}
+        >
+        <div class={styles.secondWrap}>
+          <h2>提示</h2>
+          <p>当前账号已存在 <span>【机构名称】</span> ,是否</p>
+          <p>确认更换到 <span>【机构名称】</span>吗? </p>
+          <div class={styles.buttonWrap}>
+            <div class={styles.closeBtn} onClick={()=>{data.secondConfirm = false}}> 取消</div>
+            <div  class={styles.submitBtn} onClick={submitSecond}>确定</div>
+          </div>
+        </div>
+
+        </Popup>
       </div ></>
 
   }

BIN
src/views/tenantTeacherRejest/images/checkBoxActive.png


BIN
src/views/tenantTeacherRejest/images/checkBoxDefault.png


BIN
src/views/tenantTeacherRejest/images/chioseOk.png


BIN
src/views/tenantTeacherRejest/images/teacherSuccess.png


+ 64 - 0
src/views/tenantTeacherRejest/index.module.less

@@ -189,3 +189,67 @@
   margin-left: -151px;
   margin-top: 24px;
 }
+
+.showWrap {
+  width: 264px;
+  height: 326px;
+  position: absolute;
+  top: 212px;
+  left: 50%;
+  margin-left: -132px;
+  background-color: #fff;
+  z-index: 1001;
+  box-shadow: 1px 1px 9px 0px rgba(149, 145, 145, 0.07);
+  border-radius: 12px 12px;
+  position: relative;
+  .showWrapTop {
+    width: 264px;
+    height: 130px;
+    position: relative;
+    top: -25px;
+  }
+  h2 {
+    margin-top: 3px;
+    height: 25px;
+    font-size: 18px;
+    font-weight: 500;
+    color: #333333;
+    line-height: 25px;
+    text-align: center;
+    margin-bottom: 11px;
+  }
+  h4 {
+    font-size: 15px;
+    font-weight: 500;
+    color: #333333;
+    text-align: center;
+    margin-bottom: 11px;
+    span {
+      color: #fe2451;
+      font-weight: bold;
+    }
+  }
+  p {
+    font-size: 14px;
+    font-weight: 400;
+    color: #777777;
+    line-height: 20px;
+    text-align: center;
+    margin-bottom: 22px;
+  }
+  .downApp {
+    width: 200px;
+    height: 40px;
+    background: #fe2451;
+    border-radius: 39px;
+    font-size: 18px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #ffffff;
+    text-align: center;
+    line-height: 40px;
+    position: relative;
+    left: 50%;
+    margin-left: -100px;
+  }
+}

+ 263 - 141
src/views/tenantTeacherRejest/index.tsx

@@ -1,6 +1,21 @@
 import ColHeader from '@/components/col-header'
 import ColSearch from '@/components/col-search'
-import { Sticky, Image, List, Popup, Icon, Area, Field, Form, CellGroup, Button, Toast, Picker, DatetimePicker } from 'vant'
+import {
+  Sticky,
+  Image,
+  List,
+  Popup,
+  Icon,
+  Area,
+  Field,
+  Form,
+  CellGroup,
+  Button,
+  Toast,
+  Picker,
+  DatetimePicker,
+  Overlay
+} from 'vant'
 import { defineComponent, onMounted, reactive } from 'vue'
 import styles from './index.module.less'
 import bg from './images/teacherBg.png'
@@ -12,25 +27,27 @@ import studentText from './images/studentText.png'
 import { useRoute } from 'vue-router'
 import icon_arrow from './images/icon_arrow.png'
 import rejectBtn from './images/rejectBtn.png'
+import teacherSuccess from './images/teacherSuccess.png'
+import SubjectModel from './modals/chioseSuond'
 import request from '@/helpers/request'
 import dayjs from 'dayjs'
 export default defineComponent({
   name: 'tenantStudentRejest',
   setup() {
-    const route = useRoute();
+    const route = useRoute()
     const forms = reactive({
       idCardNo: '',
       username: '',
       realName: '',
       phone: '',
       subjectId: '',
-      tenantId: '',
+      tenantId: route.query.tenantId,
       birthdate: '',
       code: ''
-    });
+    })
 
     const data = reactive({
-      schoolName: route.query.schoolName || '',
+      schoolName: route.query.name || '',
       cityName: '', // 所属城市
       showArea: false,
       checked: true,
@@ -41,9 +58,13 @@ export default defineComponent({
       subjectList: [],
       searchStatus: false,
       openStatus: false,
-      dateState: false
-    });
-    const handleSubmit = () => {
+      dateState: false,
+      showSuccess: false,
+      // selectedSubjectList: [] as any,
+      choiceSubjectIds: [] as any,
+      choiceSubjectNames: [] as any
+    })
+    const handleSubmit = async () => {
       console.log(forms, 'forms')
       if (!forms.username) {
         Toast('请输入老师昵称')
@@ -60,14 +81,35 @@ export default defineComponent({
       if (!forms.idCardNo) {
         Toast('请输入身份证号')
       }
-      if (!forms.subjectId) {
+      if (data.choiceSubjectIds.length < 1) {
         Toast('请选择声部')
       }
+      try {
+        const res = await request.post('/api-tenant/open/teacher/submit', {
+          data: { ...forms, subjectId: data.choiceSubjectIds.join(',') }
+        })
+        data.showSuccess = true
+      } catch (e) {
+        console.log(e)
+      }
     }
     const getSubjectList = async () => {
       try {
-        const res = await request.get('/api-student/open/subject/subjectSelect')
-        data.subjectList = res.data || []
+        const res = await request.get('/api-tenant/open/subject/queryPage', {
+          data: { page: 1, rows: 9999 }
+        })
+        // const res = await request.post('/api-tenant/open/subject/queryPageTree', { data: { page: 1, rows: 9999 } })
+        data.subjectList = res.data.rows || []
+
+        /**
+         * .map((item: any) => {
+          return {
+            text: item.name,
+            value: item.id
+          }
+        })
+         *
+         */
       } catch (e) {
         console.log(e)
       }
@@ -80,145 +122,193 @@ export default defineComponent({
       forms.birthdate = dayjs(val).format('YYYY-MM-DD')
       data.dateState = false
     }
+
     onMounted(() => {
+      console.log(route.query)
       getSubjectList()
     })
 
     /** 发送验证码 */
-    const onSendSms = () => {
+    const onSendSms = async () => {
       if (!forms.phone) {
-        Toast('请输入手机号码');
-        return;
+        Toast('请输入手机号码')
+        return
       }
       if (!/^1[3456789]\d{9}$/.test(forms.phone)) {
-        Toast('手机号码格式不正确');
-        return;
+        Toast('手机号码格式不正确')
+        return
       }
-      data.imgCodeStatus = true;
-    };
-    return () =>
-      <>< div class={styles.videoClass} >
-        <ColHeader
-          class={styles.classHeader}
-          border={false}
-          isFixed={false}
-          background="#fff"
-        />
-        <div class={styles.resjetStudentWrap}>
-          <img src={rejectLogo} class={styles.rejectLogo} alt="" />
-          <img src={studentText} class={styles.studentText} alt="" />
-          <img src={bg} class={styles.bgWrap} alt="" />
-          <div class={styles.schoolNameWrap}>
-            <img src={rejectSchool} class={styles.rejectSchool} alt="" />
-            <p>武汉星星小学</p>
+      await request.post('/api-student/code/sendSmsCode', {
+        requestType: 'form',
+        data: {
+          mobile: forms.phone,
+          type: 'LOGIN'
+        }
+      })
+      onCountDown()
+      setTimeout(() => {
+        Toast('验证码已发送')
+      }, 100)
+    }
+    const onCountDown = () => {
+      data.sendMsg = '60s'
+      let count = 60
+      const timer = setInterval(() => {
+        count--
+        data.sendMsg = `${count}s`
+        if (count <= 0) {
+          data.sendMsg = '获取验证码'
+          clearInterval(timer)
+        }
+      }, 1000)
+    }
 
-          </div>
-          <img class={styles.centerLogo} src={centerLogo} alt="" />
-          <div class={styles.infoWrap}>
-            <div class={styles.infoWrapCore}>
-              <img src={subTitle} class={styles.subTitle} alt="" />
-
-              <Form onSubmit={() => handleSubmit()}>
-                <CellGroup class={styles.group} border={false}>
-                  <Field
-                    class={styles.noArrow}
-                    inputAlign="right"
-                    label="老师昵称"
-                    placeholder="请输入老师昵称"
-                    maxlength={20}
-                    v-model={forms.username}
-
-                  // onUpdate: modelValue={(val: string) => {
-                  //   forms.nickname = val.trim();
-                  // }}
-                  />
-
-                  <Field
-                    inputAlign="right"
-                    label="手机号"
-                    class={styles.noArrow}
-                    maxlength={11}
-                    placeholder="请输入手机号码"
-                    v-model={forms.phone}
-                  />
-                  <div class={styles.tips}>
-                    手机号码为酷乐秀学院登录账号
-                  </div>
-
-                  <Field
-                    class={styles.inputCode}
-                    inputAlign="left"
-                    label="请输入验证码"
-                    labelWidth={0}
-                    v-model={forms.code}
-                    maxlength={6}>
-                    {{
-                      button: () => (
-                        <Button
-
-                          disabled={data.sendMsg.includes('s')}
-                          class={styles.sendBtn}
-                          onClick={() => onSendSms()}>
-                          {data.sendMsg}
-                        </Button>
-                      )
-                    }}
-                  </Field>
-                  <Field
-                    class={styles.noArrow}
-                    inputAlign="right"
-                    label="真实姓名"
-                    placeholder="请输入真实姓名"
-                    maxlength={20}
-                    v-model={forms.realName}
-
-                  // onUpdate: modelValue={(val: string) => {
-                  //   forms.nickname = val.trim();
-                  // }}
-                  />
-                  <Field
-                    class={styles.noArrow}
-                    inputAlign="right"
-                    label="身份证号"
-                    placeholder="请输入身份证号"
-                    maxlength={20}
-                    v-model={forms.idCardNo}
-
-                  // onUpdate: modelValue={(val: string) => {
-                  //   forms.nickname = val.trim();
-                  // }}
-                  />
-
-
-                  <Field
-                    border={false}
-                    inputAlign="right"
-                    label="声部"
-                    placeholder="请选择声部"
-                    readonly
-                    v-model={data.cityName}
-                    onClick={() => (data.searchStatus = true)}>
-                    {{
-                      button: () => (
-                        <img
-                          style={{
-                            display: 'block',
-                            width: '12px',
-                            height: '12px',
-
-                          }}
-                          src={icon_arrow}
-                        />
-                      )
-                    }}
-                  </Field>
-                </CellGroup>
-              </Form>
+    const downApp = () => {
+      window.open(location.origin + '/student/#/download?type=teacher')
+      data.showSuccess = false
+    }
+
+    const onChoice = (val: any) => {
+      data.searchStatus = false
+      data.choiceSubjectIds = [...val]
+      const chioseSound = [] as any
+      data.subjectList.forEach((item: any) => {
+        if (data.choiceSubjectIds.indexOf(item.id) != -1) {
+          chioseSound.push(item.name)
+        }
+      })
+      data.choiceSubjectNames = [...chioseSound]
+      // data.choiceSubjectNames =
+    }
+
+    return () => (
+      <>
+        <div class={styles.videoClass}>
+          <ColHeader
+            class={styles.classHeader}
+            border={false}
+            isFixed={false}
+            background="#fff"
+          />
+          <div class={styles.resjetStudentWrap}>
+            <img src={rejectLogo} class={styles.rejectLogo} alt="" />
+            <img src={studentText} class={styles.studentText} alt="" />
+            <img src={bg} class={styles.bgWrap} alt="" />
+            <div class={styles.schoolNameWrap}>
+              <img src={rejectSchool} class={styles.rejectSchool} alt="" />
+              <p>{data.schoolName}</p>
+            </div>
+            <img class={styles.centerLogo} src={centerLogo} alt="" />
+            <div class={styles.infoWrap}>
+              <div class={styles.infoWrapCore}>
+                <img src={subTitle} class={styles.subTitle} alt="" />
+
+                <Form onSubmit={() => handleSubmit()}>
+                  <CellGroup class={styles.group} border={false}>
+                    <Field
+                      class={styles.noArrow}
+                      inputAlign="right"
+                      label="老师昵称"
+                      placeholder="请输入老师昵称"
+                      maxlength={20}
+                      v-model={forms.username}
+
+                      // onUpdate: modelValue={(val: string) => {
+                      //   forms.nickname = val.trim();
+                      // }}
+                    />
+
+                    <Field
+                      inputAlign="right"
+                      label="手机号"
+                      class={styles.noArrow}
+                      maxlength={11}
+                      placeholder="请输入手机号码"
+                      v-model={forms.phone}
+                    />
+                    <div class={styles.tips}>手机号码为酷乐秀学院登录账号</div>
+
+                    <Field
+                      class={styles.inputCode}
+                      inputAlign="left"
+                      label="请输入验证码"
+                      labelWidth={0}
+                      v-model={forms.code}
+                      maxlength={6}
+                    >
+                      {{
+                        button: () => (
+                          <Button
+                            disabled={data.sendMsg.includes('s')}
+                            class={styles.sendBtn}
+                            onClick={() => onSendSms()}
+                          >
+                            {data.sendMsg}
+                          </Button>
+                        )
+                      }}
+                    </Field>
+                    <Field
+                      class={styles.noArrow}
+                      inputAlign="right"
+                      label="真实姓名"
+                      placeholder="请输入真实姓名"
+                      maxlength={20}
+                      v-model={forms.realName}
+
+                      // onUpdate: modelValue={(val: string) => {
+                      //   forms.nickname = val.trim();
+                      // }}
+                    />
+                    <Field
+                      class={styles.noArrow}
+                      inputAlign="right"
+                      label="身份证号"
+                      placeholder="请输入身份证号"
+                      maxlength={20}
+                      v-model={forms.idCardNo}
+
+                      // onUpdate: modelValue={(val: string) => {
+                      //   forms.nickname = val.trim();
+                      // }}
+                    />
+
+                    <Field
+                      border={false}
+                      inputAlign="right"
+                      label="声部"
+                      placeholder="请选择声部"
+                      readonly
+                      v-model={data.choiceSubjectNames}
+                      onClick={() => (data.searchStatus = true)}
+                    >
+                      {{
+                        button: () => (
+                          <img
+                            style={{
+                              display: 'block',
+                              width: '12px',
+                              height: '12px'
+                            }}
+                            src={icon_arrow}
+                          />
+                        )
+                      }}
+                    </Field>
+                  </CellGroup>
+                </Form>
+              </div>
+              <img
+                src={rejectBtn}
+                onClick={() => {
+                  handleSubmit()
+                }}
+                class={styles.rejectBtn}
+                alt=""
+              />
             </div>
-            <img src={rejectBtn} onClick={() => { handleSubmit() }} class={styles.rejectBtn} alt="" />
           </div>
-        </div>
-        <Popup
+          {/* <Popup
           show={data.searchStatus}
           position="bottom"
           round
@@ -228,9 +318,41 @@ export default defineComponent({
           onClosed={() => (data.openStatus = false)}
         >
           <Picker columns={data.subjectList} onCancel={() => { data.searchStatus = false }} onConfirm={confirmSubject}></Picker>
-        </Popup>
-      </div ></>
+        </Popup> */}
 
-  }
+          <Popup
+            show={data.searchStatus}
+            round
+            closeable
+            position="bottom"
+            style={{ height: '60%' }}
+            teleport="body"
+            onUpdate:show={val => (data.searchStatus = val)}
+          >
+            <SubjectModel
+              subjectList={data.subjectList}
+              choiceSubjectIds={data.choiceSubjectIds}
+              onChoice={onChoice}
+              single={true}
+              selectType="Checkbox"
+            />
+          </Popup>
+        </div>
 
+        <Overlay show={data.showSuccess} z-index={1000}>
+          <div class={styles.showWrap}>
+            <img class={styles.showWrapTop} src={teacherSuccess} alt="" />
+            <h2>恭喜您已成功登记为</h2>
+            <h4>
+              {data.schoolName} <span>【音乐老师】</span>{' '}
+            </h4>
+            <p>请下载酷乐秀机构版APP进行学习</p>
+            <div class={styles.downApp} onClick={downApp}>
+              立即下载
+            </div>
+          </div>
+        </Overlay>
+      </>
+    )
+  }
 })

+ 110 - 0
src/views/tenantTeacherRejest/modals/chioseSuond.module.less

@@ -0,0 +1,110 @@
+.subjects {
+  .subjectName {
+    text-align: center;
+    margin-bottom: 15px;
+  }
+  padding: 15px 0 0;
+  background: #f6f8f9;
+  min-height: calc(100vh - 15px);
+  .subjectContainer {
+    min-height: calc(100vh - 95px);
+  }
+
+  .subjectMaxLength {
+    margin: 0 14px 10px;
+    background: linear-gradient(139deg, #fff6ee 0%, #ffecdd 100%) #ffffff;
+    border-radius: 10px;
+    padding: 7px 11px;
+    background: #ffffff;
+    font-size: 14px;
+    color: #ff9e5a;
+    line-height: 22px;
+  }
+  .title {
+    padding: 12px 0;
+    margin: 0 15px;
+    color: #333;
+    font-size: 16px;
+    display: flex;
+    align-items: center;
+    &::before {
+      content: ' ';
+      display: inline-block;
+      width: 3px;
+      height: 16px;
+      background: #2dc7aa;
+      border-radius: 3px;
+      margin-right: 8px;
+      vertical-align: text-bottom;
+    }
+  }
+
+  .subject-list {
+    display: flex;
+    align-items: center;
+    // justify-content: space-between;
+    // justify-content: center;
+    flex-wrap: wrap;
+    padding: 0 10px;
+
+    .subject-item {
+      position: relative;
+      width: 108px;
+      height: 108px;
+      margin-right: 5px;
+      margin-left: 5px;
+      margin-bottom: 10px;
+      border-radius: 7px;
+      overflow: hidden;
+    }
+
+    .topBg {
+      position: absolute;
+      top: 0;
+      left: 0;
+      width: 100%;
+      height: 100%;
+      background: linear-gradient(
+        180deg,
+        rgba(0, 0, 0, 0) 0%,
+        rgba(0, 0, 0, 0.54) 100%
+      );
+    }
+
+    .checkbox {
+      position: absolute;
+      right: 7px;
+      top: 7px;
+    }
+
+    .name {
+      position: absolute;
+      bottom: 7px;
+      left: 7px;
+      font-size: 16px;
+      font-weight: 500;
+      color: #ffffff;
+      line-height: 22px;
+    }
+
+    :global {
+      .van-checkbox__icon,
+      .van-radio__icon {
+        height: 22px;
+        .van-icon {
+          border: 0;
+          background-color: transparent;
+        }
+      }
+      .van-checkbox__icon--checked .van-icon,
+      .van-radio__icon--checked .van-icon {
+        background-color: transparent;
+        border: transparent;
+      }
+    }
+  }
+}
+.chioseBtn {
+  width: 303px;
+  height: 50px;
+}

+ 315 - 0
src/views/tenantTeacherRejest/modals/chioseSuond.tsx

@@ -0,0 +1,315 @@
+import {
+  Button,
+  Checkbox,
+  CheckboxGroup,
+  Icon,
+  Image,
+  Loading,
+  Radio,
+  RadioGroup,
+  Sticky,
+  Toast
+} from 'vant'
+import { defineComponent, PropType } from 'vue'
+import styles from './chioseSuond.module.less'
+import checkBoxActive from '../images/checkBoxActive.png'
+import checkBoxDefault from '../images/checkBoxDefault.png'
+import ColResult from '@/components/col-result'
+import chioseOk from '../images/chioseOk.png'
+export default defineComponent({
+  name: 'SubjectList',
+  props: {
+    onChoice: {
+      type: Function,
+      default: (item: any) => { }
+    },
+    choiceSubjectIds: {
+      type: Array,
+      default: []
+    },
+    subjectList: {
+      type: Array,
+      default: []
+    },
+    max: {
+      // 最多可选数量
+      type: Number,
+      default: 5
+    },
+    selectType: {
+      // 选择类型,Radio:单选,Checkbox:多选
+      type: String as PropType<'Checkbox' | 'Radio'>,
+      default: 'Checkbox'
+    },
+    single: {
+      // 单选模式
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      checkBox: [],
+      checkboxRefs: [] as any,
+      radio: null as any // 单选
+    }
+  },
+  async mounted() {
+    console.log('mounted=====>', this.selectType)
+    if (this.selectType === 'Radio') {
+      this.radio = this.choiceSubjectIds[0]
+    } else {
+
+      this.checkBox = [...this.choiceSubjectIds] as never[]
+    }
+  },
+  watch: {
+    choiceSubjectIds(val: any, oldVal) {
+      // 同步更新显示数据
+      console.log(this.choiceSubjectIds, this.checkBox, 'choiceSubjectIds')
+      this.checkBox = [...val] as never[]
+    }
+  },
+  methods: {
+    onSelect(id: number) {
+      if (this.selectType === 'Checkbox') {
+        if (
+          this.max === this.checkBox.length &&
+          !this.checkBox.includes(id as never)
+        ) {
+          Toast(`乐器最多选择${this.max}个`)
+        }
+        this.checkboxRefs[id].toggle()
+        console.log(this.checkBox, 'onSelect====>')
+      } else if (this.selectType === 'Radio') {
+        this.radio = id
+      }
+    }
+  },
+  render() {
+    return (
+      <div class={styles.subjects}>
+        <h2 class={styles.subjectName}>选择声部</h2>
+        <div class={styles.subjectContainer}>
+          {this.subjectList.length ? (
+            this.selectType === 'Checkbox' ? (
+              <CheckboxGroup v-model={this.checkBox} max={this.max}>
+                <div class={styles.subjectMaxLength}>
+                  最多可选择{this.max}个乐器
+                </div>
+
+                {!this.single &&
+                  this.subjectList.map((item: any) =>
+                    item.subjects && item.subjects.length > 0 ? (
+                      <>
+                        <div class={styles.title}>{item.name}</div>
+                        <div class={styles['subject-list']}>
+                          {item.subjects &&
+                            item.subjects.map((sub: any) => (
+                              <div
+                                class={styles['subject-item']}
+                                onClick={() => this.onSelect(sub.id)}
+                              >
+                                <Image
+                                  src={sub.img || 'xxx'}
+                                  width="100%"
+                                  height="100%"
+                                  fit="cover"
+                                  v-slots={{
+                                    loading: () => (
+                                      <Loading type="spinner" size={20} />
+                                    )
+                                  }}
+                                />
+                                <div class={styles.topBg}>
+                                  <Checkbox
+                                    name={sub.id}
+                                    class={styles.checkbox}
+                                    disabled
+                                    ref={(el: any) =>
+                                      (this.checkboxRefs[sub.id] = el)
+                                    }
+                                    v-slots={{
+                                      icon: (props: any) => (
+                                        <Icon
+                                          name={
+                                            props.checked
+                                              ? checkBoxActive
+                                              : checkBoxDefault
+                                          }
+                                          size="20"
+                                        />
+                                      )
+                                    }}
+                                  />
+                                  <p class={styles.name}>{sub.name}</p>
+                                </div>
+                              </div>
+                            ))}
+                        </div>
+                      </>
+                    ) : null
+                  )}
+                {this.single ? (
+                  <div class={styles['subject-list']}>
+                    {this.subjectList.map((item: any) => (
+                      <div
+                        class={styles['subject-item']}
+                        onClick={() => this.onSelect(item.id)}
+                      >
+                        <Image
+                          src={item.img || 'xxx'}
+                          width="100%"
+                          height="100%"
+                          fit="cover"
+                          v-slots={{
+                            loading: () => <Loading type="spinner" size={20} />
+                          }}
+                        />
+                        <div class={styles.topBg}>
+                          <Checkbox
+                            name={item.id}
+                            class={styles.checkbox}
+                            disabled
+                            ref={(el: any) => (this.checkboxRefs[item.id] = el)}
+                            v-slots={{
+                              icon: (props: any) => (
+                                <Icon
+                                  name={
+                                    props.checked
+                                      ? checkBoxActive
+                                      : checkBoxDefault
+                                  }
+                                  size="20"
+                                />
+                              )
+                            }}
+                          />
+                          <p class={styles.name}>{item.name}</p>
+                        </div>
+                      </div>
+                    ))}
+                  </div>
+                ) : null}
+              </CheckboxGroup>
+            ) : (
+              <RadioGroup v-model={this.radio}>
+                {!this.single &&
+                  this.subjectList.map((item: any) =>
+                    item.subjects && item.subjects.length > 0 ? (
+                      <>
+                        <div class={styles.title}>{item.name}</div>
+                        <div class={styles['subject-list']}>
+                          {item.subjects &&
+                            item.subjects.map((sub: any) => (
+                              <div
+                                class={styles['subject-item']}
+                                onClick={() => this.onSelect(sub.id)}
+                              >
+                                <Image
+                                  src={sub.img || 'xxx'}
+                                  width="100%"
+                                  height="100%"
+                                  fit="cover"
+                                  v-slots={{
+                                    loading: () => (
+                                      <Loading type="spinner" size={20} />
+                                    )
+                                  }}
+                                />
+                                <div class={styles.topBg}>
+                                  <Radio
+                                    name={sub.id}
+                                    class={styles.checkbox}
+                                    v-slots={{
+                                      icon: (props: any) => (
+                                        <Icon
+                                          name={
+                                            props.checked
+                                              ? checkBoxActive
+                                              : checkBoxDefault
+                                          }
+                                          size="20"
+                                        />
+                                      )
+                                    }}
+                                  />
+                                  <p class={styles.name}>{sub.name}</p>
+                                </div>
+                              </div>
+                            ))}
+                        </div>
+                      </>
+                    ) : null
+                  )}
+                {this.single ? (
+                  <div class={styles['subject-list']}>
+                    {this.subjectList.map((item: any) => (
+                      <div
+                        class={styles['subject-item']}
+                        onClick={() => this.onSelect(item.id)}
+                      >
+                        <Image
+                          src={item.img || 'xxx'}
+                          width="100%"
+                          height="100%"
+                          fit="cover"
+                          v-slots={{
+                            loading: () => <Loading type="spinner" size={20} />
+                          }}
+                        />
+                        <div class={styles.topBg}>
+                          <Radio
+                            name={item.id}
+                            class={styles.checkbox}
+                            v-slots={{
+                              icon: (props: any) => (
+                                <Icon
+                                  name={
+                                    props.checked
+                                      ? checkBoxActive
+                                      : checkBoxDefault
+                                  }
+                                  size="20"
+                                />
+                              )
+                            }}
+                          />
+                          <p class={styles.name}>{item.name}</p>
+                        </div>
+                      </div>
+                    ))}
+                  </div>
+                ) : null}
+              </RadioGroup>
+            )
+          ) : (
+            <ColResult tips="暂无声部数据" btnStatus={false} />
+          )}
+        </div>
+
+        {this.subjectList.length > 0 && (
+          <Sticky offsetBottom={0} position="bottom">
+            <div class={'btnGroup'}>
+
+              <img src={chioseOk} class={styles.chioseBtn} alt="" onClick={() =>
+                this.onChoice(
+                  this.selectType === 'Checkbox' ? this.checkBox : this.radio
+                )
+              } />
+              {/* <Button
+                round
+                block
+                type="primary"
+                style={{ width: '96%', margin: '0 auto' }}
+
+              >
+                确定
+              </Button> */}
+            </div>
+          </Sticky>
+        )}
+      </div>
+    )
+  }
+})

+ 2 - 2
src/views/trade/trade-detail.module.less

@@ -34,7 +34,7 @@
     }
 
     .orderContent::before {
-      background: url('./images/icon_close_block.png') no-repeat center;
+      background: url('./images/icon_close_block.png') no-repeat center !important;
       background-size: contain;
     }
   }
@@ -45,7 +45,7 @@
     }
 
     .orderContent::before {
-      background: url('./images/icon_paying_block.png') no-repeat center;
+      background: url('./images/icon_paying_block.png') no-repeat center !important;
       background-size: contain;
     }
   }

+ 5 - 1
vite.config.ts

@@ -12,7 +12,7 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://online.colexiu.com/';
-const proxyUrl = 'https://dev.colexiu.com/'
+const proxyUrl = 'https://test.colexiu.com/'
 // const proxyUrl = 'http://192.168.3.143:8000/'
 export default defineConfig({
   base: './',
@@ -101,6 +101,10 @@ export default defineConfig({
       '/api-mall-portal': {
         target: proxyUrl,
         changeOrigin: true
+      },
+      '/api-tenant': {
+        target: proxyUrl,
+        changeOrigin: true
       }
     }
   },