新增营销系统、分销系统、会员功能、门店、提现功能
This commit is contained in:
121
views/distribution/team/component/DistributorInfoItem.vue
Normal file
121
views/distribution/team/component/DistributorInfoItem.vue
Normal file
@ -0,0 +1,121 @@
|
||||
<!--
|
||||
@name: DistributorDataItem
|
||||
@author: kahu4
|
||||
@date: 2024-01-17 15:50
|
||||
@description:DistributorDataItem
|
||||
@update: 2024-01-17 15:50
|
||||
-->
|
||||
<script setup>
|
||||
|
||||
import { distributorDataList } from "@/views/distribution/team/index.data";
|
||||
import { toRefs } from "vue";
|
||||
import moment from "moment";
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const {data} = toRefs(props)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="user-item">
|
||||
<view class="userinfo-row flex flex-jc__start">
|
||||
<image :src="data.avatar" />
|
||||
<view class="userinfo flex flex-column flex-jc__sb">
|
||||
<view class="username">
|
||||
{{ data.nickname }}
|
||||
<text class="tag">{{ data.isDistributor === 0 ? '客户' : '分销商' }}</text>
|
||||
</view>
|
||||
<view class="time">加入时间:{{ moment(data.createTime).format('YYYY-MM-DD') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="distribution-info-row">
|
||||
<view
|
||||
class="info-item"
|
||||
v-for="distributorData in distributorDataList"
|
||||
:key="distributorData.label">
|
||||
<view class="title">{{ distributorData.label }}</view>
|
||||
<view class="count">{{ data[distributorData.field] || '0' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style
|
||||
scoped
|
||||
lang="scss">
|
||||
.user-item {
|
||||
margin-bottom: 16rpx;
|
||||
@include usePadding(32, 32);
|
||||
background: $white-color;
|
||||
border-radius: 15rpx;
|
||||
|
||||
.userinfo-row {
|
||||
padding-bottom: 16rpx;
|
||||
margin-bottom: 16rpx;
|
||||
border-bottom: 1rpx solid $page-bg-color;
|
||||
|
||||
image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 24rpx;
|
||||
background: #fbfbfb;
|
||||
}
|
||||
|
||||
.userinfo {
|
||||
|
||||
|
||||
.username {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
|
||||
.tag {
|
||||
@include usePadding(24, 4);
|
||||
margin-left: 12rpx;
|
||||
color: $primary-color;
|
||||
background: #E85A2B12;
|
||||
border-radius: 50rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
color: $tips-color;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.distribution-info-row {
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
column-gap: 16rpx;
|
||||
|
||||
.info-item {
|
||||
@include usePadding(16, 16);
|
||||
border-radius: 15rpx;
|
||||
background: #f6f6f6;
|
||||
color: #7A7A7A;
|
||||
font-size: 24rpx;
|
||||
|
||||
.title {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.count {
|
||||
color: #333;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
21
views/distribution/team/index.data.js
Normal file
21
views/distribution/team/index.data.js
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @name: index.data
|
||||
* @author: kahu4
|
||||
* @date: 2024-01-17 15:39
|
||||
* @description:index.data
|
||||
* @update: 2024-01-17 15:39
|
||||
* */
|
||||
export const distributorDataList = [
|
||||
{
|
||||
label: '商品金额(元)',
|
||||
field: 'productAmount'
|
||||
},
|
||||
{
|
||||
label: '订单数',
|
||||
field: 'orderCount'
|
||||
},
|
||||
{
|
||||
label: '佣金收入(元)',
|
||||
field: 'wages'
|
||||
},
|
||||
]
|
170
views/distribution/team/index.vue
Normal file
170
views/distribution/team/index.vue
Normal file
@ -0,0 +1,170 @@
|
||||
<!--
|
||||
@name: index
|
||||
@author: kahu4
|
||||
@date: 2024-01-17 14:52
|
||||
@description:我的团队
|
||||
@update: 2024-01-17 14:52
|
||||
-->
|
||||
<script setup>
|
||||
import Header from '@/components/Header/index.vue'
|
||||
import { useScroll } from "@/hooks/useScroll";
|
||||
import { onLoad, onPageScroll } from "@dcloudio/uni-app";
|
||||
import { ref } from "vue";
|
||||
import DistributorInfoItem from "@/views/distribution/team/component/DistributorInfoItem.vue";
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { getUserAddCount, getUserAllCount, pageMyUserTeam } from "@/api/distribution";
|
||||
import Empty from "@/components/Empty/index.vue"
|
||||
import { emptyOrderIcon } from "@/utils/images";
|
||||
// ======================= hooks =====================
|
||||
const {scrollTop} = useScroll()
|
||||
onPageScroll(() => {
|
||||
})
|
||||
|
||||
// ======================== level tab ====================
|
||||
const leverTabs = [{label: '一级', filed: 'p1Count', value: 1}, {label: '二级', filed: 'p2Count', value: 2}]
|
||||
const leverCurrent = ref(1)
|
||||
|
||||
async function leverSelect(value) {
|
||||
leverCurrent.value = value
|
||||
otherParams.value.type = value
|
||||
await refreshPage()
|
||||
await doGetUserAddCount()
|
||||
}
|
||||
|
||||
const {loading, otherParams, list, refreshPage} = usePaging({
|
||||
request: pageMyUserTeam,
|
||||
});
|
||||
|
||||
const addUserCount = ref(0)
|
||||
|
||||
async function doGetUserAddCount() {
|
||||
addUserCount.value = await getUserAddCount({
|
||||
type: otherParams.value.type
|
||||
})
|
||||
}
|
||||
|
||||
const allUserCount = ref({
|
||||
p1Count: 0,
|
||||
p2Count: 0
|
||||
})
|
||||
|
||||
async function doGetUserAllCount() {
|
||||
allUserCount.value = await getUserAllCount()
|
||||
}
|
||||
|
||||
onLoad(async () => {
|
||||
otherParams.value.type = 1
|
||||
await refreshPage()
|
||||
await doGetUserAddCount()
|
||||
await doGetUserAllCount()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="team">
|
||||
<Header
|
||||
:scroll-top="scrollTop"
|
||||
system-bar-area-bg="#fff"
|
||||
header-area-bg="#fff"> 我的团队
|
||||
</Header>
|
||||
<!-- tabs -->
|
||||
<view class="tab-content">
|
||||
<view class="tab-inner">
|
||||
<view
|
||||
class="tab-item"
|
||||
:class="{current:leverCurrent===lever.value}"
|
||||
v-for="lever in leverTabs"
|
||||
:key="lever.value"
|
||||
@click="leverSelect(lever.value)"
|
||||
>
|
||||
{{ lever.label }}({{ allUserCount[lever.filed] }})
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- main -->
|
||||
<view class="main">
|
||||
<!-- user num -->
|
||||
<view class="user-num-box">
|
||||
<view class="title">今日新增:
|
||||
<text class="num primary-color">{{ addUserCount }}人</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- user list -->
|
||||
<view
|
||||
class="user-list-box"
|
||||
v-if="list.length>0">
|
||||
<template
|
||||
v-for="item in list"
|
||||
:key="item.id">
|
||||
<DistributorInfoItem :data="item" />
|
||||
</template>
|
||||
</view>
|
||||
<view
|
||||
class="user-list-box"
|
||||
v-else>
|
||||
<Empty :icon-src="emptyOrderIcon" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style
|
||||
scoped
|
||||
lang="scss">
|
||||
.team {
|
||||
width: 100%;
|
||||
|
||||
.tab-content {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
@include usePadding(34, 34);
|
||||
|
||||
.tab-inner {
|
||||
@include useFlex(space-between, center, row, nowrap, 30rpx);
|
||||
border-radius: 50rpx;
|
||||
width: 100%;
|
||||
background: #f5f5f5;
|
||||
border: 5rpx solid #f5f5f5;
|
||||
overflow: hidden;
|
||||
|
||||
.tab-item {
|
||||
border-radius: 50rpx;
|
||||
|
||||
@include usePadding(0, 16);
|
||||
text-align: center;
|
||||
flex: 1 0 auto;
|
||||
background: #f6f8f8;
|
||||
color: #333333;
|
||||
transition: all .3s;
|
||||
|
||||
&.current {
|
||||
background: $white-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.main {
|
||||
width: 100%;
|
||||
@include usePadding(34, 34);
|
||||
}
|
||||
|
||||
.user-num-box {
|
||||
margin-bottom: 24rpx;
|
||||
width: 100%;
|
||||
@include useFlex(flex-start, center);
|
||||
font-size: 28rpx;
|
||||
|
||||
.title {
|
||||
color: $tips-color;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.user-list-box {
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user