✨ 分销:首页接入 100%
parent
2dcba5bbea
commit
ae52aa69f6
24
pages.json
24
pages.json
|
|
@ -349,18 +349,6 @@
|
||||||
"group": "分销商城"
|
"group": "分销商城"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "apply",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "申请分销商"
|
|
||||||
},
|
|
||||||
"meta": {
|
|
||||||
"auth": true,
|
|
||||||
"sync": true,
|
|
||||||
"title": "申请分销商",
|
|
||||||
"group": "分销商城"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "goods",
|
"path": "goods",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
@ -385,18 +373,6 @@
|
||||||
"group": "分销商城"
|
"group": "分销商城"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "share-log",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "分享记录"
|
|
||||||
},
|
|
||||||
"meta": {
|
|
||||||
"auth": true,
|
|
||||||
"sync": true,
|
|
||||||
"title": "分享记录",
|
|
||||||
"group": "分销商城"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "team",
|
"path": "team",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
||||||
|
|
@ -1,117 +1,125 @@
|
||||||
<!-- 账户 -->
|
<!-- 分销账户:展示基本统计信息 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="account-card">
|
<view class="account-card">
|
||||||
<view class="account-card-box">
|
<view class="account-card-box">
|
||||||
<view class="ss-flex ss-row-between card-box-header">
|
<view class="ss-flex ss-row-between card-box-header">
|
||||||
<view class="ss-flex">
|
<view class="ss-flex">
|
||||||
<view class="header-title ss-m-r-16">账户信息</view>
|
<view class="header-title ss-m-r-16">账户信息</view>
|
||||||
<button class="ss-reset-button look-btn ss-flex" @tap="state.showMoney = !state.showMoney">
|
<button
|
||||||
<uni-icons :type="state.showMoney ? 'eye-filled' : 'eye-slash-filled'" color="#A57A55"
|
class="ss-reset-button look-btn ss-flex"
|
||||||
size="20"></uni-icons>
|
@tap="state.showMoney = !state.showMoney"
|
||||||
</button>
|
>
|
||||||
</view>
|
<uni-icons
|
||||||
<view class="ss-flex" @tap="sheep.$router.go('/pages/user/wallet/commission')">
|
:type="state.showMoney ? 'eye-filled' : 'eye-slash-filled'"
|
||||||
<view class="header-title ss-m-r-4">查看明细</view>
|
color="#A57A55"
|
||||||
<text class="cicon-play-arrow"></text>
|
size="20"
|
||||||
</view>
|
/>
|
||||||
</view>
|
</button>
|
||||||
<!-- 收益 -->
|
</view>
|
||||||
<view class="card-content ss-flex">
|
<view class="ss-flex" @tap="sheep.$router.go('/pages/user/wallet/commission')">
|
||||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
<view class="header-title ss-m-r-4">查看明细</view>
|
||||||
<view class="item-title">当前佣金(元)</view>
|
<text class="cicon-play-arrow" />
|
||||||
<view class="item-detail">
|
</view>
|
||||||
{{ state.showMoney ? userInfo.brokeragePrice || '0.00' : '***' }}
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
<!-- 收益 -->
|
||||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
<view class="card-content ss-flex">
|
||||||
<view class="item-title">昨天的佣金(元)</view>
|
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||||
<view class="item-detail">
|
<view class="item-title">当前佣金(元)</view>
|
||||||
{{ state.showMoney ? userInfo.yesterdayPrice || '0.00' : '***' }}
|
<view class="item-detail">
|
||||||
</view>
|
{{ state.showMoney ? fen2yuan(state.summary.brokeragePrice || 0) : '***' }}
|
||||||
</view>
|
</view>
|
||||||
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
</view>
|
||||||
<view class="item-title">累计已提(元)</view>
|
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||||
<view class="item-detail">
|
<view class="item-title">昨天的佣金(元)</view>
|
||||||
{{ state.showMoney ? userInfo.withdrawPrice || '0.00' : '***' }}
|
<view class="item-detail">
|
||||||
</view>
|
{{ state.showMoney ? fen2yuan(state.summary.yesterdayPrice || 0) : '***' }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="ss-flex-1 ss-flex-col ss-col-center">
|
||||||
</view>
|
<view class="item-title">累计已提(元)</view>
|
||||||
|
<view class="item-detail">
|
||||||
|
{{ state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '***' }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import {
|
import { computed, reactive, onMounted } from 'vue';
|
||||||
computed,
|
import BrokerageApi from '@/sheep/api/trade/brokerage';
|
||||||
reactive,
|
import { fen2yuan } from '@/sheep/hooks/useGoods';
|
||||||
onMounted
|
|
||||||
} from 'vue';
|
|
||||||
|
|
||||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||||
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
showMoney: false,
|
showMoney: false,
|
||||||
});
|
summary: {},
|
||||||
onMounted(async () => {
|
});
|
||||||
let res = await sheep.$api.commission.getSummary();
|
|
||||||
userInfo = res.data;
|
onMounted(async () => {
|
||||||
})
|
let { code, data } = await BrokerageApi.getBrokerageUserSummary();
|
||||||
|
if (code === 0) {
|
||||||
|
state.summary = data || {}
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.account-card {
|
.account-card {
|
||||||
width: 694rpx;
|
width: 694rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 2rpx;
|
padding: 2rpx;
|
||||||
background: linear-gradient(180deg, #ffffff 0.88%, #fff9ec 100%);
|
background: linear-gradient(180deg, #ffffff 0.88%, #fff9ec 100%);
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.account-card-box {
|
.account-card-box {
|
||||||
background: #ffefd6;
|
background: #ffefd6;
|
||||||
|
|
||||||
.card-box-header {
|
.card-box-header {
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
height: 72rpx;
|
height: 72rpx;
|
||||||
box-shadow: 0px 2px 6px #f2debe;
|
box-shadow: 0px 2px 6px #f2debe;
|
||||||
|
|
||||||
.header-title {
|
.header-title {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #a17545;
|
color: #a17545;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cicon-play-arrow {
|
.cicon-play-arrow {
|
||||||
color: #a17545;
|
color: #a17545;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-content {
|
.card-content {
|
||||||
height: 190rpx;
|
height: 190rpx;
|
||||||
background: #fdfae9;
|
background: #fdfae9;
|
||||||
|
|
||||||
.item-title {
|
.item-title {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #cba67e;
|
color: #cba67e;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-detail {
|
.item-detail {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-family: OPPOSANS;
|
font-family: OPPOSANS;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #692e04;
|
color: #692e04;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- 页面 -->
|
<!-- 分销权限弹窗:再没有权限时,进行提示 -->
|
||||||
<template>
|
<template>
|
||||||
<su-popup
|
<su-popup
|
||||||
:show="state.show"
|
:show="state.show"
|
||||||
|
|
@ -12,17 +12,17 @@
|
||||||
<view class="img-wrap">
|
<view class="img-wrap">
|
||||||
<image
|
<image
|
||||||
class="notice-img"
|
class="notice-img"
|
||||||
:src="sheep.$url.static(state.event.image)"
|
:src="sheep.$url.static('/static/img/shop/commission/forbidden.png')"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
></image>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="notice-title">{{ state.event.title }}</view>
|
<view class="notice-title"> 抱歉!您没有分销权限 </view>
|
||||||
<view class="notice-detail">{{ state.event.subtitle }}</view>
|
<view class="notice-detail"> 该功能暂不可用 </view>
|
||||||
<button
|
<button
|
||||||
class="ss-reset-button notice-btn ui-Shadow-Main ui-BG-Main-Gradient"
|
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>
|
||||||
<button class="ss-reset-button back-btn" @tap="sheep.$router.back()"> 返回 </button>
|
<button class="ss-reset-button back-btn" @tap="sheep.$router.back()"> 返回 </button>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -30,105 +30,22 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import sheep from '@/sheep';
|
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({
|
const state = reactive({
|
||||||
event: {},
|
|
||||||
show: false,
|
show: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
onShow(async () => {
|
||||||
() => props.error,
|
// 读取是否有分销权限
|
||||||
(error) => {
|
const { code, data } = await BrokerageApi.getBrokerageUser();
|
||||||
if (error !== 0 && error !== 100) {
|
if (code === 0 && !data?.brokerageEnabled) {
|
||||||
state.event = eventMap[error];
|
state.show = true;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<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>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import {
|
import { computed, reactive } from 'vue';
|
||||||
computed,
|
|
||||||
reactive
|
|
||||||
} from 'vue';
|
|
||||||
|
|
||||||
const userInfo = computed(() => sheep.$store('user').userInfo);
|
const userInfo = computed(() => sheep.$store('user').userInfo);
|
||||||
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
||||||
const headerBg = sheep.$url.css('/static/img/shop/commission/background.png');
|
const headerBg = sheep.$url.css('/static/img/shop/commission/background.png');
|
||||||
console.log(userInfo);
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
showMoney: false,
|
showMoney: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,25 @@
|
||||||
<!-- 分销明细 -->
|
<!-- 分销首页:明细列表 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="distribution-log-wrap">
|
<view class="distribution-log-wrap">
|
||||||
<view class="header-box">
|
<view class="header-box">
|
||||||
<image class="header-bg" :src="sheep.$url.static('/static/img/shop/commission/title2.png')" />
|
<image class="header-bg" :src="sheep.$url.static('/static/img/shop/commission/title2.png')" />
|
||||||
<view class="ss-flex header-title">
|
<view class="ss-flex header-title">
|
||||||
<view class="title">实时动态</view>
|
<view class="title">实时动态</view>
|
||||||
<text class="cicon-forward"></text>
|
<text class="cicon-forward" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y="true" @scrolltolower="loadmore" class="scroll-box log-scroll"
|
<scroll-view scroll-y="true" @scrolltolower="loadmore" class="scroll-box log-scroll"
|
||||||
scroll-with-animation="true">
|
scroll-with-animation="true">
|
||||||
<view v-if="state.pagination.data">
|
<view v-if="state.pagination.list">
|
||||||
<view class="log-item-box ss-flex ss-row-between" v-for="item in state.pagination.data" :key="item.id">
|
<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-wrap">
|
||||||
<view class="log-item ss-flex ss-ellipsis-1 ss-col-center">
|
<view class="log-item ss-flex ss-ellipsis-1 ss-col-center">
|
||||||
<view class="ss-flex ss-col-center">
|
<view class="ss-flex ss-col-center">
|
||||||
<image v-if="item.oper_type === 'user'" class="log-img"
|
<image class="log-img" :src="sheep.$url.static('/static/img/shop/avatar/notice.png')" mode="aspectFill" />
|
||||||
: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>
|
|
||||||
</view>
|
</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>
|
||||||
</view>
|
</view>
|
||||||
<text class="log-time">{{ dayjs(item.createTime).fromNow() }}</text>
|
<text class="log-time">{{ dayjs(item.createTime).fromNow() }}</text>
|
||||||
|
|
@ -40,50 +35,46 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import {
|
import { reactive } from 'vue';
|
||||||
computed,
|
|
||||||
reactive
|
|
||||||
} from 'vue';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import BrokerageApi from '@/sheep/api/trade/brokerage';
|
||||||
|
import { fen2yuan } from '../../../sheep/hooks/useGoods';
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
loadStatus: '',
|
loadStatus: '',
|
||||||
pagination: {
|
pagination: {
|
||||||
data: [],
|
list: [],
|
||||||
current_page: 1,
|
total: 0,
|
||||||
total: 1,
|
pageNo: 1,
|
||||||
last_page: 1,
|
pageSize: 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getLog(page = 1) {
|
async function getLog() {
|
||||||
state.pagination.current_page = page
|
state.loadStatus = 'loading';
|
||||||
const res = await sheep.$api.commission.order({
|
const { code, data } = await BrokerageApi.getBrokerageRecordPage({
|
||||||
page,
|
pageNo: state.pagination.pageNo,
|
||||||
|
pageSize: state.pagination.pageSize
|
||||||
});
|
});
|
||||||
console.log(res, '下面的数据')
|
if (code !== 0) {
|
||||||
if (res.code === 0) {
|
return;
|
||||||
let list = _.concat(state.pagination.data, res.data.list);
|
}
|
||||||
state.pagination = {
|
state.pagination.list = _.concat(state.pagination.list, data.list);
|
||||||
...res.data,
|
state.pagination.total = data.total;
|
||||||
data: list,
|
state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
||||||
};
|
|
||||||
if (state.pagination.data.length < state.pagination.total) {
|
|
||||||
state.loadStatus = 'more';
|
|
||||||
} else {
|
|
||||||
state.loadStatus = 'noMore';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getLog();
|
getLog();
|
||||||
|
|
||||||
// 加载更多
|
// 加载更多
|
||||||
function loadmore() {
|
function loadmore() {
|
||||||
if (state.loadStatus !== 'noMore') {
|
if (state.loadStatus === 'noMore') {
|
||||||
getLog(state.pagination.current_page + 1);
|
return;
|
||||||
}
|
}
|
||||||
}
|
state.pagination.pageNo++;
|
||||||
|
getLog();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- 分销商菜单栏 -->
|
<!-- 分销:商菜单栏 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="menu-box ss-flex-col">
|
<view class="menu-box ss-flex-col">
|
||||||
<view class="header-box">
|
<view class="header-box">
|
||||||
|
|
@ -15,36 +15,12 @@
|
||||||
<view>{{ item.title }}</view>
|
<view>{{ item.title }}</view>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import sheep from '@/sheep';
|
||||||
import {
|
import { reactive } from 'vue';
|
||||||
onLoad
|
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
import {
|
|
||||||
computed,
|
|
||||||
reactive
|
|
||||||
} from 'vue';
|
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
menuList: [{
|
menuList: [{
|
||||||
|
|
@ -78,20 +54,18 @@
|
||||||
img: '/static/img/shop/commission/commission_icon7.png',
|
img: '/static/img/shop/commission/commission_icon7.png',
|
||||||
title: '邀请海报',
|
title: '邀请海报',
|
||||||
path: 'action:showShareModal',
|
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',
|
|
||||||
},
|
},
|
||||||
// {
|
// TODO @芋艿:缺少 icon
|
||||||
// img: '/static/img/shop/commission/commission_icon8.png',
|
{
|
||||||
// title: '分享记录',
|
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||||
// path: '/pages/commission/share-log',
|
title: '推广排行',
|
||||||
// },
|
path: '/pages/commission/promoter',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// img: '/static/img/shop/commission/commission_icon7.png',
|
||||||
|
title: '佣金排行',
|
||||||
|
path: '/pages/commission/commission-ranking',
|
||||||
|
}
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -9,57 +9,25 @@
|
||||||
<commission-menu />
|
<commission-menu />
|
||||||
<!-- 分销记录 -->
|
<!-- 分销记录 -->
|
||||||
<commission-log />
|
<commission-log />
|
||||||
<!-- 弹框 -->
|
|
||||||
<commission-condition :error="state.error" :errorData="state.errorData" />
|
|
||||||
|
|
||||||
<!-- 权限 -->
|
<!-- 权限弹窗 -->
|
||||||
<commission-auth :error="state.error" @getAgentInfo="getAgentInfo" />
|
<commission-auth />
|
||||||
</s-layout>
|
</s-layout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import sheep from '@/sheep';
|
import { reactive } from 'vue';
|
||||||
import {
|
|
||||||
onShow
|
|
||||||
} from '@dcloudio/uni-app';
|
|
||||||
import {
|
|
||||||
computed,
|
|
||||||
reactive
|
|
||||||
} from 'vue';
|
|
||||||
import commissionInfo from './components/commission-info.vue';
|
import commissionInfo from './components/commission-info.vue';
|
||||||
import accountInfo from './components/account-info.vue';
|
import accountInfo from './components/account-info.vue';
|
||||||
import commissionLog from './components/commission-log.vue';
|
import commissionLog from './components/commission-log.vue';
|
||||||
import commissionMenu from './components/commission-menu.vue';
|
import commissionMenu from './components/commission-menu.vue';
|
||||||
import commissionAuth from './components/commission-auth.vue';
|
import commissionAuth from './components/commission-auth.vue';
|
||||||
import commissionCondition from './components/commission-condition.vue';
|
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({});
|
||||||
error: 0,
|
|
||||||
errorData: {},
|
|
||||||
config: {
|
|
||||||
background: '/storage/default/20220704/29ac76a3c9d0d983200d612e45a052ca.png',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const agentInfo = computed(() => sheep.$store('user').agentInfo);
|
|
||||||
|
|
||||||
const bgStyle = {
|
const bgStyle = {
|
||||||
color: '#F7D598',
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<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',
|
url: '/app-api/member/sign-in/record/page',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}),
|
}),
|
||||||
// signAdd: () =>
|
|
||||||
// request({
|
|
||||||
// url: 'activity/signin',
|
|
||||||
// method: 'POST',
|
|
||||||
// }),
|
|
||||||
replenish: (data) =>
|
replenish: (data) =>
|
||||||
request({
|
request({
|
||||||
url: 'activity/signin/replenish',
|
url: 'activity/signin/replenish',
|
||||||
|
|
@ -55,11 +50,6 @@ export default {
|
||||||
url: 'activity/activity/' + id,
|
url: 'activity/activity/' + id,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}),
|
}),
|
||||||
getSummary: () =>
|
|
||||||
request({
|
|
||||||
url: '/app-api/member/sign-in/record/get-summary',
|
|
||||||
method: 'GET',
|
|
||||||
}),
|
|
||||||
getBargainRecordSummary: () =>
|
getBargainRecordSummary: () =>
|
||||||
request({
|
request({
|
||||||
url: '/app-api/promotion/bargain-record/get-summary',
|
url: '/app-api/promotion/bargain-record/get-summary',
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,6 @@ export default {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params,
|
params,
|
||||||
}),
|
}),
|
||||||
// 分销订单
|
|
||||||
order: (params) =>
|
|
||||||
request({
|
|
||||||
url: '/app-api/trade/brokerage-record/page',
|
|
||||||
method: 'GET',
|
|
||||||
params,
|
|
||||||
}),
|
|
||||||
|
|
||||||
// 分销商品
|
// 分销商品
|
||||||
goods: (params) =>
|
goods: (params) =>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
import request from '@/sheep/request';
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const DiyTemplateApi = {
|
const DiyTemplateApi = {
|
||||||
// TODO 芋艿:测试
|
getUsedDiyTemplate: () => {
|
||||||
// getUsedDiyTemplate: () => {
|
return request({
|
||||||
// return request({
|
url: '/app-api/promotion/diy-template/used',
|
||||||
// url: '/app-api/promotion/diy-template/used',
|
method: 'GET',
|
||||||
// method: 'GET',
|
});
|
||||||
// });
|
},
|
||||||
// },
|
|
||||||
getDiyTemplate: (id) => {
|
getDiyTemplate: (id) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/app-api/promotion/diy-template/get',
|
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
|
defineStore
|
||||||
} from 'pinia';
|
} from 'pinia';
|
||||||
import userApi from '@/sheep/api/user';
|
import userApi from '@/sheep/api/user';
|
||||||
import commissionApi from '@/sheep/api/commission';
|
|
||||||
import $share from '@/sheep/platform/share';
|
import $share from '@/sheep/platform/share';
|
||||||
import {
|
import {
|
||||||
isEmpty,
|
isEmpty,
|
||||||
|
|
@ -15,6 +14,7 @@ import {
|
||||||
showAuthModal
|
showAuthModal
|
||||||
} from '@/sheep/hooks/useModal';
|
} from '@/sheep/hooks/useModal';
|
||||||
import AuthUtil from '@/sheep/api/member/auth';
|
import AuthUtil from '@/sheep/api/member/auth';
|
||||||
|
import BrokerageApi from '@/sheep/api/trade/brokerage';
|
||||||
|
|
||||||
// 默认用户信息
|
// 默认用户信息
|
||||||
const defaultUserInfo = {
|
const defaultUserInfo = {
|
||||||
|
|
@ -23,7 +23,7 @@ const defaultUserInfo = {
|
||||||
gender: 0, // 性别
|
gender: 0, // 性别
|
||||||
mobile: '', // 手机号
|
mobile: '', // 手机号
|
||||||
money: '--', // 余额
|
money: '--', // 余额
|
||||||
commission: '--', // 佣金
|
commission: '--', // 佣金 TODO 芋艿:干掉
|
||||||
score: '--', // 积分
|
score: '--', // 积分
|
||||||
verification: {}, // 认证字段
|
verification: {}, // 认证字段
|
||||||
};
|
};
|
||||||
|
|
@ -46,7 +46,6 @@ const user = defineStore({
|
||||||
userInfo: clone(defaultUserInfo), // 用户信息
|
userInfo: clone(defaultUserInfo), // 用户信息
|
||||||
isLogin: !!uni.getStorageSync('token'), // 登录状态
|
isLogin: !!uni.getStorageSync('token'), // 登录状态
|
||||||
numData: cloneDeep(defaultNumData), // 用户其他数据
|
numData: cloneDeep(defaultNumData), // 用户其他数据
|
||||||
agentInfo: {}, // 分销商信息
|
|
||||||
lastUpdateTime: 0, // 上次更新时间
|
lastUpdateTime: 0, // 上次更新时间
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
@ -72,16 +71,6 @@ const user = defineStore({
|
||||||
return Promise.resolve(data);
|
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 芋艿:整理下;
|
// TODO 芋艿:整理下;
|
||||||
async getNumData() {
|
async getNumData() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue