Commit 6120c8a6 by 胡悦

Merge branch 'huy_v2.8.1' of http://192.168.3.233:8090/h5/vite-integral into huy_v2.8.1

2 parents 4ba4b6b5 b8ac797a
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<div class="wrapper-integral"> <div class="wrapper-integral">
<span>可用积分</span> <span>可用积分</span>
<span class="integral">1800</span> <span class="integral">1800</span>
<img class="coin-img" src="@/assets/images/coin.png" alt="" />
</div> </div>
<div class="wrapper-userinfo"> <div class="wrapper-userinfo">
<div class="user-content"> <div class="user-content">
...@@ -50,14 +51,10 @@ ...@@ -50,14 +51,10 @@
<div class="history-list-top"> <div class="history-list-top">
<img class="top-img" src="@/assets/images/list-info.png" alt="" /> <img class="top-img" src="@/assets/images/list-info.png" alt="" />
</div> </div>
<!-- 没有历史数据 --> <div
<template v-if="!list.length"> class="van-list-box"
<div class="nodata"> :style="{ height: innerHeight - (280 + 10 + 28 + 68) + 'px' }"
<img class="nodata-img" src="@/assets/images/nodata.png" alt="" /> >
<div class="nodata-word">暂无积分历史明细</div>
</div>
</template>
<template v-else>
<van-list <van-list
finished-text="- 没有更多啦 -" finished-text="- 没有更多啦 -"
loading-text="加载中..." loading-text="加载中..."
...@@ -65,6 +62,18 @@ ...@@ -65,6 +62,18 @@
v-model:loading="loading" v-model:loading="loading"
:finished="finished" :finished="finished"
> >
<!-- 没有历史数据 -->
<template v-if="!list.length">
<div class="nodata">
<img
class="nodata-img"
src="@/assets/images/nodata.png"
alt=""
/>
<div class="nodata-word">暂无积分历史明细</div>
</div>
</template>
<template v-else>
<template v-for="item in list" :key="item.id"> <template v-for="item in list" :key="item.id">
<div class="list-content"> <div class="list-content">
<div class="list-content-left"> <div class="list-content-left">
...@@ -74,15 +83,16 @@ ...@@ -74,15 +83,16 @@
<div class="list-content-right">{{ item.jifen }}</div> <div class="list-content-right">{{ item.jifen }}</div>
</div> </div>
</template> </template>
</van-list>
</template> </template>
</van-list>
</div>
</div> </div>
</template> </template>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onBeforeMount } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
type listStyle = { type listStyle = {
...@@ -98,7 +108,7 @@ const router = useRouter(); ...@@ -98,7 +108,7 @@ const router = useRouter();
const innerHeight = ref<number>(window.innerHeight); const innerHeight = ref<number>(window.innerHeight);
const list = reactive<listStyle>([]); const list = reactive<listStyle>([]);
let id = ref<number>(0); let id = ref<number>(0);
const loading = ref<boolean>(false); const loading = ref<boolean>(true);
const finished = ref<boolean>(false); const finished = ref<boolean>(false);
// 跳到登录页面 // 跳到登录页面
...@@ -117,8 +127,8 @@ const toUseList = () => { ...@@ -117,8 +127,8 @@ const toUseList = () => {
}; };
// 跳转我的信息 // 跳转我的信息
const toInformation = () => { const toInformation = () => {
router.push('/information') router.push("/information");
} };
// 下拉加载数据 // 下拉加载数据
const onLoad = (): void => { const onLoad = (): void => {
...@@ -141,11 +151,11 @@ const onLoad = (): void => { ...@@ -141,11 +151,11 @@ const onLoad = (): void => {
if (list.length >= 40) { if (list.length >= 40) {
finished.value = true; finished.value = true;
} }
}, 1000); });
}; };
// 组件挂载完成 // 组件挂载完成
onMounted(() => { onBeforeMount(() => {
onLoad(); onLoad();
}); });
</script> </script>
...@@ -202,7 +212,7 @@ onMounted(() => { ...@@ -202,7 +212,7 @@ onMounted(() => {
border-radius: 4px; border-radius: 4px;
margin: 0 16px 28px; margin: 0 16px 28px;
width: calc(100% - 32px); width: calc(100% - 32px);
overflow: auto; // overflow: auto;
.history-list-top { .history-list-top {
text-align: center; text-align: center;
padding: 16px 0; padding: 16px 0;
...@@ -211,6 +221,9 @@ onMounted(() => { ...@@ -211,6 +221,9 @@ onMounted(() => {
height: 33px; height: 33px;
} }
} }
.van-list-box {
overflow: auto;
}
.nodata { .nodata {
margin-top: 40px; margin-top: 40px;
text-align: center; text-align: center;
...@@ -259,12 +272,13 @@ onMounted(() => { ...@@ -259,12 +272,13 @@ onMounted(() => {
&-integral { &-integral {
display: inline-flex; display: inline-flex;
height: 37px; height: 37px;
width: calc(100% - 32px);
margin-top: 55px; margin-top: 55px;
margin-left: 30px; margin-left: 30px;
color: #ffffff; color: #ffffff;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
position: relative;
span:first-child { span:first-child {
padding: 11px 0 6px; padding: 11px 0 6px;
} }
...@@ -275,6 +289,13 @@ onMounted(() => { ...@@ -275,6 +289,13 @@ onMounted(() => {
line-height: 37px; line-height: 37px;
margin-left: 4px; margin-left: 4px;
} }
.coin-img {
width: 123px;
height: 109px;
position: absolute;
top: -25px;
right: 20px;
}
} }
&-userinfo { &-userinfo {
......
<template> <template>
<div>
<template v-if="useList.length == 0">
<div class="nodata" :style="{ height: innerHeight + 'px' }">
<img class="nodata-img" src="@/assets/images/nodata.png" alt="" />
<div class="nodata-word">暂无积分使用记录</div>
</div>
</template>
<template v-else>
<div class="info-content" :style="{ height: innerHeight + 'px' }"> <div class="info-content" :style="{ height: innerHeight + 'px' }">
<van-list <van-list
finished-text="- 没有更多啦 -" finished-text="- 没有更多啦 -"
...@@ -15,6 +7,13 @@ ...@@ -15,6 +7,13 @@
v-model:loading="loading" v-model:loading="loading"
:finished="finished" :finished="finished"
> >
<template v-if="useList.length == 0">
<div class="nodata" :style="{ height: innerHeight + 'px' }">
<img class="nodata-img" src="@/assets/images/nodata.png" alt="" />
<div class="nodata-word">暂无积分使用记录</div>
</div>
</template>
<template v-else>
<div v-for="item in useList" :key="item.id"> <div v-for="item in useList" :key="item.id">
<div class="info-content-list"> <div class="info-content-list">
<div class="info-content-list-left"> <div class="info-content-list-left">
...@@ -36,14 +35,13 @@ ...@@ -36,14 +35,13 @@
<div class="finish-img">已完成</div> <div class="finish-img">已完成</div>
</div> </div>
</div> </div>
</van-list>
</div>
</template> </template>
</van-list>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onBeforeMount } from "vue";
type historyList = { type historyList = {
id?: number; id?: number;
...@@ -55,7 +53,7 @@ type historyList = { ...@@ -55,7 +53,7 @@ type historyList = {
// 获取可视区高度 // 获取可视区高度
const innerHeight = ref<number>(window.innerHeight); const innerHeight = ref<number>(window.innerHeight);
const useList = reactive<historyList>([]); const useList = reactive<historyList>([]);
const loading = ref<boolean>(false); const loading = ref<boolean>(true);
const finished = ref<boolean>(false); const finished = ref<boolean>(false);
// 获取积分使用记录 // 获取积分使用记录
...@@ -78,11 +76,11 @@ const getHistoryList = (): void => { ...@@ -78,11 +76,11 @@ const getHistoryList = (): void => {
if (useList.length >= 40) { if (useList.length >= 40) {
finished.value = true; finished.value = true;
} }
}, 1000); });
}; };
// 组件挂载完成 // 组件挂载完成
onMounted(() => { onBeforeMount(() => {
getHistoryList(); getHistoryList();
}); });
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!