提交 3b594a25 authored 作者: matian's avatar matian

updates

上级 3bdada40
...@@ -41,15 +41,15 @@ const emit = defineEmits<{ ...@@ -41,15 +41,15 @@ const emit = defineEmits<{
const checkdChange = (val: string) => { const checkdChange = (val: string) => {
currentCheck.value = val currentCheck.value = val
} }
// const optionParams = reactive({ const optionParams = reactive({
// shop_id: '6998523899570814976', shop_id: '6998523899570814976',
// spu_id: '6998525810348916736', spu_id: '6998525810348916736',
// sku_id: '6998525810365693952', sku_id: '6998525810365693952',
// redirect_url: '', redirect_url: '',
// buy_count: '1', buy_count: '1',
// payment_method: '', payment_method: '',
// notify_url: `https://ep-lms-api.ezijing.com/v2/student/push?tenant=paa&sso_id=${user.user?.id}&class_id=${props.shopItem?.class_id}&course_flag=1&course_id=${props.shopItem?.course_id}` notify_url: `https://ep-lms-api.ezijing.com/v2/student/push?tenant=paa&sso_id=${user.user?.id}&class_id=${props.shopItem?.class_id}&course_flag=1&course_id=${props.shopItem?.course_id}`
// }) })
// 点击立即购买 // 点击立即购买
const handlePay = () => { const handlePay = () => {
...@@ -79,70 +79,70 @@ const handlePay = () => { ...@@ -79,70 +79,70 @@ const handlePay = () => {
} }
// 去支付 // 去支付
// const pay = () => { const pay = () => {
// createOrderHandle().then((order: any) => { createOrderHandle().then((order: any) => {
// orderInfo.value = order orderInfo.value = order
// if (wechat) { if (wechat) {
// wxJSPay(order, payCallback(optionParams)) wxJSPay(order, payCallback(optionParams))
// } else { } else {
// location.href = order.payment_url // '4' \ '12' location.href = order.payment_url // '4' \ '12'
// getOrder() getOrder()
// } }
// }) })
// } }
// // 支付回调 // 支付回调
// const payCallback = async (options: any) => { const payCallback = async (options: any) => {
// const { callback } = options const { callback } = options
// const order = await getOrder() const order = await getOrder()
// callback && callback(order) callback && callback(order)
// const params = { const params = {
// status: 'success', status: 'success',
// orderId: order.order_id, orderId: order.order_id,
// payPrice: order.payment_money, payPrice: order.payment_money,
// payStatus: order.order_status payStatus: order.order_status
// } }
// orderInfoDetail.value = order.order_status orderInfoDetail.value = order.order_status
// emit('success', params) emit('success', params)
// } }
// // 创建订单 // 创建订单
// const createOrderHandle = () => { const createOrderHandle = () => {
// let defaultParams = {} let defaultParams = {}
// // 微信内 // 微信内
// if (wechat) { if (wechat) {
// const openId = localStorage.getItem('openId') const openId = localStorage.getItem('openId')
// if (!openId) { if (!openId) {
// getOpenId( getOpenId(
// queryString.parse(location.search, { parseBooleans: true }).code, queryString.parse(location.search, { parseBooleans: true }).code,
// pay pay
// ) )
// return Promise.reject('openId不存在') return Promise.reject('openId不存在')
// } }
// defaultParams = { open_id: openId, payment_method: '3' } defaultParams = { open_id: openId, payment_method: '3' }
// } }
// // 支付宝网页支付 // 支付宝网页支付
// if (currentCheck.value === '12') { if (currentCheck.value === '12') {
// defaultParams = { payment_method: '12' } defaultParams = { payment_method: '12' }
// } }
// //微信外微信h5支付 //微信外微信h5支付
// if (currentCheck.value === '4') { if (currentCheck.value === '4') {
// defaultParams = { payment_method: '4' } defaultParams = { payment_method: '4' }
// } }
// const params = Object.assign(optionParams, defaultParams) const params = Object.assign(optionParams, defaultParams)
// return createOrder(params).then((resp: any) => resp.data) return createOrder(params).then((resp: any) => resp.data)
// } }
// // 获取订单 // 获取订单
// function getOrder() { function getOrder() {
// return getOrderList({ return getOrderList({
// order_detail_id: orderInfo.value.order_detail_id order_detail_id: orderInfo.value.order_detail_id
// }).then((resp) => { }).then((resp) => {
// return resp.data[0] return resp.data[0]
// }) })
// } }
const handlePrev = () => { const handlePrev = () => {
router.push({ router.push({
path: `/shop/detail/${props.shopItem?.id}`, path: `/shop/detail/${props.shopItem?.id}`,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论