分销问题修复,订单问题修复
This commit is contained in:
@@ -45,46 +45,66 @@
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="u-p-t-16 u-p-b-20 u-flex u-p-l-28 u-p-r-28 " style="align-items: baseline;justify-content: flex-end;">
|
||||
<view
|
||||
class="u-p-t-16 u-p-b-20 u-flex u-p-l-28 u-p-r-28"
|
||||
style="align-items: baseline; justify-content: flex-end"
|
||||
>
|
||||
<text class="color-666 font-12"> 总计:</text>
|
||||
<text class="font-16 color-333 font-700"> 999.99</text>
|
||||
<text class="font-16 color-333 font-700" v-if="centerUserInfo">
|
||||
{{ centerUserInfo.totalIncome }}</text
|
||||
>
|
||||
</view>
|
||||
|
||||
<view class="list">
|
||||
<view v-for="(item, index) in 3" :key="index" class="item">
|
||||
<view v-for="(item, index) in state.records" :key="index" class="item">
|
||||
<view class="u-flex justify-between">
|
||||
<view>
|
||||
<text class="color-666 ">来源:</text>
|
||||
<text class="color-333 font-700">儿童玩具部落</text>
|
||||
<text class="color-666">来源:</text>
|
||||
<text class="color-333 font-700">{{ item.shopName }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="color-666">待入账</text>
|
||||
<text class="color-666" v-if="item.status == 'pending'"
|
||||
>待入账</text
|
||||
>
|
||||
<text class="color-666" v-if="item.status == 'success'"
|
||||
>已入账</text
|
||||
>
|
||||
<text class="color-666" v-if="item.status == 'REFUND'"
|
||||
>已退款</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex justify-between u-m-t-16">
|
||||
<view>
|
||||
<text class="color-666 ">订单:</text>
|
||||
<text class="color-333 font-700">WEB1942482053783560192</text>
|
||||
<text class="color-666">订单:</text>
|
||||
<text class="color-333 font-700">{{ item.orderNo }}</text>
|
||||
</view>
|
||||
<view class="money">
|
||||
<text class="money reduce">+100</text>
|
||||
<text class="tag">(订单一级分成)</text>
|
||||
|
||||
<text class="money reduce" v-if="item.status == 'REFUND'"
|
||||
>-{{ item.rewardAmount }}</text
|
||||
>
|
||||
|
||||
<text class="money" v-else>+{{ item.rewardAmount }}</text>
|
||||
<text class="tag" v-if="item.status == 'REFUND'">订单退款</text>
|
||||
<text class="tag" v-else-if="item.level == 1"
|
||||
>(订单一级分成)</text
|
||||
>
|
||||
<text class="tag" v-else-if="item.level == 2"
|
||||
>(订单二级分成)</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex justify-between u-m-t-16">
|
||||
<view>
|
||||
<text class="color-666 ">时间:</text>
|
||||
<text class="color-333 font-700">2025/01/21 04:03</text>
|
||||
<text class="color-666">时间:</text>
|
||||
<text class="color-333 font-700">{{ item.createTime }}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-loadmore :status="list.status"></u-loadmore>
|
||||
<u-loadmore :status="isEnd ? 'nomore' : 'loading'"></u-loadmore>
|
||||
<u-popup :show="show" round="20" closeable @close="show = false">
|
||||
<view class="shoplist-popup">
|
||||
<view class="title">
|
||||
@@ -132,7 +152,9 @@
|
||||
<script setup>
|
||||
import dayjs from "dayjs";
|
||||
import dateAreaSel from "@/components/date-range-picker/date-range-picker.vue";
|
||||
import { ref, reactive, onMounted, computed } from "vue";
|
||||
import { ref, reactive, onMounted, computed, watch } from "vue";
|
||||
import * as distributionApi from "@/common/api/market/distribution.js";
|
||||
|
||||
import {
|
||||
onLoad,
|
||||
onReady,
|
||||
@@ -150,43 +172,41 @@ const show = ref(false);
|
||||
const showTimeArea = ref(false);
|
||||
|
||||
const querForm = ref({
|
||||
searchValue: "",
|
||||
shopId: "",
|
||||
shopName: "",
|
||||
statusActiveIndex: 0,
|
||||
status: "",
|
||||
statusName: "",
|
||||
startDate: "",
|
||||
startTime: "",
|
||||
timeArea: "",
|
||||
endDate: "",
|
||||
date: [],
|
||||
endTime: "",
|
||||
page: 1,
|
||||
});
|
||||
|
||||
function confirmTimeArea(e) {
|
||||
console.log(e);
|
||||
querForm.value.date = e;
|
||||
querForm.value.startDate = e[0];
|
||||
querForm.value.endDate = e[1];
|
||||
querForm.value.startTime = e[0];
|
||||
querForm.value.endTime = e[1];
|
||||
querForm.value.timeArea = e[0] + "-" + e[1];
|
||||
}
|
||||
|
||||
// 状态
|
||||
const statusList = ref([
|
||||
{
|
||||
value: 0,
|
||||
name: "未使用",
|
||||
value: "pending",
|
||||
name: "待入账",
|
||||
color: "#333",
|
||||
fontSize: "16",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
name: "已使用",
|
||||
value: "success",
|
||||
name: "已入账",
|
||||
color: "#333",
|
||||
fontSize: "16",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
name: "已失效",
|
||||
value: "REFUND",
|
||||
name: "已退款",
|
||||
color: "#333",
|
||||
fontSize: "16",
|
||||
},
|
||||
@@ -205,28 +225,17 @@ function selectStatusHandle(e) {
|
||||
querForm.value.status = e.value;
|
||||
querForm.value.statusName = returnStatusName();
|
||||
}
|
||||
const list = reactive({
|
||||
page: 1,
|
||||
size: 10,
|
||||
status: "loading",
|
||||
data: [],
|
||||
});
|
||||
|
||||
onReachBottom(() => {
|
||||
if (list.status != "nomore") {
|
||||
list.page++;
|
||||
console.log("到底了");
|
||||
if (!isEnd.value) {
|
||||
console.log("没有跟多了");
|
||||
querForm.value.page++;
|
||||
getIncomeDetailsAjax();
|
||||
}
|
||||
});
|
||||
|
||||
const showStatus = ref(false);
|
||||
const selectListItemDetails = ref([]);
|
||||
|
||||
// 切换类型
|
||||
function tabChange(index) {
|
||||
querForm.value.statusActiveIndex = index;
|
||||
list.page = 1;
|
||||
list.status = "loading";
|
||||
}
|
||||
|
||||
// 店铺列表滚动到底部了
|
||||
function scrollBottom() {
|
||||
@@ -237,25 +246,113 @@ function scrollBottom() {
|
||||
function selectShopHandle(item) {
|
||||
querForm.value.shopId = item.shopId;
|
||||
querForm.value.shopName = item.shopName;
|
||||
list.page = 1;
|
||||
show.value = false;
|
||||
}
|
||||
// 获取当前店铺会员信息
|
||||
const shopList = ref([]);
|
||||
async function getCouponShopsAjax() {
|
||||
try {
|
||||
const res = await getCouponShops();
|
||||
shopList.value = res;
|
||||
const res = await distributionApi.activates({ page: 1, size: 999 });
|
||||
shopList.value = res.records || [];
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取收益明细
|
||||
const state = reactive({
|
||||
records: [],
|
||||
totalRow: 0,
|
||||
});
|
||||
const isEnd = ref(false);
|
||||
async function getIncomeDetailsAjax() {
|
||||
try {
|
||||
const ajaxQuery = {
|
||||
shopId: querForm.value.shopId,
|
||||
startTime: querForm.value.startTime
|
||||
? `${querForm.value.startTime} 00:00:00`
|
||||
: "",
|
||||
endTime: querForm.value.endTime
|
||||
? `${querForm.value.endTime} 23:59:59`
|
||||
: "",
|
||||
status: querForm.value.status,
|
||||
page: querForm.value.page,
|
||||
};
|
||||
console.log("ajaxQuery,", ajaxQuery);
|
||||
const res = await distributionApi.getIncomeDetails(ajaxQuery);
|
||||
if (res) {
|
||||
if (querForm.value.page == 1) {
|
||||
Object.assign(state, res);
|
||||
} else {
|
||||
state.totalPage = res.totalPage * 1;
|
||||
state.records.push(...(res.records || []));
|
||||
}
|
||||
isEnd.value = querForm.value.page >= res.totalPage * 1;
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
const centerUserInfo = ref({});
|
||||
async function centerUser() {
|
||||
const res = await distributionApi.centerUser();
|
||||
centerUserInfo.value = res;
|
||||
}
|
||||
onShow(() => {});
|
||||
|
||||
onLoad(() => {
|
||||
getCouponShopsAjax();
|
||||
onLoad(async (opt) => {
|
||||
await getCouponShopsAjax();
|
||||
|
||||
console.log(opt);
|
||||
if (opt.name) {
|
||||
const findItem = statusList.value.find((item) => item.name == opt.name);
|
||||
if (findItem) {
|
||||
querForm.value.status = findItem.value;
|
||||
querForm.value.statusName = findItem.name;
|
||||
}
|
||||
}
|
||||
if (opt.shopId) {
|
||||
querForm.value.shopId = opt.shopId;
|
||||
const findItem = couponShops.value.find((item) => item.id == opt.shopId);
|
||||
querForm.value.shopName = findItem.shopName || "";
|
||||
}
|
||||
centerUser();
|
||||
getIncomeDetailsAjax();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => querForm.value.status,
|
||||
(newVal, oldVal) => {
|
||||
querForm.value.page = 1;
|
||||
isEnd.value = false;
|
||||
getIncomeDetailsAjax();
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => querForm.value.shopId,
|
||||
(newVal, oldVal) => {
|
||||
querForm.value.page = 1;
|
||||
isEnd.value = false;
|
||||
getIncomeDetailsAjax();
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => querForm.value.startTime,
|
||||
(newVal, oldVal) => {
|
||||
querForm.value.page = 1;
|
||||
isEnd.value = false;
|
||||
getIncomeDetailsAjax();
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => querForm.value.endTime,
|
||||
(newVal, oldVal) => {
|
||||
querForm.value.page = 1;
|
||||
isEnd.value = false;
|
||||
getIncomeDetailsAjax();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -267,33 +364,33 @@ page {
|
||||
.container {
|
||||
padding: 130rpx 0 28upx;
|
||||
}
|
||||
.list{
|
||||
font-size: 28rpx;
|
||||
.item{
|
||||
background-color: #fff;
|
||||
padding: 32rpx 28rpx 32rpx 36rpx;
|
||||
margin-bottom: 16rpx;
|
||||
.money{
|
||||
line-height: 44rpx;
|
||||
color: #FE7E00;
|
||||
font-size: 48rpx;
|
||||
font-weight: 700;
|
||||
position: relative;
|
||||
&.reduce{
|
||||
color: #FF1C1C;
|
||||
}
|
||||
.tag{
|
||||
position: absolute;
|
||||
font-weight: 400;
|
||||
right: 0;
|
||||
top: 100%;
|
||||
font-size: 28rpx;
|
||||
white-space: nowrap;
|
||||
color: #999;
|
||||
transform: translateY(10rpx);
|
||||
}
|
||||
}
|
||||
.list {
|
||||
font-size: 28rpx;
|
||||
.item {
|
||||
background-color: #fff;
|
||||
padding: 32rpx 28rpx 32rpx 36rpx;
|
||||
margin-bottom: 16rpx;
|
||||
.money {
|
||||
line-height: 44rpx;
|
||||
color: #fe7e00;
|
||||
font-size: 48rpx;
|
||||
font-weight: 700;
|
||||
position: relative;
|
||||
&.reduce {
|
||||
color: #ff1c1c;
|
||||
}
|
||||
.tag {
|
||||
position: absolute;
|
||||
font-weight: 400;
|
||||
right: 0;
|
||||
top: 100%;
|
||||
font-size: 28rpx;
|
||||
white-space: nowrap;
|
||||
color: #999;
|
||||
transform: translateY(10rpx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.header-wrap {
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user