支付
This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
<script setup lang="ts">
|
||||
import { FormatBytes } from '@/utils/tools'
|
||||
import { fetchDownloadItemsByGet } from '@/api/user'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { CreateOrder, ORDER_STATUS, GetOrderStatus } from '@/api/shoppingCart'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@@ -119,6 +119,9 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
clearInterval(viewTime.value)
|
||||
})
|
||||
const agreement = ref(false)
|
||||
const paymentStatus = ref(ORDER_STATUS.PENDING)
|
||||
const onPayWith = () => {
|
||||
@@ -150,14 +153,23 @@
|
||||
}
|
||||
})
|
||||
}
|
||||
const viewTime = ref(null)
|
||||
const openView = (url, width = 600, height = 800) => {
|
||||
const left = (screen.width - width) / 2
|
||||
const top = (screen.height - height) / 2
|
||||
window.open(
|
||||
const view = window.open(
|
||||
url,
|
||||
'_blank',
|
||||
'width=' + width + ', height=' + height + ', left=' + left + ', top=' + top
|
||||
)
|
||||
|
||||
clearInterval(viewTime.value)
|
||||
viewTime.value = setInterval(() => {
|
||||
if (view.closed) {
|
||||
clearInterval(viewTime.value)
|
||||
getOrderStatus()
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
const DOWNLOAD_STATUS = {
|
||||
null: 0, // 未开始
|
||||
|
||||
Reference in New Issue
Block a user