分销模块页面接口完成
This commit is contained in:
parent
c6a1751e72
commit
1070049a9d
|
|
@ -419,3 +419,12 @@ text {
|
||||||
::v-deep .u-m-t-16 .u-textarea{
|
::v-deep .u-m-t-16 .u-textarea{
|
||||||
border-width: 1px!important;
|
border-width: 1px!important;
|
||||||
}
|
}
|
||||||
|
.font-700{
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.text-center{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.bg-f7{
|
||||||
|
background-color: #F7F7F7;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,317 @@
|
||||||
|
<template>
|
||||||
|
<view class="min-page u-font-28">
|
||||||
|
<up-sticky>
|
||||||
|
<view class="top">
|
||||||
|
<up-search
|
||||||
|
v-model="searchText"
|
||||||
|
placeholder="搜索昵称、手机号"
|
||||||
|
@clear="refresh"
|
||||||
|
@search="refresh"
|
||||||
|
@custom="refresh"
|
||||||
|
></up-search>
|
||||||
|
</view>
|
||||||
|
</up-sticky>
|
||||||
|
|
||||||
|
<view class="list u-m-t-32">
|
||||||
|
<template v-if="list.length > 0">
|
||||||
|
<view class="box">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
|
class="item"
|
||||||
|
@tap="chooseUser(index, item)"
|
||||||
|
>
|
||||||
|
<view class="u-flex u-row-between u-relative">
|
||||||
|
<view class="u-flex">
|
||||||
|
<view class="headimg u-flex u-row-center u-col-center">
|
||||||
|
<image
|
||||||
|
v-if="item.headImg"
|
||||||
|
:src="item.headImg"
|
||||||
|
class="img"
|
||||||
|
mode=""
|
||||||
|
></image>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-l-12">
|
||||||
|
<view class="u-flex">
|
||||||
|
<view>{{ item.nickName }}</view>
|
||||||
|
<view class="u-m-l-14">{{ item.phone }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="vip" v-if="item.isVip"
|
||||||
|
>会员等级{{ item.memberLevelName }}</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between">
|
||||||
|
<view class="u-m-t-16 u-flex money" style="gap: 64rpx">
|
||||||
|
<view class="">
|
||||||
|
<view class="color-333 u-font-32 font-bold">{{
|
||||||
|
item.amount
|
||||||
|
}}</view>
|
||||||
|
|
||||||
|
<view class="u-flex u-m-t-12" style="align-items: baseline">
|
||||||
|
<text class="color-666">余额</text>
|
||||||
|
<up-icon name="arrow-right" size="14"></up-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="">
|
||||||
|
<view class="color-333 u-font-32 font-bold">{{
|
||||||
|
item.accountPoints
|
||||||
|
}}</view>
|
||||||
|
|
||||||
|
<view class="u-flex u-m-t-12" style="align-items: baseline">
|
||||||
|
<text class="color-666">积分</text>
|
||||||
|
<up-icon name="arrow-right" size="14"></up-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="">
|
||||||
|
<view class="color-333 u-font-32 font-bold">{{
|
||||||
|
item.accountPoints
|
||||||
|
}}</view>
|
||||||
|
|
||||||
|
<view class="u-flex u-m-t-12" style="align-items: baseline">
|
||||||
|
<text class="color-666">优惠券</text>
|
||||||
|
<up-icon name="arrow-right" size="14"></up-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<my-radio
|
||||||
|
v-if="!isFenxiaoYuan(item)"
|
||||||
|
shape="square"
|
||||||
|
@change="chooseUser(index, item)"
|
||||||
|
v-model="item.checked"
|
||||||
|
:size="18"
|
||||||
|
border-color="#d1d1d1"
|
||||||
|
></my-radio>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-32">
|
||||||
|
<my-pagination
|
||||||
|
:page="query.page"
|
||||||
|
:totalElements="query.totalElements"
|
||||||
|
:size="query.size"
|
||||||
|
@change="pageChange"
|
||||||
|
></my-pagination>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-if="hasAjax && list.length <= 0">
|
||||||
|
<my-img-empty tips="未找到相关用户"></my-img-empty>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
<view class="fixed-bottom">
|
||||||
|
<view class="u-flex-1 btn">已选择{{ hasSelected.length }}名用户</view>
|
||||||
|
<view class="u-flex-1 btn" @click="back">取消</view>
|
||||||
|
<view class="u-flex-1 btn my-bg-main" @click="confirm">确认</view>
|
||||||
|
</view>
|
||||||
|
<view style="height: 160rpx"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { ref, onMounted, computed } from "vue";
|
||||||
|
import { shopUserList } from "@/http/api/shopUser.js";
|
||||||
|
import * as distributionApi from "@/http/api/market/distribution.js";
|
||||||
|
|
||||||
|
const searchText = ref("");
|
||||||
|
|
||||||
|
const list = ref([]);
|
||||||
|
const pageNum = ref(1);
|
||||||
|
const isEnd = ref(false);
|
||||||
|
async function getList() {
|
||||||
|
const res = await shopUserList({
|
||||||
|
page: pageNum.value,
|
||||||
|
size: 10,
|
||||||
|
key:searchText.value
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
if (pageNum.value == 1) {
|
||||||
|
list.value = (res.records || []).map((item) => {
|
||||||
|
item.checked = false;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const newArr = (res.records || []).map((item) => {
|
||||||
|
item.checked = false;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
list.value = [...list.value, ...newArr];
|
||||||
|
}
|
||||||
|
isEnd.value = pageNum.value >= res.totalPage * 1 ? true : false;
|
||||||
|
console.log(isEnd.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasSelected = computed(() => {
|
||||||
|
return list.value.filter((item) => item.checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
function refresh(){
|
||||||
|
pageNum.value = 1;
|
||||||
|
isEnd.value = false;
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
// 取消
|
||||||
|
function back() {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 判断是否是分销员
|
||||||
|
function isFenxiaoYuan(item) {
|
||||||
|
const isFenxiao = item.distributionShops.split("_")[1];
|
||||||
|
return isFenxiao;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function confirm() {
|
||||||
|
// 保留原有的前置校验
|
||||||
|
if (hasSelected.value.length <= 0) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "请选择用户",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 1. 构建所有请求的 Promise 数组(并行执行前提)
|
||||||
|
const requestPromises = hasSelected.value.map((item) =>
|
||||||
|
distributionApi.addDistributionUser({
|
||||||
|
id: item.id,
|
||||||
|
openingMethod: "手动添加",
|
||||||
|
shopId: uni.getStorageSync("shopId"),
|
||||||
|
userId: item.userId,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// 2. 使用 Promise.all 并行执行所有请求
|
||||||
|
// 特点:所有请求同时发起,等待全部成功后才继续执行
|
||||||
|
await Promise.all(requestPromises);
|
||||||
|
|
||||||
|
// 3. 所有请求成功后,统一提示(避免多次弹窗叠加)
|
||||||
|
uni.showToast({
|
||||||
|
title: `成功添加 ${hasSelected.value.length} 个用户`,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
refresh()
|
||||||
|
} catch (error) {
|
||||||
|
// 4. 错误处理:只要有一个请求失败,就会进入 catch
|
||||||
|
uni.showToast({
|
||||||
|
title: "添加失败,请重试",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
console.error("用户添加失败:", error); // 便于调试
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.min-page {
|
||||||
|
background: #f7f7f7;
|
||||||
|
}
|
||||||
|
.top {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
}
|
||||||
|
:deep(.u-search__action) {
|
||||||
|
display: flex;
|
||||||
|
width: 120rpx !important;
|
||||||
|
color: #fff !important;
|
||||||
|
padding: 10rpx 32rpx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
margin-left: 78rpx !important;
|
||||||
|
background: #318afe;
|
||||||
|
}
|
||||||
|
.scale7 {
|
||||||
|
transform: scale(0.7);
|
||||||
|
}
|
||||||
|
|
||||||
|
.search {
|
||||||
|
padding-right: 28rpx;
|
||||||
|
|
||||||
|
.icon-saoma {
|
||||||
|
margin-left: 20rpx;
|
||||||
|
width: 34rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
.no-choose {
|
||||||
|
padding: 36rpx 30rpx 36rpx 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
// padding: 32rpx 30rpx 78rpx 24rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
padding: 32rpx 30rpx;
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.headimg {
|
||||||
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||||
|
font-size: 0;
|
||||||
|
width: 84rpx;
|
||||||
|
height: 84rpx;
|
||||||
|
background-color: #eee;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 84rpx;
|
||||||
|
height: 84rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.vip {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
color: $my-main-color;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.money {
|
||||||
|
padding: 16rpx 24rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
.fixed-bottom {
|
||||||
|
position: fixed;
|
||||||
|
text-align: center;
|
||||||
|
padding: 0;
|
||||||
|
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 10;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
background-color: #3e3a3a;
|
||||||
|
color: #fff;
|
||||||
|
display: flex;
|
||||||
|
overflow: hidden;
|
||||||
|
.btn {
|
||||||
|
padding: 16rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
&:first-child {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
&:first-child::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 0;
|
||||||
|
bottom: 20rpx;
|
||||||
|
width: 1px;
|
||||||
|
border-radius: 1px;
|
||||||
|
background-color: #f7f7f7aa;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,197 @@
|
||||||
|
<template>
|
||||||
|
<view class="list u-font-28">
|
||||||
|
<view class="u-m-t-32 item" v-for="item in list" :key="item.id">
|
||||||
|
<view class="u-flex u-row-between">
|
||||||
|
<view class="color-666 u-font-24 u-flex">
|
||||||
|
<text class="no-wrap"> 关联订单:</text>
|
||||||
|
<text> {{ item.orderNo }} </text>
|
||||||
|
</view>
|
||||||
|
<view class="status" :class="[item.status]">
|
||||||
|
{{ returnStatus(item.status) }}</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-t-16">
|
||||||
|
<view>
|
||||||
|
<view class="color-333 u-font-28 u-flex u-line-1">
|
||||||
|
<text class="font-bold"> 分销员 </text>
|
||||||
|
<text class="color-666 u-font-24 u-m-l-28">
|
||||||
|
{{ item.nickName }}
|
||||||
|
</text>
|
||||||
|
<text class="color-666 u-font-24 u-m-l-10"> {{ item.phone }} </text>
|
||||||
|
</view>
|
||||||
|
<view class="color-333 u-font-28 u-flex u-m-t-16 u-line-1">
|
||||||
|
<text class="font-bold"> 下级用户 </text>
|
||||||
|
<text class="color-666 u-font-24 u-m-l-28">
|
||||||
|
{{ item.sourceNickName }}
|
||||||
|
</text>
|
||||||
|
<text class="color-666 u-font-24 u-m-l-10"> {{ item.sourcePhone }} </text>
|
||||||
|
</view>
|
||||||
|
<view class="color-333 u-font-28 u-flex u-m-t-16 u-line-1">
|
||||||
|
<text class="font-bold"> 创建时间 </text>
|
||||||
|
<text class="color-666 u-font-24 u-m-l-28">
|
||||||
|
{{ item.sourceNickName }}
|
||||||
|
</text>
|
||||||
|
<text class="color-666 u-font-24 u-m-l-10"> {{ item.createTime }} </text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view
|
||||||
|
class="text-center color-main font-bold"
|
||||||
|
:class="[ item.status == 'refund' ? 'color-red' : '']"
|
||||||
|
>{{ 0 }}</view
|
||||||
|
>
|
||||||
|
<view class="color-66 u-font-24">{{
|
||||||
|
item.level == 1 ? "直接分成" : "间接分成"
|
||||||
|
}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-p-30">
|
||||||
|
<up-loadmore :status="isEnd ? 'nomore' : 'loading'"></up-loadmore>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
reactive,
|
||||||
|
watch,
|
||||||
|
toRaw,
|
||||||
|
onMounted,
|
||||||
|
onUnmounted,
|
||||||
|
inject,
|
||||||
|
} from "vue";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
isEnd: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const statusMap = {
|
||||||
|
success: "已入账",
|
||||||
|
refund: "已退款",
|
||||||
|
pending: "待入账",
|
||||||
|
};
|
||||||
|
function returnStatus(status) {
|
||||||
|
return status in statusMap ? statusMap[status] : status;
|
||||||
|
}
|
||||||
|
|
||||||
|
const $actions = [
|
||||||
|
{
|
||||||
|
name: "更改分销组",
|
||||||
|
value: "change-group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "重置分销组",
|
||||||
|
value: "reset-group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "恢复分销员",
|
||||||
|
value: "back-fenxiao",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "取消分销员",
|
||||||
|
value: "cancel-fenxiao",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const actions = ref($actions);
|
||||||
|
|
||||||
|
const emits = defineEmits(["refresh"]);
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.list {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
padding: 32rpx 24rpx;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
border-radius: 12rpx;
|
||||||
|
padding: 8rpx 22rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
&.success {
|
||||||
|
background-color: #edfff0;
|
||||||
|
color: #5bbc6d;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.end {
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-btn {
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
padding: 8rpx 32rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.money {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 16rpx 28rpx;
|
||||||
|
}
|
||||||
|
.more {
|
||||||
|
display: flex;
|
||||||
|
height: 56rpx;
|
||||||
|
padding: 8rpx 28rpx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
border-radius: 28rpx;
|
||||||
|
border: 2rpx solid $my-main-color;
|
||||||
|
color: $my-main-color;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
position: fixed;
|
||||||
|
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||||
|
left: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
}
|
||||||
|
.status {
|
||||||
|
display: flex;
|
||||||
|
padding: 8rpx 18rpx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-radius: 0 0 8rpx 8rpx;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
&.success {
|
||||||
|
color: rgba(123, 209, 54, 1);
|
||||||
|
border-color: rgba(123, 209, 54, 1);
|
||||||
|
background-color: rgba(123, 209, 54, 0.12);
|
||||||
|
}
|
||||||
|
&.refund {
|
||||||
|
border-color: rgba(249, 50, 40, 1);
|
||||||
|
background-color: rgba(209, 64, 54, 0.12);
|
||||||
|
color: rgba(255, 47, 47, 1);
|
||||||
|
}
|
||||||
|
&.pending {
|
||||||
|
border-color: rgba(153, 153, 153, 1);
|
||||||
|
background-color: rgba(153, 153, 153, 0.12);
|
||||||
|
color: rgba(153, 153, 153, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.color-red {
|
||||||
|
color: #ff2f2f;
|
||||||
|
}
|
||||||
|
.text-center{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view style="height: 100rpx"></view>
|
<view style="height: 100rpx"></view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<my-button>添加分销员</my-button>
|
<my-button @click="go.to('PAGES_DISTRIBUTION_ADD_FENXIAO_USER')">添加分销员</my-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<up-action-sheet
|
<up-action-sheet
|
||||||
|
|
@ -99,6 +99,8 @@ import {
|
||||||
onUnmounted,
|
onUnmounted,
|
||||||
inject,
|
inject,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
|
import go from "@/commons/utils/go.js";
|
||||||
|
|
||||||
import Modal from "@/pageMarket/components/modal.vue";
|
import Modal from "@/pageMarket/components/modal.vue";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: {
|
list: {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,254 @@
|
||||||
|
<template>
|
||||||
|
<view class="list u-font-28">
|
||||||
|
<view class="u-m-t-32 item" v-for="item in list" :key="item.id">
|
||||||
|
<view class="u-flex u-row-between">
|
||||||
|
<view class="color-666 u-font-24 u-flex">
|
||||||
|
<text class="no-wrap"> 订单号:</text>
|
||||||
|
<text> {{ item.orderNo }} </text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="color-999 u-font-20">{{ item.createTime }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-row-between u-m-t-16">
|
||||||
|
<view class="color-333 u-font-28 color-666">
|
||||||
|
<view> 用户昵称 </view>
|
||||||
|
<view class="u-m-t-4">
|
||||||
|
<text class=""> {{ item.nickName }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="color-main u-font-32 font-700">{{ item.changeAmount }}</text>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="u-p-30">
|
||||||
|
<up-loadmore :status="isEnd ? 'nomore' : 'loading'"></up-loadmore>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<up-action-sheet
|
||||||
|
:show="showActions"
|
||||||
|
:actions="actions"
|
||||||
|
@select="handleSelect"
|
||||||
|
@close="showActions = false"
|
||||||
|
cancel-text="取消"
|
||||||
|
></up-action-sheet>
|
||||||
|
<Modal
|
||||||
|
v-model="modalData.show"
|
||||||
|
:title="modalData.title"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
>
|
||||||
|
<view class="u-p-48" v-if="modalData.key == 'change-group'">
|
||||||
|
<view class="u-m-r-36 u-m-b-24">分销组</view>
|
||||||
|
<up-radio-group v-model="group" placement="row" place="row">
|
||||||
|
<up-radio
|
||||||
|
v-for="item in distributionStore.config.levelConfigList"
|
||||||
|
:key="item.id"
|
||||||
|
:name="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
>
|
||||||
|
<template #label>
|
||||||
|
<text>
|
||||||
|
{{ item.name }}
|
||||||
|
</text>
|
||||||
|
</template>
|
||||||
|
</up-radio>
|
||||||
|
</up-radio-group>
|
||||||
|
</view>
|
||||||
|
<view class="u-p-48 u-flex" v-if="modalData.key == 'reset-group'">
|
||||||
|
<up-icon name="info-circle" color="#FF2F2F" size="20"></up-icon>
|
||||||
|
<view class="u-font-32 color-333 u-m-l-20"
|
||||||
|
>是否确认重置分销组 重置后将会按照用户的实际数据匹配分销组</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view class="u-p-48 u-flex" v-if="modalData.key == 'cancel-group'">
|
||||||
|
<up-icon name="info-circle" color="#FF2F2F" size="20"></up-icon>
|
||||||
|
<view class="u-font-32 color-333 u-m-l-20">是否确认取消分销员</view>
|
||||||
|
</view>
|
||||||
|
</Modal>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
reactive,
|
||||||
|
watch,
|
||||||
|
toRaw,
|
||||||
|
onMounted,
|
||||||
|
onUnmounted,
|
||||||
|
inject,
|
||||||
|
} from "vue";
|
||||||
|
import go from "@/commons/utils/go.js";
|
||||||
|
|
||||||
|
import Modal from "@/pageMarket/components/modal.vue";
|
||||||
|
const props = defineProps({
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
isEnd: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
//选中的分销组
|
||||||
|
const group = ref("");
|
||||||
|
|
||||||
|
const distributionStore = inject("distributionStore");
|
||||||
|
const distributionApi = inject("distributionApi");
|
||||||
|
const modalData = reactive({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
key: "",
|
||||||
|
data: null,
|
||||||
|
});
|
||||||
|
const showActions = ref(false);
|
||||||
|
const $actions = [
|
||||||
|
{
|
||||||
|
name: "更改分销组",
|
||||||
|
value: "change-group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "重置分销组",
|
||||||
|
value: "reset-group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "恢复分销员",
|
||||||
|
value: "back-fenxiao",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "取消分销员",
|
||||||
|
value: "cancel-fenxiao",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const actions = ref($actions);
|
||||||
|
function moreShow(item) {
|
||||||
|
modalData.data = item;
|
||||||
|
group.value = item.distributionLevelId;
|
||||||
|
if (item.isAssignLevel == 0) {
|
||||||
|
actions.value = $actions.filter((item) => item.value !== "reset-group");
|
||||||
|
} else {
|
||||||
|
actions.value = $actions.filter((item) => item.value !== "change-group");
|
||||||
|
}
|
||||||
|
if (item.status == 1) {
|
||||||
|
actions.value = actions.value.filter(
|
||||||
|
(item) => item.value !== "back-fenxiao"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (item.status == 9) {
|
||||||
|
actions.value = actions.value.filter(
|
||||||
|
(item) => item.value !== "cancel-fenxiao"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
showActions.value = true;
|
||||||
|
}
|
||||||
|
function handleSelect(item) {
|
||||||
|
console.log(item);
|
||||||
|
modalData.title = item.name;
|
||||||
|
modalData.key = item.value;
|
||||||
|
|
||||||
|
showActions.value = false;
|
||||||
|
modalData.show = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const emits = defineEmits(["refresh"]);
|
||||||
|
|
||||||
|
async function handleConfirm() {
|
||||||
|
if (modalData.key == "reset-group") {
|
||||||
|
await distributionApi.resetLevel({
|
||||||
|
id: modalData.data.id,
|
||||||
|
shopId: uni.getSystemInfoSync("shopInfo").id || "",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (modalData.key == "change-group") {
|
||||||
|
const level = distributionStore.config.levelConfigList.find(
|
||||||
|
(item) => item.id == group.value
|
||||||
|
);
|
||||||
|
await distributionApi.editDistributionUser({
|
||||||
|
id: modalData.data.id,
|
||||||
|
isAssignLevel: 1,
|
||||||
|
distributionLevelId: group.value,
|
||||||
|
distributionLevelName: level.name,
|
||||||
|
});
|
||||||
|
emits("refresh");
|
||||||
|
}
|
||||||
|
if (modalData.key == "cancel-fenxiao") {
|
||||||
|
await distributionApi.editDistributionUser({
|
||||||
|
id: modalData.data.id,
|
||||||
|
status: 9,
|
||||||
|
});
|
||||||
|
emits("refresh");
|
||||||
|
}
|
||||||
|
if (modalData.key == "back-fenxiao") {
|
||||||
|
await distributionApi.editDistributionUser({
|
||||||
|
id: modalData.data.id,
|
||||||
|
status: 1,
|
||||||
|
});
|
||||||
|
emits("refresh");
|
||||||
|
}
|
||||||
|
group.value = "";
|
||||||
|
modalData.show = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.list {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
padding: 32rpx 24rpx;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
border-radius: 12rpx;
|
||||||
|
padding: 8rpx 22rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
|
||||||
|
&.success {
|
||||||
|
background-color: #edfff0;
|
||||||
|
color: #5bbc6d;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.end {
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-btn {
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 36rpx;
|
||||||
|
padding: 8rpx 32rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.money {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
padding: 16rpx 28rpx;
|
||||||
|
}
|
||||||
|
.more {
|
||||||
|
display: flex;
|
||||||
|
height: 56rpx;
|
||||||
|
padding: 8rpx 28rpx;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
border-radius: 28rpx;
|
||||||
|
border: 2rpx solid $my-main-color;
|
||||||
|
color: $my-main-color;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
position: fixed;
|
||||||
|
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
||||||
|
left: 30rpx;
|
||||||
|
right: 30rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
</view>
|
</view>
|
||||||
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
|
<my-tabs v-model="active" :list="tabs" textKey="label"></my-tabs>
|
||||||
<view
|
<view
|
||||||
v-if="active == 1"
|
v-if="active == 1 || active == 2"
|
||||||
class="u-flex u-row-between u-m-t-32"
|
class="u-flex u-row-between u-m-t-32"
|
||||||
style="gap: 58rpx"
|
style="gap: 58rpx"
|
||||||
>
|
>
|
||||||
|
|
@ -57,35 +57,105 @@
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="u-flex u-m-t-40" v-if="active == 1">
|
<view
|
||||||
<view class="u-flex color-333" @click="showShopSelActionSheetFun">
|
v-if="active ==3"
|
||||||
<text class="u-line-1" style="max-width: 300rpx">{{
|
class="u-flex u-row-between u-m-t-32"
|
||||||
selShop.shopName || "全部门店"
|
style="gap: 30rpx"
|
||||||
}}</text>
|
>
|
||||||
<up-icon name="arrow-down-fill" size="12" color="#333"></up-icon>
|
<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>
|
||||||
<view class="u-flex-1 u-p-l-16">
|
<view class="u-flex-1 filter-box" style="border-radius: 100rpx">
|
||||||
<up-search
|
<up-icon name="search" size="18"></up-icon>
|
||||||
bgColor="#F9F9F9"
|
<input
|
||||||
height="60rpx"
|
class="u-m-l-10 u-font-28"
|
||||||
:showAction="false"
|
type="text"
|
||||||
placeholder="搜索订单号"
|
placeholder-class="color-999 u-font-28"
|
||||||
@search="search"
|
placeholder="分销员昵称/手机号"
|
||||||
@clear="search"
|
v-model="keyWord"
|
||||||
v-model="searchText"
|
@blur="keyWordBlur"
|
||||||
></up-search>
|
/>
|
||||||
</view>
|
</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>
|
</up-sticky>
|
||||||
<configVue v-if="active == 0"></configVue>
|
<configVue v-if="active == 0"></configVue>
|
||||||
<fenxiaoUserListVue
|
<fenxiaoUserListVue
|
||||||
v-if="active == 1"
|
v-if="active == 1"
|
||||||
:list="list"
|
:list="list"
|
||||||
:isEnd="isEnd"
|
:isEnd="isEnd"
|
||||||
@refresh="fenxaioListRefresh"
|
@refresh="refresh"
|
||||||
></fenxiaoUserListVue>
|
></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
|
<shopSelActionSheetVue
|
||||||
@choose="chooseShop"
|
@choose="chooseShop"
|
||||||
|
|
@ -100,6 +170,8 @@
|
||||||
@close="showTimeArea = false"
|
@close="showTimeArea = false"
|
||||||
@confirm="confirmTimeArea"
|
@confirm="confirmTimeArea"
|
||||||
></dateAreaSel>
|
></dateAreaSel>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -111,7 +183,7 @@ import {
|
||||||
onReachBottom,
|
onReachBottom,
|
||||||
onBackPress,
|
onBackPress,
|
||||||
} from "@dcloudio/uni-app";
|
} from "@dcloudio/uni-app";
|
||||||
|
import go from "@/commons/utils/go.js";
|
||||||
import { ref, onMounted, watch, provide } from "vue";
|
import { ref, onMounted, watch, provide } from "vue";
|
||||||
import * as consumeCashbackApi from "@/http/api/market/consumeCashback.js";
|
import * as consumeCashbackApi from "@/http/api/market/consumeCashback.js";
|
||||||
import * as distributionApi from "@/http/api/market/distribution.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 shopSelActionSheetVue from "@/pageMarket/components/shop-sel-action-sheet.vue";
|
||||||
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
|
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
|
||||||
import fenxiaoUserListVue from "./components/fenxiao-user-list.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 { useDistributionStore } from "@/store/market.js";
|
||||||
import { reactive } from "vue";
|
import { reactive } from "vue";
|
||||||
|
|
@ -204,21 +278,61 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
function fenxaioListRefresh(){
|
|
||||||
isEnd.value = false;
|
|
||||||
pageNum.value = 1;
|
function refresh() {
|
||||||
getList();
|
isEnd.value = false;
|
||||||
|
pageNum.value = 1;
|
||||||
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const listRes=ref({})
|
||||||
async function getList() {
|
async function getList() {
|
||||||
const res = await distributionApi.distributionUser({
|
let res = null;
|
||||||
page: pageNum.value,
|
if (active.value == 1) {
|
||||||
size: 10,
|
//分销员列表
|
||||||
user: userComponentQuery.user,
|
res = await distributionApi.distributionUser({
|
||||||
startTime: userComponentQuery.startTime? userComponentQuery.startTime+' 00:00:00' :'',
|
page: pageNum.value,
|
||||||
endTime: userComponentQuery.endTime? userComponentQuery.endTime+' 23:59:59' :'',
|
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) {
|
if (res) {
|
||||||
|
listRes.value=res
|
||||||
if (pageNum.value == 1) {
|
if (pageNum.value == 1) {
|
||||||
list.value = res.records || [];
|
list.value = res.records || [];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -235,7 +349,7 @@ const showShopSelActionSheet = ref(false);
|
||||||
function showShopSelActionSheetFun() {
|
function showShopSelActionSheetFun() {
|
||||||
showShopSelActionSheet.value = true;
|
showShopSelActionSheet.value = true;
|
||||||
}
|
}
|
||||||
const active = ref(1);
|
const active = ref(3);
|
||||||
watch(
|
watch(
|
||||||
() => active.value,
|
() => active.value,
|
||||||
(newval) => {
|
(newval) => {
|
||||||
|
|
@ -244,6 +358,12 @@ watch(
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
watch(
|
||||||
|
() => active.value,
|
||||||
|
(newval) => {
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
);
|
||||||
onReachBottom(() => {
|
onReachBottom(() => {
|
||||||
if (!isEnd.value) {
|
if (!isEnd.value) {
|
||||||
pageNum.value++;
|
pageNum.value++;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,328 @@
|
||||||
|
<template>
|
||||||
|
<view class="box min-page">
|
||||||
|
<up-sticky>
|
||||||
|
<view class="bg-fff top">
|
||||||
|
<view class="u-flex u-row-between" style="gap: 58rpx">
|
||||||
|
<view
|
||||||
|
class="u-font-28 u-flex-1 filter-box u-flex u-row-between"
|
||||||
|
@click="showActions = true"
|
||||||
|
>
|
||||||
|
<template v-if="selType && selType.value">
|
||||||
|
<text class="u-font-28">{{ selType.name }}</text>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<text class="color-999 u-m-r-10">全部</text>
|
||||||
|
</template>
|
||||||
|
<up-icon name="arrow-down" size="12"></up-icon>
|
||||||
|
</view>
|
||||||
|
<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
|
||||||
|
v-if="false"
|
||||||
|
class="u-flex-1 u-font-28 filter-box u-flex u-row-between"
|
||||||
|
@click="showTimeArea = true"
|
||||||
|
>
|
||||||
|
<template v-if="query.startTime && query.endTime">
|
||||||
|
<text class="u-font-20">
|
||||||
|
{{ query.startTime }} -
|
||||||
|
{{ query.endTime }}
|
||||||
|
</text>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<text class="color-999">请选择日期</text>
|
||||||
|
<up-icon name="arrow-right" size="12"></up-icon>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view 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">{{
|
||||||
|
state.totalRecharge
|
||||||
|
}}</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">{{
|
||||||
|
state.totalSub
|
||||||
|
}}</view>
|
||||||
|
<view class="u-font-24 color-666 u-m-t-16">已扣减金额(元)</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</up-sticky>
|
||||||
|
|
||||||
|
<view class="recoders-list" v-if="state.records.length">
|
||||||
|
<view class="item" v-for="(item, index) in state.records" :key="index">
|
||||||
|
<view class="u-flex u-flex-between u-font-24">
|
||||||
|
<view class="color-666">
|
||||||
|
{{ returnState(item.type) }}
|
||||||
|
</view>
|
||||||
|
<text class="color-999">{{ item.createTime }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex u-flex-between u-font-28 color-666 u-m-t-16">
|
||||||
|
<view>
|
||||||
|
<text>关联订单:WX1987787224197300224</text>
|
||||||
|
<text></text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="price">
|
||||||
|
<text>{{ item.changeAmount }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="u-m-t-4 u-font-24 color-999">变动后:{{item.amount}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<up-loadmore :status="isEnd ? 'nomore' : 'loadmore'"></up-loadmore>
|
||||||
|
</view>
|
||||||
|
<view style="height: 60rpx"></view>
|
||||||
|
<dateAreaSel
|
||||||
|
:show="showTimeArea"
|
||||||
|
:minYear="2022"
|
||||||
|
@close="showTimeArea = false"
|
||||||
|
@confirm="confirmTimeArea"
|
||||||
|
></dateAreaSel>
|
||||||
|
|
||||||
|
<up-action-sheet
|
||||||
|
:show="showActions"
|
||||||
|
:actions="actions"
|
||||||
|
@select="handleSelect"
|
||||||
|
@close="showActions = false"
|
||||||
|
cancel-text="取消"
|
||||||
|
></up-action-sheet>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import * as distributionApi from "@/http/api/market/distribution.js";
|
||||||
|
import { onMounted, ref, reactive, watch } from "vue";
|
||||||
|
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||||
|
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
|
||||||
|
|
||||||
|
import go from "@/commons/utils/go.js";
|
||||||
|
const showActions = ref(false);
|
||||||
|
const selType = ref(null);
|
||||||
|
const actions = [
|
||||||
|
{
|
||||||
|
name: "全部",
|
||||||
|
value: "",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "充值",
|
||||||
|
value: "manual_recharge",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "自助充值",
|
||||||
|
value: "self_recharge",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "退款",
|
||||||
|
value: "refund",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "手动扣减",
|
||||||
|
value: "manual_sub",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "系统扣减",
|
||||||
|
value: "sub",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
function returnState(type) {
|
||||||
|
const item = actions.find((item) => item.value === type);
|
||||||
|
if (item) {
|
||||||
|
return item.name;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
const keyWord = ref("");
|
||||||
|
function keyWordBlur() {
|
||||||
|
query.key = keyWord.value;
|
||||||
|
}
|
||||||
|
function handleSelect(item) {
|
||||||
|
console.log(item);
|
||||||
|
selType.value = item;
|
||||||
|
query.type = item.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const options = ref({});
|
||||||
|
|
||||||
|
function parseQueryString(queryString) {
|
||||||
|
const queryParams = queryString.split("&").map((param) => param.split("="));
|
||||||
|
const params = {};
|
||||||
|
for (const [key, value] of queryParams) {
|
||||||
|
params[key] = value;
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
onLoad((opt) => {
|
||||||
|
console.log(opt);
|
||||||
|
if (opt.q) {
|
||||||
|
const q = decodeURIComponent(opt.q);
|
||||||
|
const params = parseQueryString(q.split("?")[1]);
|
||||||
|
Object.assign(options.value, params);
|
||||||
|
} else {
|
||||||
|
Object.assign(options.value, opt);
|
||||||
|
}
|
||||||
|
console.log(options.value);
|
||||||
|
if (options.value.shopId) {
|
||||||
|
price.value = options.value.amount;
|
||||||
|
selChargeIndex.value = chargeList.value.findIndex(
|
||||||
|
(item) => item.price * 1 === options.value.amount * 1
|
||||||
|
);
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
flow();
|
||||||
|
});
|
||||||
|
|
||||||
|
const showTimeArea = ref(false);
|
||||||
|
function confirmTimeArea(e) {
|
||||||
|
console.log(e);
|
||||||
|
query.startTime = e[0];
|
||||||
|
query.endTime = e[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
function refresh() {
|
||||||
|
query.page = 1;
|
||||||
|
flow();
|
||||||
|
}
|
||||||
|
|
||||||
|
const query = reactive({
|
||||||
|
page: 1,
|
||||||
|
size: 10,
|
||||||
|
type: "",
|
||||||
|
key: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const state = reactive({
|
||||||
|
records: [],
|
||||||
|
totalRecharge: 0,
|
||||||
|
});
|
||||||
|
const listRes = ref({});
|
||||||
|
|
||||||
|
const isEnd = ref(false);
|
||||||
|
async function flow() {
|
||||||
|
console.log(selType.value);
|
||||||
|
const res = await distributionApi.moneyRecoders(query);
|
||||||
|
if (query.page == 1) {
|
||||||
|
Object.assign(state, res);
|
||||||
|
} else {
|
||||||
|
state.records = state.records.concat(res.records || []);
|
||||||
|
state.totalRecharge = res.totalRecharge || 0;
|
||||||
|
}
|
||||||
|
isEnd.value = query.page >= res.totalPage * 1;
|
||||||
|
}
|
||||||
|
onReachBottom(() => {
|
||||||
|
if (isEnd.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
query.page++;
|
||||||
|
flow();
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => query.key,
|
||||||
|
(newval) => {
|
||||||
|
isEnd.value = false;
|
||||||
|
query.page = 1;
|
||||||
|
flow();
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deep: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => query.type,
|
||||||
|
(newval) => {
|
||||||
|
isEnd.value = false;
|
||||||
|
query.page = 1;
|
||||||
|
flow();
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deep: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.min-page {
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
padding: 32rpx 24rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chrage-box {
|
||||||
|
border-radius: 74rpx;
|
||||||
|
background: #ffffff4d;
|
||||||
|
padding: 42rpx 28rpx;
|
||||||
|
}
|
||||||
|
.title-bg {
|
||||||
|
position: relative;
|
||||||
|
.image {
|
||||||
|
position: absolute;
|
||||||
|
height: 14rpx;
|
||||||
|
width: 94rpx;
|
||||||
|
right: -10rpx;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.xieyi {
|
||||||
|
color: #ecb592;
|
||||||
|
}
|
||||||
|
|
||||||
|
.u-text-nowrap {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.input-box {
|
||||||
|
padding: 24rpx 16rpx;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
background: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recoders-list {
|
||||||
|
margin-top: 40rpx;
|
||||||
|
.item {
|
||||||
|
margin-bottom: 36rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 32rpx 28rpx;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
.price {
|
||||||
|
font-weight: 700;
|
||||||
|
color: $my-main-color;
|
||||||
|
font-size: 32rpx;
|
||||||
|
.yuan {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.filter-box {
|
||||||
|
display: flex;
|
||||||
|
padding: 8rpx 24rpx;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
border: 2rpx solid #d9d9d9;
|
||||||
|
background: #f7f7f7;
|
||||||
|
min-height: 62rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.top {
|
||||||
|
padding: 32rpx 24rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
17
pages.json
17
pages.json
|
|
@ -93,8 +93,7 @@
|
||||||
"path": "pages/pay",
|
"path": "pages/pay",
|
||||||
"pageId": "PAGES_PAY",
|
"pageId": "PAGES_PAY",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分销",
|
"navigationBarTitleText": "运营余额"
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -651,6 +650,20 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分销员等级"
|
"navigationBarTitleText": "分销员等级"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pageId": "PAGES_DISTRIBUTION_ADD_FENXIAO_USER",
|
||||||
|
"path": "distribution/add-fenxiao-user",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "添加分销员"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pageId": "PAGES_DISTRIBUTION_MONEY_RECODERS",
|
||||||
|
"path": "distribution/money-recoders",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "运营余额"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
258
pages/pay.vue
258
pages/pay.vue
|
|
@ -1,115 +1,105 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="box">
|
<view class="box min-page">
|
||||||
<up-navbar
|
|
||||||
title="分销"
|
|
||||||
bg-color="transparent"
|
|
||||||
:placeholder="true"
|
|
||||||
@leftClick="back"
|
|
||||||
></up-navbar>
|
|
||||||
<view class="top">
|
|
||||||
<image
|
|
||||||
src="/static/market/top-bg.png"
|
|
||||||
class="image"
|
|
||||||
mode="widthFix"
|
|
||||||
></image>
|
|
||||||
</view>
|
|
||||||
<view style="height: 38rpx"></view>
|
|
||||||
<view class="chrage-box">
|
<view class="chrage-box">
|
||||||
<view class="u-flex u-flex-between">
|
<view class="bg-fff container">
|
||||||
<view class="u-flex">
|
<view class="u-flex u-flex-between">
|
||||||
<image
|
<view class="u-flex">
|
||||||
src="/static/market/gold.png"
|
<view class="title-bg">
|
||||||
style="width: 44rpx; height: 44rpx"
|
<view class="font-bold u-font-32 color-333">当前余额:{{distributionFlowRes.balanceAmount}}</view>
|
||||||
></image>
|
</view>
|
||||||
<view class="title-bg">
|
</view>
|
||||||
<image src="/static/market/title-bg.png" class="image"></image>
|
<view>
|
||||||
<view class="font-bold u-font-32 color-333 u-m-l-24">立即充值</view>
|
<text class="u-font-32 color-main" @click="go.to('PAGES_DISTRIBUTION_MONEY_RECODERS')"> 查看记录</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view
|
||||||
<text class="u-font-24 color-999"> 充值代表接受</text>
|
class="list u-m-t-32 u-flex u-m-t-60"
|
||||||
<text class="u-font-24 xieyi"> 《用户隐私协议》 </text>
|
style="align-items: flex-start"
|
||||||
|
>
|
||||||
|
<text class="font-bold u-font-32 color-333 u-text-nowrap"
|
||||||
|
>选择金额</text
|
||||||
|
>
|
||||||
|
<view class="u-m-l-60 chargeList">
|
||||||
|
<view
|
||||||
|
class="item"
|
||||||
|
v-for="(item, index) in chargeList"
|
||||||
|
:key="index"
|
||||||
|
:class="{ active: selChargeIndex == index }"
|
||||||
|
@click="changeCharge(index)"
|
||||||
|
>
|
||||||
|
<view class="price">
|
||||||
|
<text class="u-font-28">¥ </text>
|
||||||
|
<text class="font-bold u-font-32">{{ item.price }}</text>
|
||||||
|
</view>
|
||||||
|
<image
|
||||||
|
class="sel"
|
||||||
|
v-show="selChargeIndex == index"
|
||||||
|
src="/static/iconimg/icon-sel.png"
|
||||||
|
></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="u-flex input-box">
|
||||||
|
<text class="color-333 u-font-28 font-bold">其他金额</text>
|
||||||
|
<view class="u-flex-1 u-flex u-m-l-28">
|
||||||
|
<input
|
||||||
|
:min="0.01"
|
||||||
|
placeholder-class="u-font-24"
|
||||||
|
type="digit"
|
||||||
|
class="u-flex-1 u-font-28"
|
||||||
|
placeholder="请输入充值金额"
|
||||||
|
@input="inputEvent"
|
||||||
|
v-model="price"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view class="u-m-t-32"></view>
|
||||||
class="list u-m-t-32 u-flex u-m-t-60"
|
|
||||||
style="align-items: flex-start"
|
<my-button @click="buy">立即充值</my-button>
|
||||||
>
|
<view class="container u-m-t-32">
|
||||||
<text class="font-bold u-font-32 color-333 u-text-nowrap"
|
<view class="u-flex u-flex-between ">
|
||||||
>选择金额</text
|
<view class="u-flex">
|
||||||
>
|
<view class="title-bg">
|
||||||
<view class="u-m-l-60 chargeList">
|
<image src="/static/market/title-bg.png" class="image"></image>
|
||||||
|
<view class="font-bold u-font-32 color-333 u-m-l-24"
|
||||||
|
>充值记录</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text class="u-font-28 color-333">
|
||||||
|
总计:{{ state.totalRecharge || 0 }}元</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="recoders-list" v-if="state.records.length">
|
||||||
<view
|
<view
|
||||||
class="item"
|
class="item"
|
||||||
v-for="(item, index) in chargeList"
|
v-for="(item, index) in state.records"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="{ active: selChargeIndex == index }"
|
|
||||||
@click="changeCharge(index)"
|
|
||||||
>
|
>
|
||||||
<view class="price">
|
<view class="u-flex u-flex-between">
|
||||||
<text class="u-font-28">¥ </text>
|
<view class="u-font-28">
|
||||||
<text class="font-bold" style="font-size: 48rpx">{{
|
<view class="color-666">
|
||||||
item.price
|
<text v-if="item.type === 'self_recharge'">自助充值</text>
|
||||||
}}</text>
|
<text v-if="item.type === 'manual_recharge'">手动充值</text>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<view class="u-m-t-16">
|
||||||
class="sel"
|
<text class="color-666">时间:</text>
|
||||||
v-show="selChargeIndex == index"
|
<text class="color-333">{{ item.createTime }}</text>
|
||||||
src="/static/market/sel.png"
|
</view>
|
||||||
></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="u-flex input-box u-m-t-30">
|
|
||||||
<text class="color-333 u-font-28 font-700">其他金额</text>
|
|
||||||
<view class="u-flex-1 u-flex u-m-l-28">
|
|
||||||
<input
|
|
||||||
:min="0.01"
|
|
||||||
placeholder-class="u-font-24"
|
|
||||||
type="digit"
|
|
||||||
class="u-flex-1 u-font-28"
|
|
||||||
placeholder="请输入充值金额"
|
|
||||||
@input="inputEvent"
|
|
||||||
v-model="price"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="buy" @click="buy">立即充值</view>
|
|
||||||
|
|
||||||
<view class="u-flex u-flex-between u-m-t-60">
|
|
||||||
<view class="u-flex">
|
|
||||||
<view class="title-bg">
|
|
||||||
<image src="/static/market/title-bg.png" class="image"></image>
|
|
||||||
<view class="font-bold u-font-32 color-333 u-m-l-24">充值记录</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<text class="u-font-28 color-333">
|
|
||||||
总计:{{ state.totalRecharge || 0 }}元</text
|
|
||||||
>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="recoders-list" v-if="state.records.length">
|
|
||||||
<view class="item" v-for="(item, index) in state.records" :key="index">
|
|
||||||
<view class="u-flex u-flex-between">
|
|
||||||
<view class="u-font-28">
|
|
||||||
<view class="color-666">
|
|
||||||
<text v-if="item.type === 'self_recharge'">自助充值</text>
|
|
||||||
<text v-if="item.type === 'manual_recharge'">手动充值</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="u-m-t-16">
|
<view class="price">
|
||||||
<text class="color-666">时间:</text>
|
<text>{{ item.changeAmount }}</text>
|
||||||
<text class="color-333">{{ item.createTime }}</text>
|
<text class="yuan">元</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="price">
|
|
||||||
<text>{{ item.changeAmount }}</text>
|
|
||||||
<text class="yuan">元</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<up-loadmore :status="isEnd ? 'nomore' : 'loadmore'"></up-loadmore>
|
||||||
</view>
|
</view>
|
||||||
<up-loadmore :status="isEnd ? 'nomore' : 'loadmore'"></up-loadmore>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -117,9 +107,11 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { mchRecharge } from "@/http/api/pay";
|
import { mchRecharge } from "@/http/api/pay";
|
||||||
import * as distributionFlowApi from "@/http/api/market/distributionFlow.js";
|
import * as distributionApi from "@/http/api/market/distribution.js";
|
||||||
import { onMounted, ref, reactive, watch } from "vue";
|
import { onMounted, ref, reactive, watch } from "vue";
|
||||||
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||||
|
import go from "@/commons/utils/go.js";
|
||||||
|
|
||||||
function back() {
|
function back() {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
}
|
}
|
||||||
|
|
@ -158,11 +150,12 @@ onLoad((opt) => {
|
||||||
if (options.value.shopId) {
|
if (options.value.shopId) {
|
||||||
price.value = options.value.amount;
|
price.value = options.value.amount;
|
||||||
selChargeIndex.value = chargeList.value.findIndex(
|
selChargeIndex.value = chargeList.value.findIndex(
|
||||||
(item) => item.price*1 === options.value.amount*1
|
(item) => item.price * 1 === options.value.amount * 1
|
||||||
);
|
);
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
flow();
|
flow();
|
||||||
|
distributionFlow();
|
||||||
});
|
});
|
||||||
|
|
||||||
let timer = null;
|
let timer = null;
|
||||||
|
|
@ -202,7 +195,7 @@ function inputEvent(e) {
|
||||||
// 延迟更新,避免输入闪烁
|
// 延迟更新,避免输入闪烁
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
selChargeIndex.value = chargeList.value.findIndex(
|
selChargeIndex.value = chargeList.value.findIndex(
|
||||||
(item) => item.price*1 === value*1
|
(item) => item.price * 1 === value * 1
|
||||||
);
|
);
|
||||||
price.value = value;
|
price.value = value;
|
||||||
}, 30);
|
}, 30);
|
||||||
|
|
@ -308,6 +301,7 @@ async function buy() {
|
||||||
function refresh() {
|
function refresh() {
|
||||||
query.page = 1;
|
query.page = 1;
|
||||||
flow();
|
flow();
|
||||||
|
distributionFlow()
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = reactive({
|
const query = reactive({
|
||||||
|
|
@ -321,9 +315,16 @@ const state = reactive({
|
||||||
totalRecharge: 0,
|
totalRecharge: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const distributionFlowRes=ref({})
|
||||||
|
async function distributionFlow(){
|
||||||
|
const res=await distributionApi.distributionFlow();
|
||||||
|
distributionFlowRes.value=res
|
||||||
|
}
|
||||||
|
|
||||||
const isEnd = ref(false);
|
const isEnd = ref(false);
|
||||||
async function flow() {
|
async function flow() {
|
||||||
const res = await distributionFlowApi.flow(query);
|
const res = await distributionApi.moneyRecoders(query);
|
||||||
if (query.page == 1) {
|
if (query.page == 1) {
|
||||||
Object.assign(state, res);
|
Object.assign(state, res);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -341,6 +342,7 @@ onReachBottom(() => {
|
||||||
});
|
});
|
||||||
async function init() {
|
async function init() {
|
||||||
const code = await wxlogin();
|
const code = await wxlogin();
|
||||||
|
distributionFlow();
|
||||||
const res = await mchRecharge({
|
const res = await mchRecharge({
|
||||||
...options.value,
|
...options.value,
|
||||||
code,
|
code,
|
||||||
|
|
@ -361,7 +363,7 @@ async function init() {
|
||||||
watch(
|
watch(
|
||||||
() => selChargeIndex.value,
|
() => selChargeIndex.value,
|
||||||
(newval) => {
|
(newval) => {
|
||||||
if (newval != -1 &&price.value*1!=chargeList.value[newval].price*1) {
|
if (newval != -1 && price.value * 1 != chargeList.value[newval].price * 1) {
|
||||||
price.value = chargeList.value[newval].price;
|
price.value = chargeList.value[newval].price;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -372,22 +374,19 @@ watch(
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.min-page {
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
.box {
|
.box {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.top {
|
.container {
|
||||||
position: absolute;
|
padding: 32rpx 24rpx;
|
||||||
left: 0;
|
border-radius: 16rpx;
|
||||||
right: 0;
|
background-color: #fff;
|
||||||
top: 0;
|
|
||||||
z-index: -1;
|
|
||||||
.image {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.chrage-box {
|
.chrage-box {
|
||||||
width: 750rpx;
|
|
||||||
border-radius: 74rpx;
|
border-radius: 74rpx;
|
||||||
background: #ffffff4d;
|
background: #ffffff4d;
|
||||||
padding: 42rpx 28rpx;
|
padding: 42rpx 28rpx;
|
||||||
|
|
@ -413,24 +412,20 @@ watch(
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.item {
|
.item {
|
||||||
padding: 16rpx 36rpx;
|
padding: 16rpx 36rpx;
|
||||||
border-radius: 22rpx;
|
border-radius: 8rpx;
|
||||||
background: linear-gradient(180deg, #f5f5f5 58.54%, #fff 104.47%);
|
background-color: #f8f8f8;
|
||||||
border: 6rpx solid transparent;
|
border: 6rpx solid transparent;
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
margin-bottom: 62rpx;
|
margin-bottom: 36rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 220rpx;
|
width: 172rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
&.active {
|
&.active {
|
||||||
border: 6rpx solid #fe6c0e;
|
border: 6rpx solid $my-main-color;
|
||||||
background: linear-gradient(180deg, #ffc29a -26.17%, #fff 64.06%);
|
|
||||||
box-shadow: 0 0 31.2rpx 2rpx #fe8b435e;
|
|
||||||
.price {
|
.price {
|
||||||
.font-bold {
|
color: $my-main-color;
|
||||||
color: #ff6300;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sel {
|
.sel {
|
||||||
|
|
@ -445,7 +440,7 @@ watch(
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
color: #5f2e0f;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item:nth-of-type(2n) {
|
.item:nth-of-type(2n) {
|
||||||
|
|
@ -460,18 +455,7 @@ watch(
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
}
|
}
|
||||||
.buy {
|
|
||||||
padding: 32rpx 32rpx;
|
|
||||||
background: linear-gradient(98deg, #fe6d1100 40.64%, #ffd1b4 105.2%),
|
|
||||||
linear-gradient(259deg, #fe6d11 50.14%, #ffd1b4 114.93%);
|
|
||||||
box-shadow: 0 14rpx 30.4rpx 0 #fe8b435e;
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 48rpx;
|
|
||||||
}
|
|
||||||
.recoders-list {
|
.recoders-list {
|
||||||
margin-top: 40rpx;
|
margin-top: 40rpx;
|
||||||
.item {
|
.item {
|
||||||
|
|
@ -482,8 +466,8 @@ watch(
|
||||||
.price {
|
.price {
|
||||||
line-height: 44rpx;
|
line-height: 44rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #fe7e00;
|
color: $my-main-color;
|
||||||
font-size: 48rpx;
|
font-size: 44rpx;
|
||||||
.yuan {
|
.yuan {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 767 B |
Loading…
Reference in New Issue