提交 4d1e4658 authored 作者: matian's avatar matian

updates

上级 d4469cfb
......@@ -16,23 +16,15 @@ const props = defineProps({
const buyDialogVisible = ref(false)
const handleBuyCourse = () => {
if (user.isLogin) {
if (props.payStatus === '4' || props.shopItem?.isBuy === true) {
if (props.shopItem?.category === 'system_course') {
buyDialogVisible.value = true
} else {
window.open('https://fi-learning.ezijing.com')
}
} else {
if (props.shopItem?.category === 'free_course') {
buyDialogVisible.value = true
} else {
router.push(`/shop/pay/${props.shopItem?.id}`)
}
}
} else {
window.location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
}
}
</script>
<template>
......
......@@ -67,7 +67,7 @@ const handleBuy = (courseItem: any) => {
<div class="bottom_btn">
<div class="btn_detail" v-if="!mobile" @click="handleDatail(courseItem?.id)">查看详情</div>
<div class="btn_buy" @click="handleBuy(courseItem)">
{{ courseItem?.isBuy === true || courseItem?.category === 'free_course' ? '立即学习' : '立即购买' }}
{{ courseItem?.isBuy === true ? '立即学习' : '立即购买' }}
</div>
</div>
</div>
......
......@@ -26,25 +26,10 @@ courseItem.value = shopStore.shopList.filter(
<DetailBanner :shopItem="shopStore.shopItem" :payStatus="payStatus" />
<div class="detail_con">
<div class="con_left">
<IncludeCourseCard
v-if="
shopStore.shopItem?.type === '课程' &&
shopStore.shopItem?.category !== 'system_course' &&
shopStore.shopItem?.category !== 'free_course'
"
:courseItem="courseItem"
/>
<div
class="left_course"
v-if="
shopStore.shopItem?.type === '课程包' ||
shopStore.shopItem?.category === 'system_course' ||
shopStore.shopItem?.category === 'free_course'
"
>
<IncludeCourseCard v-if="shopStore.shopItem?.type === '课程'" :courseItem="courseItem" />
<div class="left_course" v-if="shopStore.shopItem?.type === '课程包'">
<CourseIntrouduce :shopItem="shopStore.shopItem" />
<CourseFor :shopItem="shopStore.shopItem" />
<CourseCatalogPC v-if="shopStore.shopItem?.type === '课程包'" :shopItem="shopStore.shopItem" />
</div>
</div>
......@@ -57,25 +42,11 @@ courseItem.value = shopStore.shopList.filter(
</div>
<div class="course_detail" v-else>
<DetailBanner :shopItem="shopStore.shopItem" :payStatus="payStatus" />
<IncludeCourseCard
v-if="
shopStore.shopItem?.type === '课程' &&
shopStore.shopItem?.category !== 'system_course' &&
shopStore.shopItem?.category !== 'free_course'
"
:courseItem="courseItem"
/>
<div class="detail_con">
<CourseIntrouduce
:shopItem="shopStore.shopItem"
v-if="
shopStore.shopItem?.type === '课程包' ||
shopStore.shopItem?.category !== 'system_course' ||
shopStore.shopItem?.category !== 'free_course'
"
/>
<IncludeCourseCard v-if="shopStore.shopItem?.type === '课程'" :courseItem="courseItem" />
<div class="detail_con" v-if="shopStore.shopItem?.type === '课程包'">
<CourseIntrouduce :shopItem="shopStore.shopItem" />
<!-- <TeacherCard :lecturerList="shopStore.shopItem?.lecturer_list" /> -->
<CourseCatalogH5 :shopItem="shopStore.shopItem" v-if="shopStore.shopItem?.type === '课程包'" />
<CourseCatalogH5 :shopItem="shopStore.shopItem" />
</div>
<RecommendCourse :shopRelatedList="shopStore.shopRelatedList" />
<CourseFooter :payStatus="payStatus" :shopItem="shopStore.shopItem" />
......
......@@ -42,9 +42,7 @@ export const useShopStore = defineStore('shop', () => {
// 相关推荐商品列表
const shopRelatedList = computed(() => {
if (shopItem.value?.category === 'free_course') {
return shopList.value.filter(item => item.category === 'system_course' && !item.is_test)
} else if (shopItem.value?.type === '课程包') {
if (shopItem.value?.type === '课程包') {
return shopList.value.filter(
item => item.type === shopItem.value?.type && !item.is_test && item.id !== shopItem.value?.id
)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论