Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-online-fi
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-online-fi
Commits
20df3cc0
提交
20df3cc0
authored
11月 18, 2022
作者:
matian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updates
上级
ac3e8616
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
69 行增加
和
15 行删除
+69
-15
Header.vue
src/components/layout/Header.vue
+15
-0
Nav.vue
src/components/layout/Nav.vue
+1
-1
Confirm.vue
src/modules/pay/components/Confirm.vue
+13
-6
CourseIntroduceCard.vue
src/modules/shop/components/CourseIntroduceCard.vue
+13
-1
CourseListItem.vue
src/modules/shop/components/CourseListItem.vue
+18
-1
View.vue
src/modules/shop/views/View.vue
+3
-3
shop.ts
src/stores/shop.ts
+4
-2
user.ts
src/stores/user.ts
+2
-1
没有找到文件。
src/components/layout/Header.vue
浏览文件 @
20df3cc0
...
@@ -3,6 +3,8 @@ import { useWindowScroll } from '@vueuse/core'
...
@@ -3,6 +3,8 @@ import { useWindowScroll } from '@vueuse/core'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useUserStore
}
from
'@/stores/user'
import
{
useRoute
}
from
'vue-router'
import
{
useRoute
}
from
'vue-router'
import
AppNav
from
'./Nav.vue'
import
AppNav
from
'./Nav.vue'
import
{
ElMessage
}
from
'element-plus'
// const { courses } = useUserStore()
interface
Props
{
interface
Props
{
fixed
?:
boolean
fixed
?:
boolean
...
@@ -42,6 +44,13 @@ const { y } = useWindowScroll()
...
@@ -42,6 +44,13 @@ const { y } = useWindowScroll()
const
isScrolled
=
computed
(()
=>
{
const
isScrolled
=
computed
(()
=>
{
return
y
.
value
>
0
return
y
.
value
>
0
})
})
const
handleStudy
=
()
=>
{
if
(
JSON
.
parse
(
localStorage
.
getItem
(
'courses'
)
as
string
).
length
>
0
)
{
window
.
open
(
'https://paa-learning.ezijing.com'
)
}
else
{
ElMessage
.
warning
(
'请先购买课程,才能开始学习'
)
}
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -58,6 +67,7 @@ const isScrolled = computed(() => {
...
@@ -58,6 +67,7 @@ const isScrolled = computed(() => {
<div
class=
"app-header-right"
>
<div
class=
"app-header-right"
>
<AppNav></AppNav>
<AppNav></AppNav>
<div
class=
"menu"
@
click=
"toggleMenu"
></div>
<div
class=
"menu"
@
click=
"toggleMenu"
></div>
<div
class=
"study"
@
click=
"handleStudy"
v-if=
"user.isLogin"
>
立即学习
</div>
</div>
</div>
<div
class=
"app-header-right"
>
<div
class=
"app-header-right"
>
<template
v-if=
"user.isLogin"
>
<template
v-if=
"user.isLogin"
>
...
@@ -122,6 +132,11 @@ const isScrolled = computed(() => {
...
@@ -122,6 +132,11 @@ const isScrolled = computed(() => {
}
}
}
}
.app-header-right
{
.app-header-right
{
.study
{
font-size
:
18px
;
line-height
:
50px
;
margin-right
:
30px
;
}
display
:
flex
;
display
:
flex
;
.app-header-logout
{
.app-header-logout
{
...
...
src/components/layout/Nav.vue
浏览文件 @
20df3cc0
...
@@ -28,7 +28,7 @@ const navList = [
...
@@ -28,7 +28,7 @@ const navList = [
justify-content
:
space-between
;
justify-content
:
space-between
;
}
}
.app-menu
>
li
{
.app-menu
>
li
{
margin-right
:
8
0px
;
margin-right
:
6
0px
;
position
:
relative
;
position
:
relative
;
>
.cell
{
>
.cell
{
font-size
:
18px
;
font-size
:
18px
;
...
...
src/modules/pay/components/Confirm.vue
浏览文件 @
20df3cc0
...
@@ -9,13 +9,22 @@ defineProps({
...
@@ -9,13 +9,22 @@ defineProps({
})
})
const
payMode
=
ref
(
1
)
const
payMode
=
ref
(
1
)
const
isAgree
=
ref
(
false
)
const
isAgree
=
ref
(
false
)
const
isAgreeChecked
=
ref
(
false
)
function
getDateTime
(
dayNum
:
any
)
{
const
dateDay
=
new
Date
()
dateDay
.
setDate
(
dateDay
.
getDate
()
+
dayNum
)
//获取dayNum天后的日期
console
.
log
(
dateDay
)
const
y
=
dateDay
.
getFullYear
()
const
m
=
dateDay
.
getMonth
()
+
1
<
10
?
'0'
+
(
dateDay
.
getMonth
()
+
1
)
:
dateDay
.
getMonth
()
+
1
//获取当前月份的日期,不足10补0
const
d
=
dateDay
.
getDate
()
<
10
?
'0'
+
dateDay
.
getDate
()
:
dateDay
.
getDate
()
//获取当前几号,不足10补0
return
y
+
'-'
+
m
+
'-'
+
d
}
const
start_time
=
getDateTime
(
0
)
const
end_time
=
getDateTime
(
90
)
const
emit
=
defineEmits
<
{
const
emit
=
defineEmits
<
{
(
e
:
'success'
,
params
:
object
):
void
(
e
:
'success'
,
params
:
object
):
void
}
>
()
}
>
()
const
handlePay
=
()
=>
{
const
handlePay
=
()
=>
{
if
(
isAgree
.
value
===
false
)
{
if
(
isAgree
.
value
===
false
)
{
isAgreeChecked
.
value
=
true
ElMessage
.
warning
(
'请先勾选紫荆金保服务协议'
)
ElMessage
.
warning
(
'请先勾选紫荆金保服务协议'
)
}
else
{
}
else
{
const
params
=
{
const
params
=
{
...
@@ -39,7 +48,7 @@ const handlePay = () => {
...
@@ -39,7 +48,7 @@ const handlePay = () => {
/>
/>
<div
class=
"course_info"
>
<div
class=
"course_info"
>
<div
class=
"info_tit"
>
{{
shopItem
?.
title
}}
</div>
<div
class=
"info_tit"
>
{{
shopItem
?.
title
}}
</div>
<div
class=
"info_range"
>
有效期:
{{
s
hopItem
?.
start_time
}}
至
{{
shopItem
?.
end_time
}}
</div>
<div
class=
"info_range"
>
有效期:
{{
s
tart_time
}}
至
{{
end_time
}}
</div>
<div
class=
"info_price"
>
<div
class=
"info_price"
>
<div
class=
"price_icon"
>
¥
</div>
<div
class=
"price_icon"
>
¥
</div>
<div
class=
"price_num"
>
{{
shopItem
?.
price
}}
</div>
<div
class=
"price_num"
>
{{
shopItem
?.
price
}}
</div>
...
@@ -68,9 +77,7 @@ const handlePay = () => {
...
@@ -68,9 +77,7 @@ const handlePay = () => {
><span
style=
"color: #666666; font-size: 16px; font-weight: 400"
>
同意
</span
><span
style=
"color: #666666; font-size: 16px; font-weight: 400"
>
同意
</span
><a
style=
"color: #e3a232; font-size: 16px; font-weight: 400"
>
紫荆金保服务协议
</a></el-checkbox
><a
style=
"color: #e3a232; font-size: 16px; font-weight: 400"
>
紫荆金保服务协议
</a></el-checkbox
>
>
<div
class=
"left_desc"
:class=
"isAgreeChecked === true ? 'left_desc_active' : ''"
>
<div
class=
"left_desc"
:class=
"isAgree === false ? 'left_desc_active' : ''"
>
请先勾选紫荆金保服务协议
</div>
请先勾选紫荆金保服务协议
</div>
</div>
</div>
<div
class=
"footer_right"
>
<div
class=
"footer_right"
>
<div
class=
"right_top"
>
<div
class=
"right_top"
>
...
...
src/modules/shop/components/CourseIntroduceCard.vue
浏览文件 @
20df3cc0
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
const
router
=
useRouter
()
defineProps
({
defineProps
({
shopItem
:
{
shopItem
:
{
type
:
Object
type
:
Object
...
@@ -9,6 +11,10 @@ const defaultProps = {
...
@@ -9,6 +11,10 @@ const defaultProps = {
children
:
'children'
,
children
:
'children'
,
label
:
'label'
label
:
'label'
}
}
const
handleDetail
=
(
item
:
any
)
=>
{
router
.
push
(
`/shop/detail/
${
item
.
id
}
`
)
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -30,7 +36,12 @@ const defaultProps = {
...
@@ -30,7 +36,12 @@ const defaultProps = {
<div
class=
"info_tit"
>
课程目录
</div>
<div
class=
"info_tit"
>
课程目录
</div>
<div
class=
"info_line"
></div>
<div
class=
"info_line"
></div>
<div
class=
"info_con1"
v-if=
"shopItem?.type === '课程包'"
>
<div
class=
"info_con1"
v-if=
"shopItem?.type === '课程包'"
>
<div
class=
"course_list"
v-for=
"(item, index) in shopItem?.course_list"
:key=
"index"
>
<div
class=
"course_list"
v-for=
"(item, index) in shopItem?.course_list"
:key=
"index"
@
click=
"handleDetail(item)"
>
<img
<img
src=
"https://img1.baidu.com/it/u=3009731526,373851691&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"
src=
"https://img1.baidu.com/it/u=3009731526,373851691&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"
alt=
""
alt=
""
...
@@ -114,6 +125,7 @@ const defaultProps = {
...
@@ -114,6 +125,7 @@ const defaultProps = {
border-bottom
:
1px
solid
#e8e8e8
;
border-bottom
:
1px
solid
#e8e8e8
;
padding
:
20px
0
;
padding
:
20px
0
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
cursor
:
pointer
;
img
{
img
{
width
:
140px
;
width
:
140px
;
height
:
80px
;
height
:
80px
;
...
...
src/modules/shop/components/CourseListItem.vue
浏览文件 @
20df3cc0
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
ContactDialog
from
'../components/ContactDialog.vue'
const
router
=
useRouter
()
const
router
=
useRouter
()
const
buyDialogVisible
=
ref
(
false
)
defineProps
({
defineProps
({
courseItem
:
{
courseItem
:
{
...
@@ -13,6 +16,17 @@ const handleDatail = (item: any) => {
...
@@ -13,6 +16,17 @@ const handleDatail = (item: any) => {
path
:
`/shop/detail/
${
item
}
`
path
:
`/shop/detail/
${
item
}
`
})
})
}
}
const
handleBuy
=
(
courseItem
:
any
)
=>
{
if
(
courseItem
.
type
===
'课程包'
)
{
buyDialogVisible
.
value
=
true
}
else
{
if
(
courseItem
?.
isBuy
===
true
)
{
window
.
open
(
'https://paa-learning.ezijing.com'
)
}
else
{
router
.
push
(
`/pay/
${
courseItem
.
id
}
`
)
}
}
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -43,11 +57,14 @@ const handleDatail = (item: any) => {
...
@@ -43,11 +57,14 @@ const handleDatail = (item: any) => {
</div>
</div>
<div
class=
"bottom_btn"
>
<div
class=
"bottom_btn"
>
<div
class=
"btn_detail"
@
click=
"handleDatail(courseItem?.id)"
>
查看详情
</div>
<div
class=
"btn_detail"
@
click=
"handleDatail(courseItem?.id)"
>
查看详情
</div>
<div
class=
"btn_buy"
>
立即购买
</div>
<div
class=
"btn_buy"
@
click=
"handleBuy(courseItem)"
>
{{
courseItem
?.
isBuy
===
true
?
'立即学习'
:
'立即购买'
}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<ContactDialog
v-model:buyDialogVisible=
"buyDialogVisible"
/>
</div>
</div>
</
template
>
</
template
>
...
...
src/modules/shop/views/View.vue
浏览文件 @
20df3cc0
...
@@ -28,7 +28,7 @@ const handleBuyCourse = () => {
...
@@ -28,7 +28,7 @@ const handleBuyCourse = () => {
if
(
shopItem
?.
type
===
'课程包'
)
{
if
(
shopItem
?.
type
===
'课程包'
)
{
buyDialogVisible
.
value
=
true
buyDialogVisible
.
value
=
true
}
else
{
}
else
{
if
(
route
.
query
.
payStatus
===
'4'
)
{
if
(
route
.
query
.
payStatus
===
'4'
&&
shopItem
?.
isBuy
===
true
)
{
window
.
open
(
'https://paa-learning.ezijing.com'
)
window
.
open
(
'https://paa-learning.ezijing.com'
)
}
else
{
}
else
{
router
.
push
(
`/pay/
${
shopItem
?.
id
}
`)
router
.
push
(
`/pay/
${
shopItem
?.
id
}
`)
...
@@ -77,7 +77,7 @@ const handleShare = () => {
...
@@ -77,7 +77,7 @@ const handleShare = () => {
<div
class=
"left_tip tip2"
>
课程回放
</div>
<div
class=
"left_tip tip2"
>
课程回放
</div>
</div>
</div>
<div
class=
"buy_right"
@
click=
"handleBuyCourse"
>
<div
class=
"buy_right"
@
click=
"handleBuyCourse"
>
{{
route
.
query
.
payStatus
===
'4'
?
'立即学习'
:
'立即购买'
}}
{{
route
.
query
.
payStatus
===
'4'
||
shopItem
?.
isBuy
===
true
?
'立即学习'
:
'立即购买'
}}
</div>
</div>
</div>
</div>
<div
class=
"detail_con"
>
<div
class=
"detail_con"
>
...
@@ -106,7 +106,7 @@ const handleShare = () => {
...
@@ -106,7 +106,7 @@ const handleShare = () => {
<div
class=
"left_status"
v-else
>
已购买
</div>
<div
class=
"left_status"
v-else
>
已购买
</div>
<div
class=
"footer_btn"
@
click=
"handleBuyCourse"
>
<div
class=
"footer_btn"
@
click=
"handleBuyCourse"
>
{{
route
.
query
.
payStatus
===
'4'
?
'立即学习'
:
'立即购买'
}}
{{
route
.
query
.
payStatus
===
'4'
||
shopItem
?.
isBuy
===
true
?
'立即学习'
:
'立即购买'
}}
</div>
</div>
</div>
</div>
<ShareDialog
v-model:shareDialogVisible=
"shareDialogVisible"
/>
<ShareDialog
v-model:shareDialogVisible=
"shareDialogVisible"
/>
...
...
src/stores/shop.ts
浏览文件 @
20df3cc0
import
{
defineStore
}
from
'pinia'
import
{
defineStore
}
from
'pinia'
import
{
useUserStore
}
from
'./user'
//
import { useUserStore } from './user'
const
{
courses
}
=
useUserStore
()
//
const { courses } = useUserStore()
interface
ShopFilter
{
interface
ShopFilter
{
label
:
string
label
:
string
value
:
string
value
:
string
...
@@ -22,6 +22,8 @@ export const useShopStore = defineStore({
...
@@ -22,6 +22,8 @@ export const useShopStore = defineStore({
getters
:
{
getters
:
{
shopList
({
list
})
{
shopList
({
list
})
{
return
list
.
map
(
item
=>
{
return
list
.
map
(
item
=>
{
// const { courses } = useUserStore()
const
courses
=
JSON
.
parse
(
localStorage
.
getItem
(
'courses'
)
as
string
)
item
.
isBuy
=
!!
courses
.
find
((
course
:
any
)
=>
course
.
course_id
===
item
.
course_id
)
item
.
isBuy
=
!!
courses
.
find
((
course
:
any
)
=>
course
.
course_id
===
item
.
course_id
)
return
item
return
item
})
})
...
...
src/stores/user.ts
浏览文件 @
20df3cc0
...
@@ -10,7 +10,7 @@ export const useUserStore = defineStore({
...
@@ -10,7 +10,7 @@ export const useUserStore = defineStore({
id
:
'user'
,
id
:
'user'
,
state
:
():
State
=>
({
state
:
():
State
=>
({
user
:
null
,
user
:
null
,
courses
:
[]
courses
:
[]
||
JSON
.
parse
(
localStorage
.
getItem
(
'courses'
)
as
string
)
}),
}),
getters
:
{
getters
:
{
isLogin
:
state
=>
!!
state
.
user
,
isLogin
:
state
=>
!!
state
.
user
,
...
@@ -28,6 +28,7 @@ export const useUserStore = defineStore({
...
@@ -28,6 +28,7 @@ export const useUserStore = defineStore({
const
res
=
await
getUser
()
const
res
=
await
getUser
()
try
{
try
{
this
.
courses
=
await
getBuyShop
()
this
.
courses
=
await
getBuyShop
()
localStorage
.
setItem
(
'courses'
,
JSON
.
stringify
(
this
.
courses
))
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论