|  | @@ -20,9 +20,10 @@ 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'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default defineComponent({
 | 
	
		
			
				|  |  |    name: 'phone',
 | 
	
	
		
			
				|  | @@ -65,19 +66,16 @@ export default defineComponent({
 | 
	
		
			
				|  |  |            return
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (state.selectType === 'add') {
 | 
	
		
			
				|  |  | -          await request.post('/api-school/orchestraPhotoAlbum/save', {
 | 
	
		
			
				|  |  | +          await request.post(baseState.platformApi + '/orchestraPhotoAlbum/save', {
 | 
	
		
			
				|  |  |              data: {
 | 
	
		
			
				|  |  |                name: state.photoName
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  | -          // setTimeout(() => {
 | 
	
		
			
				|  |  | -          //   showToast('添加成功')
 | 
	
		
			
				|  |  | -          // }, 100)
 | 
	
		
			
				|  |  |            state.status = false
 | 
	
		
			
				|  |  |            state.photoName = null
 | 
	
		
			
				|  |  |            onSearch()
 | 
	
		
			
				|  |  |          } else {
 | 
	
		
			
				|  |  | -          await request.post('/api-school/orchestraPhotoAlbum/update', {
 | 
	
		
			
				|  |  | +          await request.post(baseState.platformApi + '/orchestraPhotoAlbum/update', {
 | 
	
		
			
				|  |  |              data: {
 | 
	
		
			
				|  |  |                id: state.selectItem.id,
 | 
	
		
			
				|  |  |                orchestraId: route.query.id,
 | 
	
	
		
			
				|  | @@ -87,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 {
 | 
	
		
			
				|  |  |          //
 | 
	
		
			
				|  |  |        }
 | 
	
	
		
			
				|  | @@ -117,7 +108,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        try {
 | 
	
		
			
				|  |  |          if (state.isLoading) return
 | 
	
		
			
				|  |  |          state.isLoading = true
 | 
	
		
			
				|  |  | -        const res = await request.post('/api-school/orchestraPhotoAlbum/page', {
 | 
	
		
			
				|  |  | +        const res = await request.post(baseState.platformApi + '/orchestraPhotoAlbum/page', {
 | 
	
		
			
				|  |  |            data: {
 | 
	
		
			
				|  |  |              ...state.params,
 | 
	
		
			
				|  |  |              schoolId: state.school.id
 | 
	
	
		
			
				|  | @@ -142,28 +133,28 @@ export default defineComponent({
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    // const getSchoolList = async () => {
 | 
	
		
			
				|  |  | -    //   try {
 | 
	
		
			
				|  |  | -    //     const res = await request.post('/api-school/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')
 | 
	
	
		
			
				|  | @@ -194,7 +185,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          message: '您确认删除该相册吗?'
 | 
	
		
			
				|  |  |        }).then(async () => {
 | 
	
		
			
				|  |  |          try {
 | 
	
		
			
				|  |  | -          await request.post('/api-school/orchestraPhotoAlbum/remove', {
 | 
	
		
			
				|  |  | +          await request.post(baseState.platformApi + '/orchestraPhotoAlbum/remove', {
 | 
	
		
			
				|  |  |              requestType: 'form',
 | 
	
		
			
				|  |  |              data: {
 | 
	
		
			
				|  |  |                id: state.selectItem.id
 | 
	
	
		
			
				|  | @@ -208,7 +199,9 @@ export default defineComponent({
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      onMounted(async () => {
 | 
	
		
			
				|  |  | -      // await getSchoolList()
 | 
	
		
			
				|  |  | +      if (baseState.platformType === 'TEACHER') {
 | 
	
		
			
				|  |  | +        await getSchoolList()
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        await getList()
 | 
	
		
			
				|  |  |      })
 | 
	
		
			
				|  |  |      return () => (
 | 
	
	
		
			
				|  | @@ -218,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"
 | 
	
	
		
			
				|  | @@ -330,7 +338,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' }}
 | 
	
	
		
			
				|  | @@ -347,7 +355,7 @@ export default defineComponent({
 | 
	
		
			
				|  |  |                onSearch()
 | 
	
		
			
				|  |  |              }}
 | 
	
		
			
				|  |  |            />
 | 
	
		
			
				|  |  | -        </Popup> */}
 | 
	
		
			
				|  |  | +        </Popup>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      )
 | 
	
		
			
				|  |  |    }
 |