Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-psp-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-psp-show-h5
Commits
fae42594
提交
fae42594
authored
10月 11, 2024
作者:
lhh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增留资
上级
cca200af
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
54 行增加
和
2 行删除
+54
-2
Index.vue
src/modules/home/views/Index.vue
+9
-0
api.ts
src/modules/pay/api.ts
+10
-0
Result.vue
src/modules/pay/views/Result.vue
+34
-1
vite.config.ts
vite.config.ts
+1
-1
没有找到文件。
src/modules/home/views/Index.vue
浏览文件 @
fae42594
...
@@ -29,6 +29,15 @@ onMounted(() => {
...
@@ -29,6 +29,15 @@ onMounted(() => {
fetchHomeData
()
fetchHomeData
()
// useWXShare()
// useWXShare()
})
})
const
getURLParameters
=
(
url
:
any
)
=>
(
url
.
match
(
/
([^
?=&
]
+
)(
=
([^
&
]
*
))
/g
)
||
[]).
reduce
(
(
a
:
any
,
v
:
any
)
=>
((
a
[
v
.
slice
(
0
,
v
.
indexOf
(
'='
))]
=
v
.
slice
(
v
.
indexOf
(
'='
)
+
1
)),
a
),
{}
)
if
(
getURLParameters
(
window
.
location
.
href
)?.
channel_num
)
{
window
.
sessionStorage
.
channel_num
=
getURLParameters
(
window
.
location
.
href
).
channel_num
}
</
script
>
</
script
>
<
template
>
<
template
>
...
...
src/modules/pay/api.ts
浏览文件 @
fae42594
...
@@ -29,4 +29,13 @@ export function getOpenId(data?: any) {
...
@@ -29,4 +29,13 @@ export function getOpenId(data?: any) {
export
function
getCourseDetail
(
params
:
{
id
:
string
})
{
export
function
getCourseDetail
(
params
:
{
id
:
string
})
{
return
httpRequest
.
get
(
'/api/psp/v2/learning/course-view'
,
{
params
})
return
httpRequest
.
get
(
'/api/psp/v2/learning/course-view'
,
{
params
})
}
/**
* 留资
* */
export
function
applications
(
data
?:
any
)
{
return
httpRequest
.
post
(
'/api/zws/v1/enrollment/applications'
,
data
,
{
// headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
}
\ No newline at end of file
src/modules/pay/views/Result.vue
浏览文件 @
fae42594
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
type
{
Order
}
from
'../types'
import
type
{
Order
}
from
'../types'
import
{
getOrderList
}
from
'../api'
import
{
getOrderList
,
applications
,
getCourseDetail
}
from
'../api'
import
{
getUser
}
from
'@/api/base'
const
router
=
useRouter
()
const
router
=
useRouter
()
const
route
=
useRoute
()
const
route
=
useRoute
()
const
orderId
=
useStorage
(
'order_detail_id'
,
route
.
query
.
order_detail_id
)
const
orderId
=
useStorage
(
'order_detail_id'
,
route
.
query
.
order_detail_id
)
const
order
=
ref
<
Order
>
()
const
order
=
ref
<
Order
>
()
// applications()
// course_info: { name: }
// {"name":"课程名","times":"学时","teacher":"讲师","price":"金额","course_id":"课程ID","last_learn_time":""}
const
subApplications
=
function
()
{
let
userData
=
{}
let
courseData
=
{}
getUser
().
then
((
res
:
any
)
=>
{
userData
=
{
user_id
:
res
.
data
?.
info
?.
sso_id
,
phone
:
res
.
data
?.
info
?.
mobile
,
project_id
:
5008
,
name
:
res
.
data
?.
info
?.
name
,
channel
:
window
.
sessionStorage
.
channel_num
}
getCourseDetail
({
id
:
route
.
query
?.
id
as
string
}).
then
((
res
:
any
)
=>
{
courseData
=
{
name
:
res
.
data
?.
course
?.
category_name
,
times
:
res
.
data
?.
course
?.
times
,
teacher
:
res
.
data
?.
course
?.
course_lectures
[
0
]?.
lecturer_name
,
price
:
res
.
data
?.
course
?.
prices
,
course_id
:
res
.
data
?.
course
?.
id
,
last_learn_time
:
''
}
applications
({
...
userData
,
course_info
:
JSON
.
stringify
(
courseData
)
})
})
})
}
let
isPay
=
$ref
(
false
)
let
isPay
=
$ref
(
false
)
async
function
getOrder
()
{
async
function
getOrder
()
{
getOrderList
({
order_detail_id
:
orderId
.
value
})
getOrderList
({
order_detail_id
:
orderId
.
value
})
...
@@ -18,6 +48,9 @@ async function getOrder() {
...
@@ -18,6 +48,9 @@ async function getOrder() {
// useUserStore().getCourse()
// useUserStore().getCourse()
// useUserStore().addCourse({ course_id: shopItem?.course_id })
// useUserStore().addCourse({ course_id: shopItem?.course_id })
isPay
=
true
isPay
=
true
if
(
window
.
sessionStorage
.
channel_num
)
{
subApplications
()
}
}
else
{
}
else
{
// 未支付,返回支付页面
// 未支付,返回支付页面
router
.
replace
(
`/shop/pay?id=
${
route
.
query
.
id
}
`
)
router
.
replace
(
`/shop/pay?id=
${
route
.
query
.
id
}
`
)
...
...
vite.config.ts
浏览文件 @
fae42594
...
@@ -27,7 +27,7 @@ export default defineConfig(({ mode }) => {
...
@@ -27,7 +27,7 @@ export default defineConfig(({ mode }) => {
cert
:
fs
.
readFileSync
(
path
.
join
(
__dirname
,
'./https/dev.ezijing.com.pem'
))
cert
:
fs
.
readFileSync
(
path
.
join
(
__dirname
,
'./https/dev.ezijing.com.pem'
))
},
},
proxy
:
{
proxy
:
{
'/api'
:
'https://
psp
-show-h5.ezijing.com'
'/api'
:
'https://
wmpc
-show-h5.ezijing.com'
}
}
},
},
resolve
:
{
resolve
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论