|
|
@@ -1,8 +1,8 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { ref } from "vue";
|
|
|
-import { safeAreaInsets, menuButtonInfo } from "@/utils";
|
|
|
-import CustomNavigationBar from "@/components/CustomNavigationBar.vue";
|
|
|
+import { computed, ref } from "vue";
|
|
|
import { getImageUrl } from "@/utils/imageUtil";
|
|
|
+import LsvList from "@/components/listScrollView/index.vue";
|
|
|
+import { getWriteOffIncomeList } from "@/api/my";
|
|
|
|
|
|
definePage({
|
|
|
style: {
|
|
|
@@ -11,72 +11,63 @@ definePage({
|
|
|
},
|
|
|
});
|
|
|
|
|
|
-const totalIncome = ref("38.00");
|
|
|
+const totalAmount = ref();
|
|
|
|
|
|
-const shareList = ref([
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- couponName: "某某某某某优惠券",
|
|
|
- income: "2.00",
|
|
|
- receiveTime: "2026-05-18 19:00:00",
|
|
|
- receiver: "林雨欣",
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- couponName: "某某某某某优惠券",
|
|
|
- income: "17.00",
|
|
|
- receiveTime: "2026-05-18 19:00:00",
|
|
|
- receiver: "吴雨桐",
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- couponName: "某某某某某优惠券",
|
|
|
- income: "18.00",
|
|
|
- receiveTime: "2026-05-18 19:00:00",
|
|
|
- receiver: "周昭宁",
|
|
|
- },
|
|
|
- {
|
|
|
- id: 4,
|
|
|
- couponName: "某某某某某优惠券",
|
|
|
- income: "8.00",
|
|
|
- receiveTime: "2026-05-18 19:00:00",
|
|
|
- receiver: "周宇轩",
|
|
|
- },
|
|
|
+const tabList = ref([
|
|
|
+ { label: "今天", value: "1" },
|
|
|
+ { label: "近30天", value: "2" },
|
|
|
]);
|
|
|
+const currentTab = ref("1");
|
|
|
|
|
|
-function handleViewDetail(item) {
|
|
|
- uni.showToast({
|
|
|
- title: `查看 ${item.couponName} 详情`,
|
|
|
- icon: "none",
|
|
|
- });
|
|
|
-}
|
|
|
+const showPicker = ref(false);
|
|
|
+const defaultStart = ref();
|
|
|
+const defaultEnd = ref();
|
|
|
|
|
|
-// 定义tab列表
|
|
|
-const tabList = ref([
|
|
|
- { label: "今天", value: "0" },
|
|
|
- { label: "近30天", value: "1" },
|
|
|
-]);
|
|
|
-// 当前选中的tab
|
|
|
-const currentTab = ref("0");
|
|
|
+const listRef = ref();
|
|
|
|
|
|
-// 点击tab事件
|
|
|
const handleTabClick = (value) => {
|
|
|
currentTab.value = value;
|
|
|
- console.log("选中tab:", value);
|
|
|
+ reloadListRef();
|
|
|
};
|
|
|
|
|
|
-const showPicker = ref(false);
|
|
|
-const defaultStart = "";
|
|
|
-const defaultEnd = "";
|
|
|
-
|
|
|
const handleConfirm = (value: { startDate: string; endDate: string }) => {
|
|
|
- console.log("选中的日期范围:", value);
|
|
|
- // 处理业务逻辑
|
|
|
+ defaultStart.value = value.startDate;
|
|
|
+ defaultEnd.value = value.endDate;
|
|
|
+ reloadListRef();
|
|
|
+};
|
|
|
+
|
|
|
+const reloadListRef = () => {
|
|
|
+ listRef.value.reloadList({
|
|
|
+ startTime: defaultStart.value ? defaultStart.value + " 00:00:00" : "",
|
|
|
+ endTime: defaultEnd.value ? defaultEnd.value + " 23:59:59" : "",
|
|
|
+ timeType: currentTab.value,
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleCancel = () => {
|
|
|
console.log("取消选择");
|
|
|
};
|
|
|
+
|
|
|
+const getCouponListApi = (params) => {
|
|
|
+ return getWriteOffIncomeList({
|
|
|
+ pageNo: params.pageNo,
|
|
|
+ pageSize: params.pageSize,
|
|
|
+ timeType: params.timeType ?? 1,
|
|
|
+ startTime: params.startTime || "",
|
|
|
+ endTime: params.endTime || "",
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const afterFetch = (item) => {
|
|
|
+ totalAmount.value = item.totalAmount;
|
|
|
+};
|
|
|
+
|
|
|
+const dateRangeText = computed(() => {
|
|
|
+ if (defaultStart.value && defaultEnd.value) {
|
|
|
+ return `${defaultStart.value} - ${defaultEnd.value}`;
|
|
|
+ }
|
|
|
+ return "日期筛选";
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -92,7 +83,7 @@ const handleCancel = () => {
|
|
|
backgroundPosition: 'center'
|
|
|
}">
|
|
|
<text class="income-label">核销累计收益(元)</text>
|
|
|
- <text class="income-amount">3859.00</text>
|
|
|
+ <text class="income-amount">{{totalAmount || 0}}</text>
|
|
|
</view>
|
|
|
|
|
|
<view class="filter-box">
|
|
|
@@ -107,8 +98,7 @@ const handleCancel = () => {
|
|
|
<view class="income-line"></view>
|
|
|
<view class='income-select'>
|
|
|
<view class='income-time' @click='showPicker=true'>
|
|
|
- <!-- <view class='income-time-name'>2026 05.10-2026 05.12 </view> -->
|
|
|
- <view class='income-time-name'>日期筛选 </view>
|
|
|
+ <view class='income-time-name'>{{ dateRangeText }}</view>
|
|
|
<view class="caret" />
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -123,61 +113,64 @@ const handleCancel = () => {
|
|
|
<text class="total-label">总收益</text>
|
|
|
<view>
|
|
|
<text class="total-symbol">¥</text>
|
|
|
- <text class="total-amount">{{ totalIncome }}</text>
|
|
|
+ <text class="total-amount">{{ totalAmount || 0 }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="records-list">
|
|
|
- <view v-for="(item, index) in shareList" :key="item.id" class="record-item">
|
|
|
-
|
|
|
- <view class="record-bottom">
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">优惠券名称</text>
|
|
|
- <text class="info-value">¥{{ item.income }}</text>
|
|
|
- </view>
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">核销时间</text>
|
|
|
- <text class="info-value">{{ item.receiver }}</text>
|
|
|
- </view>
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">核销用户</text>
|
|
|
- <view class="income-person">
|
|
|
- <u--image class='income-phone' :src="getImageUrl('@img/me/head.png')" width="42rpx" height="42rpx"
|
|
|
- shape="circle">
|
|
|
- </u--image>
|
|
|
- <view>林雨欣</view>
|
|
|
+ <LsvList ref="listRef" :api="getCouponListApi" key-name="detailList" @afterFetch='afterFetch'>
|
|
|
+ <template #list="{ data }">
|
|
|
+ <view class="records-list">
|
|
|
+ <view v-for="(item, index) in data" :key="item.id" class="record-item">
|
|
|
+ <view class="record-bottom">
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">优惠券名称</text>
|
|
|
+ <text class="info-value">{{ item.couponName }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">核销时间</text>
|
|
|
+ <text class="info-value">{{ item.writeOffTime }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">核销用户</text>
|
|
|
+ <view class="income-person">
|
|
|
+ <u--image class='income-phone' :src="item.writeOffUserUrl || getImageUrl('@img/me/head.png')" width="42rpx" height="42rpx"
|
|
|
+ shape="circle">
|
|
|
+ </u--image>
|
|
|
+ <view>{{ item.writeOffUserNickName }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">联系方式</text>
|
|
|
+ <text class="info-value">{{ item.writeOffUserPhone }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">商品类目</text>
|
|
|
+ <text class="info-value">{{ item.commodityCategory }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">商品名称</text>
|
|
|
+ <text class="info-value">{{ item.productName }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">核销商家</text>
|
|
|
+ <text class="info-value">{{ item.writeOffMerchant }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">实付金额</text>
|
|
|
+ <text class="info-value">¥{{ item.actualPaymentAmount }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="info-row">
|
|
|
+ <text class="info-label">获得佣金</text>
|
|
|
+ <text class="income-value">¥{{ item.commission }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">联系方式</text>
|
|
|
- <text class="info-value">{{ item.receiveTime }}</text>
|
|
|
- </view>
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">核销类型</text>
|
|
|
- <text class="info-value">{{ item.receiveTime }}</text>
|
|
|
- </view>
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">商品名称</text>
|
|
|
- <text class="info-value">{{ item.receiveTime }}</text>
|
|
|
- </view>
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">核销商家</text>
|
|
|
- <text class="info-value">{{ item.receiveTime }}</text>
|
|
|
- </view>
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">实付金额</text>
|
|
|
- <text class="info-value">{{ item.receiveTime }}</text>
|
|
|
- </view>
|
|
|
- <view class="info-row">
|
|
|
- <text class="info-label">获得佣金</text>
|
|
|
- <text class="income-value">{{ item.receiveTime }}</text>
|
|
|
+
|
|
|
+ <view v-if="index < data.length - 1" class="record-divider"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view v-if="index < shareList.length - 1" class="record-divider"></view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
+ </template>
|
|
|
+ </LsvList>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -191,8 +184,13 @@ const handleCancel = () => {
|
|
|
.share-info-container {
|
|
|
min-height: 100vh;
|
|
|
background: #f8f8fa;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
|
|
|
.share-info-content {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
padding: 32rpx 0;
|
|
|
}
|
|
|
|
|
|
@@ -294,6 +292,7 @@ const handleCancel = () => {
|
|
|
border-radius: 32rpx;
|
|
|
padding: 32rpx 32rpx 0 32rpx;
|
|
|
margin: 0 32rpx;
|
|
|
+ flex: 1;
|
|
|
.card-header {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|