Explorar o código

修改乐理证书不需要检验

lex-xin %!s(int64=4) %!d(string=hai) anos
pai
achega
12fab80bec

BIN=BIN
dist/app.2890f5e019243f75b4f4.js.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/app.5a1f519c18ac2a6813ed.js


BIN=BIN
dist/app.5a1f519c18ac2a6813ed.js.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/css/AppDetail.88467e17.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/css/AppDetail.c819930b.css


BIN=BIN
dist/css/SignUpBaseInfo.0e8de62e.css.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/css/SignUpBaseInfo.33618853.css


BIN=BIN
dist/css/SignUpBaseInfo.33618853.css.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/css/SignUpLevel.cbece6a0.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
dist/index.html


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/AppDetail.13659b5f.js


BIN=BIN
dist/js/AppDetail.13659b5f.js.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/AppDetail.c2b06c9f.js


BIN=BIN
dist/js/AppDetail.c2b06c9f.js.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/SignUpBaseInfo.06245019.js


BIN=BIN
dist/js/SignUpBaseInfo.06245019.js.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/SignUpBaseInfo.775d2d6c.js


BIN=BIN
dist/js/SignUpBaseInfo.775d2d6c.js.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/SignUpLevel.88faaebe.js


BIN=BIN
dist/js/SignUpLevel.88faaebe.js.gz


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/js/SignUpLevel.b0fa9cf1.js


BIN=BIN
dist/js/SignUpLevel.b0fa9cf1.js.gz


+ 1 - 1
public/index.html

@@ -14,7 +14,7 @@
     <meta http-equiv="Pragma" content="no-cache">
     <meta http-equiv="Cache-control" content="no-cache">
     <meta http-equiv="Cache" content="no-cache">
-    <meta name="description" content="" >
+    <meta name="description" content="酷乐秀是一个专注于音乐类在线教育领域的平台,致力于打造新一代云教育体系,突破教育资源,地域限制等因素的影响,为“教”“学”两端提供专业服务。" >
 
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title>酷乐秀</title>

+ 194 - 52
src/views/app/AppDetail.vue

@@ -12,15 +12,12 @@
             <van-cell title="专业等级" >
                 {{ form.subjectName }}({{ form.level | formatLevel }})
             </van-cell>
-            <van-cell v-for="(item, index) in performInfo" :key="index" :title="`练习曲${numberToCN(index)}`" @click="onOpen('perform', index)" is-link >
+            <van-cell v-for="(item, index) in practiceInfo" :key="index" :title="`练习曲${numberToCN(index)}`" @click="onOpen('practice', index)" is-link >
                 {{ item.songName }} {{ item.songAuthor ? '-' + item.songAuthor : item.songAuthor }}
             </van-cell>
-            <van-cell v-for="(item, index) in practiceInfo" :key="index" :title="`演奏曲${numberToCN(index)}`" @click="onOpen('practice', index)" is-link >
+            <van-cell v-for="(item, index) in performInfo" :key="index" :title="`演奏曲${numberToCN(index)}`" @click="onOpen('perform', index)" is-link >
                 {{ item.songName }} {{ item.songAuthor ? '-' + item.songAuthor : item.songAuthor }}
             </van-cell>
-            <!-- <van-cell title="练习曲" is-link />
-            <van-cell title="演奏曲" is-link />
-            <van-cell title="演奏曲" is-link /> -->
             <van-field v-model="form.name" disabled label="考级证书" >
                 <template #input>
                     <van-uploader
@@ -52,28 +49,27 @@
                         :max-count="1" />
                 </template>
             </van-field>
-            <!-- disabled
-                        :deletable="false" -->
         </van-cell-group>
 
         <van-cell-group class="memos">
             <van-cell disabled title="报名审核" >
                 <p class="pass" v-if="form.status === 'AUDIT_PASS'">已通过</p>
