123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <template>
- <view class="page">
- <view class="timePicker" @click="show = true">{{ `${year}年${month}月` }}
- <u-icon class="icon" size="10" color="#CCCCCC" style="margin-left: 8rpx;" name="arrow-down-fill"></u-icon>
- </view>
- <view class="card">
- <view class="item" v-for="(item, index) in list" :key="index">
- <view class="phone_amount">
- <view class="phone">
- {{ item.phone || '匿名' }}
- </view>
- <view class="amount">
- ¥{{ currency(item.total, { fromCents: true }) }}
- </view>
- </view>
- <view class="date_type">
- <view class="date">{{ $u.timeFormat(new Date(item.receiptsTime), 'yyyy-mm-dd') }}</view>
- <view class="type">{{ item.planningName }}</view>
- </view>
- </view>
- </view>
- <u-empty iconSize="90px" textSize="14px" v-if="list.length == 0"></u-empty>
- <u-datetime-picker :show="show" v-model="time" mode="year-month" @cancel="show = false" @close="show = false"
- @confirm="confirm"></u-datetime-picker>
- </view>
- </template>
- <script>
- import { rewardDetailList } from "@/api/invite"
- import currency from '@/utils/currency'
- export default {
- data() {
- return {
- show: false,
- currency: currency,
- month: '',
- year: '',
- list: [],
- time: new Date()
- };
- },
- methods: {
- getRewardDetailList(query) {
- rewardDetailList(query).then(({ content }) => {
- if (content) {
- this.list = content
- }
- })
- },
- confirm({ value }) {
- this.year = new Date(value).getFullYear()
- this.month = new Date(value).getMonth() + 1
- this.getRewardDetailList({
- year: this.year,
- month: this.month
- })
- this.show = false
- }
- },
- onShow() {
- console.log(currency)
- const date = new Date()
- this.year = date.getFullYear()
- this.month = date.getMonth() + 1
- this.getRewardDetailList({
- year: this.year,
- month: this.month
- })
- }
- };
- </script>
- <style lang="scss" scoped>
- .page {
- min-height: 100vh;
- background-color: #F9F9F9;
- padding: 20rpx 24rpx;
- .timePicker {
- color: #181818;
- font-size: 28rpx;
- display: flex;
- align-items: center;
- }
- .card {
- background-color: #ffffff;
- border-radius: 16rpx;
- .item {
- border-top: 1px solid #F0F0F0;
- padding: 28rpx 24rpx;
- margin-top: 20rpx;
- &:first-child {
- border-top: none;
- }
- .phone_amount {
- display: flex;
- justify-content: space-between;
- .phone {
- font-size: 28rpx;
- color: #181818;
- }
- .amount {
- font-size: 28rpx;
- color: #FF3E3E;
- font-weight: bold;
- }
- margin-bottom: 8rpx;
- }
- .date_type {
- display: flex;
- justify-content: space-between;
- .date {
- font-size: 22rpx;
- color: #CCCCCC;
- }
- .type {
- font-size: 22rpx;
- color: #CCCCCC;
- }
- }
- }
- }
- }
- </style>
|