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

updates

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