+                <p v-else-if="form.status === 'AUDIT_WAIT'">等待审核</p>
                 <p class="noPass" v-else>未通过</p>
             </van-cell>
             <van-cell title="备注" >
                 {{ form.memo }}
             </van-cell>
         </van-cell-group>
-        <van-button type="primary" v-if="form.editStatus" round block>重新提交</van-button>
+        <van-button type="primary" v-if="form.editStatus" @click="onSubmit" round block>重新提交</van-button>
 
         <van-popup class="van-popup-song" v-model="songUpload.songStatus" :close-on-click-overlay="false">
             <div class="song-popup">
                 <div class="title">自定义曲目</div>
-                <van-field name="songName" v-model="songUpload.name" :disabled="!form.editStatus" label="曲名" placeholder="请输入曲名" >
+                <van-field name="songName" v-model="songUpload.songName" :disabled="!form.editStatus" label="曲名" placeholder="请输入曲名" >
                     <template #label><i style="color: #ee0a24">*</i>曲名</template>
                 </van-field>
-                <van-field name="songAuthor" :disabled="!form.editStatus" v-model="songUpload.author" label="作者" placeholder="请输入作者" >
+                <van-field name="songAuthor" :disabled="!form.editStatus" v-model="songUpload.songAuthor" label="作者" placeholder="请输入作者" >
                     <template #label><i style="color: #ffffff">*</i>作者</template>
                 </van-field>
                 <van-field readonly clearable >
@@ -110,7 +106,7 @@
 
                 <div class="popup-group">
                     <span @click="onSaveCancel">取消</span>
-                    <span class="popup-sure">确定</span>
+                    <span @click="onSaveUpload" class="popup-sure">确定</span>
                 </div>
             </div>
         </van-popup>
@@ -122,7 +118,7 @@ import { browser } from '@/utils/common'
 // import dayjs from 'dayjs'
 import setLoading from '@/utils/loading'
 import fileUtil from '@/utils/fileUtil'
-import { uploadFile } from '../signup/SignUpApi'
+import { uploadFile, examRegistrationUpdate } from '../signup/SignUpApi'
 import { applyList } from './appApi'
 export default {
     name: 'appDetail',
@@ -133,6 +129,7 @@ export default {
             headerStatus: false,
             examRegistrationId: query.examRegistrationId,
             form: {
+                id: null,
                 paymentOrderNo: null,
                 examBaseName: null,
                 subjectName: null,
@@ -143,6 +140,8 @@ export default {
                 lastMusicTheoryLevel: null,
                 lastMusicTheoryCertificateUrl: null,
                 memo: null,
+                practiceSongIdList: null,
+                performSongIdList: null,
                 editStatus: false
             },
             uploadCertificate: [],
@@ -151,12 +150,16 @@ export default {
                 songStatus: false, // 曲目状态
                 indexName: null,
                 index: null, // 索引
-                name: null, // 曲名
-                author: null // 作者
+                songName: null, // 曲名
+                songAuthor: null // 作者
             },
+            practiceNum: null,
             performUpload: [], // 演奏曲
+            performUploadTemp: [], // 演奏曲
             performInfo: [], // 演奏曲基本信息
+            performNum: null,
             practiceUpload: [], // 练习曲
+            practiceUploadTemp: [], // 练习曲
             practiceInfo: [], // 练习曲基本信息
         }
     },
@@ -184,11 +187,12 @@ export default {
                     rows: 20,
                     examRegistrationId: this.examRegistrationId
                 })
