|
|
@@ -6,23 +6,19 @@ import { ScheduleType } from '@/constant'
|
|
|
const cacheMap = {}
|
|
|
|
|
|
function getProgramInst (id) {
|
|
|
- return programApi(id, { custom: true, background: true })
|
|
|
+ return programApi(id, { custom: true, background: true }).then(({ data }) => data)
|
|
|
}
|
|
|
|
|
|
function getScheduleInst (id) {
|
|
|
return scheduleApi(id, { custom: true, background: true })
|
|
|
}
|
|
|
|
|
|
-function getProgramName ({ data }) {
|
|
|
- return data.name
|
|
|
-}
|
|
|
-
|
|
|
-function getScheduleName ({ name }) {
|
|
|
+function getInstName ({ name }) {
|
|
|
return name
|
|
|
}
|
|
|
|
|
|
-function getProgramImage ({ data }) {
|
|
|
- return getAssetUrl(data.img)
|
|
|
+function getProgramImage ({ img }) {
|
|
|
+ return getAssetUrl(img)
|
|
|
}
|
|
|
|
|
|
function getScheduleImage ({ events }) {
|
|
|
@@ -49,7 +45,7 @@ function getPromise (type, id) {
|
|
|
}
|
|
|
|
|
|
export function getName (type, id) {
|
|
|
- return getPromise(type, id).then(type === ScheduleType.CALENDAR ? getProgramName : getScheduleName)
|
|
|
+ return getPromise(type, id).then(getInstName)
|
|
|
}
|
|
|
|
|
|
export function getImage (type, id) {
|