处理数据看板
This commit is contained in:
95
pages/data/index.vue
Normal file
95
pages/data/index.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<view class="page-content">
|
||||
<nut-calendar title="选择想要的日期" :show-sub-title="false" :poppable="false" :default-value="date"
|
||||
:start-date="startDate" :end-date="endDate" @choose="onChoose" @select="onSelect"></nut-calendar>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
onMounted,
|
||||
reactive,
|
||||
ref
|
||||
} from 'vue';
|
||||
import {
|
||||
onLoad,
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
navigateTo,
|
||||
} from '@/utils/helper';
|
||||
import {
|
||||
fetchOrderList,
|
||||
} from '@/api/index';
|
||||
|
||||
|
||||
|
||||
// 获取上月的第一天
|
||||
const getLastMonthFirstDay = () => {
|
||||
const date = new Date();
|
||||
date.setMonth(date.getMonth() - 1); // 设置为上个月
|
||||
date.setDate(1); // 设置为本月的第一天
|
||||
return formatDate(date);
|
||||
};
|
||||
|
||||
// 获取本月的最后一天
|
||||
const getCurrentMonthLastDay = () => {
|
||||
const date = new Date();
|
||||
date.setMonth(date.getMonth() + 1); // 设置为下个月
|
||||
date.setDate(0); // 设置为下个月的最后一天
|
||||
return formatDate(date);
|
||||
};
|
||||
|
||||
// 格式化日期为 Y-m-d 格式
|
||||
const formatDate = (date) => {
|
||||
const year = date.getFullYear();
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // 获取月份并确保是两位数
|
||||
const day = date.getDate().toString().padStart(2, '0'); // 获取日期并确保是两位数
|
||||
return `${year}-${month}-${day}`;
|
||||
};
|
||||
|
||||
// 获取上月的第一天和本月的最后一天
|
||||
const startDate = ref(getLastMonthFirstDay());
|
||||
const endDate = ref(getCurrentMonthLastDay());
|
||||
// const date = ref(formatDate(new Date())); // 获取今天的日期并格式化为 Y-m-d 格式
|
||||
const date = ref('');
|
||||
|
||||
const onChoose = (e) => {
|
||||
console.log('onChoose', e);
|
||||
}
|
||||
const onSelect = (e) => {
|
||||
console.log('onSelect', e);
|
||||
uni.navigateTo({
|
||||
url: `/pages/data/list?date=${e[3]}`
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
onLoad((options) => {
|
||||
// current_tab_idx.value = parseInt(options.tab)
|
||||
})
|
||||
|
||||
/**
|
||||
* 页面显示生命周期钩子
|
||||
* 每次页面显示时都会执行
|
||||
*/
|
||||
onShow(() => {
|
||||
// 获取配置
|
||||
// getConfig()
|
||||
// if (paging.value) {
|
||||
// // paging.value.pageNo = 1;
|
||||
// paging.value.refresh();
|
||||
// // paging.value.refreshToPage(1)
|
||||
// // paging.value.reload();
|
||||
// }
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<style scoped lang="scss">
|
||||
.page-content {
|
||||
min-height: 100vh;
|
||||
background-color: #f2f3f5;
|
||||
}
|
||||
</style>
|
||||
8
pages/data/list.vue
Normal file
8
pages/data/list.vue
Normal file
@@ -0,0 +1,8 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -16,7 +16,7 @@
|
||||
<nut-grid-item text="订单管理" @click="navigateTo('/pages/order/index?tab=0')">
|
||||
<nut-icon name="order"></nut-icon>
|
||||
</nut-grid-item>
|
||||
<nut-grid-item text="运营数据" @click="navigateTo('/pages/order/shopOrder/index?tab=0')">
|
||||
<nut-grid-item text="运营数据" @click="navigateTo('/pages/data/index')">
|
||||
<nut-icon name="eye"></nut-icon>
|
||||
</nut-grid-item>
|
||||
</nut-grid>
|
||||
|
||||
@@ -251,11 +251,14 @@
|
||||
color: #666;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.room-id {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.remark {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.room-id {
|
||||
font-size: 26rpx;
|
||||
padding-top: 40rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user