Compare commits
No commits in common. "309760863ab7aeaf096a0affd154df39e5c4dccd" and "9ee59626a53f62017acba2cae72a4e52b5938616" have entirely different histories.
309760863a
...
9ee59626a5
@ -102,11 +102,3 @@ export async function contractView(data) {
|
|||||||
data
|
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>
|
<script setup>
|
||||||
import {liveStore} from "~/stores/live/index.js";
|
import {liveStore} from "~/stores/live/index.js";
|
||||||
import {createBuyOrder,createBuyOrderV3} from "~/api/goods/index.js";
|
import {createBuyOrder} from "~/api/goods/index.js";
|
||||||
import {goodStore} from "~/stores/goods/index.js";
|
import {goodStore} from "~/stores/goods/index.js";
|
||||||
import { showLoadingToast ,closeToast} from 'vant';
|
import { showLoadingToast ,closeToast} from 'vant';
|
||||||
import {authStore} from "~/stores/auth/index.js";
|
import {authStore} from "~/stores/auth/index.js";
|
||||||
@ -32,7 +32,7 @@ const confirmPay=async ()=>{
|
|||||||
forbidClick: true,
|
forbidClick: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const res=await createBuyOrderV3({
|
const res=await createBuyOrder({
|
||||||
buyUid:payment.value.buyUid,
|
buyUid:payment.value.buyUid,
|
||||||
price:payStatus.value===0?payment.value.leftPrice:amount.value,
|
price:payStatus.value===0?payment.value.leftPrice:amount.value,
|
||||||
currency:payment.value.leftCurrency,
|
currency:payment.value.leftCurrency,
|
||||||
@ -41,18 +41,16 @@ const confirmPay=async ()=>{
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (res.status===0){
|
if (res.status===0){
|
||||||
payment.value.payUid=res.data.payUid
|
checkoutSessionUrl.value=res.data.checkoutSessionUrl
|
||||||
router.push('/payment/qrcode')
|
payUid.value=res.data.payUid
|
||||||
// checkoutSessionUrl.value=res.data.checkoutSessionUrl
|
router.push({
|
||||||
// payUid.value=res.data.payUid
|
path:'/checkoutPage',
|
||||||
// router.push({
|
query:{
|
||||||
// path:'/checkoutPage',
|
payUid:res.data.payUid,
|
||||||
// query:{
|
returnUrl:'/payment/result',
|
||||||
// payUid:res.data.payUid,
|
stripeKey:res.data.checkoutSessionUrl
|
||||||
// returnUrl:'/payment/result',
|
}
|
||||||
// stripeKey:res.data.checkoutSessionUrl
|
})
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleInput = (e) => {
|
const handleInput = (e) => {
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
<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";
|
|
||||||
import {orderQuery} from "~/api/goods/index.js";
|
|
||||||
const {payment}= authStore()
|
|
||||||
definePageMeta({
|
|
||||||
i18n: 'payment.title'
|
|
||||||
})
|
|
||||||
const router=useRouter()
|
|
||||||
const resData=ref({})
|
|
||||||
let timer = null
|
|
||||||
const queryOrder = async () => {
|
|
||||||
try {
|
|
||||||
const res = await orderQuery({
|
|
||||||
orderNo: payment.value.payUid
|
|
||||||
})
|
|
||||||
|
|
||||||
if (res.status === 0) {
|
|
||||||
resData.value = res.data
|
|
||||||
|
|
||||||
// 只在支付成功时停止轮询
|
|
||||||
if (resData.value.status === 1) {
|
|
||||||
clearInterval(timer)
|
|
||||||
router.push({
|
|
||||||
path: '/payment/result',
|
|
||||||
query:{
|
|
||||||
orderNo:payment.value.payUid
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
clearInterval(timer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 立即执行一次
|
|
||||||
await queryOrder()
|
|
||||||
const qrCodeUrl=ref('')
|
|
||||||
// 开始轮询
|
|
||||||
timer = setInterval(async () => {
|
|
||||||
await queryOrder()
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
// 组件卸载时清除定时器
|
|
||||||
onUnmounted(() => {
|
|
||||||
if (timer) {
|
|
||||||
clearInterval(timer)
|
|
||||||
closeToast()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
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,7 +18,6 @@ const localState = ref({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const groupByDate = (data) => {
|
const groupByDate = (data) => {
|
||||||
|
|
||||||
if (!Array.isArray(data)) return []
|
if (!Array.isArray(data)) return []
|
||||||
|
|
||||||
return Object.values(data.reduce((acc, curr) => {
|
return Object.values(data.reduce((acc, curr) => {
|
||||||
@ -49,10 +48,8 @@ const onRefresh = async () => {
|
|||||||
|
|
||||||
const goPay = (item) => {
|
const goPay = (item) => {
|
||||||
payment.value.leftPrice=item.leftCnyPrice
|
payment.value.leftPrice=item.leftCnyPrice
|
||||||
payment.value.nickName=item.nickName
|
|
||||||
payment.value.leftCurrency=item.leftCurrency
|
payment.value.leftCurrency=item.leftCurrency
|
||||||
payment.value.buyUid=item.uuid
|
payment.value.buyUid=item.uuid
|
||||||
payment.value.artworkTitle=item?.auctionArtworkInfo?.artworkTitle
|
|
||||||
payment.value.auctionArtworkUuid=item?.auctionArtworkUuid
|
payment.value.auctionArtworkUuid=item?.auctionArtworkUuid
|
||||||
if (item.status===1){
|
if (item.status===1){
|
||||||
router.push('/signature/protocol')
|
router.push('/signature/protocol')
|
||||||
|
@ -13,9 +13,7 @@ export const authStore = createGlobalState(() => {
|
|||||||
leftPrice:'',
|
leftPrice:'',
|
||||||
leftCurrency:'',
|
leftCurrency:'',
|
||||||
buyUid:'',
|
buyUid:'',
|
||||||
auctionArtworkUuid:'',
|
auctionArtworkUuid:''
|
||||||
payUid:'',
|
|
||||||
nickName:''
|
|
||||||
})
|
})
|
||||||
const payUid=useLocalStorage('payUid','')
|
const payUid=useLocalStorage('payUid','')
|
||||||
return{
|
return{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import dotenv from 'dotenv'
|
import dotenv from 'dotenv'
|
||||||
import process from 'node:process'
|
import process from 'node:process'
|
||||||
|
import imagemin from 'vite-plugin-imagemin'
|
||||||
import { currentLocales } from './i18n/i18n'
|
import { currentLocales } from './i18n/i18n'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
@ -126,6 +127,33 @@ export default defineNuxtConfig({
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
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,7 +18,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fingerprintjs/fingerprintjs": "^4.5.1",
|
"@fingerprintjs/fingerprintjs": "^4.5.1",
|
||||||
"@intlify/message-compiler": "^11.1.3",
|
|
||||||
"@nuxtjs/i18n": "^9.1.1",
|
"@nuxtjs/i18n": "^9.1.1",
|
||||||
"@vue-office/pdf": "^2.0.10",
|
"@vue-office/pdf": "^2.0.10",
|
||||||
"@vueuse/components": "^12.8.2",
|
"@vueuse/components": "^12.8.2",
|
||||||
@ -54,7 +53,8 @@
|
|||||||
"sass-loader": "^16.0.4",
|
"sass-loader": "^16.0.4",
|
||||||
"sharp": "^0.33.5",
|
"sharp": "^0.33.5",
|
||||||
"typescript": "~5.7.2",
|
"typescript": "~5.7.2",
|
||||||
"vant": "^4.9.15"
|
"vant": "^4.9.15",
|
||||||
|
"vite-plugin-imagemin": "^0.6.1"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"peerDependencyRules": {
|
"peerDependencyRules": {
|
||||||
|
5525
pnpm-lock.yaml
5525
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@ export default defineConfig({
|
|||||||
],
|
],
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
// shortcuts to multiple utilities
|
// shortcuts to multiple utilities
|
||||||
['btn', 'px-6 py-3 rounded-3 inline-block bg-primary text-white cursor-pointer disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
|
['btn', 'px-6 py-3 rounded-3 inline-block bg-primary text-white cursor-pointer hover:bg-primary-hover disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
|
||||||
],
|
],
|
||||||
|
|
||||||
presets: [
|
presets: [
|
||||||
|
Loading…
Reference in New Issue
Block a user