| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669 |
- <template>
- <view class="box">
- <image class="bg-img" src="/static/bg.png" mode=""></image>
- <image class="bt-box" src="/static/bt.png" mode=""></image>
- <view class="top-box">
- <view class="top-left">
- <view class="fc-f fs-40 mr-32">
- {{currentDate}}
- </view>
- <view class="fc-f fs-40 mr-32">
- {{currentTime}}
- </view>
- <view class="fc-f fs-40">
- {{weekday}}
- </view>
- </view>
- <view class="top-left">
- <view class="fc-f fs-40">
- 26°C
- </view>
- </view>
- </view>
- <view class="data-box">
- <!-- 左 -->
- <view class="left-box flex-1">
- <view class="top-left mb-56">
- <view class="amount-box flex-1">
- <image class="amount-img" src="/static/k1.png" mode=""></image>
- <image class="amount-img-two z-3" src="/static/zje.png" mode=""></image>
- <view class="z-3">
- <view class="fc-00D5FF fw-b fs-48">
- ¥{{totalData.total_money}}
- </view>
- <view class="fc-f fs-14">
- 收款总金额
- </view>
- </view>
- </view>
- <view class="amount-box flex-1 mrl-12">
- <image class="amount-img" src="/static/k1.png" mode=""></image>
- <image class="amount-img-two z-3" src="/static/zbs.png" mode=""></image>
- <view class="z-3">
- <view class="fc-00D5FF fw-b fs-48">
- {{totalData.count}}
- </view>
- <view class="fc-f fs-14">
- 收款总笔数
- </view>
- </view>
- </view>
- <view class="amount-box flex-1">
- <image class="amount-img" src="/static/k1.png" mode=""></image>
- <image class="amount-img-two z-3" src="/static/zrs.png" mode=""></image>
- <view class="z-3">
- <view class="fc-00D5FF fw-b fs-48">
- {{totalData.total_member}}
- </view>
- <view class="fc-f fs-14">
- 消费总人数
- </view>
- </view>
- </view>
- </view>
- <view class="flex-1 list-box">
- <image class="list-img" src="/static/k3.png" mode=""></image>
- <view class="title-box mb-26">
- <image class="title-img" src="/static/xfmx.png" mode=""></image>
- </view>
- <!-- 滚动列表 -->
- <scroll-view class="scroll-view-css z-3" scroll-y="true" :scroll-top="scrollTop"
- scroll-with-animation="true">
- <view class="item-box" v-for="(item,i) in listData" :key="i">
- <view class="user-box">
- <image class="user-img" :src="item.head_img" mode=""></image>
- <view class="">
- <view class="fs-32 fc-f text-overflow-ellipsis-one w-max-441">
- {{item.nickname}}
- </view>
- <view class="fs-28 fc-B2D6FF">
- 消费者
- </view>
- </view>
- </view>
- <view class="">
- <view class="fs-32 fc-f">
- {{item.shop_name}}
- </view>
- <view class="fs-28 fc-B2D6FF">
- 消费门店
- </view>
- </view>
- <view class="">
- <view class="fs-32 fc-f">
- ¥{{item.pay_money}}
- </view>
- <view class="fs-28 fc-B2D6FF">
- 消费金额
- </view>
- </view>
- <view class="">
- <view class="fs-32 fc-f">
- {{item.created_at}}
- </view>
- <view class="fs-28 fc-B2D6FF text-align-right">
- 消费时间
- </view>
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- <!-- 右 -->
- <view class="right-box flex-1">
- <view class="flex-1 chart-box">
- <image class="chart-bg" src="/static/k2.png" mode=""></image>
- <view class="title-box">
- <image class="title-img" src="/static/xfdb.png" mode=""></image>
- <view class="fc-f fs-28 title-right">
- 单位(元)
- </view>
- </view>
- <view class="flex-1 z-3 column-box">
- <!-- 柱状图 -->
- <columnVue ref="columnRef" class="z-3"></columnVue>
- </view>
- </view>
- <view class="flex-1 chart-box mbt-12">
- <image class="chart-bg" src="/static/k2.png" mode=""></image>
- <view class="title-box">
- <image class="title-img" src="/static/zjtj.png" mode=""></image>
- <view class="bfje-num">
- <view class="bfje-title">
- <image class="bf-img" src="/static/bfje.png" mode=""></image>
- <view class="fc-B2D6FF fs-28">
- 总帮扶金额(元)
- </view>
- </view>
- <view class="fc-f fs-40">
- 27998.00
- </view>
- </view>
- </view>
- <view class="flex-1 tj-box">
- <view class="hx-box z-3">
- <!-- 环形图 -->
- <ringVue></ringVue>
- </view>
- <view class="bf-box mr-86 ml-28">
- <view class="bf-num">
- <image class="yhbf-img" src="/static/yhbf.png" mode=""></image>
- <view class="fc-f fs-40 z-3 text-align-center">
- ¥8999.00
- </view>
- </view>
- <view class="bf-title">
- <image class="yh-bg" src="/static/yh-bg.png" mode=""></image>
- <image class="yh-img z-3" src="/static/yh.png" mode=""></image>
- <view class="fs-28 fc-f z-3">
- 用户帮扶资金 40%
- </view>
- </view>
- </view>
- <view class="bf-box">
- <view class="bf-num">
- <image class="yhbf-img" src="/static/dpbf.png" mode=""></image>
- <view class="fc-f fs-40 z-3 text-align-center">
- ¥18999.00
- </view>
- </view>
- <view class="bf-title">
- <image class="yh-bg" src="/static/dp-bg.png" mode=""></image>
- <image class="yh-img z-3" src="/static/dp.png" mode=""></image>
- <view class="fs-28 fc-f z-3">
- 店铺帮扶资金 60%
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="flex-1 chart-box">
- <image class="chart-bg" src="/static/k2.png" mode=""></image>
- <view class="title-box">
- <image class="title-img" src="/static/rztj.png" mode=""></image>
- </view>
- <view class="flex-1 z-3">
- <!-- 曲线图 -->
- <lineVue ref="lineRef"></lineVue>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import columnVue from './components/column.vue';
- import lineVue from './components/line.vue';
- import ringVue from './components/ring.vue';
- import {
- chartShop,
- chartConsume,
- chartTotal,
- chartList
- } from '@/api/chart.js';
- export default {
- components: {
- columnVue,
- lineVue,
- ringVue
- },
- data() {
- return {
- scrollTop: 0,
- timer: '', //定时器
- listData: [],
- currentDate: '',
- currentTime: '',
- weekday: '',
- totalData: {}
- }
- },
- mounted() {
- this.startAutoScroll();
- this.updateDateTime()
- setInterval(() => { // 每分钟更新一次日期和时间
- this.updateDateTime();
- }, 60000); // 60000毫秒 = 1分钟
- this.updateTime(); // 初始化时间显示
- setInterval(this.updateTime, 1000); // 每秒更新时间
- this.chartShop()
- this.chartConsume()
- this.chartTotal()
- this.chartList()
- },
- methods: {
- chartList() {
- chartList().then((res) => {
- if (res.code === 1) {
- this.listData = res.data.items
- }
- })
- },
- chartTotal() {
- chartTotal().then((res) => {
- this.totalData = res.data
- })
- },
- chartConsume() {
- chartConsume().then((res) => {
- this.$refs.columnRef.getServerData(res)
- })
- },
- chartShop() {
- chartShop().then((res) => {
- this.$refs.lineRef.getServerData(res.categories, res.series)
- })
- },
- updateTime() {
- this.currentTime = new Date().toLocaleTimeString(); // 更新时间,例如 "2:05:30 PM" 格式(根据地区不同)
- },
- updateDateTime() {
- const now = new Date();
- this.currentDate = now.toLocaleDateString(); // 获取日期(格式可能因地区而异)
- this.weekday = now.toLocaleDateString('default', {
- weekday: 'long'
- }); // 获取星期
- },
- startAutoScroll() {
- this.timer = setInterval(() => {
- this.scrollTop += 84;
- // console.log(this.scrollTop);
- // console.log(10 * 84);
- // 到底
- if (this.scrollTop >= (10 * 84)) {
- this.scrollTop = 0;
- }
- }, 2000);
- },
- }
- }
- </script>
- <style>
- .box {
- width: 100%;
- height: 100vh;
- position: relative;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- }
- .bg-img {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 1;
- width: 101vw;
- height: 102vh;
- }
- .bt-box {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 1;
- width: 100%;
- height: 200rpx;
- }
- .top-box {
- height: 200rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 86rpx;
- margin-bottom: 60rpx;
- position: relative;
- z-index: 2;
- }
- .top-left {
- display: flex;
- align-items: center;
- }
- .text-align-center {
- text-align: center;
- }
- .text-overflow-ellipsis-one {
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- word-break: break-all;
- }
- .fw-b {
- font-weight: bold;
- }
- .fc-00D5FF {
- color: #00D5FF;
- }
- .fc-B2D6FF {
- color: #B2D6FF;
- }
- .fc-f {
- color: #fff;
- }
- .fs-13 {
- font-size: 13rpx;
- }
- .fs-48 {
- font-size: 48rpx;
- }
- .fs-10 {
- font-size: 10rpx;
- }
- .fs-40 {
- font-size: 40rpx;
- }
- .fs-32 {
- font-size: 32rpx;
- }
- .fs-28 {
- font-size: 28rpx;
- }
- .fs-7 {
- font-size: 7rpx;
- }
- .fs-16 {
- font-size: 16rpx;
- }
- .fs-5 {
- font-size: 5rpx;
- }
- .fs-14 {
- font-size: 24rpx;
- }
- .mr-32 {
- margin-right: 32rpx;
- }
- .mr-6 {
- margin-right: 6rpx;
- }
- .mr-86 {
- margin-right: 86rpx;
- }
- .ml-142 {
- margin-left: 142rpx;
- }
- .mb-10 {
- margin-bottom: 10rpx;
- }
- .mb-5 {
- margin-bottom: 5rpx;
- }
- .mb-26 {
- margin-bottom: 26rpx;
- }
- .mb-56 {
- margin-bottom: 56rpx;
- }
- .mrl-12 {
- margin: 0 12rpx;
- }
- .mbt-12 {
- margin: 12rpx 0;
- }
- .text-align-right {
- text-align: right;
- }
- .flex-1 {
- flex: 1;
- }
- .z-3 {
- position: relative;
- z-index: 3;
- }
- .left-box {
- display: flex;
- flex-direction: column;
- }
- .data-box {
- padding: 0 112rpx 56rpx 112rpx;
- box-sizing: border-box;
- display: flex;
- flex: 1;
- }
- .amount-box {
- width: 620rpx;
- height: 204rpx;
- position: relative;
- padding: 20rpx 50rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- margin-right: 62rpx;
- }
- .amount-img {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- z-index: 2;
- }
- .amount-img-two {
- width: 168rpx;
- height: 168rpx;
- margin-right: 40rpx;
- }
- .list-box {
- position: relative;
- padding: 60rpx 40rpx;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- margin-right: 62rpx;
- }
- .list-img {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- z-index: 2;
- }
- .right-box {
- display: flex;
- flex-direction: column;
- }
- .chart-box {
- position: relative;
- padding: 40rpx;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- }
- .chart-bg {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- z-index: 2;
- }
- .title-box {
- position: relative;
- width: 1404rpx;
- height: 78rpx;
- }
- .title-img {
- position: absolute;
- top: 0;
- bottom: 0;
- width: 100%;
- height: 100%;
- z-index: 2;
- }
- .title-right {
- text-align: right;
- position: relative;
- top: 20rpx;
- z-index: 2;
- }
- .bfje-num {
- position: absolute;
- top: 0;
- right: 0;
- border-radius: 2rpx;
- border-image: linear-gradient(90deg, rgba(113, 203, 255, 0.5), rgba(0, 161, 255, 0.05)) 0 0;
- z-index: 2;
- }
- .bfje-title {
- display: flex;
- align-items: center;
- margin-bottom: 1rpx;
- }
- .bf-img {
- width: 32rpx;
- height: 32rpx;
- margin-right: 1rpx;
- }
- .tj-box {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .bf-box {
- width: 376rpx;
- height: auto;
- }
- .bf-num {
- width: 376rpx;
- height: 180rpx;
- position: relative;
- margin-bottom: 24rpx;
- }
- .bf-title {
- width: 100%;
- height: 56rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
- }
- .yh-bg {
- position: absolute;
- top: 0;
- height: 0;
- width: 100%;
- height: 100%;
- z-index: 2;
- }
- .yh-img {
- width: 36rpx;
- height: 36rpx;
- margin-right: 1rpx;
- }
- .yhbf-img {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- z-index: 2;
- }
- .hx-box {
- width: 280rpx;
- height: 280rpx;
- }
- .scroll-view-css {
- width: 100%;
- height: 1060rpx;
- overflow: auto;
- }
- .scroll-view-css ::-webkit-scrollbar {
- display: none;
- }
- .item-box {
- width: 100%;
- height: 136rpx;
- background: rgba(0, 161, 255, 0.05);
- border-radius: 48rpx;
- margin-bottom: 32rpx;
- padding: 28rpx 48rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .user-box {
- display: flex;
- align-items: center;
- }
- .user-img {
- width: 80rpx;
- height: 80rpx;
- border-radius: 50%;
- margin-right: 16rpx;
- }
- .column-box {
- padding: 40rpx 0 28rpx;
- box-sizing: border-box;
- }
- .w-max-441{
- max-width: 100rpx;
- }
- </style>
|