107 行
2.9 KiB
Vue
107 行
2.9 KiB
Vue
<!-- 收益中心 -->
|
|
<template>
|
|
<s-layout navbar="inner" class="index-wrap" title="收益中心" :bgStyle="bgStyle" onShareAppMessage>
|
|
<!-- 分销商信息 -->
|
|
<commission-info />
|
|
<!-- 30 日活跃警示 -->
|
|
<view v-if="userInfo?.active_30d === false || agentInfo?.active_30d === false" class="active-warn">
|
|
<view class="warn-text">近 30 日暂无本人订单,业务奖励已暂停。</view>
|
|
<button class="ss-reset-button warn-btn" @tap="sheep.$router.go('/pages/index/index')">
|
|
去首页
|
|
</button>
|
|
</view>
|
|
<!-- 账户信息 -->
|
|
<account-info />
|
|
<!-- 菜单栏 -->
|
|
<commission-menu />
|
|
<!-- 分销记录 -->
|
|
<commission-log />
|
|
<!-- 弹框 -->
|
|
<commission-condition :error="state.error" :errorData="state.errorData" />
|
|
|
|
<!-- 权限 -->
|
|
<commission-auth :error="state.error" @getAgentInfo="getAgentInfo" />
|
|
</s-layout>
|
|
</template>
|
|
|
|
<script setup>
|
|
import sheep from '@/sheep';
|
|
import { onShow } from '@dcloudio/uni-app';
|
|
import { computed, 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 userInfo = computed(() => sheep.$store('user').userInfo);
|
|
|
|
async function getUserInfo() {
|
|
await sheep.$store('user').getInfo();
|
|
}
|
|
|
|
const bgStyle = {
|
|
color: '#F7D598',
|
|
};
|
|
|
|
async function getAgentInfo() {
|
|
const res = await sheep.$store('user').getAgentInfo();
|
|
if (res?.code !== 1) {
|
|
state.error = res?.code || 0;
|
|
state.errorData = res?.data || {};
|
|
}
|
|
}
|
|
onShow(() => {
|
|
getUserInfo();
|
|
getAgentInfo();
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
:deep(.page-main) {
|
|
background-size: 100% 100% !important;
|
|
}
|
|
|
|
.active-warn {
|
|
width: 694rpx;
|
|
margin: 0 auto 16rpx;
|
|
padding: 20rpx 24rpx;
|
|
box-sizing: border-box;
|
|
background: #fff4e5;
|
|
border-radius: 12rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
position: relative;
|
|
z-index: 3;
|
|
|
|
.warn-text {
|
|
flex: 1;
|
|
font-size: 24rpx;
|
|
line-height: 34rpx;
|
|
color: #a17545;
|
|
padding-right: 16rpx;
|
|
}
|
|
|
|
.warn-btn {
|
|
flex-shrink: 0;
|
|
height: 52rpx;
|
|
padding: 0 22rpx;
|
|
background: #ff6000;
|
|
border-radius: 26rpx;
|
|
font-size: 22rpx;
|
|
color: #ffffff;
|
|
}
|
|
}
|
|
</style>
|