|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="appDetail">
|
|
|
- <m-header />
|
|
|
+ <m-header v-if="headerStatus" />
|
|
|
<van-cell-group>
|
|
|
<!-- <van-field v-model="form.paymentOrderNo" disabled label="订单编号" /> -->
|
|
|
<van-field v-model="form.examBaseName" disabled label="考级名称" />
|
|
@@ -46,12 +46,12 @@
|
|
|
:before-delete="beforeDelete"
|
|
|
:after-read="afterRead"
|
|
|
v-model="uploadCertificate2"
|
|
|
- disabled
|
|
|
- :deletable="false"
|
|
|
accept="image/*"
|
|
|
:max-count="1" />
|
|
|
</template>
|
|
|
</van-field>
|
|
|
+ <!-- disabled
|
|
|
+ :deletable="false" -->
|
|
|
</van-cell-group>
|
|
|
|
|
|
<van-cell-group style="margin-top: 20px">
|
|
@@ -112,9 +112,10 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import MHeader from '@/components/MHeader'
|
|
|
-// import { browser } from '@/common/common'
|
|
|
+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 { applyList } from './appApi'
|
|
|
export default {
|
|
@@ -123,6 +124,7 @@ export default {
|
|
|
data () {
|
|
|
const query = this.$route.query
|
|
|
return {
|
|
|
+ headerStatus: false,
|
|
|
examRegistrationId: query.examRegistrationId,
|
|
|
form: {
|
|
|
paymentOrderNo: null,
|
|
@@ -149,22 +151,20 @@ export default {
|
|
|
performInfo: [], // 演奏曲基本信息
|
|
|
practiceUpload: [], // 练习曲
|
|
|
practiceInfo: [], // 练习曲基本信息
|
|
|
- performNumUpload: [{
|
|
|
- url: "https://daya-online.oss-cn-beijing.aliyuncs.com/202007/S3wXfqp.jpg"
|
|
|
- }, {
|
|
|
- url: "https://daya-online.oss-cn-beijing.aliyuncs.com/202007/S3wrElA.jpg"
|
|
|
- }, {
|
|
|
- url: "https://daya-online.oss-cn-beijing.aliyuncs.com/202007/S3wuoPO.jpg"
|
|
|
- }]
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
// 插入token
|
|
|
- // let params = this.$route.query
|
|
|
- // if(params.Authorization) {
|
|
|
- // localStorage.setItem('Authorization', decodeURI(params.Authorization))
|
|
|
- // }
|
|
|
- document.title = "报考详情"
|
|
|
+ let params = this.$route.query
|
|
|
+ if(params.Authorization) {
|
|
|
+ localStorage.setItem('Authorization', decodeURI(params.Authorization))
|
|
|
+ }
|
|
|
+ // 判断是否在app里面
|
|
|
+ if(!browser().android && !browser().iPhone) {
|
|
|
+ this.headerStatus = true
|
|
|
+ } else {
|
|
|
+ document.title = '报考详情'
|
|
|
+ }
|
|
|
|
|
|
this.__init()
|
|
|
},
|
|
@@ -228,25 +228,23 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
// examRegistrationId
|
|
|
- }catch(err) {}
|
|
|
+ }catch(err) {
|
|
|
+ //
|
|
|
+ }
|
|
|
setLoading(false)
|
|
|
},
|
|
|
onOpen(type, index) {
|
|
|
let songUpload = this.songUpload
|
|
|
- console.log({
|
|
|
- type: type,
|
|
|
- index: index
|
|
|
- })
|
|
|
songUpload.indexName = type
|
|
|
songUpload.index = index
|
|
|
let practiceSUL = this.practiceInfo[index]
|
|
|
let performSUL = this.performInfo[index]
|
|
|
if(type == "perform") {
|
|
|
- songUpload.name = practiceSUL ? practiceSUL.songName : null
|
|
|
- songUpload.author = practiceSUL ? practiceSUL.songAuthor : null
|
|
|
- } else if(type == "practice") {
|
|
|
songUpload.name = performSUL ? performSUL.songName : null
|
|
|
songUpload.author = performSUL ? performSUL.songAuthor : null
|
|
|
+ } else if(type == "practice") {
|
|
|
+ songUpload.name = practiceSUL ? practiceSUL.songName : null
|
|
|
+ songUpload.author = practiceSUL ? practiceSUL.songAuthor : null
|
|
|
}
|
|
|
songUpload.songStatus = true
|
|
|
},
|
|
@@ -257,7 +255,25 @@ export default {
|
|
|
this.$toast('上传图片大小不能超过 5MB')
|
|
|
return false
|
|
|
}
|
|
|
- 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('-')
|