From b55024ee2f42aa93e0ecaa3113bdeb286f6e59ac Mon Sep 17 00:00:00 2001 From: QYF-GitLab1 <1940665526@qq.com> Date: 星期二, 29 七月 2025 18:01:55 +0800 Subject: [PATCH] 优化按钮显示,教学互动 --- packagePersonal/pages/activateProduct/index.js | 52 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 35 insertions(+), 17 deletions(-) diff --git a/packagePersonal/pages/activateProduct/index.js b/packagePersonal/pages/activateProduct/index.js index 71b9400..70f5e84 100644 --- a/packagePersonal/pages/activateProduct/index.js +++ b/packagePersonal/pages/activateProduct/index.js @@ -94,25 +94,43 @@ 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 - } - } 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 = '鏁板瓧鏁欐潗' - } + // 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 } + let parentData = await app.MG.store.getProductBySaleMethod({ + saleMethodId: i.id + }) + if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') { + obj.type = '鏁板瓧璇剧▼' + } + if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') { + obj.type = '鏁板瓧鏁欐潗' + } + item.typeList.push(obj) }) }) setTimeout(() => { -- Gitblit v1.9.1