💪 optimize: 优化体验

This commit is contained in:
wangsongsole 2024-02-29 17:56:51 +08:00
parent 943a7ae352
commit 1ad91c1c9a
1 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,7 @@
class="bottom-img"> class="bottom-img">
</main> </main>
<div v-show="goods.status==2 && goods.card_show==2"> <div v-show="goods.status==2 && goods.card_show==2&&loading">
<div class="c-item mt30" v-if="goods.card_number"> <div class="c-item mt30" v-if="goods.card_number">
<div> <div>
<p>卡号</p> <p>卡号</p>
@ -77,6 +77,7 @@
const toast = ref(false); const toast = ref(false);
const clr = ref(null); const clr = ref(null);
const goodsCount = ref(0); const goodsCount = ref(0);
const loading = ref(true);
onMounted(() => { onMounted(() => {
goodsCount.value = Number(sessionStorage.getItem('goodsCount')) || 0; goodsCount.value = Number(sessionStorage.getItem('goodsCount')) || 0;
@ -85,8 +86,10 @@
/* 获取详情 */ /* 获取详情 */
function getInfo () { function getInfo () {
loading.value = false;
const orderNumber = sessionStorage.getItem('orderNumber'); const orderNumber = sessionStorage.getItem('orderNumber');
req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => { req.axiosGet(`/key/order/detail/${orderNumber}`).then(res => {
loading.value = true;
if (res.code == 200) { if (res.code == 200) {
const { product_name, status, show_url, card_number, card_password, use_coupon } = res.data; const { product_name, status, show_url, card_number, card_password, use_coupon } = res.data;
goods.value = { product_name, time: res.data.goods.end_time, status, show_url, card_number, card_password, card_show: res.data.goods.card_show, use_coupon }; goods.value = { product_name, time: res.data.goods.end_time, status, show_url, card_number, card_password, card_show: res.data.goods.card_show, use_coupon };
@ -137,7 +140,7 @@
history.go(-1); history.go(-1);
} }
return { copyFunction, getInfo, backHandler, toHome, dynamicBanner, goods, toast, goodsCount }; return { copyFunction, getInfo, backHandler, toHome, dynamicBanner, goods, toast, goodsCount, loading };
} }
}).mount('#app') }).mount('#app')
</script> </script>