+                setLoading(false)
                 const result = res.data
                 if(result.code == 200) {
                     const detail = result.data.rows ? result.data.rows[0] : {}
-                    // console.log(detail)
                     this.form = {
+                        id: detail.id,
                         paymentOrderNo: detail.paymentOrderNo,
                         examBaseName: detail.examBaseName,
                         subjectName: detail.subjectName,
@@ -211,7 +215,6 @@ export default {
                     }
 
                     const songJson = detail.songJson ? JSON.parse(detail.songJson) : []
-                    console.log(songJson)
                     songJson.forEach(item => {
                         // 曲谱
                         const uploadUrl = item.uploadUrl.split(',')
@@ -223,39 +226,44 @@ export default {
                         })
                         if(item.type === "PRACTICE") {
                             this.practiceUpload.push(tempUrl)
+                            this.practiceUploadTemp.push(tempUrl)
                             this.practiceInfo.push(item)
                         } else if(item.type === "PERFORM") {
                             this.performUpload.push(tempUrl)
+                            this.performUploadTemp.push(tempUrl)
                             this.performInfo.push(item)
                         }
                     })
-
-                    console.log({
-                        practiceInfo: this.practiceInfo,
-                        practiceUpload: this.practiceUpload,
-                        performInfo: this.performInfo,
-                        performUpload: this.performUpload
-                    })
+                    this.practiceNum = this.practiceUpload.length
+                    this.performNum = this.performInfo.length
                 }
                 // examRegistrationId
-            }catch(err) {
+            } catch(err) {
                 //
+                setLoading(false)
             }
-            setLoading(false)
         },
         onOpen(type, index) {
             let songUpload = this.songUpload
-            songUpload.indexName = type
-            songUpload.index = index
             let practiceSUL = this.practiceInfo[index]
             let performSUL = this.performInfo[index]
+            const practiceSongIdList = this.form.practiceSongIdList
+            const performSongIdList = this.form.performSongIdList
             if(type == "perform") {
-                songUpload.name = performSUL ? performSUL.songName : null
-                songUpload.author = performSUL ? performSUL.songAuthor : null
+                if(performSongIdList) {
+                    return
+                }
+                songUpload.songName = performSUL ? performSUL.songName : null
+                songUpload.songAuthor = performSUL ? performSUL.songAuthor : null
             } else if(type == "practice") {
-                songUpload.name = practiceSUL ? practiceSUL.songName : null
-                songUpload.author = practiceSUL ? practiceSUL.songAuthor : null
+                if(practiceSongIdList) { // 判断是否是自定义
+                    return
+                }
+                songUpload.songName = practiceSUL ? practiceSUL.songName : null
+                songUpload.songAuthor = practiceSUL ? practiceSUL.songAuthor : null
             }
+            songUpload.indexName = type
+            songUpload.index = index
             songUpload.songStatus = true
         },
         beforeRead(file) {
@@ -265,25 +273,26 @@ export default {
                 this.$toast('上传图片大小不能超过 5MB')
                 return false
             }
-            return new Promise((resolve) => {
-                fileUtil.getOrientation(file).then((orient) => {
-                    if (orient && orient != "" && orient != 1) {
-                        let reader = new FileReader()
-                        let img = new Image()
-                        reader.onload = (e) => {
-                            img.src = e.target.result
-                            img.onload = function () {
-                                const data = fileUtil.rotateImage(img, img.width, img.height, orient)
-                                const newFile = fileUtil.dataURLtoFile(data, file.name)
-                                resolve(newFile)
-                            }
-                        }
-                        reader.readAsDataURL(file)
-                    } else {
-                        resolve(file)
-                    }
-                })
-            })
+            return true
+            // return new Promise((resolve) => {
+            //     fileUtil.getOrientation(file).then((orient) => {
+            //         if (orient && orient != "" && orient != 1) {
+            //             let reader = new FileReader()
+            //             let img = new Image()
+            //             reader.onload = (e) => {
+            //                 img.src = e.target.result
+            //                 img.onload = function () {
+            //                     const data = fileUtil.rotateImage(img, img.width, img.height, orient)
+            //                     const newFile = fileUtil.dataURLtoFile(data, file.name)
+            //                     resolve(newFile)
+            //                 }
+            //             }
+            //             reader.readAsDataURL(file)
+            //         } else {
+            //             resolve(file)
+            //         }
+            //     })
+            // })
         },
         beforeDelete(file, detail) {
             const obj = detail.name.split('-')
@@ -311,9 +320,9 @@ export default {
                         form.lastMusicTheoryCertificateUrl = result.data.url // 上传图片地址为空
                     } else if(obj[0] == "certificate") {
                         form.lastExamCertificateUrl = result.data.url
-                    } else if(obj[0] == 'practiceNum') {
+                    } else if(obj[0] == 'practice') {
                         file.url = result.data.url
-                    } else if(obj[0] == 'performNum') {
+                    } else if(obj[0] == 'perform') {
                         file.url = result.data.url
                     }
                 } else {
@@ -326,8 +335,141 @@ export default {
                 return false
             }
         },
