Commit 3dd862ac by 匡雅琴

积分列表

1 parent ab6a5a7f
import { import {
Button, Form, Field, CellGroup Button, Form, Field, CellGroup, List
} from 'vant' } from 'vant'
export const components = [ export const components = [
Button, Form, Field, CellGroup Button, Form, Field, CellGroup, List
] ]
\ No newline at end of file \ No newline at end of file
...@@ -49,6 +49,15 @@ const staticRoutes = Object.freeze([ ...@@ -49,6 +49,15 @@ const staticRoutes = Object.freeze([
name: 'Project', name: 'Project',
path: '/project', path: '/project',
component: () => import('views/project/index.vue') component: () => import('views/project/index.vue')
},
{
name: 'UseList',
path: '/uselist',
component: () => import('views/home/useHistory.vue'),
meta: {
title: '积分使用记录',
backgroundColor: '#F8F6F5'
} }
},
]) ])
export default staticRoutes export default staticRoutes
<template> <template>
<div class="wrapper"> <div class="wrapper">
<img class="wrapper-bg" src="@/assets/images/bg.png" alt=""> <img class="wrapper-bg" src="@/assets/images/bg.png" alt="" />
<!-- 去登录 --> <!-- 去登录 -->
<template v-if="!isLogin"> <template v-if="!isLogin">
<div class="login"> <div class="login">
<div class="login-title">登录账号 享受更多服务</div> <div class="login-title">登录账号 享受更多服务</div>
<img class="login-avatar" src="@/assets/images/avatar.png" alt=""> <img class="login-avatar" src="@/assets/images/avatar.png" alt="" />
<div class="login-btn" @click="toLogin">点击登录</div> <div class="login-btn" @click="toLogin">点击登录</div>
</div> </div>
</template> </template>
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
</div> </div>
<div class="wrapper-userinfo"> <div class="wrapper-userinfo">
<div class="user-content"> <div class="user-content">
<img class="user-avatar" src="@/assets/images/avatar.png" alt=""> <img class="user-avatar" src="@/assets/images/avatar.png" alt="" />
<div class="userinfo"> <div class="userinfo">
<div class="user-top"> <div class="user-top">
<span class="username">王美丽</span> <span class="username">王美丽</span>
<img class="auth" src="@/assets/images/auth.png" alt=""> <img class="auth" src="@/assets/images/auth.png" alt="" />
</div> </div>
<div> <div>
<span>1369526347丨粤B75963</span> <span>1369526347丨粤B75963</span>
...@@ -31,25 +31,89 @@ ...@@ -31,25 +31,89 @@
</div> </div>
<div class="logout" @click="logout">退出登录</div> <div class="logout" @click="logout">退出登录</div>
</div> </div>
<div class="user-btn">
<div class="user-btn-content" @click="toUseList">
<img class="nav-img" src="@/assets/images/use-info.png" alt="" />
<div>积分使用记录</div>
</div>
<div class="user-btn-content">
<img class="nav-img" src="@/assets/images/my-info.png" alt="" />
<div>我的信息</div>
</div>
</div>
</div>
</div> </div>
<div class="wrapper-history-list">
<div class="history-list-top">
<img class="top-img" src="@/assets/images/list-info.png" alt="" />
</div>
<!-- 没有历史数据 -->
<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>
<!-- v-model:loading="loading"
:finished="finished" -->
<van-list finished-text="- 没有更多啦 -" @load="onLoad">
<van-cell v-for="item in list" :key="item.id" :title="item.name" />
</van-list>
</template>
</div> </div>
</template> </template>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref, reactive, onMounted } from "vue";
import { useRouter } from 'vue-router' import { useRouter } from "vue-router";
let isLogin = ref(true) let isLogin = ref(true);
const router = useRouter() const router = useRouter();
const toLogin = () => { const toLogin = () => {
router.push('/login') router.push("/login");
} };
const logout = () => { const logout = () => {
isLogin.value = false isLogin.value = false;
} };
// 跳到积分使用记录页面
const toUseList = () => {
router.push("/uselist");
};
const list = reactive([]);
// const loading = ref<boolean>(true);
// const finished = ref<boolean>(false);
const onload = (): void => {
console.log(111);
list.push(
{
id: "01",
name: "系统赠送",
time: "2022-08-01 15:32:37",
jifen: "+20",
},
{
id: "02",
name: "系统赠送1",
time: "2022-08-01 15:32:37",
jifen: "+20",
},
{
id: "03",
name: "系统赠送2",
time: "2022-08-01 15:32:37",
jifen: "-20",
}
);
console.log(list, "----");
};
// 组件挂载完成
onMounted(() => {
onload();
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -79,8 +143,8 @@ const logout = () => { ...@@ -79,8 +143,8 @@ const logout = () => {
margin: 47px 26px 0; margin: 47px 26px 0;
width: calc(100% - 52px); width: calc(100% - 52px);
height: 48px; height: 48px;
background-color: #FB7034; background-color: #fb7034;
box-shadow: 0px 5px 6px 1px rgba(253, 193, 167, 0.3900); box-shadow: 0px 5px 6px 1px rgba(253, 193, 167, 0.39);
border-radius: 25px; border-radius: 25px;
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;
...@@ -96,14 +160,45 @@ const logout = () => { ...@@ -96,14 +160,45 @@ const logout = () => {
z-index: -1; z-index: -1;
} }
&-content {} &-content {
}
&-history-list {
background-color: #fff;
border-radius: 4px;
margin: 0 16px 28px;
width: calc(100% - 32px);
height: 300px;
.history-list-top {
text-align: center;
padding: 16px 0;
.top-img {
width: 114px;
height: 33px;
}
}
.nodata {
text-align: center;
&-img {
width: 147px;
height: 123px;
}
&-word {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #b1b1b3;
margin-top: 20px;
}
}
}
&-integral { &-integral {
display: inline-flex; display: inline-flex;
height: 37px; height: 37px;
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;
...@@ -140,9 +235,14 @@ const logout = () => { ...@@ -140,9 +235,14 @@ const logout = () => {
bottom: 20px; bottom: 20px;
right: 0; right: 0;
padding: 3px 5px 2px 14px; padding: 3px 5px 2px 14px;
background: linear-gradient(180deg, #FFFFFF 0%, #E2E2E2 100%); background: linear-gradient(180deg, #ffffff 0%, #e2e2e2 100%);
border-radius: 12px 0px 0px 12px; border-radius: 12px 0px 0px 12px;
border-image: linear-gradient(180deg, rgba(247, 247, 247, 1), rgba(209, 209, 209, 1)) 1 1; border-image: linear-gradient(
180deg,
rgba(247, 247, 247, 1),
rgba(209, 209, 209, 1)
)
1 1;
font-weight: 400; font-weight: 400;
color: #868686; color: #868686;
line-height: 17px; line-height: 17px;
...@@ -166,7 +266,18 @@ const logout = () => { ...@@ -166,7 +266,18 @@ const logout = () => {
width: 48px; width: 48px;
height: 17px; height: 17px;
} }
.user-btn {
display: flex;
justify-content: space-around;
&-content {
width: 50%;
text-align: center;
.nav-img {
width: 48px;
height: 48px;
}
}
}
} }
} }
</style> </style>
<template>
<div>
<template v-if="useList.length == 0">
<div class="nodata">
<img class="nodata-img" src="@/assets/images/nodata.png" alt="" />
<div class="nodata-word">暂无积分使用记录</div>
</div>
</template>
<template v-else>
<div class="info-content">
<div>
<div class="info-content-list">
<div class="info-content-list-left">
<div class="info-content-left">
<div class="info-content-left-top">1000</div>
<div class="info-content-left-bottom">兑换积分</div>
</div>
</div>
<div class="right-line"></div>
<div class="info-content-list-right">
<div class="info-content-right">
<div class="info-content-right-top">李四</div>
<div class="info-content-right-middle">招商银行</div>
<div class="info-content-right-bottom">
处理时间:2022-08-01 12:10
</div>
</div>
</div>
<div class="finish-img">已完成</div>
</div>
</div>
</div>
</template>
</div>
</template>
<script lang="ts" setup>
import { reactive } from "vue";
const useList = reactive(["1"]);
</script>
<style lang="scss" scoped>
.nodata {
height: 500px;
text-align: center;
background: #fff;
&-img {
width: 147px;
height: 123px;
margin-top: 200px;
}
&-word {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #b1b1b3;
margin-top: 20px;
}
}
.info-content {
margin-top: 20px;
&-list {
width: calc(100% - 32px);
height: 96px;
margin: 0 16px 10px;
display: flex;
background: #fff;
position: relative;
&-left {
width: 30%;
}
.finish-img {
width: 48px;
height: 18px;
text-align: center;
font-size: 10px;
color: #fff;
font-weight: 500;
background: linear-gradient(180deg, #fc6f35 0%, #f6b78c 100%);
border-radius: 9px 0 0 9px;
border-image: linear-gradient(
180deg,
rgba(247, 171, 125, 1),
rgba(251, 133, 79, 1)
)
1 1;
position: absolute;
top: 12px;
right: 0;
}
}
&-left {
padding: 24px 16px 0 16px;
text-align: center;
&-top {
font-size: 24px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #333333;
line-height: 28px;
}
&-bottom {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 17px;
}
}
.right-line {
width: 1px;
height: 48px;
margin-top: 24px;
background: #ececec;
}
&-right {
padding: 16px 0 0 16px;
&-top {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
margin-bottom: 4px;
}
&-middle {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
margin-bottom: 4px;
}
&-bottom {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 16px;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!