index.tsx 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. import { Button, Popup } from 'vant'
  2. import { PropType, defineComponent, onMounted, ref, watch } from 'vue'
  3. import styles from './index.module.less'
  4. import { postMessage } from '@/helpers/native-message'
  5. export default defineComponent({
  6. name: 'message-tip',
  7. props: {
  8. // 是否显示微信弹窗
  9. show: {
  10. type: Boolean,
  11. default: true
  12. },
  13. type: {
  14. type: String as PropType<'upload' | 'error' | 'origin'>,
  15. default: 'upload'
  16. },
  17. title: {
  18. type: String,
  19. default: '温馨提示'
  20. },
  21. showButton: {
  22. type: Boolean,
  23. default: true
  24. },
  25. buttonText: {
  26. type: String,
  27. default: '我已知晓'
  28. }
  29. },
  30. emits: ['confirm'],
  31. setup(props, { emit }) {
  32. const showPopup = ref(false)
  33. onMounted(() => {
  34. if (props.show) {
  35. showPopup.value = true
  36. return
  37. }
  38. })
  39. watch(
  40. () => [props.show],
  41. () => {
  42. if (props.show) {
  43. showPopup.value = true
  44. } else {
  45. showPopup.value = false
  46. }
  47. }
  48. )
  49. // props.title, props.type
  50. // watch(
  51. // () => [props.title, props.type],
  52. // () => {}
  53. // )
  54. // 详情
  55. const onDetail = (type: string) => {
  56. let url = `${location.origin}/teacher/#/registerProtocol`
  57. if (type === 'question') {
  58. // url = `${location.origin}/teacher/muic-standard/question.html`
  59. url = `${location.origin}/teacher.html#/upload-protocol?type=question`
  60. } else if (type === 'music') {
  61. // url = `${location.origin}/teacher/muic-standard/index.html`
  62. url = `${location.origin}/teacher.html#/upload-protocol?type=music`
  63. }
  64. postMessage({
  65. api: 'openWebView',
  66. content: {
  67. url,
  68. orientation: 1,
  69. isHideTitle: false
  70. }
  71. })
  72. }
  73. return () => (
  74. <>
  75. <Popup
  76. v-model:show={showPopup.value}
  77. round
  78. style={{ width: '88%' }}
  79. closeOnClickOverlay={false}
  80. class={[
  81. styles.wxPopupDialog,
  82. props.type === 'error' ? styles.dialogError : ''
  83. ]}
  84. >
  85. <div class={styles.popupContainer}>
  86. <p class={styles.title1}>
  87. <span>{props.title}</span>
  88. </p>
  89. <div class={styles.popupTips}>
  90. {props.type === 'upload' && (
  91. <div class={styles.container}>
  92. <p class={styles.cTitle}>注意事项:</p>
  93. <div class={styles.cContent}>
  94. 1、必须是上传人自己参与制作的作品 <br />
  95. 2、歌曲及歌曲信息中请勿涉及政治、宗教、广告、涉毒、犯罪、色情、低俗、暴力、血腥、消极等违规内容,违反者直接删除内容。多次违反则进行封号处理;
  96. <br />
  97. 3、点击查看
  98. <span onClick={() => onDetail('protocol')}>
  99. 《用户注册协议》
  100. </span>
  101. ,如果您上传了文件,即认为您完全同意并遵守该协议的内容。
  102. </div>
  103. <p class={styles.cTitle}>曲谱审核标准:</p>
  104. <div class={styles.cContent}>
  105. 1、文件大小不要超过5MB,不符合版面规范的乐谱,审核未通过的不予上架,详情参考
  106. <span onClick={() => onDetail('music')}>
  107. 《曲谱排版规范》
  108. </span>
  109. <br />
  110. 2、XML与MIDI文件内容必须一致,推荐使用Sibelius打谱软件;导出设置:导出XML-未压缩(*.XML)/导出MIDI:音色-其他回放设备General
  111. MIDI、MIDI、MIDI文件类型-类型0、不要勾选“将弱拍小节导出为具有休止符的完整小节”。点击查看
  112. <span onClick={() => onDetail('question')}>
  113. 《常见问题》
  114. </span>
  115. </div>
  116. </div>
  117. )}
  118. {props.type === 'error' && (
  119. <div class={styles.container}>
  120. <div class={styles.cContent}>
  121. 声轨名称解析失败,请对照
  122. <span onClick={() => onDetail('music')}>
  123. 《曲谱排版规范》
  124. </span>
  125. 检查后重试
  126. </div>
  127. </div>
  128. )}
  129. {props.type === 'origin' && (
  130. <div class={styles.container}>
  131. <div class={styles.cContent}>
  132. 1、同一首曲目不可重复上传,如有不同版本统一用“()”补充。举例:人生的旋转木马(长笛二重奏版)
  133. <br />
  134. 2、曲目名后可添加曲目信息备注,包含但不限于曲目类型等。曲目名《XXX》,举例:人声的旋转木马《哈尔的移动城堡》(长笛二重奏版)
  135. <br />
  136. 3、其他信息不要写在曲目名里,如歌手、上传人员昵称等。
  137. </div>
  138. </div>
  139. )}
  140. </div>
  141. {props.showButton && (
  142. <Button
  143. round
  144. type="primary"
  145. block
  146. class={styles.button}
  147. onClick={() => emit('confirm')}
  148. >
  149. {props.buttonText}
  150. </Button>
  151. )}
  152. </div>
  153. </Popup>
  154. </>
  155. )
  156. }
  157. })