+        async onSubmit() {
+            if(!this.onCheckFields()) {
+                return
+            }
+            console.log(true)
+            console.log({
+                form: this.form,
+                performUpload: this.performUpload, // 演奏曲
+                performInfo: this.performInfo, // 演奏曲基本信息
+                practiceUpload: this.practiceUpload, // 练习曲
+                practiceInfo: this.practiceInfo, // 练习曲基本信息
+            })
+
+            let songJson = [] // json 数组
+            // 练习课 "PRACTICE"
+            const practiceUpload = this.practiceUpload
+            this.practiceInfo.forEach(item => {
+                let tempUrl = []
+                practiceUpload[item.index].forEach(item => {
+                    tempUrl.push(item.url)
+                })
+                songJson.push({
+                    songName: item.songName,
+                    songAuthor: item.songAuthor,
+                    index: item.index,
+                    type: "PRACTICE",
+                    uploadUrl: tempUrl.join(',')
+                })
+            })
+            // 演奏课 "PERFORM"
+            const performNumUpload = this.performNumUpload
+            this.performInfo.forEach(item => {
+                let tempUrl = []
+                performNumUpload[item.index].forEach(item => {
+                    tempUrl.push(item.url)
+                })
+                songJson.push({
+                    songName: item.songName,
+                    songAuthor: item.songAuthor,
+                    index: item.index,
+                    type: "PERFORM",
+                    uploadUrl: tempUrl.join(',')
+                })
+            })
+            console.log(songJson)
+            // lastExamCertificateUrl
+            // lastMusicTheoryCertificateUrl
+            // songJson
+            // status AUDIT_WAIT
+            let form = this.form
+            let params = {
+                lastExamCertificateUrl: form.lastExamCertificateUrl,
+                lastMusicTheoryCertificateUrl: form.lastMusicTheoryCertificateUrl,
+                songJson: JSON.stringify(songJson),
+                status: "AUDIT_WAIT"
+            }
+            console.log(params)
+            // setLoading(true)
+            // try {
+            //     let res = await examRegistrationUpdate()
+            // } catch(err) {
+            //     //
+            // }
+        },
+        onCheckFields() {
+            // 校验数据
+            let form = this.form
+            // 有值说明是列表
+            console.log({
+                practiceUpload: this.practiceUpload.length,
+                practiceNum: this.practiceNum,
+                performUpload: this.performUpload.length,
+                performNum: this.performNum
+            })
+            if(this.practiceUpload.length != this.practiceNum) {
+                this.$toast('请上传练习曲')
+                return false
+            }
+
+            if(this.performUpload.length != this.performNum) {
+                this.$toast('请上传演奏曲')
+                return false
+            }
+
+            if(form.level > 2 && form.lastMusicTheoryLevel == 0 && !form.lastMusicTheoryCertificateUrl) {
+                this.$toast("请上传乐理证书")
+                return false
+            }
+            return true
+        },
         onSaveCancel() {
             this.songUpload.songStatus = false
+            this.performUpload = JSON.parse(JSON.stringify(this.performUploadTemp)) // 回填数据
+            this.practiceUpload = JSON.parse(JSON.stringify(this.practiceUploadTemp)) // 回填数据
+        },
+        onSaveUpload() {
+            let songUpload = this.songUpload
+            if(!songUpload.songName) {
+                this.$toast("请输入曲名")
+                return
+            }
+            if(songUpload.indexName == "practice") {
+                const practiceObj = this.practiceUpload[songUpload.index]
+                const practiceLength = practiceObj ? practiceObj.length : 0
+                if(practiceObj && practiceLength > 0 && practiceObj[0].url) {
+                    if(practiceObj[practiceLength - 1].url) {
+                        this.practiceInfo[songUpload.index] = JSON.parse(JSON.stringify(songUpload))
+                        this.practiceUploadTemp = JSON.parse(JSON.stringify(this.practiceUpload))
+                    } else {
+                        this.$toast("上传曲谱中,请稍等")
+                        return
+                    }
+                } else {
+                    this.$toast("请上传文件")
+                    return
+                }
+            } else if(songUpload.indexName == "perform") {
+                const performObj = this.performUpload[songUpload.index]
+                const performLength = performObj ? performObj.length : 0
+                if(performObj && performLength > 0) {
+                    if(performObj[performLength - 1].url) {
+                        this.performInfo[songUpload.index] = JSON.parse(JSON.stringify(songUpload))
+                        this.performUploadTemp = JSON.parse(JSON.stringify(this.performUpload))
+                    } else {
+                        this.$toast("上传曲谱中,请稍等")
+                        return
+                    }
+                } else {
+                    this.$toast("请上传文件")
+                    return
+                }
+            }
+            songUpload.songName = null
+            songUpload.songAuthor = null
+            songUpload.songStatus = false
         },
         numberToCN (value) {
             const tempNumber = {

+ 3 - 2
src/views/signup/SignUpBaseInfo.vue

@@ -67,7 +67,6 @@
             <van-datetime-picker
             v-model="currentDate"
             type="date"
-            title="选择月日"
             :min-date="minDate"
             :max-date="maxDate"
             :formatter="formatter"
@@ -96,7 +95,7 @@ export default {
             examId: examId,
             certificatePhoto: [],
             minDate: new Date(1940, 0, 1),
-            maxDate: new Date(2050, 10, 1),
+            maxDate: new Date(),
             currentDate: new Date(),
             form: {
                 idCardNo: null,
@@ -224,6 +223,7 @@ export default {
                     return false
                 }
             } catch (err) {
+                setLoading(false)
                 return false
             }
         },
@@ -243,6 +243,7 @@ export default {
                     return false
                 }
             } catch (err) {
+                setLoading(false)
                 return false
             }
         },

