分销模块页面接口完成

This commit is contained in:
2025-11-20 10:26:25 +08:00
parent c6a1751e72
commit 1070049a9d
10 changed files with 1397 additions and 173 deletions

View File

@@ -24,7 +24,7 @@
</view>
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
<view
v-if="active == 1"
v-if="active == 1 || active == 2"
class="u-flex u-row-between u-m-t-32"
style="gap: 58rpx"
>
@@ -57,35 +57,105 @@
</template>
</view>
</view>
<!-- <view class="u-flex u-m-t-40" v-if="active == 1">
<view class="u-flex color-333" @click="showShopSelActionSheetFun">
<text class="u-line-1" style="max-width: 300rpx">{{
selShop.shopName || "全部门店"
}}</text>
<up-icon name="arrow-down-fill" size="12" color="#333"></up-icon>
<view
v-if="active ==3"
class="u-flex u-row-between u-m-t-32"
style="gap: 30rpx"
>
<view
class="u-font-28 filter-box u-flex u-row-between"
@click="showTimeArea = true"
>
<template
v-if="false"
>
<text class="u-font-20">
</text>
</template>
<template v-else>
<text class="color-999 u-m-r-10">全部</text>
<up-icon name="arrow-down" size="12"></up-icon>
</template>
</view>
<view class="u-flex-1 u-p-l-16">
<up-search
bgColor="#F9F9F9"
height="60rpx"
:showAction="false"
placeholder="搜索订单号"
@search="search"
@clear="search"
v-model="searchText"
></up-search>
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
<up-icon name="search" size="18"></up-icon>
<input
class="u-m-l-10 u-font-28"
type="text"
placeholder-class="color-999 u-font-28"
placeholder="分销员昵称/手机号"
v-model="keyWord"
@blur="keyWordBlur"
/>
</view>
</view> -->
</view>
<view
class="u-flex-1 u-font-28 filter-box u-flex u-row-between"
@click="showTimeArea = true"
>
<template
v-if="userComponentQuery.startTime && userComponentQuery.endTime"
>
<text class="u-font-20">
{{ userComponentQuery.startTime }} -
{{ userComponentQuery.endTime }}
</text>
</template>
<template v-else>
<text class="color-999">请选择日期</text>
<up-icon name="arrow-right" size="12"></up-icon>
</template>
</view>
</view>
<view v-if="active==2" class="u-flex u-p-l-32 u-p-r-32 u-m-t-32">
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{ listRes.totalCount}}</view>
<view class="u-font-24 color-666 u-m-t-16">支付开通人数</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{ listRes.totalAmount}}</view>
<view class="u-font-24 color-666 u-m-t-16">支付开通人数</view>
</view>
</view>
<view v-if="active==3" class="u-flex u-m-t-32">
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{ listRes.successAmount}}</view>
<view class="u-font-24 color-666 u-m-t-16">已入账金额</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{ listRes.pendingAmount||0}}</view>
<view class="u-font-24 color-666 u-m-t-16">待入账金额</view>
</view>
<view class="u-flex-1 u-text-center">
<view class="u-font-32 color-main font-bold">{{ listRes.balanceAmount}}</view>
<view class="u-font-24 color-666 u-m-t-16 ">
<text>运营余额</text>
<text class="color-main" @click="go.to('PAGES_PAY')">充值></text>
</view>
</view>
</view>
</view>
</up-sticky>
<configVue v-if="active == 0"></configVue>
<fenxiaoUserListVue
v-if="active == 1"
:list="list"
:isEnd="isEnd"
@refresh="fenxaioListRefresh"
@refresh="refresh"
></fenxiaoUserListVue>
<openListVue
v-if="active == 2"
:list="list"
:isEnd="isEnd"
@refresh="refresh"
></openListVue>
<fenxiaoMingxiVue
v-if="active == 3"
:list="list"
:isEnd="isEnd"
@refresh="refresh"
></fenxiaoMingxiVue>
<!-- 选择门店 -->
<shopSelActionSheetVue
@choose="chooseShop"
@@ -100,6 +170,8 @@
@close="showTimeArea = false"
@confirm="confirmTimeArea"
></dateAreaSel>
</view>
</template>
<script setup>
@@ -111,7 +183,7 @@ import {
onReachBottom,
onBackPress,
} from "@dcloudio/uni-app";
import go from "@/commons/utils/go.js";
import { ref, onMounted, watch, provide } from "vue";
import * as consumeCashbackApi from "@/http/api/market/consumeCashback.js";
import * as distributionApi from "@/http/api/market/distribution.js";
@@ -119,6 +191,8 @@ import configVue from "./components/config.vue";
import shopSelActionSheetVue from "@/pageMarket/components/shop-sel-action-sheet.vue";
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
import fenxiaoUserListVue from "./components/fenxiao-user-list.vue";
import openListVue from "./components/open-list.vue";
import fenxiaoMingxiVue from "./components/fenxiao-mingxi.vue";
import { useDistributionStore } from "@/store/market.js";
import { reactive } from "vue";
@@ -204,21 +278,61 @@ watch(
}
);
function fenxaioListRefresh(){
isEnd.value = false;
pageNum.value = 1;
getList();
function refresh() {
isEnd.value = false;
pageNum.value = 1;
getList();
}
const listRes=ref({})
async function getList() {
const res = await distributionApi.distributionUser({
page: pageNum.value,
size: 10,
user: userComponentQuery.user,
startTime: userComponentQuery.startTime? userComponentQuery.startTime+' 00:00:00' :'',
endTime: userComponentQuery.endTime? userComponentQuery.endTime+' 23:59:59' :'',
});
let res = null;
if (active.value == 1) {
//分销员列表
res = await distributionApi.distributionUser({
page: pageNum.value,
size: 10,
user: userComponentQuery.user,
startTime: userComponentQuery.startTime
? userComponentQuery.startTime + " 00:00:00"
: "",
endTime: userComponentQuery.endTime
? userComponentQuery.endTime + " 23:59:59"
: "",
});
}
if (active.value == 2) {
//开通记录
res = await distributionApi.openFlow({
page: pageNum.value,
size: 10,
key: userComponentQuery.user,
startTime: userComponentQuery.startTime
? userComponentQuery.startTime + " 00:00:00"
: "",
endTime: userComponentQuery.endTime
? userComponentQuery.endTime + " 23:59:59"
: "",
});
}
if (active.value == 3) {
//分销明细
res = await distributionApi.distributionFlow({
page: pageNum.value,
size: 10,
key: userComponentQuery.user,
startTime: userComponentQuery.startTime
? userComponentQuery.startTime + " 00:00:00"
: "",
endTime: userComponentQuery.endTime
? userComponentQuery.endTime + " 23:59:59"
: "",
});
}
if (res) {
listRes.value=res
if (pageNum.value == 1) {
list.value = res.records || [];
} else {
@@ -235,7 +349,7 @@ const showShopSelActionSheet = ref(false);
function showShopSelActionSheetFun() {
showShopSelActionSheet.value = true;
}
const active = ref(1);
const active = ref(3);
watch(
() => active.value,
(newval) => {
@@ -244,6 +358,12 @@ watch(
getList();
}
);
watch(
() => active.value,
(newval) => {
refresh();
}
);
onReachBottom(() => {
if (!isEnd.value) {
pageNum.value++;