✨ 分销:首页接入 100%
parent
2dcba5bbea
commit
ae52aa69f6
24
pages.json
24
pages.json
|
@ -349,18 +349,6 @@
|
|||
"group": "分销商城"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "apply",
|
||||
"style": {
|
||||
"navigationBarTitleText": "申请分销商"
|
||||
},
|
||||
"meta": {
|
||||
"auth": true,
|
||||
"sync": true,
|
||||
"title": "申请分销商",
|
||||
"group": "分销商城"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "goods",
|
||||
"style": {
|
||||
|
@ -385,18 +373,6 @@
|
|||
"group": "分销商城"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "share-log",
|
||||
"style": {
|
||||
"navigationBarTitleText": "分享记录"
|
||||
},
|
||||
"meta": {
|
||||
"auth": true,
|
||||
"sync": true,
|
||||
"title": "分享记录",
|
||||
"group": "分销商城"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "team",
|
||||
"style": {
|
||||
|
|
|
@ -1,117 +1,125 @@
|
|||
<!-- 账户 -->
|
||||
<!-- 分销账户:展示基本统计信息 -->
|
||||
<template>
|
||||
<view class="account-card">
|
||||
<view class="account-card-box">
|
||||
<view class="ss-flex ss-row-between card-box-header">
|
||||
<view class="ss-flex">
|
||||
<view class="header-title ss-m-r-16">账户信息</view>
|
||||
<button class="ss-reset-button look-btn ss-flex" @tap="state.showMoney = !state.showMoney">
|
||||
<uni-icons :type="state.showMoney ? 'eye-filled' : 'eye-slash-filled'" color="#A57A55"
|
||||
size="20"></uni-icons>
|
||||
</button>
|
||||
</view>
|
||||
<view class="ss-flex" @tap="sheep.$router.go('/pages/user/wallet/commission')">
|
||||
<view class="header-title ss-m-r-4">查看明细</view>
|
||||
<text class="cicon-play-arrow"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 收益 -->
|
||||
<view class="card-content ss-flex">
|
||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||
<view class="item-title">当前佣金(元)</view>
|
||||
<view class="item-detail">
|
||||
{{ state.showMoney ? userInfo.brokeragePrice || '0.00' : '***' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||
<view class="item-title">昨天的佣金(元)</view>
|
||||
<view class="item-detail">
|
||||
{{ state.showMoney ? userInfo.yesterdayPrice || '0.00' : '***' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||
<view class="item-title">累计已提(元)</view>
|
||||
<view class="item-detail">
|
||||
{{ state.showMoney ? userInfo.withdrawPrice || '0.00' : '***' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="account-card">
|
||||
<view class="account-card-box">
|
||||
<view class="ss-flex ss-row-between card-box-header">
|
||||
<view class="ss-flex">
|
||||
<view class="header-title ss-m-r-16">账户信息</view>
|
||||
<button
|
||||
class="ss-reset-button look-btn ss-flex"
|
||||
@tap="state.showMoney = !state.showMoney"
|
||||
>
|
||||
<uni-icons
|
||||
:type="state.showMoney ? 'eye-filled' : 'eye-slash-filled'"
|
||||
color="#A57A55"
|
||||
size="20"
|
||||
/>
|
||||
</button>
|
||||
</view>
|
||||
<view class="ss-flex" @tap="sheep.$router.go('/pages/user/wallet/commission')">
|
||||
<view class="header-title ss-m-r-4">查看明细</view>
|
||||
<text class="cicon-play-arrow" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 收益 -->
|
||||
<view class="card-content ss-flex">
|
||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||
<view class="item-title">当前佣金(元)</view>
|
||||
<view class="item-detail">
|
||||
{{ state.showMoney ? fen2yuan(state.summary.brokeragePrice || 0) : '***' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||
<view class="item-title">昨天的佣金(元)</view>
|
||||
<view class="item-detail">
|
||||
{{ state.showMoney ? fen2yuan(state.summary.yesterdayPrice || 0) : '***' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||
<view class="item-title">累计已提(元)</view>
|
||||
<view class="item-detail">
|
||||
{{ state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '***' }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
computed,
|
||||
reactive,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import { computed, reactive, onMounted } from 'vue';
|
||||
import BrokerageApi from '@/sheep/api/trade/brokerage';
|
||||
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
||||
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
|
||||
const state = reactive({
|
||||
showMoney: false,
|
||||
});
|
||||
onMounted(async () => {
|
||||
let res = await sheep.$api.commission.getSummary();
|
||||
userInfo = res.data;
|
||||
})
|
||||
const state = reactive({
|
||||
showMoney: false,
|
||||
summary: {},
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
let { code, data } = await BrokerageApi.getBrokerageUserSummary();
|
||||
if (code === 0) {
|
||||
state.summary = data || {}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.account-card {
|
||||
width: 694rpx;
|
||||
margin: 0 auto;
|
||||
padding: 2rpx;
|
||||
background: linear-gradient(180deg, #ffffff 0.88%, #fff9ec 100%);
|
||||
border-radius: 12rpx;
|
||||
z-index: 3;
|
||||
position: relative;
|
||||
.account-card {
|
||||
width: 694rpx;
|
||||
margin: 0 auto;
|
||||
padding: 2rpx;
|
||||
background: linear-gradient(180deg, #ffffff 0.88%, #fff9ec 100%);
|
||||
border-radius: 12rpx;
|
||||
z-index: 3;
|
||||
position: relative;
|
||||
|
||||
.account-card-box {
|
||||
background: #ffefd6;
|
||||
.account-card-box {
|
||||
background: #ffefd6;
|
||||
|
||||
.card-box-header {
|
||||
padding: 0 30rpx;
|
||||
height: 72rpx;
|
||||
box-shadow: 0px 2px 6px #f2debe;
|
||||
.card-box-header {
|
||||
padding: 0 30rpx;
|
||||
height: 72rpx;
|
||||
box-shadow: 0px 2px 6px #f2debe;
|
||||
|
||||
.header-title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #a17545;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
.header-title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #a17545;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
|
||||
.cicon-play-arrow {
|
||||
color: #a17545;
|
||||
font-size: 24rpx;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
}
|
||||
.cicon-play-arrow {
|
||||
color: #a17545;
|
||||
font-size: 24rpx;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.card-content {
|
||||
height: 190rpx;
|
||||
background: #fdfae9;
|
||||
.card-content {
|
||||
height: 190rpx;
|
||||
background: #fdfae9;
|
||||
|
||||
.item-title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #cba67e;
|
||||
line-height: 30rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.item-title {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #cba67e;
|
||||
line-height: 30rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.item-detail {
|
||||
font-size: 36rpx;
|
||||
font-family: OPPOSANS;
|
||||
font-weight: bold;
|
||||
color: #692e04;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.item-detail {
|
||||
font-size: 36rpx;
|
||||
font-family: OPPOSANS;
|
||||
font-weight: bold;
|
||||
color: #692e04;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,4 +1,4 @@
|
|||
<!-- 页面 -->
|
||||
<!-- 分销权限弹窗:再没有权限时,进行提示 -->
|
||||
<template>
|
||||
<su-popup
|
||||
:show="state.show"
|
||||
|
@ -12,17 +12,17 @@
|
|||
<view class="img-wrap">
|
||||
<image
|
||||
class="notice-img"
|
||||
:src="sheep.$url.static(state.event.image)"
|
||||
:src="sheep.$url.static('/static/img/shop/commission/forbidden.png')"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
/>
|
||||
</view>
|
||||
<view class="notice-title">{{ state.event.title }}</view>
|
||||
<view class="notice-detail">{{ state.event.subtitle }}</view>
|
||||
<view class="notice-title"> 抱歉!您没有分销权限 </view>
|
||||
<view class="notice-detail"> 该功能暂不可用 </view>
|
||||
<button
|
||||
class="ss-reset-button notice-btn ui-Shadow-Main ui-BG-Main-Gradient"
|
||||
@tap="onTap(state.event.action)"
|
||||
@tap="sheep.$router.back()"
|
||||
>
|
||||
{{ state.event.button }}
|
||||
知道了
|
||||
</button>
|
||||
<button class="ss-reset-button back-btn" @tap="sheep.$router.back()"> 返回 </button>
|
||||
</view>
|
||||
|
@ -30,105 +30,22 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import sheep from '@/sheep';
|
||||
import { reactive, watch } from 'vue';
|
||||
import { reactive } from 'vue';
|
||||
import BrokerageApi from '@/sheep/api/trade/brokerage';
|
||||
|
||||
const props = defineProps({
|
||||
error: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['getAgentInfo']);
|
||||
const state = reactive({
|
||||
event: {},
|
||||
show: false,
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.error,
|
||||
(error) => {
|
||||
if (error !== 0 && error !== 100) {
|
||||
state.event = eventMap[error];
|
||||
state.show = true;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
async function onTap(eventName) {
|
||||
switch (eventName) {
|
||||
case 'back': // 返回
|
||||
sheep.$router.back();
|
||||
break;
|
||||
case 'apply': // 需提交资料
|
||||
sheep.$router.go('/pages/commission/apply');
|
||||
break;
|
||||
case 'reApply': // 直接重新申请
|
||||
let { error } = await sheep.$api.commission.apply();
|
||||
if (error === 0) {
|
||||
emits('getAgentInfo');
|
||||
}
|
||||
break;
|
||||
onShow(async () => {
|
||||
// 读取是否有分销权限
|
||||
const { code, data } = await BrokerageApi.getBrokerageUser();
|
||||
if (code === 0 && !data?.brokerageEnabled) {
|
||||
state.show = true;
|
||||
}
|
||||
}
|
||||
const eventMap = {
|
||||
// 关闭
|
||||
101: {
|
||||
image: '/static/img/shop/commission/close.png',
|
||||
title: '分销中心已关闭',
|
||||
subtitle: '该功能暂不可用',
|
||||
button: '知道了',
|
||||
action: 'back',
|
||||
},
|
||||
// 禁用
|
||||
102: {
|
||||
image: '/static/img/shop/commission/forbidden.png',
|
||||
title: '账户已被禁用',
|
||||
subtitle: '该功能暂不可用',
|
||||
button: '知道了',
|
||||
action: 'back',
|
||||
},
|
||||
// 补充信息
|
||||
103: {
|
||||
image: '/static/img/shop/commission/apply.png',
|
||||
title: '待完善信息',
|
||||
subtitle: '请补充您的信息后提交审核',
|
||||
button: '完善信息',
|
||||
action: 'apply',
|
||||
},
|
||||
// 审核中
|
||||
104: {
|
||||
image: '/static/img/shop/commission/pending.png',
|
||||
title: '正在审核中',
|
||||
subtitle: '请耐心等候结果',
|
||||
button: '知道了',
|
||||
action: 'back',
|
||||
},
|
||||
// 重新提交
|
||||
105: {
|
||||
image: '/static/img/shop/commission/reject.png',
|
||||
title: '抱歉!您的申请信息未通过',
|
||||
subtitle: '请尝试修改后重新提交',
|
||||
button: '重新申请',
|
||||
action: 'apply',
|
||||
},
|
||||
// 直接重新申请
|
||||
106: {
|
||||
image: '/static/img/shop/commission/reject.png',
|
||||
title: '抱歉!您的申请未通过',
|
||||
subtitle: '请尝试重新申请',
|
||||
button: '重新申请',
|
||||
action: 'reApply',
|
||||
},
|
||||
// 冻结
|
||||
107: {
|
||||
image: '/static/img/shop/commission/freeze.png',
|
||||
title: '抱歉!您的账户已被冻结',
|
||||
subtitle: '如有疑问请联系客服',
|
||||
button: '联系客服',
|
||||
action: 'chat',
|
||||
},
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,173 +0,0 @@
|
|||
<template>
|
||||
<su-popup
|
||||
:show="state.show"
|
||||
type="bottom"
|
||||
round="10"
|
||||
:isMaskClick="false"
|
||||
:backgroundImage="sheep.$url.css('/static/img/shop/commission/become-agent.png')"
|
||||
@close="show = false"
|
||||
backgroundColor="var(--ui-BG-Main)"
|
||||
>
|
||||
<view class="model-box ss-flex ss-row-center">
|
||||
<view class="content">
|
||||
<scroll-view
|
||||
class="scroll-box"
|
||||
scroll-y="true"
|
||||
:scroll-with-animation="true"
|
||||
:show-scrollbar="false"
|
||||
>
|
||||
<view v-if="errorData.type === 'goods'">
|
||||
<view class="item-box ss-m-b-20" v-for="item in errorData.value" :key="item.id">
|
||||
<s-goods-item :title="item.title" :img="item.image" :price="item.price[0]" priceColor="#E1212B" @tap="sheep.$router.go('/pages/goods/index', { id: item.id })">
|
||||
<template #groupon>
|
||||
<view class="item-box-subtitle">{{ item.subtitle }}</view>
|
||||
</template>
|
||||
</s-goods-item>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<s-goods-item
|
||||
title="累计消费满"
|
||||
price=""
|
||||
:img="sheep.$url.static('/static/img/shop/commission/consume.png')"
|
||||
v-else-if="errorData.type === 'consume'"
|
||||
>
|
||||
<template #groupon>
|
||||
<view class="ss-flex">
|
||||
<view class="progress-box ss-flex">
|
||||
<view
|
||||
class="progerss-active"
|
||||
:style="{
|
||||
width: state.percent < 10 ? '10%' : state.percent + '%',
|
||||
}"
|
||||
></view>
|
||||
</view>
|
||||
<view class="progress-title ss-m-l-10">{{ errorData.value }}元</view>
|
||||
</view>
|
||||
<view class="progress-title ss-m-t-20">{{ userInfo.total_consume }}元</view>
|
||||
</template>
|
||||
</s-goods-item>
|
||||
</scroll-view>
|
||||
<view class="content-des" v-if="errorData.type === 'goods'"
|
||||
>* 购买指定商品即可成为分销商</view
|
||||
>
|
||||
<view class="content-des" v-else-if="errorData.type === 'consume'"
|
||||
>* 满足累计消费即可成为分销商</view
|
||||
>
|
||||
</view>
|
||||
<button class="ss-reset-button go-btn ui-BG-Main-Gradient" @tap="sheep.$router.back()">
|
||||
返回
|
||||
</button>
|
||||
</view>
|
||||
</su-popup>
|
||||
</template>
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import { computed, reactive, watch } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
|
||||
const props = defineProps({
|
||||
error: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
errorData: {
|
||||
type: Object,
|
||||
default() {},
|
||||
},
|
||||
});
|
||||
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
|
||||
const state = reactive({
|
||||
percent: computed(() => {
|
||||
if (props.errorData.type !== 'consume') {
|
||||
return 0;
|
||||
}
|
||||
let percent = (userInfo.value.total_consume / props.errorData.value) * 100;
|
||||
return parseInt(percent);
|
||||
}),
|
||||
show: false,
|
||||
money: '',
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.error,
|
||||
(error) => {
|
||||
if (error == 100) {
|
||||
state.show = true;
|
||||
}
|
||||
},
|
||||
);
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep() {
|
||||
.ss-goods-item-warp {
|
||||
background-color: #f8f8f8 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-title {
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.progress-box {
|
||||
flex: 1;
|
||||
height: 18rpx;
|
||||
background: #e7e7e7;
|
||||
border-radius: 9rpx;
|
||||
}
|
||||
|
||||
.progerss-active {
|
||||
height: 24rpx;
|
||||
background: linear-gradient(90deg, #ff6000 0%, #fe832a 100%);
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.model-box {
|
||||
padding: 140rpx 40rpx 60rpx 40rpx;
|
||||
height: 916rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
.content {
|
||||
height: 720rpx;
|
||||
width: 612rpx;
|
||||
padding-top: 30rpx;
|
||||
// background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
|
||||
.content-des {
|
||||
margin-top: 20rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
height: 620rpx;
|
||||
}
|
||||
.item-box-subtitle {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.go-btn {
|
||||
width: 600rpx;
|
||||
height: 70rpx;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: 120rpx;
|
||||
border-radius: 35rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -27,18 +27,16 @@
|
|||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
computed,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { computed, reactive } from 'vue';
|
||||
|
||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
||||
const headerBg = sheep.$url.css('/static/img/shop/commission/background.png');
|
||||
console.log(userInfo);
|
||||
|
||||
const state = reactive({
|
||||
showMoney: false,
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,30 +1,25 @@
|
|||
<!-- 分销明细 -->
|
||||
<!-- 分销首页:明细列表 -->
|
||||
<template>
|
||||
<view class="distribution-log-wrap">
|
||||
<view class="header-box">
|
||||
<image class="header-bg" :src="sheep.$url.static('/static/img/shop/commission/title2.png')" />
|
||||
<view class="ss-flex header-title">
|
||||
<view class="title">实时动态</view>
|
||||
<text class="cicon-forward"></text>
|
||||
<text class="cicon-forward" />
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" @scrolltolower="loadmore" class="scroll-box log-scroll"
|
||||
scroll-with-animation="true">
|
||||
<view v-if="state.pagination.data">
|
||||
<view class="log-item-box ss-flex ss-row-between" v-for="item in state.pagination.data" :key="item.id">
|
||||
<view v-if="state.pagination.list">
|
||||
<view class="log-item-box ss-flex ss-row-between" v-for="item in state.pagination.list" :key="item.id">
|
||||
<view class="log-item-wrap">
|
||||
<view class="log-item ss-flex ss-ellipsis-1 ss-col-center">
|
||||
<view class="ss-flex ss-col-center">
|
||||
<image v-if="item.oper_type === 'user'" class="log-img"
|
||||
:src="sheep.$url.cdn(item.oper?.avatar)" mode="aspectFill"></image>
|
||||
<image v-else-if="item.oper_type === 'admin'" class="log-img"
|
||||
:src="sheep.$url.static('/static/img/shop/avatar/default_user.png')"
|
||||
mode="aspectFill"></image>
|
||||
<image v-else class="log-img"
|
||||
:src="sheep.$url.static('/static/img/shop/avatar/notice.png')" mode="aspectFill">
|
||||
</image>
|
||||
<image class="log-img" :src="sheep.$url.static('/static/img/shop/avatar/notice.png')" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="log-text ss-ellipsis-1">{{ item.title }} {{item.price/100}}元</view>
|
||||
<view class="log-text ss-ellipsis-1">
|
||||
{{ item.title }} {{ fen2yuan(item.price) }} 元
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="log-time">{{ dayjs(item.createTime).fromNow() }}</text>
|
||||
|
@ -40,50 +35,46 @@
|
|||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
computed,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { reactive } from 'vue';
|
||||
import _ from 'lodash';
|
||||
import dayjs from 'dayjs';
|
||||
import BrokerageApi from '@/sheep/api/trade/brokerage';
|
||||
import { fen2yuan } from '../../../sheep/hooks/useGoods';
|
||||
|
||||
const state = reactive({
|
||||
loadStatus: '',
|
||||
pagination: {
|
||||
data: [],
|
||||
current_page: 1,
|
||||
total: 1,
|
||||
last_page: 1,
|
||||
list: [],
|
||||
total: 0,
|
||||
pageNo: 1,
|
||||
pageSize: 1,
|
||||
},
|
||||
});
|
||||
|
||||
async function getLog(page = 1) {
|
||||
state.pagination.current_page = page
|
||||
const res = await sheep.$api.commission.order({
|
||||
page,
|
||||
async function getLog() {
|
||||
state.loadStatus = 'loading';
|
||||
const { code, data } = await BrokerageApi.getBrokerageRecordPage({
|
||||
pageNo: state.pagination.pageNo,
|
||||
pageSize: state.pagination.pageSize
|
||||
});
|
||||
console.log(res, '下面的数据')
|
||||
if (res.code === 0) {
|
||||
let list = _.concat(state.pagination.data, res.data.list);
|
||||
state.pagination = {
|
||||
...res.data,
|
||||
data: list,
|
||||
};
|
||||
if (state.pagination.data.length < state.pagination.total) {
|
||||
state.loadStatus = 'more';
|
||||
} else {
|
||||
state.loadStatus = 'noMore';
|
||||
}
|
||||
}
|
||||
if (code !== 0) {
|
||||
return;
|
||||
}
|
||||
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||
state.pagination.total = data.total;
|
||||
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||
}
|
||||
|
||||
getLog();
|
||||
|
||||
// 加载更多
|
||||
function loadmore() {
|
||||
if (state.loadStatus !== 'noMore') {
|
||||
getLog(state.pagination.current_page + 1);
|
||||
}
|
||||
}
|
||||
if (state.loadStatus === 'noMore') {
|
||||
return;
|
||||
}
|
||||
state.pagination.pageNo++;
|
||||
getLog();
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- 分销商菜单栏 -->
|
||||
<!-- 分销:商菜单栏 -->
|
||||
<template>
|
||||
<view class="menu-box ss-flex-col">
|
||||
<view class="header-box">
|
||||
|
@ -15,36 +15,12 @@
|
|||
<view>{{ item.title }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <uni-grid :column="4" :showBorder="false" :highlight="false">
|
||||
<uni-grid-item
|
||||
v-for="(item, index) in state.menuList"
|
||||
:index="index"
|
||||
:key="index"
|
||||
@tap="sheep.$router.go(item.path)"
|
||||
>
|
||||
<view class="grid-item-box ss-flex ss-flex-col ss-row-center ss-col-center">
|
||||
<image
|
||||
class="menu-icon ss-m-b-10"
|
||||
:src="sheep.$url.static(item.img)"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
<text class="menu-title">{{ item.title }}</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { reactive } from 'vue';
|
||||
|
||||
const state = reactive({
|
||||
menuList: [{
|
||||
|
@ -78,20 +54,18 @@
|
|||
img: '/static/img/shop/commission/commission_icon7.png',
|
||||
title: '邀请海报',
|
||||
path: 'action:showShareModal',
|
||||
}, {
|
||||
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||
title: '推广人排行榜',
|
||||
path: '/pages/commission/promoter',
|
||||
}, {
|
||||
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||
title: '佣金排行榜',
|
||||
path: '/pages/commission/commission-ranking',
|
||||
},
|
||||
// {
|
||||
// img: '/static/img/shop/commission/commission_icon8.png',
|
||||
// title: '分享记录',
|
||||
// path: '/pages/commission/share-log',
|
||||
// },
|
||||
// TODO @芋艿:缺少 icon
|
||||
{
|
||||
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||
title: '推广排行',
|
||||
path: '/pages/commission/promoter',
|
||||
},
|
||||
{
|
||||
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||
title: '佣金排行',
|
||||
path: '/pages/commission/commission-ranking',
|
||||
}
|
||||
],
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -9,57 +9,25 @@
|
|||
<commission-menu />
|
||||
<!-- 分销记录 -->
|
||||
<commission-log />
|
||||
<!-- 弹框 -->
|
||||
<commission-condition :error="state.error" :errorData="state.errorData" />
|
||||
|
||||
<!-- 权限 -->
|
||||
<commission-auth :error="state.error" @getAgentInfo="getAgentInfo" />
|
||||
<!-- 权限弹窗 -->
|
||||
<commission-auth />
|
||||
</s-layout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
onShow
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
computed,
|
||||
reactive
|
||||
} from 'vue';
|
||||
import { reactive } from 'vue';
|
||||
import commissionInfo from './components/commission-info.vue';
|
||||
import accountInfo from './components/account-info.vue';
|
||||
import commissionLog from './components/commission-log.vue';
|
||||
import commissionMenu from './components/commission-menu.vue';
|
||||
import commissionAuth from './components/commission-auth.vue';
|
||||
import commissionCondition from './components/commission-condition.vue';
|
||||
|
||||
const state = reactive({
|
||||
error: 0,
|
||||
errorData: {},
|
||||
config: {
|
||||
background: '/storage/default/20220704/29ac76a3c9d0d983200d612e45a052ca.png',
|
||||
},
|
||||
});
|
||||
|
||||
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
||||
const state = reactive({});
|
||||
|
||||
const bgStyle = {
|
||||
color: '#F7D598',
|
||||
};
|
||||
|
||||
async function getAgentInfo() {
|
||||
const {
|
||||
error,
|
||||
data
|
||||
} = await sheep.$store('user').getAgentInfo();
|
||||
if (error !== 0) {
|
||||
state.error = error;
|
||||
state.errorData = data;
|
||||
}
|
||||
}
|
||||
onShow(() => {
|
||||
getAgentInfo();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -1,173 +0,0 @@
|
|||
<!-- 分销记录 -->
|
||||
<template>
|
||||
<s-layout title="分享记录">
|
||||
<view class="distraction-share-wrap">
|
||||
<view class="share-log-box">
|
||||
<!-- 分享记录列表 -->
|
||||
<view class="log-list ss-flex" v-for="item in state.pagination.data" :key="item.id">
|
||||
<view class="log-avatar-wrap">
|
||||
<image
|
||||
class="log-avatar"
|
||||
:src="sheep.$url.cdn(item.user?.avatar)"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
</view>
|
||||
|
||||
<view class="item-right">
|
||||
<view class="name">{{ item.user?.nickname }}</view>
|
||||
<view class="content ss-flex">
|
||||
<view v-if="item.ext?.image" class="content-img-wrap">
|
||||
<image class="content-img" :src="sheep.$url.cdn(item.ext?.image)" mode="aspectFill">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
<view v-if="item.ext?.memo" class="content-text">
|
||||
{{ item.ext?.memo }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-bottom ss-flex ss-row-between">
|
||||
<view class="from-text"></view>
|
||||
<view class="time">{{ dayjs(item.create_time).fromNow() }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<s-empty
|
||||
v-if="state.pagination.total === 0"
|
||||
icon="/static/data-empty.png"
|
||||
text="暂无分享记录"
|
||||
>
|
||||
</s-empty>
|
||||
<!-- 加载更多 -->
|
||||
<uni-load-more
|
||||
v-if="state.pagination.total > 0"
|
||||
:status="state.loadStatus"
|
||||
:content-text="{
|
||||
contentdown: '上拉加载更多',
|
||||
}"
|
||||
@tap="loadmore"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</s-layout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import sheep from '@/sheep';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { computed, reactive } from 'vue';
|
||||
import _ from 'lodash';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const state = reactive({
|
||||
pagination: {
|
||||
data: [],
|
||||
current_page: 1,
|
||||
total: 1,
|
||||
last_page: 1,
|
||||
},
|
||||
loadStatus: '',
|
||||
});
|
||||
|
||||
async function getShareLog(page = 1, list_rows = 8) {
|
||||
state.loadStatus = 'loading';
|
||||
let res = await sheep.$api.user.share.list({
|
||||
list_rows,
|
||||
page,
|
||||
});
|
||||
if (res.error === 0) {
|
||||
let orderList = _.concat(state.pagination.data, res.data.data);
|
||||
state.pagination = {
|
||||
...res.data,
|
||||
data: orderList,
|
||||
};
|
||||
if (state.pagination.current_page < state.pagination.last_page) {
|
||||
state.loadStatus = 'more';
|
||||
} else {
|
||||
state.loadStatus = 'noMore';
|
||||
}
|
||||
}
|
||||
}
|
||||
// 加载更多
|
||||
function loadmore() {
|
||||
if (state.loadStatus !== 'noMore') {
|
||||
getShareLog(state.pagination.current_page + 1);
|
||||
}
|
||||
}
|
||||
onLoad(async () => {
|
||||
getShareLog();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.share-log-box {
|
||||
// 分享记录列表
|
||||
.log-list {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
margin: 10rpx 0;
|
||||
align-items: flex-start;
|
||||
|
||||
.log-avatar-wrap {
|
||||
margin-right: 14rpx;
|
||||
|
||||
.log-avatar {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.item-right {
|
||||
flex: 1;
|
||||
|
||||
.name {
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
color: #7f7aa5;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.content {
|
||||
background: rgba(241, 241, 241, 0.46);
|
||||
border-radius: 2rpx;
|
||||
padding: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.content-img-wrap {
|
||||
margin-right: 16rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
|
||||
.content-img {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content-text {
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
width: 100%;
|
||||
|
||||
.time {
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #c8c8c8;
|
||||
}
|
||||
|
||||
.from-text {
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: #c8c8c8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -39,11 +39,6 @@ export default {
|
|||
url: '/app-api/member/sign-in/record/page',
|
||||
method: 'GET',
|
||||
}),
|
||||
// signAdd: () =>
|
||||
// request({
|
||||
// url: 'activity/signin',
|
||||
// method: 'POST',
|
||||
// }),
|
||||
replenish: (data) =>
|
||||
request({
|
||||
url: 'activity/signin/replenish',
|
||||
|
@ -55,11 +50,6 @@ export default {
|
|||
url: 'activity/activity/' + id,
|
||||
method: 'GET',
|
||||
}),
|
||||
getSummary: () =>
|
||||
request({
|
||||
url: '/app-api/member/sign-in/record/get-summary',
|
||||
method: 'GET',
|
||||
}),
|
||||
getBargainRecordSummary: () =>
|
||||
request({
|
||||
url: '/app-api/promotion/bargain-record/get-summary',
|
||||
|
|
|
@ -34,13 +34,6 @@ export default {
|
|||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
// 分销订单
|
||||
order: (params) =>
|
||||
request({
|
||||
url: '/app-api/trade/brokerage-record/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
}),
|
||||
|
||||
// 分销商品
|
||||
goods: (params) =>
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import request from '@/sheep/request';
|
||||
|
||||
const DiyTemplateApi = {
|
||||
// TODO 芋艿:测试
|
||||
// getUsedDiyTemplate: () => {
|
||||
// return request({
|
||||
// url: '/app-api/promotion/diy-template/used',
|
||||
// method: 'GET',
|
||||
// });
|
||||
// },
|
||||
getUsedDiyTemplate: () => {
|
||||
return request({
|
||||
url: '/app-api/promotion/diy-template/used',
|
||||
method: 'GET',
|
||||
});
|
||||
},
|
||||
getDiyTemplate: (id) => {
|
||||
return request({
|
||||
url: '/app-api/promotion/diy-template/get',
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
import request from '@/sheep/request';
|
||||
|
||||
const BrokerageApi = {
|
||||
// 获得个人分销信息
|
||||
getBrokerageUser: () => {
|
||||
return request({
|
||||
url: '/app-api/trade/brokerage-user/get',
|
||||
method: 'GET'
|
||||
});
|
||||
},
|
||||
// 获得个人分销统计
|
||||
getBrokerageUserSummary: () => {
|
||||
return request({
|
||||
url: '/app-api/trade/brokerage-user/get-summary',
|
||||
method: 'GET',
|
||||
});
|
||||
},
|
||||
// 分销订单
|
||||
getBrokerageRecordPage: (params) => {
|
||||
return request({
|
||||
url: '/app-api/trade/brokerage-record/page',
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default BrokerageApi
|
|
@ -2,7 +2,6 @@ import {
|
|||
defineStore
|
||||
} from 'pinia';
|
||||
import userApi from '@/sheep/api/user';
|
||||
import commissionApi from '@/sheep/api/commission';
|
||||
import $share from '@/sheep/platform/share';
|
||||
import {
|
||||
isEmpty,
|
||||
|
@ -15,6 +14,7 @@ import {
|
|||
showAuthModal
|
||||
} from '@/sheep/hooks/useModal';
|
||||
import AuthUtil from '@/sheep/api/member/auth';
|
||||
import BrokerageApi from '@/sheep/api/trade/brokerage';
|
||||
|
||||
// 默认用户信息
|
||||
const defaultUserInfo = {
|
||||
|
@ -23,7 +23,7 @@ const defaultUserInfo = {
|
|||
gender: 0, // 性别
|
||||
mobile: '', // 手机号
|
||||
money: '--', // 余额
|
||||
commission: '--', // 佣金
|
||||
commission: '--', // 佣金 TODO 芋艿:干掉
|
||||
score: '--', // 积分
|
||||
verification: {}, // 认证字段
|
||||
};
|
||||
|
@ -46,7 +46,6 @@ const user = defineStore({
|
|||
userInfo: clone(defaultUserInfo), // 用户信息
|
||||
isLogin: !!uni.getStorageSync('token'), // 登录状态
|
||||
numData: cloneDeep(defaultNumData), // 用户其他数据
|
||||
agentInfo: {}, // 分销商信息
|
||||
lastUpdateTime: 0, // 上次更新时间
|
||||
}),
|
||||
|
||||
|
@ -72,16 +71,6 @@ const user = defineStore({
|
|||
return Promise.resolve(data);
|
||||
},
|
||||
|
||||
// 获取分销商信息
|
||||
// TODO 芋艿:整理下;
|
||||
async getAgentInfo() {
|
||||
const res = await commissionApi.agent();
|
||||
if (res.error === 0) {
|
||||
this.agentInfo = res.data;
|
||||
}
|
||||
return Promise.resolve(res);
|
||||
},
|
||||
|
||||
// 获取订单、优惠券等其他资产信息
|
||||
// TODO 芋艿:整理下;
|
||||
async getNumData() {
|
||||
|
|
Loading…
Reference in New Issue