128 lines
4.9 KiB
Vue
128 lines
4.9 KiB
Vue
<template>
|
|
<crud-layout bg="/static/page/blue-bg.png">
|
|
<z-paging ref="pageRef" :fixed="false" height="100%" v-model="pageHook.list" :default-page-size="10"
|
|
safe-area-inset-bottom :loading-more-enabled="false" :show-scrollbar="false" @query="query"
|
|
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
|
|
<template #top>
|
|
<view class="flex items-center justify-between my-2">
|
|
<view class="flex-1 bg-white rounded-12rpx p-20rpx flex justify-between items-center">
|
|
<text class="text-30 font-600">流水统计</text>
|
|
<tm-text color="#999999" font-size="26">{{ formatVal }}</tm-text>
|
|
<view class="flex items-center cursor-pointer">
|
|
<tm-between-time start="2020-1-1" end="2050-1-1" v-model="state.date"
|
|
v-model:model-str="state.formatVal" @confirm="datePickerConfirm" format="YYYY-MM-DD"
|
|
:quickDate="[]" drawerSize="900">
|
|
<image class="w-[30rpx] h-[30rpx]" src="@/static/page/filter.svg" />
|
|
<text class="ml-1 text-30">筛选</text>
|
|
</tm-between-time>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<view class="bg-white rounded-16rpx p-2 mb-2" v-for="(v, i) in pageHook.list" :key="i">
|
|
<view class="flex justify-between items-center text-sm text-gray-800 mb-1">
|
|
<view class="flex items-center">
|
|
<image class="w-50rpx h-50rpx rounded-8rpx" :src="$fileUrl(filePath(v.logoPic))" mode="aspectFill" @error="$fileRetry(filePath(v.logoPic))" />
|
|
<view class="ml-2">{{ v.merchantName }}</view>
|
|
</view>
|
|
<view>{{ v.day }}</view>
|
|
</view>
|
|
<view class="bg-gray-100 rounded-12rpx p-2">
|
|
<view class="flex justify-between mb-2">
|
|
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx">
|
|
<text class="flex-1 text-sm text-center text-gray-600">流水金额</text>
|
|
<text class="flex-1 text-sm text-center text-gray-800">¥ {{ hooks.useMoney(v.totalPayPrice)
|
|
}}</text>
|
|
</view>
|
|
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx ml-2">
|
|
<text class="flex-1 text-sm text-center text-gray-600">流水次数</text>
|
|
<text class="flex-1 text-sm text-center text-gray-800">{{ v.totalPayCount || 0 }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="flex justify-between mb-2">
|
|
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx">
|
|
<text class="flex-1 text-sm text-center text-gray-600">盈利金额</text>
|
|
<text class="flex-1 text-sm text-center text-green-500">¥ {{
|
|
hooks.useMoney(v.totalProfitPrice)
|
|
}}</text>
|
|
</view>
|
|
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx ml-2">
|
|
<text class="flex-1 text-sm text-center text-gray-600">盈利次数</text>
|
|
<text class="flex-1 text-sm text-center text-green-500">{{ v.totalProfitCount || 0 }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="flex justify-between mb-0">
|
|
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx">
|
|
<text class="flex-1 text-sm text-center text-gray-600">退款金额</text>
|
|
<text class="flex-1 text-sm text-center text-red-500">¥ {{
|
|
hooks.useMoney(v.totalRefundPrice) }}</text>
|
|
</view>
|
|
<view class="flex-1 flex items-center p-2 bg-white rounded-8rpx ml-2">
|
|
<text class="flex-1 text-sm text-center text-gray-600">退款次数</text>
|
|
<text class="flex-1 text-sm text-center text-red-500">{{ v.totalRefundCount || 0 }}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="fixed bottom-200rpx right-40rpx">
|
|
<tm-button size="m" class="px-1 ml-1" @click="doWaterTotal">每月流水合计</tm-button>
|
|
</view>
|
|
</z-paging>
|
|
</crud-layout>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, reactive, computed } from "vue"
|
|
import { onLoad, onShow } from "@dcloudio/uni-app"
|
|
import { hooks } from "@@/index"
|
|
import { filePath } from "@@/utils/file"
|
|
import { flowStatisticsApi } from "@@/api"
|
|
|
|
const pageRef = ref<any>(null)
|
|
const state = reactive<any>({
|
|
pa: {
|
|
createTimeList: [],
|
|
},
|
|
formatVal: "",
|
|
date: [],
|
|
})
|
|
const formatVal = computed(() => (state.date.length === 2 ? state.formatVal : ""))
|
|
const pageHook = hooks.usePage(pageRef, flowStatisticsApi.page, null, "data")
|
|
|
|
onLoad(() => {
|
|
const app = getApp()
|
|
app._initTabbar()
|
|
})
|
|
onShow(() => {
|
|
const isLogin = hooks.useCheckLogin()
|
|
if (!isLogin) return
|
|
if (pageRef.value) {
|
|
pageRef.value.reload(false)
|
|
}
|
|
})
|
|
|
|
const query = (page: number, pagesize: number) => {
|
|
const isLogin = hooks.useStaticCheckLogin()
|
|
if (!isLogin) return
|
|
pageHook.startPage(page, pagesize, false, state.pa)
|
|
}
|
|
|
|
// 时间范围选择器确认
|
|
const datePickerConfirm = (date: any) => {
|
|
const list = formatVal.value.split("~")
|
|
if (list && list.length == 2) {
|
|
state.pa.createTimeList = [list[0] + " 00:00:00", list[1] + " 23:59:59"]
|
|
}
|
|
pageRef.value.reload(false)
|
|
}
|
|
|
|
// 月度流水
|
|
const doWaterTotal = () => {
|
|
uni.navigateTo({
|
|
url: "/pages/water/waterTotal",
|
|
})
|
|
}
|
|
</script>
|