分销问题修复,订单问题修复

This commit is contained in:
2025-10-30 17:11:18 +08:00
parent 6283d168e9
commit 09fc28de06
29 changed files with 2652 additions and 533 deletions

View File

@@ -11,8 +11,10 @@
<view class="top_content">
<view class="u-flex justify-between">
<view>
<view class="u-flex" @click="toShouyiDetail">
<text class="font-12 color-666 u-m-r-6">总收益</text>
<view class="u-flex">
<text class="font-12 color-666 u-m-r-6" @click="toShouyiDetail('')"
>总收益</text
>
<up-icon
name="question-circle"
size="12"
@@ -20,11 +22,15 @@
@click="questionClick('总收益')"
></up-icon>
</view>
<view class="price">9925.56</view>
<view class="price" @click="toShouyiDetail('')">{{
state.totalIncome
}}</view>
</view>
<view>
<view class="u-flex" @click="toShouyiDetail">
<text class="font-12 color-666 u-m-r-6">待入账</text>
<view class="u-flex">
<text class="font-12 color-666 u-m-r-6" @click="toShouyiDetail('待入账')"
>待入账</text
>
<up-icon
name="question-circle"
size="12"
@@ -32,18 +38,22 @@
@click="questionClick('待入账')"
></up-icon>
</view>
<view class="price">1000.55</view>
<view class="price" @click="toShouyiDetail('待入账')">{{
state.pendingIncome
}}</view>
</view>
</view>
<view class="u-flex justify-between u-m-t-16">
<view>
<view class="u-flex">
<text class="font-12 color-666 u-m-r-6">可提现金额</text>
<text class="font-12 color-666 u-m-r-6" @click="toTixian"
>可提现金额</text
>
</view>
<view class="u-flex" style="align-items: baseline">
<text class="price">9999.99</text>
<text class="price">{{ state.cashOutAmount }}</text>
<view class="u-flex" @click="toTixian">
<text class="font-12 color-666 u-m-r-6">去提现</text>
<text class="font-12 color-666 u-m-r-6 u-m-l-6">去提现</text>
<up-icon
name="arrow-right"
size="12"
@@ -60,90 +70,126 @@
<view class="u-flex">
<view class="title">我的分销</view>
</view>
<view class="u-m-t-36 small-title">已成为100家店铺的分销员</view>
<view class="u-m-t-36 small-title"
>已成为{{ state.activates.totalRow }}家店铺的分销员</view
>
<view class="list">
<view v-for="(item, index) in 3" :key="index" class="shop-item">
<up-image width="104rpx" height="104rpx" radius="8rpx"></up-image>
<view
v-for="(item, index) in state.activates.records"
@click="toShopDetail(item, 'activates')"
:key="index"
class="shop-item"
>
<up-image
width="104rpx"
height="104rpx"
radius="8rpx"
:src="item.coverImg"
></up-image>
<view class="u-flex-1 u-m-l-14">
<view class="u-flex justify-between">
<view>
<view class="shop-name">儿童玩具部落</view>
<view class="address u-line-1 u-m-t-16"
>山西省大同市云冈区奥体西路 2666 号中国铁建国际中心</view
>
<view class="shop-name">{{ item.shopName }}</view>
<view class="address u-line-1 u-m-t-16">{{
item.shopAddress
}}</view>
</view>
<view>
<view class="shouyi">收益</view>
<view class="price">¥99.999</view>
<view class="price">¥{{ item.income || "0.00" }}</view>
</view>
</view>
</view>
</view>
<view
v-if="state.activates.totalRow > 0"
class="u-flex justify-center font-12 color-666"
style="align-items: baseline"
@click="toShopList('activates')"
>
<view>查看全部店铺</view>
<up-icon name="arrow-right" size="12" color="#666"></up-icon>
</view>
</view>
<view class="u-flex">
<view class="u-flex u-m-t-32">
<view class="title">更多店铺解锁</view>
</view>
<view class="list">
<view
v-for="(item, index) in 3"
v-for="(item, index) in state.unActivates.records"
:key="index"
class="shop-item"
@click="toShopDetail"
@click="toShopDetail(item, 'unActivates')"
>
<up-image width="104rpx" height="104rpx" radius="8rpx"></up-image>
<up-image
width="104rpx"
height="104rpx"
radius="8rpx"
:src="item.coverImg"
></up-image>
<view class="u-flex-1 u-m-l-14">
<view class="u-flex justify-between align-center">
<view>
<view class="shop-name">儿童玩具部落</view>
<view class="shop-name">{{ item.shopName }}</view>
<view class="u-flex">
<view class="tag">曾进入过店铺</view>
<view class="tag" v-if="item.labelContent">{{
item.labelContent
}}</view>
</view>
<view class="address u-line-1"
>山西省大同市云冈区奥体西路 2666 号中国铁建国际中心</view
>
<view class="address u-line-1">{{ item.shopAddress }}</view>
</view>
<view class="u-flex u-flex-col justify-center">
<view class="fufei" v-if="true">付费开通</view>
<template v-else>
<view class="fufei" v-if="item.openType == 'pay'"
>付费开通</view
>
<view class="fufei" v-else-if="item.openType == 'manual'"
>手动开通</view
>
<template v-else-if="item.openType == 'auto'">
<view class="font-12 color-333 font-700">自动开通</view>
<view class="u-m-t-8 color-666 font-12">还差10人开通</view>
<view class="u-m-t-8 color-666 font-12"
>还差{{
item.shopInviteCount - item.userInviteCount
}}人开通</view
>
</template>
</view>
</view>
</view>
</view>
<view
v-if="state.activates.totalRow > 0"
class="u-flex justify-center font-12 color-666"
style="align-items: baseline"
@click="toShopList('unActivates')"
>
<view>查看全部店铺</view>
<up-icon name="arrow-right" size="12" color="#666"></up-icon>
</view>
</view>
</view>
<up-popup :show="showPopup" @close="showPopup = false" mode="center" :safe-area-inset-bottom="false">
<view class="u-p-30" style="width: 500rpx;">
{{ popupText }}
总收益即您在所有店铺通过分销获得总金额包括待入账金额但不包含已退款订单
</view>
</up-popup>
<TipsPopup v-model="showPopup" :tips-type="tipsType"></TipsPopup>
</view>
</template>
<script setup>
import { ref } from "vue";
import { ref, reactive } from "vue";
import { onShow } from "@dcloudio/uni-app";
import TipsPopup from "./components/tips-popup.vue";
import * as distributionApi from "@/common/api/market/distribution.js";
const showPopup = ref(false);
const popupText = ref('');
const popupText = ref("");
const tipsType = ref("");
function questionClick(title) {
if(title=='总收益'){
popupText.value='总收益:即您在所有店铺通过分销获得总金额,包括待入账金额,但不包含已退款订单'
if (title == "总收益") {
tipsType.value = "总收益";
}
if(title=='待入账'){
popupText.value='待入账:即已通过订单分销获得但未达到结算时间的金额,结算时间达到后将会计入可提现金额'
if (title == "待入账") {
tipsType.value = "待入账";
}
showPopup.value=true
showPopup.value = true;
}
function back() {
uni.navigateBack({
@@ -151,15 +197,16 @@ function back() {
});
}
function toShouyiDetail(){
function toShouyiDetail(name) {
uni.navigateTo({
url: "/distribution/income-details/index",
url: "/distribution/income-details/index?name="+name,
});
}
function toShopDetail() {
function toShopDetail(item, type) {
uni.navigateTo({
url: "/distribution/shop-detail/index",
url:
"/distribution/shop-detail/index?shopId=" + item.shopId + "&type=" + type,
});
}
@@ -168,6 +215,32 @@ function toTixian() {
url: "/distribution/withdraw/index",
});
}
function toShopList(type) {
uni.navigateTo({
url: "/distribution/shop-list/index?type=" + type,
});
}
const state = reactive({
totalIncome: 0,
pendingIncome: 0,
cashOutAmount: 0,
totalIncome: 0,
activates: {
totalRow: 0,
records: [],
},
unActivates: {
totalRow: 0,
records: [],
},
});
async function init() {
const res = await distributionApi.centerUser();
if (res) {
Object.assign(state, res);
}
}
onShow(init);
</script>
<style scoped lang="scss">