提交 35998c72 authored 作者: lhh's avatar lhh

update

上级 fb581a91
......@@ -14,9 +14,3 @@ export function getVideo(params: { resource_id: string, course_id: string, chapt
export function uploadVideo(params: any) {
return httpRequest.get('/api/psp/v2/learning/upload-video', { params })
}
export function getOrderSpec(data?: any) {
return httpRequest.post('https://shop-show-h5.ezijing.com/api/shop/commodity/spu/spec/value/search', data, {
headers: { 'Content-Type': 'application/json' }
})
}
<script setup lang="ts">
import AppContainer from '@/components/base/AppContainer.vue'
import { getCourseDetail, getOrderSpec } from '../api'
import { getCourseDetail } from '../api'
import CourseCatalog from '../components/CourseCatalog.vue'
import { useUserStore } from '@/stores/user'
import { Dialog } from 'vant'
......@@ -23,8 +23,6 @@ getCourseDetail({ id: route.query?.id as string }).then((res: any) => {
}
// console.log(d)
// getURLParameters()
// const urlParam = getURLParameters(d.url)
// getOrderSpec({ shop_id: urlParam.shop_id, spu_id: urlParam.id })
data.course = d
})
......
......@@ -38,4 +38,10 @@ export function applications(data?: any) {
return httpRequest.post('/api/zws/v1/enrollment/applications', data, {
// headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
}
export function getOrderSpec(data?: any) {
return httpRequest.post('https://shop-show-pc.ezijing.com/api/shop/commodity/spu/spec/value/search', data, {
headers: { 'Content-Type': 'application/json' }
})
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
import { usePay } from '../composables/usePay'
import { Toast } from 'vant'
import { getUser } from '@/api/base'
import { getOrderSpec } from '../api'
const props = defineProps({ shopItem: { type: Object, default: () => ({}) } })
const emit = defineEmits(['success'])
......@@ -27,16 +28,21 @@ function handlePay() {
return
}
if (!props.shopItem?.url) return
// const urlParam = getURLParameters(d.url)
const payUrl = getURLParameters(props.shopItem?.url)
const data = {
shop_id: payUrl?.shop_id || '',
spu_id: payUrl?.spu_id || payUrl?.id || '',
sku_id: payUrl?.sku_id || '',
nUrl: `https://wmpc-show-h5.ezijing.com/api/psp/v2/index/pay-callback?tenant=wmpc&course_id=${props.shopItem.id}&user_id=${uId}`,
amount: props.shopItem?.prices,
type: params.payment_method
}
pay(params, data)
getOrderSpec({ shop_id: payUrl.shop_id, spu_id: payUrl.id }).then(res => {
if (res.data?.length) {
const data = {
shop_id: payUrl?.shop_id || '',
spu_id: payUrl?.id || res.data[0]?.spu_id || '',
sku_id: res.data[0]?.sku_id || '',
nUrl: `https://wmpc-show-h5.ezijing.com/api/psp/v2/index/pay-callback?tenant=wmpc&course_id=${props.shopItem.id}&user_id=${uId}`,
amount: props.shopItem?.prices,
type: params.payment_method
}
pay(params, data)
}
})
}
const getURLParameters = (url: any) =>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论