admin模块接入数据库
This commit is contained in:
@@ -15,12 +15,12 @@
|
||||
|
||||
<view class="filter-item">
|
||||
<text class="label-txt">退款时间:</text>
|
||||
<view class="date-picker-mock">
|
||||
<text class="date-txt">开始日期</text>
|
||||
<text class="date-split">-</text>
|
||||
<text class="date-txt">结束日期</text>
|
||||
<text class="calendar-ic">📅</text>
|
||||
</view>
|
||||
<AnalyticsDateRangePicker
|
||||
:initialStartDate="startDate"
|
||||
:initialEndDate="endDate"
|
||||
@apply="onApplyRange"
|
||||
@clear="onClearRange"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="filter-item">
|
||||
@@ -103,6 +103,7 @@
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import AnalyticsDateRangePicker from '@/components/analytics/AnalyticsDateRangePicker.uvue'
|
||||
import { fetchRefundOrderPage } from '@/services/orderService.uts'
|
||||
|
||||
interface RefundOrder {
|
||||
@@ -127,6 +128,9 @@ const page = ref(1)
|
||||
const pageSize = ref(15)
|
||||
const jumpPage = ref('')
|
||||
|
||||
const startDate = ref('')
|
||||
const endDate = ref('')
|
||||
|
||||
const totalPages = computed((): number => {
|
||||
if (pageSize.value <= 0) return 1
|
||||
const pages = Math.ceil(total.value / pageSize.value)
|
||||
@@ -149,9 +153,24 @@ const onStatusChange = (e : any) => {
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
function onApplyRange(payload : any) {
|
||||
startDate.value = payload?.start ?? ''
|
||||
endDate.value = payload?.end ?? ''
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
function onClearRange() {
|
||||
startDate.value = ''
|
||||
endDate.value = ''
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const loadRefundOrders = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const st = startDate.value ? (startDate.value + ' 00:00:00') : null
|
||||
const et = endDate.value ? (endDate.value + ' 23:59:59') : null
|
||||
|
||||
const res = await fetchRefundOrderPage(
|
||||
page.value,
|
||||
pageSize.value,
|
||||
@@ -159,7 +178,7 @@ const loadRefundOrders = async () => {
|
||||
searchQuery.value
|
||||
)
|
||||
|
||||
orderList.value = res.items.map((item: any): RefundOrder => {
|
||||
orderList.value = res.items.map((item : any) : RefundOrder => {
|
||||
const refundStatusCode = parseInt(String(item.refund_status ?? '0'))
|
||||
const orderStatusCode = parseInt(String(item.order_status ?? '0'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user