提交 b17582a0 authored 作者: matian's avatar matian

updates

上级 53fab089
import { ITEM_RENDER_EVT } from 'element-plus/es/components/virtual-list/src/defaults'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { useUserStore } from './user' import { useUserStore } from './user'
interface ShopFilter { interface ShopFilter {
...@@ -41,23 +42,21 @@ export const useShopStore = defineStore('shop', () => { ...@@ -41,23 +42,21 @@ export const useShopStore = defineStore('shop', () => {
// 相关推荐商品列表 // 相关推荐商品列表
const shopRelatedList = computed(() => { const shopRelatedList = computed(() => {
if (shopItem.value?.type === '课程包') { if (shopItem.value?.category === 'free_course') {
return shopList.value.filter(item => item.category === 'system_course' && !item.is_test)
} else if (shopItem.value?.type === '课程包') {
return shopList.value.filter( return shopList.value.filter(
item => item.category !== shopItem.value?.category && item.type === '课程包' && item.is_test === false item => item.type === shopItem.value?.type && !item.is_test && item.id !== shopItem.value?.id
) )
} else if (shopItem.value?.type === '课程') {
if (shopItem.value?.category === 'free_course') {
return shopList.value.filter(item => item.category === 'system_course' && item.is_test === false)
} else { } else {
return shopList.value.filter( return shopList.value.filter(
item => item =>
item.category === shopItem.value?.category && item.type === shopItem.value?.type &&
!item.is_test &&
item.id !== shopItem.value?.id && item.id !== shopItem.value?.id &&
item.type === '课程' && item.category === shopItem.value?.category
item.is_test === false
) )
} }
}
}) })
return { filters, list, shopList, shopItem, shopRelatedList } return { filters, list, shopList, shopItem, shopRelatedList }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论