|
@@ -20,7 +20,7 @@ import { defineComponent, onMounted, reactive } from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import styles from './photo.module.less'
|
|
|
import iconPhoneDefaut from '../images/icon-photo-default.png'
|
|
|
-import iconOrchestra from '@/views/mine-orchestra/images/icon-or.png'
|
|
|
+import iconOrchestra from '../images/icon-school.png'
|
|
|
import OSticky from '@/components/o-sticky'
|
|
|
import OHeader from '@/components/o-header'
|
|
|
import { state as baseState } from '@/state'
|
|
@@ -71,9 +71,6 @@ export default defineComponent({
|
|
|
name: state.photoName
|
|
|
}
|
|
|
})
|
|
|
- // setTimeout(() => {
|
|
|
- // showToast('添加成功')
|
|
|
- // }, 100)
|
|
|
state.status = false
|
|
|
state.photoName = null
|
|
|
onSearch()
|
|
@@ -88,17 +85,10 @@ export default defineComponent({
|
|
|
state.status = false
|
|
|
state.photoName = null
|
|
|
onSearch()
|
|
|
- // setTimeout(() => {
|
|
|
- // showToast('修改成功')
|
|
|
- // }, 100)
|
|
|
}
|
|
|
state.status = false
|
|
|
state.photoName = null
|
|
|
onSearch()
|
|
|
- // setTimeout(() => {
|
|
|
- // state.photoName = null
|
|
|
- // onSearch()
|
|
|
- // }, 1100)
|
|
|
} catch {
|
|
|
//
|
|
|
}
|
|
@@ -143,28 +133,28 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // const getSchoolList = async () => {
|
|
|
- // try {
|
|
|
- // const res = await request.post(baseState.platformApi + '/school/page', {
|
|
|
- // data: {
|
|
|
- // page: 1,
|
|
|
- // rows: 999
|
|
|
- // }
|
|
|
- // })
|
|
|
- // if (Array.isArray(res.data?.rows)) {
|
|
|
- // state.schoolList = res.data.rows.map((n: any) => {
|
|
|
- // return {
|
|
|
- // name: n.name || '',
|
|
|
- // id: n.id || ''
|
|
|
- // }
|
|
|
- // })
|
|
|
- // const tmpSchool = sessionStorage.getItem('school-photo')
|
|
|
- // state.school = tmpSchool ? JSON.parse(tmpSchool) : state.schoolList[0] || {}
|
|
|
- // }
|
|
|
- // } catch {
|
|
|
- // //
|
|
|
- // }
|
|
|
- // }
|
|
|
+ const getSchoolList = async () => {
|
|
|
+ try {
|
|
|
+ const res = await request.post(baseState.platformApi + '/school/page', {
|
|
|
+ data: {
|
|
|
+ page: 1,
|
|
|
+ rows: 999
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (Array.isArray(res.data?.rows)) {
|
|
|
+ state.schoolList = res.data.rows.map((n: any) => {
|
|
|
+ return {
|
|
|
+ name: n.name || '',
|
|
|
+ id: n.id || ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ const tmpSchool = sessionStorage.getItem('school-photo')
|
|
|
+ state.school = tmpSchool ? JSON.parse(tmpSchool) : state.schoolList[0] || {}
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
const onDetail = (item: any) => {
|
|
|
sessionStorage.setItem('orchestra-detail-tab', 'photo')
|
|
@@ -209,7 +199,9 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- // await getSchoolList()
|
|
|
+ if (baseState.platformType === 'TEACHER') {
|
|
|
+ await getSchoolList()
|
|
|
+ }
|
|
|
await getList()
|
|
|
})
|
|
|
return () => (
|
|
@@ -219,6 +211,21 @@ export default defineComponent({
|
|
|
>
|
|
|
<OSticky position="top">
|
|
|
<OHeader border={false} />
|
|
|
+ {baseState.platformType === 'TEACHER' && !!state.schoolList.length && (
|
|
|
+ <CellGroup inset style={{ marginTop: '12px' }}>
|
|
|
+ <Cell
|
|
|
+ class={styles.selectSchool}
|
|
|
+ center
|
|
|
+ isLink
|
|
|
+ onClick={() => (state.schoolStatus = true)}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ icon: () => <img class={styles.icon} src={iconOrchestra} />,
|
|
|
+ title: () => <div class="van-ellipsis">{state.school.name}</div>
|
|
|
+ }}
|
|
|
+ </Cell>
|
|
|
+ </CellGroup>
|
|
|
+ )}
|
|
|
<div class={styles.btnGroup}>
|
|
|
<Button
|
|
|
icon="plus"
|
|
@@ -329,7 +336,7 @@ export default defineComponent({
|
|
|
]}
|
|
|
/>
|
|
|
|
|
|
- {/* <Popup v-model:show={state.schoolStatus} position="bottom" round>
|
|
|
+ <Popup v-model:show={state.schoolStatus} position="bottom" round>
|
|
|
<Picker
|
|
|
columns={state.schoolList}
|
|
|
columnsFieldNames={{ text: 'name', value: 'id' }}
|
|
@@ -346,7 +353,7 @@ export default defineComponent({
|
|
|
onSearch()
|
|
|
}}
|
|
|
/>
|
|
|
- </Popup> */}
|
|
|
+ </Popup>
|
|
|
</div>
|
|
|
)
|
|
|
}
|