update loading

This commit is contained in:
ping 2025-09-25 14:55:50 +08:00
parent 95b04e9349
commit 70f2c06839

View File

@ -1,11 +1,13 @@
<template>
<div class="box">
<iframe v-loading="loading" v-if="url" :src="url" frameborder="0" class="baidu-style">
</iframe>
<div v-else>
<p>请先登录百度云账号</p>
<button @click="getToken">重试</button>
<!-- 添加全屏加载效果 -->
<div v-loading="loading" class="loading-container">
<iframe v-if="url" :src="url" frameborder="0" class="baidu-style">
</iframe>
<div v-else class="login-prompt">
<p>请先登录百度云账号</p>
<button @click="getToken">重试</button>
</div>
</div>
</div>
</template>
@ -22,7 +24,6 @@ export default {
url: '',
loading: true,
userid: '',
}
},
async created() {
@ -62,24 +63,12 @@ export default {
console.log('接收到消息:', event);
const data = event.data;
console.log('接收到的 data 是:', data);
// 1. ()
// const expectedOrigin = 'https://console.vcp.baidu.com';
// if (event.origin !== expectedOrigin) {
// console.warn('Received message from unexpected origin:', event.origin);
// return;
// }
// 2. refundInfo uuidList
if (data && data.refundInfo && Array.isArray(data.refundInfo.uuidList) && data.refundInfo.uuidList.length > 0) {
const uuidListArray = data.refundInfo.uuidList; //
// 3. ID ()
// ID退
const orderId = uuidListArray;
// ID
// const orderId = uuidListArray.join(',');
console.log('提取到的订单ID:', orderId);
console.log('提取到的订单ID:', uuidListArray);
// 4. ID
this.userid = sessionStorage.getItem('userId');
@ -91,7 +80,7 @@ export default {
// 5.
const payload = {
order_id: orderId,
order_id: uuidListArray,
userid: this.userid
};
@ -104,9 +93,9 @@ export default {
console.log("调用 reqBaiduJudgePrice 接口返回:", res);
if (res.status) { // status true
this.$message.success('退订成功');
//
// - 使 path url
this.$router.push({
url: '/BaiduNetdisk',
path: '/BaiduNetdisk',
});
} else {
//
@ -124,7 +113,6 @@ export default {
});
} else {
console.log('接收到的消息不包含有效的退款信息或 uuidList 为空');
//
}
}
}
@ -137,11 +125,19 @@ export default {
height: 100%;
}
.loading-container {
width: 100%;
height: 100%;
position: relative;
}
.login-prompt {
text-align: center;
padding: 50px;
}
.baidu-style {
width: 100%;
height: calc(100vh - 100px);
}
</style>