| | |
| | | oldlist.forEach(istrue => { |
| | | istrue.icon = getPublicImage(istrue.icon, "", 400) |
| | | }) |
| | | item.typeList = [] |
| | | item.saleMethodList.forEach(async (i) => { |
| | | if (i.type != 'defaultSaleMethod') { |
| | | var index = i.name.indexOf('-') |
| | | if (index !== -1) { |
| | | item.type = i.name.substring(0, index) |
| | | } else { |
| | | item.type = i.name |
| | | // if (i.type != 'defaultSaleMethod') { |
| | | // var index = i.name.indexOf('-') |
| | | // if (index !== -1) { |
| | | // item.type = i.name.substring(0, index) |
| | | // } else { |
| | | // item.type = i.name |
| | | // } |
| | | // } else { |
| | | // let parentData = await app.MG.store.getProductBySaleMethod({ |
| | | // saleMethodId: i.id |
| | | // }) |
| | | // if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') { |
| | | // item.type = '数字课程' |
| | | // } |
| | | // if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') { |
| | | // item.type = '数字教材' |
| | | // } |
| | | // } |
| | | const obj = { |
| | | icon: item.productList[0]?.icon, |
| | | id: item.productList[0]?.id, |
| | | name: item.productList[0]?.name, |
| | | type: i.type == 'defaultSaleMethod' ? '电子书' : i.name.split('-')[0], |
| | | defaultSaleMethodId: item.productList[0]?.defaultSaleMethodId |
| | | } |
| | | } else { |
| | | let parentData = await app.MG.store.getProductBySaleMethod({ |
| | | saleMethodId: i.id |
| | | }) |
| | | if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') { |
| | | item.type = '数字课程' |
| | | obj.type = '数字课程' |
| | | } |
| | | if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') { |
| | | item.type = '数字教材' |
| | | obj.type = '数字教材' |
| | | } |
| | | } |
| | | item.typeList.push(obj) |
| | | }) |
| | | }) |
| | | setTimeout(() => { |