+ 6 - 5
src/views/signup/SignUpLevel.vue

@@ -48,7 +48,8 @@
         <van-field required @click="onGetSheetList('examMusicTheory')" readonly clickable name="nation" label="乐理级别" v-model="formText.examMusicTheoryName" placeholder="请选择乐理级别" is-link />
         <!-- <van-field readonly clickable name="nation" label="上次考级级别" placeholder="请选择" is-link /> -->
         <!-- 乐理级别为免考 和 专业级别大于2级 -->
-        <van-field readonly :required="form.examMusicTheoryId == 999 &&  form.levelId > 2? true : false" clearable name="code" label="上传乐理证书" >
+        <!-- :required="form.examMusicTheoryId == 999 &&  form.levelId > 2? true : false" -->
+        <van-field readonly clearable name="code" label="上传乐理证书" >
             <template #input>
                 <van-uploader
                     name="certificate2"
@@ -920,10 +921,10 @@ export default {
                 return false
             }
 
-            if(form.examMusicTheoryId == 999 && form.levelId > 2 && !form.lastMusicTheoryCertificateUrl) {
-                this.$toast('请上传乐理证书')
-                return false
-            }
+            // if(form.examMusicTheoryId == 999 && form.levelId > 2 && !form.lastMusicTheoryCertificateUrl) {
+            //     this.$toast('请上传乐理证书')
+            //     return false
+            // }
 
             if(form.adviserPhone && !this.checkPhone(form.adviserPhone)) {
                 return false

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio