| | |
| | | } |
| | | |
| | | getAppPictures = () => { |
| | | if (sessionStorage.getItem('app_videos') || sessionStorage.getItem('app_pictures')) return |
| | | |
| | | Api.getSystemConfig({ |
| | | if (sessionStorage.getItem('app_pictures')) return |
| | | |
| | | let deffers = [] |
| | | let param = { |
| | | func: 's_url_db_adduptdel', |
| | | PageIndex: 0, // 0 代表全部 |
| | | PageSize: 0, // 0 代表全部 |
| | | typecharone: 'image', |
| | | type: 'search' |
| | | }).then(res => { |
| | | if (res.status) { |
| | | sessionStorage.setItem('app_pictures', JSON.stringify(res.data || [])) |
| | | } |
| | | } |
| | | deffers = [new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'image'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 500) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'video'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1000) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'color'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1500) |
| | | })] |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 's_url_db_adduptdel', |
| | | PageIndex: 0, // 0 代表全部 |
| | | PageSize: 0, // 0 代表全部 |
| | | typecharone: 'video', |
| | | type: 'search' |
| | | }).then(res => { |
| | | if (res.status) { |
| | | sessionStorage.setItem('app_videos', JSON.stringify(res.data || [])) |
| | | } |
| | | }) |
| | | Api.getSystemConfig({ |
| | | func: 's_url_db_adduptdel', |
| | | PageIndex: 0, // 0 代表全部 |
| | | PageSize: 0, // 0 代表全部 |
| | | typecharone: 'color', |
| | | type: 'search' |
| | | }).then(res => { |
| | | if (res.status) { |
| | | sessionStorage.setItem('app_colors', JSON.stringify(res.data || [])) |
| | | } |
| | | }) |
| | | Promise.all(deffers).then(response => { |
| | | sessionStorage.setItem('app_pictures', JSON.stringify(response[0] || [])) |
| | | sessionStorage.setItem('app_videos', JSON.stringify(response[1] || [])) |
| | | sessionStorage.setItem('app_colors', JSON.stringify(response[2] || [])) |
| | | }) |
| | | } |
| | | |