提交
This commit is contained in:
parent
9ee59626a5
commit
17a32a89de
@ -101,4 +101,12 @@ export async function contractView(data) {
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
export async function createBuyOrderV3(data) {
|
||||
|
||||
return await request( {
|
||||
url:'/api/v1/m/auction/createBuyOrder/v3',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import {liveStore} from "~/stores/live/index.js";
|
||||
import {createBuyOrder} from "~/api/goods/index.js";
|
||||
import {createBuyOrder,createBuyOrderV3} from "~/api/goods/index.js";
|
||||
import {goodStore} from "~/stores/goods/index.js";
|
||||
import { showLoadingToast ,closeToast} from 'vant';
|
||||
import {authStore} from "~/stores/auth/index.js";
|
||||
@ -32,7 +32,7 @@ const confirmPay=async ()=>{
|
||||
forbidClick: true,
|
||||
});
|
||||
|
||||
const res=await createBuyOrder({
|
||||
const res=await createBuyOrderV3({
|
||||
buyUid:payment.value.buyUid,
|
||||
price:payStatus.value===0?payment.value.leftPrice:amount.value,
|
||||
currency:payment.value.leftCurrency,
|
||||
@ -41,16 +41,18 @@ const confirmPay=async ()=>{
|
||||
})
|
||||
|
||||
if (res.status===0){
|
||||
checkoutSessionUrl.value=res.data.checkoutSessionUrl
|
||||
payUid.value=res.data.payUid
|
||||
router.push({
|
||||
path:'/checkoutPage',
|
||||
query:{
|
||||
payUid:res.data.payUid,
|
||||
returnUrl:'/payment/result',
|
||||
stripeKey:res.data.checkoutSessionUrl
|
||||
}
|
||||
})
|
||||
payment.value.payUid=res.data.payUid
|
||||
router.push('/payment/qrcode')
|
||||
// checkoutSessionUrl.value=res.data.checkoutSessionUrl
|
||||
// payUid.value=res.data.payUid
|
||||
// router.push({
|
||||
// path:'/checkoutPage',
|
||||
// query:{
|
||||
// payUid:res.data.payUid,
|
||||
// returnUrl:'/payment/result',
|
||||
// stripeKey:res.data.checkoutSessionUrl
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
const handleInput = (e) => {
|
||||
|
43
app/pages/payment/qrcode/index.client.vue
Normal file
43
app/pages/payment/qrcode/index.client.vue
Normal file
@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<div class="w-[100vw] h-screen-nav bg-[url('@/static/images/3532@2x.png')] bg-cover flex-grow-1 flex flex-col items-center pt-183px px-30px">
|
||||
<div class="text-#000 text-16px mb-25px">等待销售员确认</div>
|
||||
<img :src="qrCodeUrl" alt="" class="mb-10px">
|
||||
<div class="text-#848484 text-14px">已生成订单确认二维码</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import QRCode from 'qrcode';
|
||||
import { ref } from 'vue';
|
||||
import {authStore} from "~/stores/auth/index.js";
|
||||
const {payment}= authStore()
|
||||
definePageMeta({
|
||||
i18n: 'payment.title'
|
||||
})
|
||||
const qrCodeUrl=ref('')
|
||||
async function generateQRCodeURL(text) {
|
||||
try {
|
||||
const url = await QRCode.toDataURL(text, {
|
||||
width: 283,
|
||||
margin: 1,
|
||||
errorCorrectionLevel: 'H',
|
||||
color: {
|
||||
dark: '#2B53AC', // 深色部分使用蓝色
|
||||
light: '#ffffff' // 浅色部分使用白色
|
||||
},
|
||||
rendererOpts: {
|
||||
quality: 1.0
|
||||
}
|
||||
});
|
||||
return url;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
qrCodeUrl.value = await generateQRCodeURL(JSON.stringify({
|
||||
type:'auction-order',
|
||||
buyUid: payment.value.buyUid,
|
||||
payUid:payment.value.payUid
|
||||
}))
|
||||
</script>
|
@ -18,6 +18,7 @@ const localState = ref({
|
||||
})
|
||||
|
||||
const groupByDate = (data) => {
|
||||
|
||||
if (!Array.isArray(data)) return []
|
||||
|
||||
return Object.values(data.reduce((acc, curr) => {
|
||||
@ -48,8 +49,10 @@ const onRefresh = async () => {
|
||||
|
||||
const goPay = (item) => {
|
||||
payment.value.leftPrice=item.leftCnyPrice
|
||||
payment.value.nickName=item.nickName
|
||||
payment.value.leftCurrency=item.leftCurrency
|
||||
payment.value.buyUid=item.uuid
|
||||
payment.value.artworkTitle=item?.auctionArtworkInfo?.artworkTitle
|
||||
payment.value.auctionArtworkUuid=item?.auctionArtworkUuid
|
||||
if (item.status===1){
|
||||
router.push('/signature/protocol')
|
||||
|
@ -13,7 +13,9 @@ export const authStore = createGlobalState(() => {
|
||||
leftPrice:'',
|
||||
leftCurrency:'',
|
||||
buyUid:'',
|
||||
auctionArtworkUuid:''
|
||||
auctionArtworkUuid:'',
|
||||
payUid:'',
|
||||
nickName:''
|
||||
})
|
||||
const payUid=useLocalStorage('payUid','')
|
||||
return{
|
||||
|
@ -1,6 +1,5 @@
|
||||
import dotenv from 'dotenv'
|
||||
import process from 'node:process'
|
||||
import imagemin from 'vite-plugin-imagemin'
|
||||
import { currentLocales } from './i18n/i18n'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
@ -127,33 +126,6 @@ export default defineNuxtConfig({
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
imagemin({
|
||||
gifsicle: {
|
||||
optimizationLevel: 7,
|
||||
interlaced: false
|
||||
},
|
||||
optipng: {
|
||||
optimizationLevel: 7
|
||||
},
|
||||
mozjpeg: {
|
||||
quality: 70
|
||||
},
|
||||
pngquant: {
|
||||
quality: [0.8, 0.9],
|
||||
speed: 4
|
||||
},
|
||||
svgo: {
|
||||
plugins: [
|
||||
{
|
||||
name: 'removeViewBox'
|
||||
},
|
||||
{
|
||||
name: 'removeEmptyAttrs',
|
||||
active: false
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@fingerprintjs/fingerprintjs": "^4.5.1",
|
||||
"@intlify/message-compiler": "^11.1.3",
|
||||
"@nuxtjs/i18n": "^9.1.1",
|
||||
"@vue-office/pdf": "^2.0.10",
|
||||
"@vueuse/components": "^12.8.2",
|
||||
|
5523
pnpm-lock.yaml
5523
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user